GLib-2.0.gir 2.1 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031
  1. <?xml version="1.0"?>
  2. <!-- This file was automatically generated from C sources - DO NOT EDIT!
  3. To affect the contents of this file, edit the original C definitions,
  4. and/or use gtk-doc annotations. -->
  5. <repository version="1.2"
  6. xmlns="http://www.gtk.org/introspection/core/1.0"
  7. xmlns:c="http://www.gtk.org/introspection/c/1.0"
  8. xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
  9. <package name="glib-2.0"/>
  10. <c:include name="glib.h"/>
  11. <namespace name="GLib"
  12. version="2.0"
  13. shared-library="libgobject-2.0.so.0,libglib-2.0.so.0"
  14. c:identifier-prefixes="G"
  15. c:symbol-prefixes="g,glib">
  16. <alias name="DateDay" c:type="GDateDay">
  17. <doc xml:space="preserve">Integer representing a day of the month; between 1 and 31.
  18. #G_DATE_BAD_DAY represents an invalid day of the month.</doc>
  19. <type name="guint8" c:type="guint8"/>
  20. </alias>
  21. <alias name="DateYear" c:type="GDateYear">
  22. <doc xml:space="preserve">Integer representing a year; #G_DATE_BAD_YEAR is the invalid
  23. value. The year must be 1 or higher; negative (BC) years are not
  24. allowed. The year is represented with four digits.</doc>
  25. <type name="guint16" c:type="guint16"/>
  26. </alias>
  27. <alias name="MutexLocker" c:type="GMutexLocker">
  28. <doc xml:space="preserve">Opaque type. See g_mutex_locker_new() for details.</doc>
  29. <type name="gpointer" c:type="gpointer"/>
  30. </alias>
  31. <alias name="Pid" c:type="GPid">
  32. <doc xml:space="preserve">A type which is used to hold a process identification.
  33. On UNIX, processes are identified by a process id (an integer),
  34. while Windows uses process handles (which are pointers).
  35. GPid is used in GLib only for descendant processes spawned with
  36. the g_spawn functions.</doc>
  37. <type name="gint" c:type="int"/>
  38. </alias>
  39. <alias name="Quark" c:type="GQuark">
  40. <doc xml:space="preserve">A GQuark is a non-zero integer which uniquely identifies a
  41. particular string. A GQuark value of zero is associated to %NULL.</doc>
  42. <type name="guint32" c:type="guint32"/>
  43. </alias>
  44. <alias name="Strv" c:type="GStrv">
  45. <doc xml:space="preserve">A typedef alias for gchar**. This is mostly useful when used together with
  46. g_auto().</doc>
  47. <type name="gpointer" c:type="gpointer"/>
  48. </alias>
  49. <alias name="Time" c:type="GTime">
  50. <doc xml:space="preserve">Simply a replacement for time_t. It has been deprecated
  51. since it is not equivalent to time_t on 64-bit platforms
  52. with a 64-bit time_t. Unrelated to #GTimer.
  53. Note that #GTime is defined to always be a 32-bit integer,
  54. unlike time_t which may be 64-bit on some systems. Therefore,
  55. #GTime will overflow in the year 2038, and you cannot use the
  56. address of a #GTime variable as argument to the UNIX time()
  57. function.
  58. Instead, do the following:
  59. |[&lt;!-- language="C" --&gt;
  60. time_t ttime;
  61. GTime gtime;
  62. time (&amp;ttime);
  63. gtime = (GTime)ttime;
  64. ]|</doc>
  65. <type name="gint32" c:type="gint32"/>
  66. </alias>
  67. <alias name="TimeSpan" c:type="GTimeSpan">
  68. <doc xml:space="preserve">A value representing an interval of time, in microseconds.</doc>
  69. <type name="gint64" c:type="gint64"/>
  70. </alias>
  71. <alias name="Type" c:type="GType">
  72. <type name="gsize" c:type="gsize"/>
  73. </alias>
  74. <constant name="ANALYZER_ANALYZING"
  75. value="1"
  76. c:type="G_ANALYZER_ANALYZING">
  77. <type name="gint" c:type="gint"/>
  78. </constant>
  79. <constant name="ASCII_DTOSTR_BUF_SIZE"
  80. value="39"
  81. c:type="G_ASCII_DTOSTR_BUF_SIZE">
  82. <doc xml:space="preserve">A good size for a buffer to be passed into g_ascii_dtostr().
  83. It is guaranteed to be enough for all output of that function
  84. on systems with 64bit IEEE-compatible doubles.
  85. The typical usage would be something like:
  86. |[&lt;!-- language="C" --&gt;
  87. char buf[G_ASCII_DTOSTR_BUF_SIZE];
  88. fprintf (out, "value=%s\n", g_ascii_dtostr (buf, sizeof (buf), value));
  89. ]|</doc>
  90. <type name="gint" c:type="gint"/>
  91. </constant>
  92. <record name="Array"
  93. c:type="GArray"
  94. glib:type-name="GArray"
  95. glib:get-type="g_array_get_type"
  96. c:symbol-prefix="array">
  97. <doc xml:space="preserve">Contains the public fields of a GArray.</doc>
  98. <field name="data" writable="1">
  99. <doc xml:space="preserve">a pointer to the element data. The data may be moved as
  100. elements are added to the #GArray.</doc>
  101. <type name="utf8" c:type="gchar*"/>
  102. </field>
  103. <field name="len" writable="1">
  104. <doc xml:space="preserve">the number of elements in the #GArray not including the
  105. possible terminating zero element.</doc>
  106. <type name="guint" c:type="guint"/>
  107. </field>
  108. <function name="append_vals"
  109. c:identifier="g_array_append_vals"
  110. introspectable="0">
  111. <doc xml:space="preserve">Adds @len elements onto the end of the array.</doc>
  112. <return-value>
  113. <doc xml:space="preserve">the #GArray</doc>
  114. <array name="GLib.Array" c:type="GArray*">
  115. <type name="gpointer" c:type="gpointer"/>
  116. </array>
  117. </return-value>
  118. <parameters>
  119. <parameter name="array" transfer-ownership="none">
  120. <doc xml:space="preserve">a #GArray</doc>
  121. <array name="GLib.Array" c:type="GArray*">
  122. <type name="gpointer" c:type="gpointer"/>
  123. </array>
  124. </parameter>
  125. <parameter name="data" transfer-ownership="none">
  126. <doc xml:space="preserve">a pointer to the elements to append to the end of the array</doc>
  127. <type name="gpointer" c:type="gconstpointer"/>
  128. </parameter>
  129. <parameter name="len" transfer-ownership="none">
  130. <doc xml:space="preserve">the number of elements to append</doc>
  131. <type name="guint" c:type="guint"/>
  132. </parameter>
  133. </parameters>
  134. </function>
  135. <function name="free" c:identifier="g_array_free" introspectable="0">
  136. <doc xml:space="preserve">Frees the memory allocated for the #GArray. If @free_segment is
  137. %TRUE it frees the memory block holding the elements as well and
  138. also each element if @array has a @element_free_func set. Pass
  139. %FALSE if you want to free the #GArray wrapper but preserve the
  140. underlying array for use elsewhere. If the reference count of @array
  141. is greater than one, the #GArray wrapper is preserved but the size
  142. of @array will be set to zero.
  143. If array elements contain dynamically-allocated memory, they should
  144. be freed separately.</doc>
  145. <return-value transfer-ownership="full">
  146. <doc xml:space="preserve">the element data if @free_segment is %FALSE, otherwise
  147. %NULL. The element data should be freed using g_free().</doc>
  148. <type name="utf8" c:type="gchar*"/>
  149. </return-value>
  150. <parameters>
  151. <parameter name="array" transfer-ownership="none">
  152. <doc xml:space="preserve">a #GArray</doc>
  153. <array name="GLib.Array" c:type="GArray*">
  154. <type name="gpointer" c:type="gpointer"/>
  155. </array>
  156. </parameter>
  157. <parameter name="free_segment" transfer-ownership="none">
  158. <doc xml:space="preserve">if %TRUE the actual element data is freed as well</doc>
  159. <type name="gboolean" c:type="gboolean"/>
  160. </parameter>
  161. </parameters>
  162. </function>
  163. <function name="get_element_size"
  164. c:identifier="g_array_get_element_size"
  165. version="2.22"
  166. introspectable="0">
  167. <doc xml:space="preserve">Gets the size of the elements in @array.</doc>
  168. <return-value transfer-ownership="none">
  169. <doc xml:space="preserve">Size of each element, in bytes</doc>
  170. <type name="guint" c:type="guint"/>
  171. </return-value>
  172. <parameters>
  173. <parameter name="array" transfer-ownership="none">
  174. <doc xml:space="preserve">A #GArray</doc>
  175. <array name="GLib.Array" c:type="GArray*">
  176. <type name="gpointer" c:type="gpointer"/>
  177. </array>
  178. </parameter>
  179. </parameters>
  180. </function>
  181. <function name="insert_vals"
  182. c:identifier="g_array_insert_vals"
  183. introspectable="0">
  184. <doc xml:space="preserve">Inserts @len elements into a #GArray at the given index.</doc>
  185. <return-value>
  186. <doc xml:space="preserve">the #GArray</doc>
  187. <array name="GLib.Array" c:type="GArray*">
  188. <type name="gpointer" c:type="gpointer"/>
  189. </array>
  190. </return-value>
  191. <parameters>
  192. <parameter name="array" transfer-ownership="none">
  193. <doc xml:space="preserve">a #GArray</doc>
  194. <array name="GLib.Array" c:type="GArray*">
  195. <type name="gpointer" c:type="gpointer"/>
  196. </array>
  197. </parameter>
  198. <parameter name="index_" transfer-ownership="none">
  199. <doc xml:space="preserve">the index to place the elements at</doc>
  200. <type name="guint" c:type="guint"/>
  201. </parameter>
  202. <parameter name="data" transfer-ownership="none">
  203. <doc xml:space="preserve">a pointer to the elements to insert</doc>
  204. <type name="gpointer" c:type="gconstpointer"/>
  205. </parameter>
  206. <parameter name="len" transfer-ownership="none">
  207. <doc xml:space="preserve">the number of elements to insert</doc>
  208. <type name="guint" c:type="guint"/>
  209. </parameter>
  210. </parameters>
  211. </function>
  212. <function name="new" c:identifier="g_array_new" introspectable="0">
  213. <doc xml:space="preserve">Creates a new #GArray with a reference count of 1.</doc>
  214. <return-value>
  215. <doc xml:space="preserve">the new #GArray</doc>
  216. <array name="GLib.Array" c:type="GArray*">
  217. <type name="gpointer" c:type="gpointer"/>
  218. </array>
  219. </return-value>
  220. <parameters>
  221. <parameter name="zero_terminated" transfer-ownership="none">
  222. <doc xml:space="preserve">%TRUE if the array should have an extra element at
  223. the end which is set to 0</doc>
  224. <type name="gboolean" c:type="gboolean"/>
  225. </parameter>
  226. <parameter name="clear_" transfer-ownership="none">
  227. <doc xml:space="preserve">%TRUE if #GArray elements should be automatically cleared
  228. to 0 when they are allocated</doc>
  229. <type name="gboolean" c:type="gboolean"/>
  230. </parameter>
  231. <parameter name="element_size" transfer-ownership="none">
  232. <doc xml:space="preserve">the size of each element in bytes</doc>
  233. <type name="guint" c:type="guint"/>
  234. </parameter>
  235. </parameters>
  236. </function>
  237. <function name="prepend_vals"
  238. c:identifier="g_array_prepend_vals"
  239. introspectable="0">
  240. <doc xml:space="preserve">Adds @len elements onto the start of the array.
  241. This operation is slower than g_array_append_vals() since the
  242. existing elements in the array have to be moved to make space for
  243. the new elements.</doc>
  244. <return-value>
  245. <doc xml:space="preserve">the #GArray</doc>
  246. <array name="GLib.Array" c:type="GArray*">
  247. <type name="gpointer" c:type="gpointer"/>
  248. </array>
  249. </return-value>
  250. <parameters>
  251. <parameter name="array" transfer-ownership="none">
  252. <doc xml:space="preserve">a #GArray</doc>
  253. <array name="GLib.Array" c:type="GArray*">
  254. <type name="gpointer" c:type="gpointer"/>
  255. </array>
  256. </parameter>
  257. <parameter name="data" transfer-ownership="none">
  258. <doc xml:space="preserve">a pointer to the elements to prepend to the start of the array</doc>
  259. <type name="gpointer" c:type="gconstpointer"/>
  260. </parameter>
  261. <parameter name="len" transfer-ownership="none">
  262. <doc xml:space="preserve">the number of elements to prepend</doc>
  263. <type name="guint" c:type="guint"/>
  264. </parameter>
  265. </parameters>
  266. </function>
  267. <function name="ref"
  268. c:identifier="g_array_ref"
  269. version="2.22"
  270. introspectable="0">
  271. <doc xml:space="preserve">Atomically increments the reference count of @array by one.
  272. This function is MT-safe and may be called from any thread.</doc>
  273. <return-value>
  274. <doc xml:space="preserve">The passed in #GArray</doc>
  275. <array name="GLib.Array" c:type="GArray*">
  276. <type name="gpointer" c:type="gpointer"/>
  277. </array>
  278. </return-value>
  279. <parameters>
  280. <parameter name="array" transfer-ownership="none">
  281. <doc xml:space="preserve">A #GArray</doc>
  282. <array name="GLib.Array" c:type="GArray*">
  283. <type name="gpointer" c:type="gpointer"/>
  284. </array>
  285. </parameter>
  286. </parameters>
  287. </function>
  288. <function name="remove_index"
  289. c:identifier="g_array_remove_index"
  290. introspectable="0">
  291. <doc xml:space="preserve">Removes the element at the given index from a #GArray. The following
  292. elements are moved down one place.</doc>
  293. <return-value>
  294. <doc xml:space="preserve">the #GArray</doc>
  295. <array name="GLib.Array" c:type="GArray*">
  296. <type name="gpointer" c:type="gpointer"/>
  297. </array>
  298. </return-value>
  299. <parameters>
  300. <parameter name="array" transfer-ownership="none">
  301. <doc xml:space="preserve">a #GArray</doc>
  302. <array name="GLib.Array" c:type="GArray*">
  303. <type name="gpointer" c:type="gpointer"/>
  304. </array>
  305. </parameter>
  306. <parameter name="index_" transfer-ownership="none">
  307. <doc xml:space="preserve">the index of the element to remove</doc>
  308. <type name="guint" c:type="guint"/>
  309. </parameter>
  310. </parameters>
  311. </function>
  312. <function name="remove_index_fast"
  313. c:identifier="g_array_remove_index_fast"
  314. introspectable="0">
  315. <doc xml:space="preserve">Removes the element at the given index from a #GArray. The last
  316. element in the array is used to fill in the space, so this function
  317. does not preserve the order of the #GArray. But it is faster than
  318. g_array_remove_index().</doc>
  319. <return-value>
  320. <doc xml:space="preserve">the #GArray</doc>
  321. <array name="GLib.Array" c:type="GArray*">
  322. <type name="gpointer" c:type="gpointer"/>
  323. </array>
  324. </return-value>
  325. <parameters>
  326. <parameter name="array" transfer-ownership="none">
  327. <doc xml:space="preserve">a @GArray</doc>
  328. <array name="GLib.Array" c:type="GArray*">
  329. <type name="gpointer" c:type="gpointer"/>
  330. </array>
  331. </parameter>
  332. <parameter name="index_" transfer-ownership="none">
  333. <doc xml:space="preserve">the index of the element to remove</doc>
  334. <type name="guint" c:type="guint"/>
  335. </parameter>
  336. </parameters>
  337. </function>
  338. <function name="remove_range"
  339. c:identifier="g_array_remove_range"
  340. version="2.4"
  341. introspectable="0">
  342. <doc xml:space="preserve">Removes the given number of elements starting at the given index
  343. from a #GArray. The following elements are moved to close the gap.</doc>
  344. <return-value>
  345. <doc xml:space="preserve">the #GArray</doc>
  346. <array name="GLib.Array" c:type="GArray*">
  347. <type name="gpointer" c:type="gpointer"/>
  348. </array>
  349. </return-value>
  350. <parameters>
  351. <parameter name="array" transfer-ownership="none">
  352. <doc xml:space="preserve">a @GArray</doc>
  353. <array name="GLib.Array" c:type="GArray*">
  354. <type name="gpointer" c:type="gpointer"/>
  355. </array>
  356. </parameter>
  357. <parameter name="index_" transfer-ownership="none">
  358. <doc xml:space="preserve">the index of the first element to remove</doc>
  359. <type name="guint" c:type="guint"/>
  360. </parameter>
  361. <parameter name="length" transfer-ownership="none">
  362. <doc xml:space="preserve">the number of elements to remove</doc>
  363. <type name="guint" c:type="guint"/>
  364. </parameter>
  365. </parameters>
  366. </function>
  367. <function name="set_clear_func"
  368. c:identifier="g_array_set_clear_func"
  369. version="2.32"
  370. introspectable="0">
  371. <doc xml:space="preserve">Sets a function to clear an element of @array.
  372. The @clear_func will be called when an element in the array
  373. data segment is removed and when the array is freed and data
  374. segment is deallocated as well.
  375. Note that in contrast with other uses of #GDestroyNotify
  376. functions, @clear_func is expected to clear the contents of
  377. the array element it is given, but not free the element itself.</doc>
  378. <return-value transfer-ownership="none">
  379. <type name="none" c:type="void"/>
  380. </return-value>
  381. <parameters>
  382. <parameter name="array" transfer-ownership="none">
  383. <doc xml:space="preserve">A #GArray</doc>
  384. <array name="GLib.Array" c:type="GArray*">
  385. <type name="gpointer" c:type="gpointer"/>
  386. </array>
  387. </parameter>
  388. <parameter name="clear_func" transfer-ownership="none" scope="async">
  389. <doc xml:space="preserve">a function to clear an element of @array</doc>
  390. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  391. </parameter>
  392. </parameters>
  393. </function>
  394. <function name="set_size"
  395. c:identifier="g_array_set_size"
  396. introspectable="0">
  397. <doc xml:space="preserve">Sets the size of the array, expanding it if necessary. If the array
  398. was created with @clear_ set to %TRUE, the new elements are set to 0.</doc>
  399. <return-value>
  400. <doc xml:space="preserve">the #GArray</doc>
  401. <array name="GLib.Array" c:type="GArray*">
  402. <type name="gpointer" c:type="gpointer"/>
  403. </array>
  404. </return-value>
  405. <parameters>
  406. <parameter name="array" transfer-ownership="none">
  407. <doc xml:space="preserve">a #GArray</doc>
  408. <array name="GLib.Array" c:type="GArray*">
  409. <type name="gpointer" c:type="gpointer"/>
  410. </array>
  411. </parameter>
  412. <parameter name="length" transfer-ownership="none">
  413. <doc xml:space="preserve">the new size of the #GArray</doc>
  414. <type name="guint" c:type="guint"/>
  415. </parameter>
  416. </parameters>
  417. </function>
  418. <function name="sized_new"
  419. c:identifier="g_array_sized_new"
  420. introspectable="0">
  421. <doc xml:space="preserve">Creates a new #GArray with @reserved_size elements preallocated and
  422. a reference count of 1. This avoids frequent reallocation, if you
  423. are going to add many elements to the array. Note however that the
  424. size of the array is still 0.</doc>
  425. <return-value>
  426. <doc xml:space="preserve">the new #GArray</doc>
  427. <array name="GLib.Array" c:type="GArray*">
  428. <type name="gpointer" c:type="gpointer"/>
  429. </array>
  430. </return-value>
  431. <parameters>
  432. <parameter name="zero_terminated" transfer-ownership="none">
  433. <doc xml:space="preserve">%TRUE if the array should have an extra element at
  434. the end with all bits cleared</doc>
  435. <type name="gboolean" c:type="gboolean"/>
  436. </parameter>
  437. <parameter name="clear_" transfer-ownership="none">
  438. <doc xml:space="preserve">%TRUE if all bits in the array should be cleared to 0 on
  439. allocation</doc>
  440. <type name="gboolean" c:type="gboolean"/>
  441. </parameter>
  442. <parameter name="element_size" transfer-ownership="none">
  443. <doc xml:space="preserve">size of each element in the array</doc>
  444. <type name="guint" c:type="guint"/>
  445. </parameter>
  446. <parameter name="reserved_size" transfer-ownership="none">
  447. <doc xml:space="preserve">number of elements preallocated</doc>
  448. <type name="guint" c:type="guint"/>
  449. </parameter>
  450. </parameters>
  451. </function>
  452. <function name="sort" c:identifier="g_array_sort" introspectable="0">
  453. <doc xml:space="preserve">Sorts a #GArray using @compare_func which should be a qsort()-style
  454. comparison function (returns less than zero for first arg is less
  455. than second arg, zero for equal, greater zero if first arg is
  456. greater than second arg).
  457. This is guaranteed to be a stable sort since version 2.32.</doc>
  458. <return-value transfer-ownership="none">
  459. <type name="none" c:type="void"/>
  460. </return-value>
  461. <parameters>
  462. <parameter name="array" transfer-ownership="none">
  463. <doc xml:space="preserve">a #GArray</doc>
  464. <array name="GLib.Array" c:type="GArray*">
  465. <type name="gpointer" c:type="gpointer"/>
  466. </array>
  467. </parameter>
  468. <parameter name="compare_func" transfer-ownership="none">
  469. <doc xml:space="preserve">comparison function</doc>
  470. <type name="CompareFunc" c:type="GCompareFunc"/>
  471. </parameter>
  472. </parameters>
  473. </function>
  474. <function name="sort_with_data"
  475. c:identifier="g_array_sort_with_data"
  476. introspectable="0">
  477. <doc xml:space="preserve">Like g_array_sort(), but the comparison function receives an extra
  478. user data argument.
  479. This is guaranteed to be a stable sort since version 2.32.
  480. There used to be a comment here about making the sort stable by
  481. using the addresses of the elements in the comparison function.
  482. This did not actually work, so any such code should be removed.</doc>
  483. <return-value transfer-ownership="none">
  484. <type name="none" c:type="void"/>
  485. </return-value>
  486. <parameters>
  487. <parameter name="array" transfer-ownership="none">
  488. <doc xml:space="preserve">a #GArray</doc>
  489. <array name="GLib.Array" c:type="GArray*">
  490. <type name="gpointer" c:type="gpointer"/>
  491. </array>
  492. </parameter>
  493. <parameter name="compare_func" transfer-ownership="none" closure="2">
  494. <doc xml:space="preserve">comparison function</doc>
  495. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  496. </parameter>
  497. <parameter name="user_data"
  498. transfer-ownership="none"
  499. nullable="1"
  500. allow-none="1">
  501. <doc xml:space="preserve">data to pass to @compare_func</doc>
  502. <type name="gpointer" c:type="gpointer"/>
  503. </parameter>
  504. </parameters>
  505. </function>
  506. <function name="unref"
  507. c:identifier="g_array_unref"
  508. version="2.22"
  509. introspectable="0">
  510. <doc xml:space="preserve">Atomically decrements the reference count of @array by one. If the
  511. reference count drops to 0, all memory allocated by the array is
  512. released. This function is MT-safe and may be called from any
  513. thread.</doc>
  514. <return-value transfer-ownership="none">
  515. <type name="none" c:type="void"/>
  516. </return-value>
  517. <parameters>
  518. <parameter name="array" transfer-ownership="none">
  519. <doc xml:space="preserve">A #GArray</doc>
  520. <array name="GLib.Array" c:type="GArray*">
  521. <type name="gpointer" c:type="gpointer"/>
  522. </array>
  523. </parameter>
  524. </parameters>
  525. </function>
  526. </record>
  527. <bitfield name="AsciiType" c:type="GAsciiType">
  528. <member name="alnum" value="1" c:identifier="G_ASCII_ALNUM">
  529. </member>
  530. <member name="alpha" value="2" c:identifier="G_ASCII_ALPHA">
  531. </member>
  532. <member name="cntrl" value="4" c:identifier="G_ASCII_CNTRL">
  533. </member>
  534. <member name="digit" value="8" c:identifier="G_ASCII_DIGIT">
  535. </member>
  536. <member name="graph" value="16" c:identifier="G_ASCII_GRAPH">
  537. </member>
  538. <member name="lower" value="32" c:identifier="G_ASCII_LOWER">
  539. </member>
  540. <member name="print" value="64" c:identifier="G_ASCII_PRINT">
  541. </member>
  542. <member name="punct" value="128" c:identifier="G_ASCII_PUNCT">
  543. </member>
  544. <member name="space" value="256" c:identifier="G_ASCII_SPACE">
  545. </member>
  546. <member name="upper" value="512" c:identifier="G_ASCII_UPPER">
  547. </member>
  548. <member name="xdigit" value="1024" c:identifier="G_ASCII_XDIGIT">
  549. </member>
  550. </bitfield>
  551. <record name="AsyncQueue" c:type="GAsyncQueue" disguised="1">
  552. <doc xml:space="preserve">The GAsyncQueue struct is an opaque data structure which represents
  553. an asynchronous queue. It should only be accessed through the
  554. g_async_queue_* functions.</doc>
  555. <method name="length" c:identifier="g_async_queue_length">
  556. <doc xml:space="preserve">Returns the length of the queue.
  557. Actually this function returns the number of data items in
  558. the queue minus the number of waiting threads, so a negative
  559. value means waiting threads, and a positive value means available
  560. entries in the @queue. A return value of 0 could mean n entries
  561. in the queue and n threads waiting. This can happen due to locking
  562. of the queue or due to scheduling.</doc>
  563. <return-value transfer-ownership="none">
  564. <doc xml:space="preserve">the length of the @queue</doc>
  565. <type name="gint" c:type="gint"/>
  566. </return-value>
  567. <parameters>
  568. <instance-parameter name="queue" transfer-ownership="none">
  569. <doc xml:space="preserve">a #GAsyncQueue.</doc>
  570. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  571. </instance-parameter>
  572. </parameters>
  573. </method>
  574. <method name="length_unlocked"
  575. c:identifier="g_async_queue_length_unlocked">
  576. <doc xml:space="preserve">Returns the length of the queue.
  577. Actually this function returns the number of data items in
  578. the queue minus the number of waiting threads, so a negative
  579. value means waiting threads, and a positive value means available
  580. entries in the @queue. A return value of 0 could mean n entries
  581. in the queue and n threads waiting. This can happen due to locking
  582. of the queue or due to scheduling.
  583. This function must be called while holding the @queue's lock.</doc>
  584. <return-value transfer-ownership="none">
  585. <doc xml:space="preserve">the length of the @queue.</doc>
  586. <type name="gint" c:type="gint"/>
  587. </return-value>
  588. <parameters>
  589. <instance-parameter name="queue" transfer-ownership="none">
  590. <doc xml:space="preserve">a #GAsyncQueue</doc>
  591. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  592. </instance-parameter>
  593. </parameters>
  594. </method>
  595. <method name="lock" c:identifier="g_async_queue_lock">
  596. <doc xml:space="preserve">Acquires the @queue's lock. If another thread is already
  597. holding the lock, this call will block until the lock
  598. becomes available.
  599. Call g_async_queue_unlock() to drop the lock again.
  600. While holding the lock, you can only call the
  601. g_async_queue_*_unlocked() functions on @queue. Otherwise,
  602. deadlock may occur.</doc>
  603. <return-value transfer-ownership="none">
  604. <type name="none" c:type="void"/>
  605. </return-value>
  606. <parameters>
  607. <instance-parameter name="queue" transfer-ownership="none">
  608. <doc xml:space="preserve">a #GAsyncQueue</doc>
  609. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  610. </instance-parameter>
  611. </parameters>
  612. </method>
  613. <method name="pop" c:identifier="g_async_queue_pop">
  614. <doc xml:space="preserve">Pops data from the @queue. If @queue is empty, this function
  615. blocks until data becomes available.</doc>
  616. <return-value transfer-ownership="none" nullable="1">
  617. <doc xml:space="preserve">data from the queue</doc>
  618. <type name="gpointer" c:type="gpointer"/>
  619. </return-value>
  620. <parameters>
  621. <instance-parameter name="queue" transfer-ownership="none">
  622. <doc xml:space="preserve">a #GAsyncQueue</doc>
  623. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  624. </instance-parameter>
  625. </parameters>
  626. </method>
  627. <method name="pop_unlocked" c:identifier="g_async_queue_pop_unlocked">
  628. <doc xml:space="preserve">Pops data from the @queue. If @queue is empty, this function
  629. blocks until data becomes available.
  630. This function must be called while holding the @queue's lock.</doc>
  631. <return-value transfer-ownership="none" nullable="1">
  632. <doc xml:space="preserve">data from the queue.</doc>
  633. <type name="gpointer" c:type="gpointer"/>
  634. </return-value>
  635. <parameters>
  636. <instance-parameter name="queue" transfer-ownership="none">
  637. <doc xml:space="preserve">a #GAsyncQueue</doc>
  638. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  639. </instance-parameter>
  640. </parameters>
  641. </method>
  642. <method name="push" c:identifier="g_async_queue_push">
  643. <doc xml:space="preserve">Pushes the @data into the @queue. @data must not be %NULL.</doc>
  644. <return-value transfer-ownership="none">
  645. <type name="none" c:type="void"/>
  646. </return-value>
  647. <parameters>
  648. <instance-parameter name="queue" transfer-ownership="none">
  649. <doc xml:space="preserve">a #GAsyncQueue</doc>
  650. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  651. </instance-parameter>
  652. <parameter name="data"
  653. transfer-ownership="none"
  654. nullable="1"
  655. allow-none="1">
  656. <doc xml:space="preserve">@data to push into the @queue</doc>
  657. <type name="gpointer" c:type="gpointer"/>
  658. </parameter>
  659. </parameters>
  660. </method>
  661. <method name="push_front"
  662. c:identifier="g_async_queue_push_front"
  663. version="2.46">
  664. <doc xml:space="preserve">Pushes the @item into the @queue. @item must not be %NULL.
  665. In contrast to g_async_queue_push(), this function
  666. pushes the new item ahead of the items already in the queue,
  667. so that it will be the next one to be popped off the queue.</doc>
  668. <return-value transfer-ownership="none">
  669. <type name="none" c:type="void"/>
  670. </return-value>
  671. <parameters>
  672. <instance-parameter name="queue" transfer-ownership="none">
  673. <doc xml:space="preserve">a #GAsyncQueue</doc>
  674. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  675. </instance-parameter>
  676. <parameter name="item"
  677. transfer-ownership="none"
  678. nullable="1"
  679. allow-none="1">
  680. <doc xml:space="preserve">data to push into the @queue</doc>
  681. <type name="gpointer" c:type="gpointer"/>
  682. </parameter>
  683. </parameters>
  684. </method>
  685. <method name="push_front_unlocked"
  686. c:identifier="g_async_queue_push_front_unlocked"
  687. version="2.46">
  688. <doc xml:space="preserve">Pushes the @item into the @queue. @item must not be %NULL.
  689. In contrast to g_async_queue_push_unlocked(), this function
  690. pushes the new item ahead of the items already in the queue,
  691. so that it will be the next one to be popped off the queue.
  692. This function must be called while holding the @queue's lock.</doc>
  693. <return-value transfer-ownership="none">
  694. <type name="none" c:type="void"/>
  695. </return-value>
  696. <parameters>
  697. <instance-parameter name="queue" transfer-ownership="none">
  698. <doc xml:space="preserve">a #GAsyncQueue</doc>
  699. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  700. </instance-parameter>
  701. <parameter name="item"
  702. transfer-ownership="none"
  703. nullable="1"
  704. allow-none="1">
  705. <doc xml:space="preserve">data to push into the @queue</doc>
  706. <type name="gpointer" c:type="gpointer"/>
  707. </parameter>
  708. </parameters>
  709. </method>
  710. <method name="push_sorted"
  711. c:identifier="g_async_queue_push_sorted"
  712. version="2.10"
  713. introspectable="0">
  714. <doc xml:space="preserve">Inserts @data into @queue using @func to determine the new
  715. position.
  716. This function requires that the @queue is sorted before pushing on
  717. new elements, see g_async_queue_sort().
  718. This function will lock @queue before it sorts the queue and unlock
  719. it when it is finished.
  720. For an example of @func see g_async_queue_sort().</doc>
  721. <return-value transfer-ownership="none">
  722. <type name="none" c:type="void"/>
  723. </return-value>
  724. <parameters>
  725. <instance-parameter name="queue" transfer-ownership="none">
  726. <doc xml:space="preserve">a #GAsyncQueue</doc>
  727. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  728. </instance-parameter>
  729. <parameter name="data"
  730. transfer-ownership="none"
  731. nullable="1"
  732. allow-none="1">
  733. <doc xml:space="preserve">the @data to push into the @queue</doc>
  734. <type name="gpointer" c:type="gpointer"/>
  735. </parameter>
  736. <parameter name="func" transfer-ownership="none" closure="2">
  737. <doc xml:space="preserve">the #GCompareDataFunc is used to sort @queue</doc>
  738. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  739. </parameter>
  740. <parameter name="user_data"
  741. transfer-ownership="none"
  742. nullable="1"
  743. allow-none="1">
  744. <doc xml:space="preserve">user data passed to @func.</doc>
  745. <type name="gpointer" c:type="gpointer"/>
  746. </parameter>
  747. </parameters>
  748. </method>
  749. <method name="push_sorted_unlocked"
  750. c:identifier="g_async_queue_push_sorted_unlocked"
  751. version="2.10"
  752. introspectable="0">
  753. <doc xml:space="preserve">Inserts @data into @queue using @func to determine the new
  754. position.
  755. The sort function @func is passed two elements of the @queue.
  756. It should return 0 if they are equal, a negative value if the
  757. first element should be higher in the @queue or a positive value
  758. if the first element should be lower in the @queue than the second
  759. element.
  760. This function requires that the @queue is sorted before pushing on
  761. new elements, see g_async_queue_sort().
  762. This function must be called while holding the @queue's lock.
  763. For an example of @func see g_async_queue_sort().</doc>
  764. <return-value transfer-ownership="none">
  765. <type name="none" c:type="void"/>
  766. </return-value>
  767. <parameters>
  768. <instance-parameter name="queue" transfer-ownership="none">
  769. <doc xml:space="preserve">a #GAsyncQueue</doc>
  770. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  771. </instance-parameter>
  772. <parameter name="data"
  773. transfer-ownership="none"
  774. nullable="1"
  775. allow-none="1">
  776. <doc xml:space="preserve">the @data to push into the @queue</doc>
  777. <type name="gpointer" c:type="gpointer"/>
  778. </parameter>
  779. <parameter name="func" transfer-ownership="none" closure="2">
  780. <doc xml:space="preserve">the #GCompareDataFunc is used to sort @queue</doc>
  781. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  782. </parameter>
  783. <parameter name="user_data"
  784. transfer-ownership="none"
  785. nullable="1"
  786. allow-none="1">
  787. <doc xml:space="preserve">user data passed to @func.</doc>
  788. <type name="gpointer" c:type="gpointer"/>
  789. </parameter>
  790. </parameters>
  791. </method>
  792. <method name="push_unlocked" c:identifier="g_async_queue_push_unlocked">
  793. <doc xml:space="preserve">Pushes the @data into the @queue. @data must not be %NULL.
  794. This function must be called while holding the @queue's lock.</doc>
  795. <return-value transfer-ownership="none">
  796. <type name="none" c:type="void"/>
  797. </return-value>
  798. <parameters>
  799. <instance-parameter name="queue" transfer-ownership="none">
  800. <doc xml:space="preserve">a #GAsyncQueue</doc>
  801. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  802. </instance-parameter>
  803. <parameter name="data"
  804. transfer-ownership="none"
  805. nullable="1"
  806. allow-none="1">
  807. <doc xml:space="preserve">@data to push into the @queue</doc>
  808. <type name="gpointer" c:type="gpointer"/>
  809. </parameter>
  810. </parameters>
  811. </method>
  812. <method name="ref" c:identifier="g_async_queue_ref" introspectable="0">
  813. <doc xml:space="preserve">Increases the reference count of the asynchronous @queue by 1.
  814. You do not need to hold the lock to call this function.</doc>
  815. <return-value>
  816. <doc xml:space="preserve">the @queue that was passed in (since 2.6)</doc>
  817. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  818. </return-value>
  819. <parameters>
  820. <instance-parameter name="queue" transfer-ownership="none">
  821. <doc xml:space="preserve">a #GAsyncQueue</doc>
  822. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  823. </instance-parameter>
  824. </parameters>
  825. </method>
  826. <method name="ref_unlocked"
  827. c:identifier="g_async_queue_ref_unlocked"
  828. deprecated="1"
  829. deprecated-version="2.8">
  830. <doc xml:space="preserve">Increases the reference count of the asynchronous @queue by 1.</doc>
  831. <doc-deprecated xml:space="preserve">Reference counting is done atomically.
  832. so g_async_queue_ref() can be used regardless of the @queue's
  833. lock.</doc-deprecated>
  834. <return-value transfer-ownership="none">
  835. <type name="none" c:type="void"/>
  836. </return-value>
  837. <parameters>
  838. <instance-parameter name="queue" transfer-ownership="none">
  839. <doc xml:space="preserve">a #GAsyncQueue</doc>
  840. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  841. </instance-parameter>
  842. </parameters>
  843. </method>
  844. <method name="remove" c:identifier="g_async_queue_remove" version="2.46">
  845. <doc xml:space="preserve">Remove an item from the queue.</doc>
  846. <return-value transfer-ownership="none">
  847. <doc xml:space="preserve">%TRUE if the item was removed</doc>
  848. <type name="gboolean" c:type="gboolean"/>
  849. </return-value>
  850. <parameters>
  851. <instance-parameter name="queue" transfer-ownership="none">
  852. <doc xml:space="preserve">a #GAsyncQueue</doc>
  853. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  854. </instance-parameter>
  855. <parameter name="item"
  856. transfer-ownership="none"
  857. nullable="1"
  858. allow-none="1">
  859. <doc xml:space="preserve">the data to remove from the @queue</doc>
  860. <type name="gpointer" c:type="gpointer"/>
  861. </parameter>
  862. </parameters>
  863. </method>
  864. <method name="remove_unlocked"
  865. c:identifier="g_async_queue_remove_unlocked"
  866. version="2.46">
  867. <doc xml:space="preserve">Remove an item from the queue.
  868. This function must be called while holding the @queue's lock.</doc>
  869. <return-value transfer-ownership="none">
  870. <doc xml:space="preserve">%TRUE if the item was removed</doc>
  871. <type name="gboolean" c:type="gboolean"/>
  872. </return-value>
  873. <parameters>
  874. <instance-parameter name="queue" transfer-ownership="none">
  875. <doc xml:space="preserve">a #GAsyncQueue</doc>
  876. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  877. </instance-parameter>
  878. <parameter name="item"
  879. transfer-ownership="none"
  880. nullable="1"
  881. allow-none="1">
  882. <doc xml:space="preserve">the data to remove from the @queue</doc>
  883. <type name="gpointer" c:type="gpointer"/>
  884. </parameter>
  885. </parameters>
  886. </method>
  887. <method name="sort"
  888. c:identifier="g_async_queue_sort"
  889. version="2.10"
  890. introspectable="0">
  891. <doc xml:space="preserve">Sorts @queue using @func.
  892. The sort function @func is passed two elements of the @queue.
  893. It should return 0 if they are equal, a negative value if the
  894. first element should be higher in the @queue or a positive value
  895. if the first element should be lower in the @queue than the second
  896. element.
  897. This function will lock @queue before it sorts the queue and unlock
  898. it when it is finished.
  899. If you were sorting a list of priority numbers to make sure the
  900. lowest priority would be at the top of the queue, you could use:
  901. |[&lt;!-- language="C" --&gt;
  902. gint32 id1;
  903. gint32 id2;
  904. id1 = GPOINTER_TO_INT (element1);
  905. id2 = GPOINTER_TO_INT (element2);
  906. return (id1 &gt; id2 ? +1 : id1 == id2 ? 0 : -1);
  907. ]|</doc>
  908. <return-value transfer-ownership="none">
  909. <type name="none" c:type="void"/>
  910. </return-value>
  911. <parameters>
  912. <instance-parameter name="queue" transfer-ownership="none">
  913. <doc xml:space="preserve">a #GAsyncQueue</doc>
  914. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  915. </instance-parameter>
  916. <parameter name="func" transfer-ownership="none" closure="1">
  917. <doc xml:space="preserve">the #GCompareDataFunc is used to sort @queue</doc>
  918. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  919. </parameter>
  920. <parameter name="user_data"
  921. transfer-ownership="none"
  922. nullable="1"
  923. allow-none="1">
  924. <doc xml:space="preserve">user data passed to @func</doc>
  925. <type name="gpointer" c:type="gpointer"/>
  926. </parameter>
  927. </parameters>
  928. </method>
  929. <method name="sort_unlocked"
  930. c:identifier="g_async_queue_sort_unlocked"
  931. version="2.10"
  932. introspectable="0">
  933. <doc xml:space="preserve">Sorts @queue using @func.
  934. The sort function @func is passed two elements of the @queue.
  935. It should return 0 if they are equal, a negative value if the
  936. first element should be higher in the @queue or a positive value
  937. if the first element should be lower in the @queue than the second
  938. element.
  939. This function must be called while holding the @queue's lock.</doc>
  940. <return-value transfer-ownership="none">
  941. <type name="none" c:type="void"/>
  942. </return-value>
  943. <parameters>
  944. <instance-parameter name="queue" transfer-ownership="none">
  945. <doc xml:space="preserve">a #GAsyncQueue</doc>
  946. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  947. </instance-parameter>
  948. <parameter name="func" transfer-ownership="none" closure="1">
  949. <doc xml:space="preserve">the #GCompareDataFunc is used to sort @queue</doc>
  950. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  951. </parameter>
  952. <parameter name="user_data"
  953. transfer-ownership="none"
  954. nullable="1"
  955. allow-none="1">
  956. <doc xml:space="preserve">user data passed to @func</doc>
  957. <type name="gpointer" c:type="gpointer"/>
  958. </parameter>
  959. </parameters>
  960. </method>
  961. <method name="timed_pop"
  962. c:identifier="g_async_queue_timed_pop"
  963. deprecated="1">
  964. <doc xml:space="preserve">Pops data from the @queue. If the queue is empty, blocks until
  965. @end_time or until data becomes available.
  966. If no data is received before @end_time, %NULL is returned.
  967. To easily calculate @end_time, a combination of g_get_current_time()
  968. and g_time_val_add() can be used.</doc>
  969. <doc-deprecated xml:space="preserve">use g_async_queue_timeout_pop().</doc-deprecated>
  970. <return-value transfer-ownership="none" nullable="1">
  971. <doc xml:space="preserve">data from the queue or %NULL, when no data is
  972. received before @end_time.</doc>
  973. <type name="gpointer" c:type="gpointer"/>
  974. </return-value>
  975. <parameters>
  976. <instance-parameter name="queue" transfer-ownership="none">
  977. <doc xml:space="preserve">a #GAsyncQueue</doc>
  978. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  979. </instance-parameter>
  980. <parameter name="end_time" transfer-ownership="none">
  981. <doc xml:space="preserve">a #GTimeVal, determining the final time</doc>
  982. <type name="TimeVal" c:type="GTimeVal*"/>
  983. </parameter>
  984. </parameters>
  985. </method>
  986. <method name="timed_pop_unlocked"
  987. c:identifier="g_async_queue_timed_pop_unlocked"
  988. deprecated="1">
  989. <doc xml:space="preserve">Pops data from the @queue. If the queue is empty, blocks until
  990. @end_time or until data becomes available.
  991. If no data is received before @end_time, %NULL is returned.
  992. To easily calculate @end_time, a combination of g_get_current_time()
  993. and g_time_val_add() can be used.
  994. This function must be called while holding the @queue's lock.</doc>
  995. <doc-deprecated xml:space="preserve">use g_async_queue_timeout_pop_unlocked().</doc-deprecated>
  996. <return-value transfer-ownership="none" nullable="1">
  997. <doc xml:space="preserve">data from the queue or %NULL, when no data is
  998. received before @end_time.</doc>
  999. <type name="gpointer" c:type="gpointer"/>
  1000. </return-value>
  1001. <parameters>
  1002. <instance-parameter name="queue" transfer-ownership="none">
  1003. <doc xml:space="preserve">a #GAsyncQueue</doc>
  1004. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  1005. </instance-parameter>
  1006. <parameter name="end_time" transfer-ownership="none">
  1007. <doc xml:space="preserve">a #GTimeVal, determining the final time</doc>
  1008. <type name="TimeVal" c:type="GTimeVal*"/>
  1009. </parameter>
  1010. </parameters>
  1011. </method>
  1012. <method name="timeout_pop" c:identifier="g_async_queue_timeout_pop">
  1013. <doc xml:space="preserve">Pops data from the @queue. If the queue is empty, blocks for
  1014. @timeout microseconds, or until data becomes available.
  1015. If no data is received before the timeout, %NULL is returned.</doc>
  1016. <return-value transfer-ownership="none" nullable="1">
  1017. <doc xml:space="preserve">data from the queue or %NULL, when no data is
  1018. received before the timeout.</doc>
  1019. <type name="gpointer" c:type="gpointer"/>
  1020. </return-value>
  1021. <parameters>
  1022. <instance-parameter name="queue" transfer-ownership="none">
  1023. <doc xml:space="preserve">a #GAsyncQueue</doc>
  1024. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  1025. </instance-parameter>
  1026. <parameter name="timeout" transfer-ownership="none">
  1027. <doc xml:space="preserve">the number of microseconds to wait</doc>
  1028. <type name="guint64" c:type="guint64"/>
  1029. </parameter>
  1030. </parameters>
  1031. </method>
  1032. <method name="timeout_pop_unlocked"
  1033. c:identifier="g_async_queue_timeout_pop_unlocked">
  1034. <doc xml:space="preserve">Pops data from the @queue. If the queue is empty, blocks for
  1035. @timeout microseconds, or until data becomes available.
  1036. If no data is received before the timeout, %NULL is returned.
  1037. This function must be called while holding the @queue's lock.</doc>
  1038. <return-value transfer-ownership="none" nullable="1">
  1039. <doc xml:space="preserve">data from the queue or %NULL, when no data is
  1040. received before the timeout.</doc>
  1041. <type name="gpointer" c:type="gpointer"/>
  1042. </return-value>
  1043. <parameters>
  1044. <instance-parameter name="queue" transfer-ownership="none">
  1045. <doc xml:space="preserve">a #GAsyncQueue</doc>
  1046. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  1047. </instance-parameter>
  1048. <parameter name="timeout" transfer-ownership="none">
  1049. <doc xml:space="preserve">the number of microseconds to wait</doc>
  1050. <type name="guint64" c:type="guint64"/>
  1051. </parameter>
  1052. </parameters>
  1053. </method>
  1054. <method name="try_pop" c:identifier="g_async_queue_try_pop">
  1055. <doc xml:space="preserve">Tries to pop data from the @queue. If no data is available,
  1056. %NULL is returned.</doc>
  1057. <return-value transfer-ownership="none" nullable="1">
  1058. <doc xml:space="preserve">data from the queue or %NULL, when no data is
  1059. available immediately.</doc>
  1060. <type name="gpointer" c:type="gpointer"/>
  1061. </return-value>
  1062. <parameters>
  1063. <instance-parameter name="queue" transfer-ownership="none">
  1064. <doc xml:space="preserve">a #GAsyncQueue</doc>
  1065. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  1066. </instance-parameter>
  1067. </parameters>
  1068. </method>
  1069. <method name="try_pop_unlocked"
  1070. c:identifier="g_async_queue_try_pop_unlocked">
  1071. <doc xml:space="preserve">Tries to pop data from the @queue. If no data is available,
  1072. %NULL is returned.
  1073. This function must be called while holding the @queue's lock.</doc>
  1074. <return-value transfer-ownership="none" nullable="1">
  1075. <doc xml:space="preserve">data from the queue or %NULL, when no data is
  1076. available immediately.</doc>
  1077. <type name="gpointer" c:type="gpointer"/>
  1078. </return-value>
  1079. <parameters>
  1080. <instance-parameter name="queue" transfer-ownership="none">
  1081. <doc xml:space="preserve">a #GAsyncQueue</doc>
  1082. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  1083. </instance-parameter>
  1084. </parameters>
  1085. </method>
  1086. <method name="unlock" c:identifier="g_async_queue_unlock">
  1087. <doc xml:space="preserve">Releases the queue's lock.
  1088. Calling this function when you have not acquired
  1089. the with g_async_queue_lock() leads to undefined
  1090. behaviour.</doc>
  1091. <return-value transfer-ownership="none">
  1092. <type name="none" c:type="void"/>
  1093. </return-value>
  1094. <parameters>
  1095. <instance-parameter name="queue" transfer-ownership="none">
  1096. <doc xml:space="preserve">a #GAsyncQueue</doc>
  1097. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  1098. </instance-parameter>
  1099. </parameters>
  1100. </method>
  1101. <method name="unref" c:identifier="g_async_queue_unref">
  1102. <doc xml:space="preserve">Decreases the reference count of the asynchronous @queue by 1.
  1103. If the reference count went to 0, the @queue will be destroyed
  1104. and the memory allocated will be freed. So you are not allowed
  1105. to use the @queue afterwards, as it might have disappeared.
  1106. You do not need to hold the lock to call this function.</doc>
  1107. <return-value transfer-ownership="none">
  1108. <type name="none" c:type="void"/>
  1109. </return-value>
  1110. <parameters>
  1111. <instance-parameter name="queue" transfer-ownership="none">
  1112. <doc xml:space="preserve">a #GAsyncQueue.</doc>
  1113. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  1114. </instance-parameter>
  1115. </parameters>
  1116. </method>
  1117. <method name="unref_and_unlock"
  1118. c:identifier="g_async_queue_unref_and_unlock"
  1119. deprecated="1"
  1120. deprecated-version="2.8">
  1121. <doc xml:space="preserve">Decreases the reference count of the asynchronous @queue by 1
  1122. and releases the lock. This function must be called while holding
  1123. the @queue's lock. If the reference count went to 0, the @queue
  1124. will be destroyed and the memory allocated will be freed.</doc>
  1125. <doc-deprecated xml:space="preserve">Reference counting is done atomically.
  1126. so g_async_queue_unref() can be used regardless of the @queue's
  1127. lock.</doc-deprecated>
  1128. <return-value transfer-ownership="none">
  1129. <type name="none" c:type="void"/>
  1130. </return-value>
  1131. <parameters>
  1132. <instance-parameter name="queue" transfer-ownership="none">
  1133. <doc xml:space="preserve">a #GAsyncQueue</doc>
  1134. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  1135. </instance-parameter>
  1136. </parameters>
  1137. </method>
  1138. <function name="new" c:identifier="g_async_queue_new" introspectable="0">
  1139. <doc xml:space="preserve">Creates a new asynchronous queue.</doc>
  1140. <return-value>
  1141. <doc xml:space="preserve">a new #GAsyncQueue. Free with g_async_queue_unref()</doc>
  1142. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  1143. </return-value>
  1144. </function>
  1145. <function name="new_full"
  1146. c:identifier="g_async_queue_new_full"
  1147. version="2.16"
  1148. introspectable="0">
  1149. <doc xml:space="preserve">Creates a new asynchronous queue and sets up a destroy notify
  1150. function that is used to free any remaining queue items when
  1151. the queue is destroyed after the final unref.</doc>
  1152. <return-value>
  1153. <doc xml:space="preserve">a new #GAsyncQueue. Free with g_async_queue_unref()</doc>
  1154. <type name="AsyncQueue" c:type="GAsyncQueue*"/>
  1155. </return-value>
  1156. <parameters>
  1157. <parameter name="item_free_func"
  1158. transfer-ownership="none"
  1159. scope="async">
  1160. <doc xml:space="preserve">function to free queue elements</doc>
  1161. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  1162. </parameter>
  1163. </parameters>
  1164. </function>
  1165. </record>
  1166. <constant name="BIG_ENDIAN" value="4321" c:type="G_BIG_ENDIAN">
  1167. <doc xml:space="preserve">Specifies one of the possible types of byte order.
  1168. See #G_BYTE_ORDER.</doc>
  1169. <type name="gint" c:type="gint"/>
  1170. </constant>
  1171. <record name="BookmarkFile" c:type="GBookmarkFile" disguised="1">
  1172. <doc xml:space="preserve">The `GBookmarkFile` structure contains only
  1173. private data and should not be directly accessed.</doc>
  1174. <method name="add_application"
  1175. c:identifier="g_bookmark_file_add_application"
  1176. version="2.12">
  1177. <doc xml:space="preserve">Adds the application with @name and @exec to the list of
  1178. applications that have registered a bookmark for @uri into
  1179. @bookmark.
  1180. Every bookmark inside a #GBookmarkFile must have at least an
  1181. application registered. Each application must provide a name, a
  1182. command line useful for launching the bookmark, the number of times
  1183. the bookmark has been registered by the application and the last
  1184. time the application registered this bookmark.
  1185. If @name is %NULL, the name of the application will be the
  1186. same returned by g_get_application_name(); if @exec is %NULL, the
  1187. command line will be a composition of the program name as
  1188. returned by g_get_prgname() and the "\%u" modifier, which will be
  1189. expanded to the bookmark's URI.
  1190. This function will automatically take care of updating the
  1191. registrations count and timestamping in case an application
  1192. with the same @name had already registered a bookmark for
  1193. @uri inside @bookmark.
  1194. If no bookmark for @uri is found, one is created.</doc>
  1195. <return-value transfer-ownership="none">
  1196. <type name="none" c:type="void"/>
  1197. </return-value>
  1198. <parameters>
  1199. <instance-parameter name="bookmark" transfer-ownership="none">
  1200. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1201. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1202. </instance-parameter>
  1203. <parameter name="uri" transfer-ownership="none">
  1204. <doc xml:space="preserve">a valid URI</doc>
  1205. <type name="utf8" c:type="const gchar*"/>
  1206. </parameter>
  1207. <parameter name="name"
  1208. transfer-ownership="none"
  1209. nullable="1"
  1210. allow-none="1">
  1211. <doc xml:space="preserve">the name of the application registering the bookmark
  1212. or %NULL</doc>
  1213. <type name="utf8" c:type="const gchar*"/>
  1214. </parameter>
  1215. <parameter name="exec"
  1216. transfer-ownership="none"
  1217. nullable="1"
  1218. allow-none="1">
  1219. <doc xml:space="preserve">command line to be used to launch the bookmark or %NULL</doc>
  1220. <type name="utf8" c:type="const gchar*"/>
  1221. </parameter>
  1222. </parameters>
  1223. </method>
  1224. <method name="add_group"
  1225. c:identifier="g_bookmark_file_add_group"
  1226. version="2.12">
  1227. <doc xml:space="preserve">Adds @group to the list of groups to which the bookmark for @uri
  1228. belongs to.
  1229. If no bookmark for @uri is found then it is created.</doc>
  1230. <return-value transfer-ownership="none">
  1231. <type name="none" c:type="void"/>
  1232. </return-value>
  1233. <parameters>
  1234. <instance-parameter name="bookmark" transfer-ownership="none">
  1235. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1236. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1237. </instance-parameter>
  1238. <parameter name="uri" transfer-ownership="none">
  1239. <doc xml:space="preserve">a valid URI</doc>
  1240. <type name="utf8" c:type="const gchar*"/>
  1241. </parameter>
  1242. <parameter name="group" transfer-ownership="none">
  1243. <doc xml:space="preserve">the group name to be added</doc>
  1244. <type name="utf8" c:type="const gchar*"/>
  1245. </parameter>
  1246. </parameters>
  1247. </method>
  1248. <method name="free" c:identifier="g_bookmark_file_free" version="2.12">
  1249. <doc xml:space="preserve">Frees a #GBookmarkFile.</doc>
  1250. <return-value transfer-ownership="none">
  1251. <type name="none" c:type="void"/>
  1252. </return-value>
  1253. <parameters>
  1254. <instance-parameter name="bookmark" transfer-ownership="none">
  1255. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1256. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1257. </instance-parameter>
  1258. </parameters>
  1259. </method>
  1260. <method name="get_added"
  1261. c:identifier="g_bookmark_file_get_added"
  1262. version="2.12"
  1263. throws="1">
  1264. <doc xml:space="preserve">Gets the time the bookmark for @uri was added to @bookmark
  1265. In the event the URI cannot be found, -1 is returned and
  1266. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
  1267. <return-value transfer-ownership="none">
  1268. <doc xml:space="preserve">a timestamp</doc>
  1269. <type name="glong" c:type="time_t"/>
  1270. </return-value>
  1271. <parameters>
  1272. <instance-parameter name="bookmark" transfer-ownership="none">
  1273. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1274. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1275. </instance-parameter>
  1276. <parameter name="uri" transfer-ownership="none">
  1277. <doc xml:space="preserve">a valid URI</doc>
  1278. <type name="utf8" c:type="const gchar*"/>
  1279. </parameter>
  1280. </parameters>
  1281. </method>
  1282. <method name="get_app_info"
  1283. c:identifier="g_bookmark_file_get_app_info"
  1284. version="2.12"
  1285. throws="1">
  1286. <doc xml:space="preserve">Gets the registration informations of @app_name for the bookmark for
  1287. @uri. See g_bookmark_file_set_app_info() for more informations about
  1288. the returned data.
  1289. The string returned in @app_exec must be freed.
  1290. In the event the URI cannot be found, %FALSE is returned and
  1291. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the
  1292. event that no application with name @app_name has registered a bookmark
  1293. for @uri, %FALSE is returned and error is set to
  1294. #G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED. In the event that unquoting
  1295. the command line fails, an error of the #G_SHELL_ERROR domain is
  1296. set and %FALSE is returned.</doc>
  1297. <return-value transfer-ownership="none">
  1298. <doc xml:space="preserve">%TRUE on success.</doc>
  1299. <type name="gboolean" c:type="gboolean"/>
  1300. </return-value>
  1301. <parameters>
  1302. <instance-parameter name="bookmark" transfer-ownership="none">
  1303. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1304. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1305. </instance-parameter>
  1306. <parameter name="uri" transfer-ownership="none">
  1307. <doc xml:space="preserve">a valid URI</doc>
  1308. <type name="utf8" c:type="const gchar*"/>
  1309. </parameter>
  1310. <parameter name="name" transfer-ownership="none">
  1311. <doc xml:space="preserve">an application's name</doc>
  1312. <type name="utf8" c:type="const gchar*"/>
  1313. </parameter>
  1314. <parameter name="exec"
  1315. direction="out"
  1316. caller-allocates="0"
  1317. transfer-ownership="full"
  1318. optional="1"
  1319. allow-none="1">
  1320. <doc xml:space="preserve">return location for the command line of the application, or %NULL</doc>
  1321. <type name="utf8" c:type="gchar**"/>
  1322. </parameter>
  1323. <parameter name="count"
  1324. direction="out"
  1325. caller-allocates="0"
  1326. transfer-ownership="full"
  1327. optional="1"
  1328. allow-none="1">
  1329. <doc xml:space="preserve">return location for the registration count, or %NULL</doc>
  1330. <type name="guint" c:type="guint*"/>
  1331. </parameter>
  1332. <parameter name="stamp"
  1333. direction="out"
  1334. caller-allocates="0"
  1335. transfer-ownership="full"
  1336. optional="1"
  1337. allow-none="1">
  1338. <doc xml:space="preserve">return location for the last registration time, or %NULL</doc>
  1339. <type name="glong" c:type="time_t*"/>
  1340. </parameter>
  1341. </parameters>
  1342. </method>
  1343. <method name="get_applications"
  1344. c:identifier="g_bookmark_file_get_applications"
  1345. version="2.12"
  1346. throws="1">
  1347. <doc xml:space="preserve">Retrieves the names of the applications that have registered the
  1348. bookmark for @uri.
  1349. In the event the URI cannot be found, %NULL is returned and
  1350. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
  1351. <return-value transfer-ownership="full">
  1352. <doc xml:space="preserve">a newly allocated %NULL-terminated array of strings.
  1353. Use g_strfreev() to free it.</doc>
  1354. <array length="1" zero-terminated="0" c:type="gchar**">
  1355. <type name="utf8"/>
  1356. </array>
  1357. </return-value>
  1358. <parameters>
  1359. <instance-parameter name="bookmark" transfer-ownership="none">
  1360. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1361. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1362. </instance-parameter>
  1363. <parameter name="uri" transfer-ownership="none">
  1364. <doc xml:space="preserve">a valid URI</doc>
  1365. <type name="utf8" c:type="const gchar*"/>
  1366. </parameter>
  1367. <parameter name="length"
  1368. direction="out"
  1369. caller-allocates="0"
  1370. transfer-ownership="full"
  1371. optional="1"
  1372. allow-none="1">
  1373. <doc xml:space="preserve">return location of the length of the returned list, or %NULL</doc>
  1374. <type name="gsize" c:type="gsize*"/>
  1375. </parameter>
  1376. </parameters>
  1377. </method>
  1378. <method name="get_description"
  1379. c:identifier="g_bookmark_file_get_description"
  1380. version="2.12"
  1381. throws="1">
  1382. <doc xml:space="preserve">Retrieves the description of the bookmark for @uri.
  1383. In the event the URI cannot be found, %NULL is returned and
  1384. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
  1385. <return-value transfer-ownership="full">
  1386. <doc xml:space="preserve">a newly allocated string or %NULL if the specified
  1387. URI cannot be found.</doc>
  1388. <type name="utf8" c:type="gchar*"/>
  1389. </return-value>
  1390. <parameters>
  1391. <instance-parameter name="bookmark" transfer-ownership="none">
  1392. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1393. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1394. </instance-parameter>
  1395. <parameter name="uri" transfer-ownership="none">
  1396. <doc xml:space="preserve">a valid URI</doc>
  1397. <type name="utf8" c:type="const gchar*"/>
  1398. </parameter>
  1399. </parameters>
  1400. </method>
  1401. <method name="get_groups"
  1402. c:identifier="g_bookmark_file_get_groups"
  1403. version="2.12"
  1404. throws="1">
  1405. <doc xml:space="preserve">Retrieves the list of group names of the bookmark for @uri.
  1406. In the event the URI cannot be found, %NULL is returned and
  1407. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
  1408. The returned array is %NULL terminated, so @length may optionally
  1409. be %NULL.</doc>
  1410. <return-value transfer-ownership="full">
  1411. <doc xml:space="preserve">a newly allocated %NULL-terminated array of group names.
  1412. Use g_strfreev() to free it.</doc>
  1413. <array length="1" zero-terminated="0" c:type="gchar**">
  1414. <type name="utf8"/>
  1415. </array>
  1416. </return-value>
  1417. <parameters>
  1418. <instance-parameter name="bookmark" transfer-ownership="none">
  1419. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1420. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1421. </instance-parameter>
  1422. <parameter name="uri" transfer-ownership="none">
  1423. <doc xml:space="preserve">a valid URI</doc>
  1424. <type name="utf8" c:type="const gchar*"/>
  1425. </parameter>
  1426. <parameter name="length"
  1427. direction="out"
  1428. caller-allocates="0"
  1429. transfer-ownership="full"
  1430. optional="1"
  1431. allow-none="1">
  1432. <doc xml:space="preserve">return location for the length of the returned string, or %NULL</doc>
  1433. <type name="gsize" c:type="gsize*"/>
  1434. </parameter>
  1435. </parameters>
  1436. </method>
  1437. <method name="get_icon"
  1438. c:identifier="g_bookmark_file_get_icon"
  1439. version="2.12"
  1440. throws="1">
  1441. <doc xml:space="preserve">Gets the icon of the bookmark for @uri.
  1442. In the event the URI cannot be found, %FALSE is returned and
  1443. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
  1444. <return-value transfer-ownership="none">
  1445. <doc xml:space="preserve">%TRUE if the icon for the bookmark for the URI was found.
  1446. You should free the returned strings.</doc>
  1447. <type name="gboolean" c:type="gboolean"/>
  1448. </return-value>
  1449. <parameters>
  1450. <instance-parameter name="bookmark" transfer-ownership="none">
  1451. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1452. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1453. </instance-parameter>
  1454. <parameter name="uri" transfer-ownership="none">
  1455. <doc xml:space="preserve">a valid URI</doc>
  1456. <type name="utf8" c:type="const gchar*"/>
  1457. </parameter>
  1458. <parameter name="href"
  1459. direction="out"
  1460. caller-allocates="0"
  1461. transfer-ownership="full"
  1462. optional="1"
  1463. allow-none="1">
  1464. <doc xml:space="preserve">return location for the icon's location or %NULL</doc>
  1465. <type name="utf8" c:type="gchar**"/>
  1466. </parameter>
  1467. <parameter name="mime_type"
  1468. direction="out"
  1469. caller-allocates="0"
  1470. transfer-ownership="full"
  1471. optional="1"
  1472. allow-none="1">
  1473. <doc xml:space="preserve">return location for the icon's MIME type or %NULL</doc>
  1474. <type name="utf8" c:type="gchar**"/>
  1475. </parameter>
  1476. </parameters>
  1477. </method>
  1478. <method name="get_is_private"
  1479. c:identifier="g_bookmark_file_get_is_private"
  1480. version="2.12"
  1481. throws="1">
  1482. <doc xml:space="preserve">Gets whether the private flag of the bookmark for @uri is set.
  1483. In the event the URI cannot be found, %FALSE is returned and
  1484. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the
  1485. event that the private flag cannot be found, %FALSE is returned and
  1486. @error is set to #G_BOOKMARK_FILE_ERROR_INVALID_VALUE.</doc>
  1487. <return-value transfer-ownership="none">
  1488. <doc xml:space="preserve">%TRUE if the private flag is set, %FALSE otherwise.</doc>
  1489. <type name="gboolean" c:type="gboolean"/>
  1490. </return-value>
  1491. <parameters>
  1492. <instance-parameter name="bookmark" transfer-ownership="none">
  1493. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1494. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1495. </instance-parameter>
  1496. <parameter name="uri" transfer-ownership="none">
  1497. <doc xml:space="preserve">a valid URI</doc>
  1498. <type name="utf8" c:type="const gchar*"/>
  1499. </parameter>
  1500. </parameters>
  1501. </method>
  1502. <method name="get_mime_type"
  1503. c:identifier="g_bookmark_file_get_mime_type"
  1504. version="2.12"
  1505. throws="1">
  1506. <doc xml:space="preserve">Retrieves the MIME type of the resource pointed by @uri.
  1507. In the event the URI cannot be found, %NULL is returned and
  1508. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the
  1509. event that the MIME type cannot be found, %NULL is returned and
  1510. @error is set to #G_BOOKMARK_FILE_ERROR_INVALID_VALUE.</doc>
  1511. <return-value transfer-ownership="full">
  1512. <doc xml:space="preserve">a newly allocated string or %NULL if the specified
  1513. URI cannot be found.</doc>
  1514. <type name="utf8" c:type="gchar*"/>
  1515. </return-value>
  1516. <parameters>
  1517. <instance-parameter name="bookmark" transfer-ownership="none">
  1518. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1519. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1520. </instance-parameter>
  1521. <parameter name="uri" transfer-ownership="none">
  1522. <doc xml:space="preserve">a valid URI</doc>
  1523. <type name="utf8" c:type="const gchar*"/>
  1524. </parameter>
  1525. </parameters>
  1526. </method>
  1527. <method name="get_modified"
  1528. c:identifier="g_bookmark_file_get_modified"
  1529. version="2.12"
  1530. throws="1">
  1531. <doc xml:space="preserve">Gets the time when the bookmark for @uri was last modified.
  1532. In the event the URI cannot be found, -1 is returned and
  1533. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
  1534. <return-value transfer-ownership="none">
  1535. <doc xml:space="preserve">a timestamp</doc>
  1536. <type name="glong" c:type="time_t"/>
  1537. </return-value>
  1538. <parameters>
  1539. <instance-parameter name="bookmark" transfer-ownership="none">
  1540. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1541. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1542. </instance-parameter>
  1543. <parameter name="uri" transfer-ownership="none">
  1544. <doc xml:space="preserve">a valid URI</doc>
  1545. <type name="utf8" c:type="const gchar*"/>
  1546. </parameter>
  1547. </parameters>
  1548. </method>
  1549. <method name="get_size"
  1550. c:identifier="g_bookmark_file_get_size"
  1551. version="2.12">
  1552. <doc xml:space="preserve">Gets the number of bookmarks inside @bookmark.</doc>
  1553. <return-value transfer-ownership="none">
  1554. <doc xml:space="preserve">the number of bookmarks</doc>
  1555. <type name="gint" c:type="gint"/>
  1556. </return-value>
  1557. <parameters>
  1558. <instance-parameter name="bookmark" transfer-ownership="none">
  1559. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1560. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1561. </instance-parameter>
  1562. </parameters>
  1563. </method>
  1564. <method name="get_title"
  1565. c:identifier="g_bookmark_file_get_title"
  1566. version="2.12"
  1567. throws="1">
  1568. <doc xml:space="preserve">Returns the title of the bookmark for @uri.
  1569. If @uri is %NULL, the title of @bookmark is returned.
  1570. In the event the URI cannot be found, %NULL is returned and
  1571. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
  1572. <return-value transfer-ownership="full">
  1573. <doc xml:space="preserve">a newly allocated string or %NULL if the specified
  1574. URI cannot be found.</doc>
  1575. <type name="utf8" c:type="gchar*"/>
  1576. </return-value>
  1577. <parameters>
  1578. <instance-parameter name="bookmark" transfer-ownership="none">
  1579. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1580. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1581. </instance-parameter>
  1582. <parameter name="uri"
  1583. transfer-ownership="none"
  1584. nullable="1"
  1585. allow-none="1">
  1586. <doc xml:space="preserve">a valid URI or %NULL</doc>
  1587. <type name="utf8" c:type="const gchar*"/>
  1588. </parameter>
  1589. </parameters>
  1590. </method>
  1591. <method name="get_uris"
  1592. c:identifier="g_bookmark_file_get_uris"
  1593. version="2.12">
  1594. <doc xml:space="preserve">Returns all URIs of the bookmarks in the bookmark file @bookmark.
  1595. The array of returned URIs will be %NULL-terminated, so @length may
  1596. optionally be %NULL.</doc>
  1597. <return-value transfer-ownership="full">
  1598. <doc xml:space="preserve">a newly allocated %NULL-terminated array of strings.
  1599. Use g_strfreev() to free it.</doc>
  1600. <array length="0" zero-terminated="0" c:type="gchar**">
  1601. <type name="utf8"/>
  1602. </array>
  1603. </return-value>
  1604. <parameters>
  1605. <instance-parameter name="bookmark" transfer-ownership="none">
  1606. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1607. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1608. </instance-parameter>
  1609. <parameter name="length"
  1610. direction="out"
  1611. caller-allocates="0"
  1612. transfer-ownership="full"
  1613. optional="1"
  1614. allow-none="1">
  1615. <doc xml:space="preserve">return location for the number of returned URIs, or %NULL</doc>
  1616. <type name="gsize" c:type="gsize*"/>
  1617. </parameter>
  1618. </parameters>
  1619. </method>
  1620. <method name="get_visited"
  1621. c:identifier="g_bookmark_file_get_visited"
  1622. version="2.12"
  1623. throws="1">
  1624. <doc xml:space="preserve">Gets the time the bookmark for @uri was last visited.
  1625. In the event the URI cannot be found, -1 is returned and
  1626. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
  1627. <return-value transfer-ownership="none">
  1628. <doc xml:space="preserve">a timestamp.</doc>
  1629. <type name="glong" c:type="time_t"/>
  1630. </return-value>
  1631. <parameters>
  1632. <instance-parameter name="bookmark" transfer-ownership="none">
  1633. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1634. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1635. </instance-parameter>
  1636. <parameter name="uri" transfer-ownership="none">
  1637. <doc xml:space="preserve">a valid URI</doc>
  1638. <type name="utf8" c:type="const gchar*"/>
  1639. </parameter>
  1640. </parameters>
  1641. </method>
  1642. <method name="has_application"
  1643. c:identifier="g_bookmark_file_has_application"
  1644. version="2.12"
  1645. throws="1">
  1646. <doc xml:space="preserve">Checks whether the bookmark for @uri inside @bookmark has been
  1647. registered by application @name.
  1648. In the event the URI cannot be found, %FALSE is returned and
  1649. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
  1650. <return-value transfer-ownership="none">
  1651. <doc xml:space="preserve">%TRUE if the application @name was found</doc>
  1652. <type name="gboolean" c:type="gboolean"/>
  1653. </return-value>
  1654. <parameters>
  1655. <instance-parameter name="bookmark" transfer-ownership="none">
  1656. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1657. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1658. </instance-parameter>
  1659. <parameter name="uri" transfer-ownership="none">
  1660. <doc xml:space="preserve">a valid URI</doc>
  1661. <type name="utf8" c:type="const gchar*"/>
  1662. </parameter>
  1663. <parameter name="name" transfer-ownership="none">
  1664. <doc xml:space="preserve">the name of the application</doc>
  1665. <type name="utf8" c:type="const gchar*"/>
  1666. </parameter>
  1667. </parameters>
  1668. </method>
  1669. <method name="has_group"
  1670. c:identifier="g_bookmark_file_has_group"
  1671. version="2.12"
  1672. throws="1">
  1673. <doc xml:space="preserve">Checks whether @group appears in the list of groups to which
  1674. the bookmark for @uri belongs to.
  1675. In the event the URI cannot be found, %FALSE is returned and
  1676. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
  1677. <return-value transfer-ownership="none">
  1678. <doc xml:space="preserve">%TRUE if @group was found.</doc>
  1679. <type name="gboolean" c:type="gboolean"/>
  1680. </return-value>
  1681. <parameters>
  1682. <instance-parameter name="bookmark" transfer-ownership="none">
  1683. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1684. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1685. </instance-parameter>
  1686. <parameter name="uri" transfer-ownership="none">
  1687. <doc xml:space="preserve">a valid URI</doc>
  1688. <type name="utf8" c:type="const gchar*"/>
  1689. </parameter>
  1690. <parameter name="group" transfer-ownership="none">
  1691. <doc xml:space="preserve">the group name to be searched</doc>
  1692. <type name="utf8" c:type="const gchar*"/>
  1693. </parameter>
  1694. </parameters>
  1695. </method>
  1696. <method name="has_item"
  1697. c:identifier="g_bookmark_file_has_item"
  1698. version="2.12">
  1699. <doc xml:space="preserve">Looks whether the desktop bookmark has an item with its URI set to @uri.</doc>
  1700. <return-value transfer-ownership="none">
  1701. <doc xml:space="preserve">%TRUE if @uri is inside @bookmark, %FALSE otherwise</doc>
  1702. <type name="gboolean" c:type="gboolean"/>
  1703. </return-value>
  1704. <parameters>
  1705. <instance-parameter name="bookmark" transfer-ownership="none">
  1706. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1707. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1708. </instance-parameter>
  1709. <parameter name="uri" transfer-ownership="none">
  1710. <doc xml:space="preserve">a valid URI</doc>
  1711. <type name="utf8" c:type="const gchar*"/>
  1712. </parameter>
  1713. </parameters>
  1714. </method>
  1715. <method name="load_from_data"
  1716. c:identifier="g_bookmark_file_load_from_data"
  1717. version="2.12"
  1718. throws="1">
  1719. <doc xml:space="preserve">Loads a bookmark file from memory into an empty #GBookmarkFile
  1720. structure. If the object cannot be created then @error is set to a
  1721. #GBookmarkFileError.</doc>
  1722. <return-value transfer-ownership="none">
  1723. <doc xml:space="preserve">%TRUE if a desktop bookmark could be loaded.</doc>
  1724. <type name="gboolean" c:type="gboolean"/>
  1725. </return-value>
  1726. <parameters>
  1727. <instance-parameter name="bookmark" transfer-ownership="none">
  1728. <doc xml:space="preserve">an empty #GBookmarkFile struct</doc>
  1729. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1730. </instance-parameter>
  1731. <parameter name="data" transfer-ownership="none">
  1732. <doc xml:space="preserve">desktop bookmarks loaded in memory</doc>
  1733. <type name="utf8" c:type="const gchar*"/>
  1734. </parameter>
  1735. <parameter name="length" transfer-ownership="none">
  1736. <doc xml:space="preserve">the length of @data in bytes</doc>
  1737. <type name="gsize" c:type="gsize"/>
  1738. </parameter>
  1739. </parameters>
  1740. </method>
  1741. <method name="load_from_data_dirs"
  1742. c:identifier="g_bookmark_file_load_from_data_dirs"
  1743. version="2.12"
  1744. throws="1">
  1745. <doc xml:space="preserve">This function looks for a desktop bookmark file named @file in the
  1746. paths returned from g_get_user_data_dir() and g_get_system_data_dirs(),
  1747. loads the file into @bookmark and returns the file's full path in
  1748. @full_path. If the file could not be loaded then an %error is
  1749. set to either a #GFileError or #GBookmarkFileError.</doc>
  1750. <return-value transfer-ownership="none">
  1751. <doc xml:space="preserve">%TRUE if a key file could be loaded, %FALSE otherwise</doc>
  1752. <type name="gboolean" c:type="gboolean"/>
  1753. </return-value>
  1754. <parameters>
  1755. <instance-parameter name="bookmark" transfer-ownership="none">
  1756. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1757. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1758. </instance-parameter>
  1759. <parameter name="file" transfer-ownership="none">
  1760. <doc xml:space="preserve">a relative path to a filename to open and parse</doc>
  1761. <type name="utf8" c:type="const gchar*"/>
  1762. </parameter>
  1763. <parameter name="full_path"
  1764. transfer-ownership="none"
  1765. nullable="1"
  1766. allow-none="1">
  1767. <doc xml:space="preserve">return location for a string containing the full path
  1768. of the file, or %NULL</doc>
  1769. <type name="utf8" c:type="gchar**"/>
  1770. </parameter>
  1771. </parameters>
  1772. </method>
  1773. <method name="load_from_file"
  1774. c:identifier="g_bookmark_file_load_from_file"
  1775. version="2.12"
  1776. throws="1">
  1777. <doc xml:space="preserve">Loads a desktop bookmark file into an empty #GBookmarkFile structure.
  1778. If the file could not be loaded then @error is set to either a #GFileError
  1779. or #GBookmarkFileError.</doc>
  1780. <return-value transfer-ownership="none">
  1781. <doc xml:space="preserve">%TRUE if a desktop bookmark file could be loaded</doc>
  1782. <type name="gboolean" c:type="gboolean"/>
  1783. </return-value>
  1784. <parameters>
  1785. <instance-parameter name="bookmark" transfer-ownership="none">
  1786. <doc xml:space="preserve">an empty #GBookmarkFile struct</doc>
  1787. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1788. </instance-parameter>
  1789. <parameter name="filename" transfer-ownership="none">
  1790. <doc xml:space="preserve">the path of a filename to load, in the GLib file name encoding</doc>
  1791. <type name="utf8" c:type="const gchar*"/>
  1792. </parameter>
  1793. </parameters>
  1794. </method>
  1795. <method name="move_item"
  1796. c:identifier="g_bookmark_file_move_item"
  1797. version="2.12"
  1798. throws="1">
  1799. <doc xml:space="preserve">Changes the URI of a bookmark item from @old_uri to @new_uri. Any
  1800. existing bookmark for @new_uri will be overwritten. If @new_uri is
  1801. %NULL, then the bookmark is removed.
  1802. In the event the URI cannot be found, %FALSE is returned and
  1803. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
  1804. <return-value transfer-ownership="none">
  1805. <doc xml:space="preserve">%TRUE if the URI was successfully changed</doc>
  1806. <type name="gboolean" c:type="gboolean"/>
  1807. </return-value>
  1808. <parameters>
  1809. <instance-parameter name="bookmark" transfer-ownership="none">
  1810. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1811. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1812. </instance-parameter>
  1813. <parameter name="old_uri" transfer-ownership="none">
  1814. <doc xml:space="preserve">a valid URI</doc>
  1815. <type name="utf8" c:type="const gchar*"/>
  1816. </parameter>
  1817. <parameter name="new_uri"
  1818. transfer-ownership="none"
  1819. nullable="1"
  1820. allow-none="1">
  1821. <doc xml:space="preserve">a valid URI, or %NULL</doc>
  1822. <type name="utf8" c:type="const gchar*"/>
  1823. </parameter>
  1824. </parameters>
  1825. </method>
  1826. <method name="remove_application"
  1827. c:identifier="g_bookmark_file_remove_application"
  1828. version="2.12"
  1829. throws="1">
  1830. <doc xml:space="preserve">Removes application registered with @name from the list of applications
  1831. that have registered a bookmark for @uri inside @bookmark.
  1832. In the event the URI cannot be found, %FALSE is returned and
  1833. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
  1834. In the event that no application with name @app_name has registered
  1835. a bookmark for @uri, %FALSE is returned and error is set to
  1836. #G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED.</doc>
  1837. <return-value transfer-ownership="none">
  1838. <doc xml:space="preserve">%TRUE if the application was successfully removed.</doc>
  1839. <type name="gboolean" c:type="gboolean"/>
  1840. </return-value>
  1841. <parameters>
  1842. <instance-parameter name="bookmark" transfer-ownership="none">
  1843. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1844. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1845. </instance-parameter>
  1846. <parameter name="uri" transfer-ownership="none">
  1847. <doc xml:space="preserve">a valid URI</doc>
  1848. <type name="utf8" c:type="const gchar*"/>
  1849. </parameter>
  1850. <parameter name="name" transfer-ownership="none">
  1851. <doc xml:space="preserve">the name of the application</doc>
  1852. <type name="utf8" c:type="const gchar*"/>
  1853. </parameter>
  1854. </parameters>
  1855. </method>
  1856. <method name="remove_group"
  1857. c:identifier="g_bookmark_file_remove_group"
  1858. version="2.12"
  1859. throws="1">
  1860. <doc xml:space="preserve">Removes @group from the list of groups to which the bookmark
  1861. for @uri belongs to.
  1862. In the event the URI cannot be found, %FALSE is returned and
  1863. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
  1864. In the event no group was defined, %FALSE is returned and
  1865. @error is set to #G_BOOKMARK_FILE_ERROR_INVALID_VALUE.</doc>
  1866. <return-value transfer-ownership="none">
  1867. <doc xml:space="preserve">%TRUE if @group was successfully removed.</doc>
  1868. <type name="gboolean" c:type="gboolean"/>
  1869. </return-value>
  1870. <parameters>
  1871. <instance-parameter name="bookmark" transfer-ownership="none">
  1872. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1873. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1874. </instance-parameter>
  1875. <parameter name="uri" transfer-ownership="none">
  1876. <doc xml:space="preserve">a valid URI</doc>
  1877. <type name="utf8" c:type="const gchar*"/>
  1878. </parameter>
  1879. <parameter name="group" transfer-ownership="none">
  1880. <doc xml:space="preserve">the group name to be removed</doc>
  1881. <type name="utf8" c:type="const gchar*"/>
  1882. </parameter>
  1883. </parameters>
  1884. </method>
  1885. <method name="remove_item"
  1886. c:identifier="g_bookmark_file_remove_item"
  1887. version="2.12"
  1888. throws="1">
  1889. <doc xml:space="preserve">Removes the bookmark for @uri from the bookmark file @bookmark.</doc>
  1890. <return-value transfer-ownership="none">
  1891. <doc xml:space="preserve">%TRUE if the bookmark was removed successfully.</doc>
  1892. <type name="gboolean" c:type="gboolean"/>
  1893. </return-value>
  1894. <parameters>
  1895. <instance-parameter name="bookmark" transfer-ownership="none">
  1896. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1897. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1898. </instance-parameter>
  1899. <parameter name="uri" transfer-ownership="none">
  1900. <doc xml:space="preserve">a valid URI</doc>
  1901. <type name="utf8" c:type="const gchar*"/>
  1902. </parameter>
  1903. </parameters>
  1904. </method>
  1905. <method name="set_added"
  1906. c:identifier="g_bookmark_file_set_added"
  1907. version="2.12">
  1908. <doc xml:space="preserve">Sets the time the bookmark for @uri was added into @bookmark.
  1909. If no bookmark for @uri is found then it is created.</doc>
  1910. <return-value transfer-ownership="none">
  1911. <type name="none" c:type="void"/>
  1912. </return-value>
  1913. <parameters>
  1914. <instance-parameter name="bookmark" transfer-ownership="none">
  1915. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1916. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1917. </instance-parameter>
  1918. <parameter name="uri" transfer-ownership="none">
  1919. <doc xml:space="preserve">a valid URI</doc>
  1920. <type name="utf8" c:type="const gchar*"/>
  1921. </parameter>
  1922. <parameter name="added" transfer-ownership="none">
  1923. <doc xml:space="preserve">a timestamp or -1 to use the current time</doc>
  1924. <type name="glong" c:type="time_t"/>
  1925. </parameter>
  1926. </parameters>
  1927. </method>
  1928. <method name="set_app_info"
  1929. c:identifier="g_bookmark_file_set_app_info"
  1930. version="2.12"
  1931. throws="1">
  1932. <doc xml:space="preserve">Sets the meta-data of application @name inside the list of
  1933. applications that have registered a bookmark for @uri inside
  1934. @bookmark.
  1935. You should rarely use this function; use g_bookmark_file_add_application()
  1936. and g_bookmark_file_remove_application() instead.
  1937. @name can be any UTF-8 encoded string used to identify an
  1938. application.
  1939. @exec can have one of these two modifiers: "\%f", which will
  1940. be expanded as the local file name retrieved from the bookmark's
  1941. URI; "\%u", which will be expanded as the bookmark's URI.
  1942. The expansion is done automatically when retrieving the stored
  1943. command line using the g_bookmark_file_get_app_info() function.
  1944. @count is the number of times the application has registered the
  1945. bookmark; if is &lt; 0, the current registration count will be increased
  1946. by one, if is 0, the application with @name will be removed from
  1947. the list of registered applications.
  1948. @stamp is the Unix time of the last registration; if it is -1, the
  1949. current time will be used.
  1950. If you try to remove an application by setting its registration count to
  1951. zero, and no bookmark for @uri is found, %FALSE is returned and
  1952. @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND; similarly,
  1953. in the event that no application @name has registered a bookmark
  1954. for @uri, %FALSE is returned and error is set to
  1955. #G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED. Otherwise, if no bookmark
  1956. for @uri is found, one is created.</doc>
  1957. <return-value transfer-ownership="none">
  1958. <doc xml:space="preserve">%TRUE if the application's meta-data was successfully
  1959. changed.</doc>
  1960. <type name="gboolean" c:type="gboolean"/>
  1961. </return-value>
  1962. <parameters>
  1963. <instance-parameter name="bookmark" transfer-ownership="none">
  1964. <doc xml:space="preserve">a #GBookmarkFile</doc>
  1965. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  1966. </instance-parameter>
  1967. <parameter name="uri" transfer-ownership="none">
  1968. <doc xml:space="preserve">a valid URI</doc>
  1969. <type name="utf8" c:type="const gchar*"/>
  1970. </parameter>
  1971. <parameter name="name" transfer-ownership="none">
  1972. <doc xml:space="preserve">an application's name</doc>
  1973. <type name="utf8" c:type="const gchar*"/>
  1974. </parameter>
  1975. <parameter name="exec" transfer-ownership="none">
  1976. <doc xml:space="preserve">an application's command line</doc>
  1977. <type name="utf8" c:type="const gchar*"/>
  1978. </parameter>
  1979. <parameter name="count" transfer-ownership="none">
  1980. <doc xml:space="preserve">the number of registrations done for this application</doc>
  1981. <type name="gint" c:type="gint"/>
  1982. </parameter>
  1983. <parameter name="stamp" transfer-ownership="none">
  1984. <doc xml:space="preserve">the time of the last registration for this application</doc>
  1985. <type name="glong" c:type="time_t"/>
  1986. </parameter>
  1987. </parameters>
  1988. </method>
  1989. <method name="set_description"
  1990. c:identifier="g_bookmark_file_set_description"
  1991. version="2.12">
  1992. <doc xml:space="preserve">Sets @description as the description of the bookmark for @uri.
  1993. If @uri is %NULL, the description of @bookmark is set.
  1994. If a bookmark for @uri cannot be found then it is created.</doc>
  1995. <return-value transfer-ownership="none">
  1996. <type name="none" c:type="void"/>
  1997. </return-value>
  1998. <parameters>
  1999. <instance-parameter name="bookmark" transfer-ownership="none">
  2000. <doc xml:space="preserve">a #GBookmarkFile</doc>
  2001. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  2002. </instance-parameter>
  2003. <parameter name="uri"
  2004. transfer-ownership="none"
  2005. nullable="1"
  2006. allow-none="1">
  2007. <doc xml:space="preserve">a valid URI or %NULL</doc>
  2008. <type name="utf8" c:type="const gchar*"/>
  2009. </parameter>
  2010. <parameter name="description" transfer-ownership="none">
  2011. <doc xml:space="preserve">a string</doc>
  2012. <type name="utf8" c:type="const gchar*"/>
  2013. </parameter>
  2014. </parameters>
  2015. </method>
  2016. <method name="set_groups"
  2017. c:identifier="g_bookmark_file_set_groups"
  2018. version="2.12">
  2019. <doc xml:space="preserve">Sets a list of group names for the item with URI @uri. Each previously
  2020. set group name list is removed.
  2021. If @uri cannot be found then an item for it is created.</doc>
  2022. <return-value transfer-ownership="none">
  2023. <type name="none" c:type="void"/>
  2024. </return-value>
  2025. <parameters>
  2026. <instance-parameter name="bookmark" transfer-ownership="none">
  2027. <doc xml:space="preserve">a #GBookmarkFile</doc>
  2028. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  2029. </instance-parameter>
  2030. <parameter name="uri" transfer-ownership="none">
  2031. <doc xml:space="preserve">an item's URI</doc>
  2032. <type name="utf8" c:type="const gchar*"/>
  2033. </parameter>
  2034. <parameter name="groups"
  2035. transfer-ownership="none"
  2036. nullable="1"
  2037. allow-none="1">
  2038. <doc xml:space="preserve">an array of group names, or %NULL to remove all groups</doc>
  2039. <type name="utf8" c:type="const gchar**"/>
  2040. </parameter>
  2041. <parameter name="length" transfer-ownership="none">
  2042. <doc xml:space="preserve">number of group name values in @groups</doc>
  2043. <type name="gsize" c:type="gsize"/>
  2044. </parameter>
  2045. </parameters>
  2046. </method>
  2047. <method name="set_icon"
  2048. c:identifier="g_bookmark_file_set_icon"
  2049. version="2.12">
  2050. <doc xml:space="preserve">Sets the icon for the bookmark for @uri. If @href is %NULL, unsets
  2051. the currently set icon. @href can either be a full URL for the icon
  2052. file or the icon name following the Icon Naming specification.
  2053. If no bookmark for @uri is found one is created.</doc>
  2054. <return-value transfer-ownership="none">
  2055. <type name="none" c:type="void"/>
  2056. </return-value>
  2057. <parameters>
  2058. <instance-parameter name="bookmark" transfer-ownership="none">
  2059. <doc xml:space="preserve">a #GBookmarkFile</doc>
  2060. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  2061. </instance-parameter>
  2062. <parameter name="uri" transfer-ownership="none">
  2063. <doc xml:space="preserve">a valid URI</doc>
  2064. <type name="utf8" c:type="const gchar*"/>
  2065. </parameter>
  2066. <parameter name="href"
  2067. transfer-ownership="none"
  2068. nullable="1"
  2069. allow-none="1">
  2070. <doc xml:space="preserve">the URI of the icon for the bookmark, or %NULL</doc>
  2071. <type name="utf8" c:type="const gchar*"/>
  2072. </parameter>
  2073. <parameter name="mime_type" transfer-ownership="none">
  2074. <doc xml:space="preserve">the MIME type of the icon for the bookmark</doc>
  2075. <type name="utf8" c:type="const gchar*"/>
  2076. </parameter>
  2077. </parameters>
  2078. </method>
  2079. <method name="set_is_private"
  2080. c:identifier="g_bookmark_file_set_is_private"
  2081. version="2.12">
  2082. <doc xml:space="preserve">Sets the private flag of the bookmark for @uri.
  2083. If a bookmark for @uri cannot be found then it is created.</doc>
  2084. <return-value transfer-ownership="none">
  2085. <type name="none" c:type="void"/>
  2086. </return-value>
  2087. <parameters>
  2088. <instance-parameter name="bookmark" transfer-ownership="none">
  2089. <doc xml:space="preserve">a #GBookmarkFile</doc>
  2090. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  2091. </instance-parameter>
  2092. <parameter name="uri" transfer-ownership="none">
  2093. <doc xml:space="preserve">a valid URI</doc>
  2094. <type name="utf8" c:type="const gchar*"/>
  2095. </parameter>
  2096. <parameter name="is_private" transfer-ownership="none">
  2097. <doc xml:space="preserve">%TRUE if the bookmark should be marked as private</doc>
  2098. <type name="gboolean" c:type="gboolean"/>
  2099. </parameter>
  2100. </parameters>
  2101. </method>
  2102. <method name="set_mime_type"
  2103. c:identifier="g_bookmark_file_set_mime_type"
  2104. version="2.12">
  2105. <doc xml:space="preserve">Sets @mime_type as the MIME type of the bookmark for @uri.
  2106. If a bookmark for @uri cannot be found then it is created.</doc>
  2107. <return-value transfer-ownership="none">
  2108. <type name="none" c:type="void"/>
  2109. </return-value>
  2110. <parameters>
  2111. <instance-parameter name="bookmark" transfer-ownership="none">
  2112. <doc xml:space="preserve">a #GBookmarkFile</doc>
  2113. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  2114. </instance-parameter>
  2115. <parameter name="uri" transfer-ownership="none">
  2116. <doc xml:space="preserve">a valid URI</doc>
  2117. <type name="utf8" c:type="const gchar*"/>
  2118. </parameter>
  2119. <parameter name="mime_type" transfer-ownership="none">
  2120. <doc xml:space="preserve">a MIME type</doc>
  2121. <type name="utf8" c:type="const gchar*"/>
  2122. </parameter>
  2123. </parameters>
  2124. </method>
  2125. <method name="set_modified"
  2126. c:identifier="g_bookmark_file_set_modified"
  2127. version="2.12">
  2128. <doc xml:space="preserve">Sets the last time the bookmark for @uri was last modified.
  2129. If no bookmark for @uri is found then it is created.
  2130. The "modified" time should only be set when the bookmark's meta-data
  2131. was actually changed. Every function of #GBookmarkFile that
  2132. modifies a bookmark also changes the modification time, except for
  2133. g_bookmark_file_set_visited().</doc>
  2134. <return-value transfer-ownership="none">
  2135. <type name="none" c:type="void"/>
  2136. </return-value>
  2137. <parameters>
  2138. <instance-parameter name="bookmark" transfer-ownership="none">
  2139. <doc xml:space="preserve">a #GBookmarkFile</doc>
  2140. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  2141. </instance-parameter>
  2142. <parameter name="uri" transfer-ownership="none">
  2143. <doc xml:space="preserve">a valid URI</doc>
  2144. <type name="utf8" c:type="const gchar*"/>
  2145. </parameter>
  2146. <parameter name="modified" transfer-ownership="none">
  2147. <doc xml:space="preserve">a timestamp or -1 to use the current time</doc>
  2148. <type name="glong" c:type="time_t"/>
  2149. </parameter>
  2150. </parameters>
  2151. </method>
  2152. <method name="set_title"
  2153. c:identifier="g_bookmark_file_set_title"
  2154. version="2.12">
  2155. <doc xml:space="preserve">Sets @title as the title of the bookmark for @uri inside the
  2156. bookmark file @bookmark.
  2157. If @uri is %NULL, the title of @bookmark is set.
  2158. If a bookmark for @uri cannot be found then it is created.</doc>
  2159. <return-value transfer-ownership="none">
  2160. <type name="none" c:type="void"/>
  2161. </return-value>
  2162. <parameters>
  2163. <instance-parameter name="bookmark" transfer-ownership="none">
  2164. <doc xml:space="preserve">a #GBookmarkFile</doc>
  2165. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  2166. </instance-parameter>
  2167. <parameter name="uri"
  2168. transfer-ownership="none"
  2169. nullable="1"
  2170. allow-none="1">
  2171. <doc xml:space="preserve">a valid URI or %NULL</doc>
  2172. <type name="utf8" c:type="const gchar*"/>
  2173. </parameter>
  2174. <parameter name="title" transfer-ownership="none">
  2175. <doc xml:space="preserve">a UTF-8 encoded string</doc>
  2176. <type name="utf8" c:type="const gchar*"/>
  2177. </parameter>
  2178. </parameters>
  2179. </method>
  2180. <method name="set_visited"
  2181. c:identifier="g_bookmark_file_set_visited"
  2182. version="2.12">
  2183. <doc xml:space="preserve">Sets the time the bookmark for @uri was last visited.
  2184. If no bookmark for @uri is found then it is created.
  2185. The "visited" time should only be set if the bookmark was launched,
  2186. either using the command line retrieved by g_bookmark_file_get_app_info()
  2187. or by the default application for the bookmark's MIME type, retrieved
  2188. using g_bookmark_file_get_mime_type(). Changing the "visited" time
  2189. does not affect the "modified" time.</doc>
  2190. <return-value transfer-ownership="none">
  2191. <type name="none" c:type="void"/>
  2192. </return-value>
  2193. <parameters>
  2194. <instance-parameter name="bookmark" transfer-ownership="none">
  2195. <doc xml:space="preserve">a #GBookmarkFile</doc>
  2196. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  2197. </instance-parameter>
  2198. <parameter name="uri" transfer-ownership="none">
  2199. <doc xml:space="preserve">a valid URI</doc>
  2200. <type name="utf8" c:type="const gchar*"/>
  2201. </parameter>
  2202. <parameter name="visited" transfer-ownership="none">
  2203. <doc xml:space="preserve">a timestamp or -1 to use the current time</doc>
  2204. <type name="glong" c:type="time_t"/>
  2205. </parameter>
  2206. </parameters>
  2207. </method>
  2208. <method name="to_data"
  2209. c:identifier="g_bookmark_file_to_data"
  2210. version="2.12"
  2211. throws="1">
  2212. <doc xml:space="preserve">This function outputs @bookmark as a string.</doc>
  2213. <return-value transfer-ownership="full">
  2214. <doc xml:space="preserve">a newly allocated string holding
  2215. the contents of the #GBookmarkFile</doc>
  2216. <type name="utf8" c:type="gchar*"/>
  2217. </return-value>
  2218. <parameters>
  2219. <instance-parameter name="bookmark" transfer-ownership="none">
  2220. <doc xml:space="preserve">a #GBookmarkFile</doc>
  2221. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  2222. </instance-parameter>
  2223. <parameter name="length"
  2224. direction="out"
  2225. caller-allocates="0"
  2226. transfer-ownership="full"
  2227. optional="1"
  2228. allow-none="1">
  2229. <doc xml:space="preserve">return location for the length of the returned string, or %NULL</doc>
  2230. <type name="gsize" c:type="gsize*"/>
  2231. </parameter>
  2232. </parameters>
  2233. </method>
  2234. <method name="to_file"
  2235. c:identifier="g_bookmark_file_to_file"
  2236. version="2.12"
  2237. throws="1">
  2238. <doc xml:space="preserve">This function outputs @bookmark into a file. The write process is
  2239. guaranteed to be atomic by using g_file_set_contents() internally.</doc>
  2240. <return-value transfer-ownership="none">
  2241. <doc xml:space="preserve">%TRUE if the file was successfully written.</doc>
  2242. <type name="gboolean" c:type="gboolean"/>
  2243. </return-value>
  2244. <parameters>
  2245. <instance-parameter name="bookmark" transfer-ownership="none">
  2246. <doc xml:space="preserve">a #GBookmarkFile</doc>
  2247. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  2248. </instance-parameter>
  2249. <parameter name="filename" transfer-ownership="none">
  2250. <doc xml:space="preserve">path of the output file</doc>
  2251. <type name="utf8" c:type="const gchar*"/>
  2252. </parameter>
  2253. </parameters>
  2254. </method>
  2255. <function name="error_quark" c:identifier="g_bookmark_file_error_quark">
  2256. <return-value transfer-ownership="none">
  2257. <type name="Quark" c:type="GQuark"/>
  2258. </return-value>
  2259. </function>
  2260. <function name="new"
  2261. c:identifier="g_bookmark_file_new"
  2262. version="2.12"
  2263. introspectable="0">
  2264. <doc xml:space="preserve">Creates a new empty #GBookmarkFile object.
  2265. Use g_bookmark_file_load_from_file(), g_bookmark_file_load_from_data()
  2266. or g_bookmark_file_load_from_data_dirs() to read an existing bookmark
  2267. file.</doc>
  2268. <return-value>
  2269. <doc xml:space="preserve">an empty #GBookmarkFile</doc>
  2270. <type name="BookmarkFile" c:type="GBookmarkFile*"/>
  2271. </return-value>
  2272. </function>
  2273. </record>
  2274. <enumeration name="BookmarkFileError"
  2275. c:type="GBookmarkFileError"
  2276. glib:error-domain="g-bookmark-file-error-quark">
  2277. <doc xml:space="preserve">Error codes returned by bookmark file parsing.</doc>
  2278. <member name="invalid_uri"
  2279. value="0"
  2280. c:identifier="G_BOOKMARK_FILE_ERROR_INVALID_URI">
  2281. <doc xml:space="preserve">URI was ill-formed</doc>
  2282. </member>
  2283. <member name="invalid_value"
  2284. value="1"
  2285. c:identifier="G_BOOKMARK_FILE_ERROR_INVALID_VALUE">
  2286. <doc xml:space="preserve">a requested field was not found</doc>
  2287. </member>
  2288. <member name="app_not_registered"
  2289. value="2"
  2290. c:identifier="G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED">
  2291. <doc xml:space="preserve">a requested application did
  2292. not register a bookmark</doc>
  2293. </member>
  2294. <member name="uri_not_found"
  2295. value="3"
  2296. c:identifier="G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND">
  2297. <doc xml:space="preserve">a requested URI was not found</doc>
  2298. </member>
  2299. <member name="read" value="4" c:identifier="G_BOOKMARK_FILE_ERROR_READ">
  2300. <doc xml:space="preserve">document was ill formed</doc>
  2301. </member>
  2302. <member name="unknown_encoding"
  2303. value="5"
  2304. c:identifier="G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING">
  2305. <doc xml:space="preserve">the text being parsed was
  2306. in an unknown encoding</doc>
  2307. </member>
  2308. <member name="write"
  2309. value="6"
  2310. c:identifier="G_BOOKMARK_FILE_ERROR_WRITE">
  2311. <doc xml:space="preserve">an error occurred while writing</doc>
  2312. </member>
  2313. <member name="file_not_found"
  2314. value="7"
  2315. c:identifier="G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND">
  2316. <doc xml:space="preserve">requested file was not found</doc>
  2317. </member>
  2318. </enumeration>
  2319. <record name="ByteArray"
  2320. c:type="GByteArray"
  2321. glib:type-name="GByteArray"
  2322. glib:get-type="g_byte_array_get_type"
  2323. c:symbol-prefix="byte_array">
  2324. <doc xml:space="preserve">Contains the public fields of a GByteArray.</doc>
  2325. <field name="data" writable="1">
  2326. <doc xml:space="preserve">a pointer to the element data. The data may be moved as
  2327. elements are added to the #GByteArray</doc>
  2328. <type name="guint8" c:type="guint8*"/>
  2329. </field>
  2330. <field name="len" writable="1">
  2331. <doc xml:space="preserve">the number of elements in the #GByteArray</doc>
  2332. <type name="guint" c:type="guint"/>
  2333. </field>
  2334. <function name="append"
  2335. c:identifier="g_byte_array_append"
  2336. introspectable="0">
  2337. <doc xml:space="preserve">Adds the given bytes to the end of the #GByteArray.
  2338. The array will grow in size automatically if necessary.</doc>
  2339. <return-value>
  2340. <doc xml:space="preserve">the #GByteArray</doc>
  2341. <array name="GLib.ByteArray" c:type="GByteArray*">
  2342. <type name="guint8" c:type="guint8"/>
  2343. </array>
  2344. </return-value>
  2345. <parameters>
  2346. <parameter name="array" transfer-ownership="none">
  2347. <doc xml:space="preserve">a #GByteArray</doc>
  2348. <array name="GLib.ByteArray" c:type="GByteArray*">
  2349. <type name="guint8" c:type="guint8"/>
  2350. </array>
  2351. </parameter>
  2352. <parameter name="data" transfer-ownership="none">
  2353. <doc xml:space="preserve">the byte data to be added</doc>
  2354. <type name="guint8" c:type="const guint8*"/>
  2355. </parameter>
  2356. <parameter name="len" transfer-ownership="none">
  2357. <doc xml:space="preserve">the number of bytes to add</doc>
  2358. <type name="guint" c:type="guint"/>
  2359. </parameter>
  2360. </parameters>
  2361. </function>
  2362. <function name="free" c:identifier="g_byte_array_free">
  2363. <doc xml:space="preserve">Frees the memory allocated by the #GByteArray. If @free_segment is
  2364. %TRUE it frees the actual byte data. If the reference count of
  2365. @array is greater than one, the #GByteArray wrapper is preserved but
  2366. the size of @array will be set to zero.</doc>
  2367. <return-value transfer-ownership="none">
  2368. <doc xml:space="preserve">the element data if @free_segment is %FALSE, otherwise
  2369. %NULL. The element data should be freed using g_free().</doc>
  2370. <type name="guint8" c:type="guint8*"/>
  2371. </return-value>
  2372. <parameters>
  2373. <parameter name="array" transfer-ownership="none">
  2374. <doc xml:space="preserve">a #GByteArray</doc>
  2375. <array name="GLib.ByteArray" c:type="GByteArray*">
  2376. <type name="guint8" c:type="guint8"/>
  2377. </array>
  2378. </parameter>
  2379. <parameter name="free_segment" transfer-ownership="none">
  2380. <doc xml:space="preserve">if %TRUE the actual byte data is freed as well</doc>
  2381. <type name="gboolean" c:type="gboolean"/>
  2382. </parameter>
  2383. </parameters>
  2384. </function>
  2385. <function name="free_to_bytes"
  2386. c:identifier="g_byte_array_free_to_bytes"
  2387. version="2.32">
  2388. <doc xml:space="preserve">Transfers the data from the #GByteArray into a new immutable #GBytes.
  2389. The #GByteArray is freed unless the reference count of @array is greater
  2390. than one, the #GByteArray wrapper is preserved but the size of @array
  2391. will be set to zero.
  2392. This is identical to using g_bytes_new_take() and g_byte_array_free()
  2393. together.</doc>
  2394. <return-value transfer-ownership="full">
  2395. <doc xml:space="preserve">a new immutable #GBytes representing same
  2396. byte data that was in the array</doc>
  2397. <type name="Bytes" c:type="GBytes*"/>
  2398. </return-value>
  2399. <parameters>
  2400. <parameter name="array" transfer-ownership="full">
  2401. <doc xml:space="preserve">a #GByteArray</doc>
  2402. <array name="GLib.ByteArray" c:type="GByteArray*">
  2403. <type name="guint8" c:type="guint8"/>
  2404. </array>
  2405. </parameter>
  2406. </parameters>
  2407. </function>
  2408. <function name="new" c:identifier="g_byte_array_new">
  2409. <doc xml:space="preserve">Creates a new #GByteArray with a reference count of 1.</doc>
  2410. <return-value transfer-ownership="full">
  2411. <doc xml:space="preserve">the new #GByteArray</doc>
  2412. <array name="GLib.ByteArray" c:type="GByteArray*">
  2413. <type name="guint8" c:type="guint8"/>
  2414. </array>
  2415. </return-value>
  2416. </function>
  2417. <function name="new_take"
  2418. c:identifier="g_byte_array_new_take"
  2419. version="2.32">
  2420. <doc xml:space="preserve">Create byte array containing the data. The data will be owned by the array
  2421. and will be freed with g_free(), i.e. it could be allocated using g_strdup().</doc>
  2422. <return-value transfer-ownership="full">
  2423. <doc xml:space="preserve">a new #GByteArray</doc>
  2424. <array name="GLib.ByteArray" c:type="GByteArray*">
  2425. <type name="guint8" c:type="guint8"/>
  2426. </array>
  2427. </return-value>
  2428. <parameters>
  2429. <parameter name="data" transfer-ownership="full">
  2430. <doc xml:space="preserve">byte data for the array</doc>
  2431. <array length="1" zero-terminated="0" c:type="guint8*">
  2432. <type name="guint8" c:type="guint8"/>
  2433. </array>
  2434. </parameter>
  2435. <parameter name="len" transfer-ownership="none">
  2436. <doc xml:space="preserve">length of @data</doc>
  2437. <type name="gsize" c:type="gsize"/>
  2438. </parameter>
  2439. </parameters>
  2440. </function>
  2441. <function name="prepend"
  2442. c:identifier="g_byte_array_prepend"
  2443. introspectable="0">
  2444. <doc xml:space="preserve">Adds the given data to the start of the #GByteArray.
  2445. The array will grow in size automatically if necessary.</doc>
  2446. <return-value>
  2447. <doc xml:space="preserve">the #GByteArray</doc>
  2448. <array name="GLib.ByteArray" c:type="GByteArray*">
  2449. <type name="guint8" c:type="guint8"/>
  2450. </array>
  2451. </return-value>
  2452. <parameters>
  2453. <parameter name="array" transfer-ownership="none">
  2454. <doc xml:space="preserve">a #GByteArray</doc>
  2455. <array name="GLib.ByteArray" c:type="GByteArray*">
  2456. <type name="guint8" c:type="guint8"/>
  2457. </array>
  2458. </parameter>
  2459. <parameter name="data" transfer-ownership="none">
  2460. <doc xml:space="preserve">the byte data to be added</doc>
  2461. <type name="guint8" c:type="const guint8*"/>
  2462. </parameter>
  2463. <parameter name="len" transfer-ownership="none">
  2464. <doc xml:space="preserve">the number of bytes to add</doc>
  2465. <type name="guint" c:type="guint"/>
  2466. </parameter>
  2467. </parameters>
  2468. </function>
  2469. <function name="ref"
  2470. c:identifier="g_byte_array_ref"
  2471. version="2.22"
  2472. introspectable="0">
  2473. <doc xml:space="preserve">Atomically increments the reference count of @array by one.
  2474. This function is thread-safe and may be called from any thread.</doc>
  2475. <return-value>
  2476. <doc xml:space="preserve">The passed in #GByteArray</doc>
  2477. <array name="GLib.ByteArray" c:type="GByteArray*">
  2478. <type name="guint8" c:type="guint8"/>
  2479. </array>
  2480. </return-value>
  2481. <parameters>
  2482. <parameter name="array" transfer-ownership="none">
  2483. <doc xml:space="preserve">A #GByteArray</doc>
  2484. <array name="GLib.ByteArray" c:type="GByteArray*">
  2485. <type name="guint8" c:type="guint8"/>
  2486. </array>
  2487. </parameter>
  2488. </parameters>
  2489. </function>
  2490. <function name="remove_index"
  2491. c:identifier="g_byte_array_remove_index"
  2492. introspectable="0">
  2493. <doc xml:space="preserve">Removes the byte at the given index from a #GByteArray.
  2494. The following bytes are moved down one place.</doc>
  2495. <return-value>
  2496. <doc xml:space="preserve">the #GByteArray</doc>
  2497. <array name="GLib.ByteArray" c:type="GByteArray*">
  2498. <type name="guint8" c:type="guint8"/>
  2499. </array>
  2500. </return-value>
  2501. <parameters>
  2502. <parameter name="array" transfer-ownership="none">
  2503. <doc xml:space="preserve">a #GByteArray</doc>
  2504. <array name="GLib.ByteArray" c:type="GByteArray*">
  2505. <type name="guint8" c:type="guint8"/>
  2506. </array>
  2507. </parameter>
  2508. <parameter name="index_" transfer-ownership="none">
  2509. <doc xml:space="preserve">the index of the byte to remove</doc>
  2510. <type name="guint" c:type="guint"/>
  2511. </parameter>
  2512. </parameters>
  2513. </function>
  2514. <function name="remove_index_fast"
  2515. c:identifier="g_byte_array_remove_index_fast"
  2516. introspectable="0">
  2517. <doc xml:space="preserve">Removes the byte at the given index from a #GByteArray. The last
  2518. element in the array is used to fill in the space, so this function
  2519. does not preserve the order of the #GByteArray. But it is faster
  2520. than g_byte_array_remove_index().</doc>
  2521. <return-value>
  2522. <doc xml:space="preserve">the #GByteArray</doc>
  2523. <array name="GLib.ByteArray" c:type="GByteArray*">
  2524. <type name="guint8" c:type="guint8"/>
  2525. </array>
  2526. </return-value>
  2527. <parameters>
  2528. <parameter name="array" transfer-ownership="none">
  2529. <doc xml:space="preserve">a #GByteArray</doc>
  2530. <array name="GLib.ByteArray" c:type="GByteArray*">
  2531. <type name="guint8" c:type="guint8"/>
  2532. </array>
  2533. </parameter>
  2534. <parameter name="index_" transfer-ownership="none">
  2535. <doc xml:space="preserve">the index of the byte to remove</doc>
  2536. <type name="guint" c:type="guint"/>
  2537. </parameter>
  2538. </parameters>
  2539. </function>
  2540. <function name="remove_range"
  2541. c:identifier="g_byte_array_remove_range"
  2542. version="2.4"
  2543. introspectable="0">
  2544. <doc xml:space="preserve">Removes the given number of bytes starting at the given index from a
  2545. #GByteArray. The following elements are moved to close the gap.</doc>
  2546. <return-value>
  2547. <doc xml:space="preserve">the #GByteArray</doc>
  2548. <array name="GLib.ByteArray" c:type="GByteArray*">
  2549. <type name="guint8" c:type="guint8"/>
  2550. </array>
  2551. </return-value>
  2552. <parameters>
  2553. <parameter name="array" transfer-ownership="none">
  2554. <doc xml:space="preserve">a @GByteArray</doc>
  2555. <array name="GLib.ByteArray" c:type="GByteArray*">
  2556. <type name="guint8" c:type="guint8"/>
  2557. </array>
  2558. </parameter>
  2559. <parameter name="index_" transfer-ownership="none">
  2560. <doc xml:space="preserve">the index of the first byte to remove</doc>
  2561. <type name="guint" c:type="guint"/>
  2562. </parameter>
  2563. <parameter name="length" transfer-ownership="none">
  2564. <doc xml:space="preserve">the number of bytes to remove</doc>
  2565. <type name="guint" c:type="guint"/>
  2566. </parameter>
  2567. </parameters>
  2568. </function>
  2569. <function name="set_size"
  2570. c:identifier="g_byte_array_set_size"
  2571. introspectable="0">
  2572. <doc xml:space="preserve">Sets the size of the #GByteArray, expanding it if necessary.</doc>
  2573. <return-value>
  2574. <doc xml:space="preserve">the #GByteArray</doc>
  2575. <array name="GLib.ByteArray" c:type="GByteArray*">
  2576. <type name="guint8" c:type="guint8"/>
  2577. </array>
  2578. </return-value>
  2579. <parameters>
  2580. <parameter name="array" transfer-ownership="none">
  2581. <doc xml:space="preserve">a #GByteArray</doc>
  2582. <array name="GLib.ByteArray" c:type="GByteArray*">
  2583. <type name="guint8" c:type="guint8"/>
  2584. </array>
  2585. </parameter>
  2586. <parameter name="length" transfer-ownership="none">
  2587. <doc xml:space="preserve">the new size of the #GByteArray</doc>
  2588. <type name="guint" c:type="guint"/>
  2589. </parameter>
  2590. </parameters>
  2591. </function>
  2592. <function name="sized_new"
  2593. c:identifier="g_byte_array_sized_new"
  2594. introspectable="0">
  2595. <doc xml:space="preserve">Creates a new #GByteArray with @reserved_size bytes preallocated.
  2596. This avoids frequent reallocation, if you are going to add many
  2597. bytes to the array. Note however that the size of the array is still
  2598. 0.</doc>
  2599. <return-value>
  2600. <doc xml:space="preserve">the new #GByteArray</doc>
  2601. <array name="GLib.ByteArray" c:type="GByteArray*">
  2602. <type name="guint8" c:type="guint8"/>
  2603. </array>
  2604. </return-value>
  2605. <parameters>
  2606. <parameter name="reserved_size" transfer-ownership="none">
  2607. <doc xml:space="preserve">number of bytes preallocated</doc>
  2608. <type name="guint" c:type="guint"/>
  2609. </parameter>
  2610. </parameters>
  2611. </function>
  2612. <function name="sort"
  2613. c:identifier="g_byte_array_sort"
  2614. introspectable="0">
  2615. <doc xml:space="preserve">Sorts a byte array, using @compare_func which should be a
  2616. qsort()-style comparison function (returns less than zero for first
  2617. arg is less than second arg, zero for equal, greater than zero if
  2618. first arg is greater than second arg).
  2619. If two array elements compare equal, their order in the sorted array
  2620. is undefined. If you want equal elements to keep their order (i.e.
  2621. you want a stable sort) you can write a comparison function that,
  2622. if two elements would otherwise compare equal, compares them by
  2623. their addresses.</doc>
  2624. <return-value transfer-ownership="none">
  2625. <type name="none" c:type="void"/>
  2626. </return-value>
  2627. <parameters>
  2628. <parameter name="array" transfer-ownership="none">
  2629. <doc xml:space="preserve">a #GByteArray</doc>
  2630. <array name="GLib.ByteArray" c:type="GByteArray*">
  2631. <type name="guint8" c:type="guint8"/>
  2632. </array>
  2633. </parameter>
  2634. <parameter name="compare_func" transfer-ownership="none">
  2635. <doc xml:space="preserve">comparison function</doc>
  2636. <type name="CompareFunc" c:type="GCompareFunc"/>
  2637. </parameter>
  2638. </parameters>
  2639. </function>
  2640. <function name="sort_with_data"
  2641. c:identifier="g_byte_array_sort_with_data"
  2642. introspectable="0">
  2643. <doc xml:space="preserve">Like g_byte_array_sort(), but the comparison function takes an extra
  2644. user data argument.</doc>
  2645. <return-value transfer-ownership="none">
  2646. <type name="none" c:type="void"/>
  2647. </return-value>
  2648. <parameters>
  2649. <parameter name="array" transfer-ownership="none">
  2650. <doc xml:space="preserve">a #GByteArray</doc>
  2651. <array name="GLib.ByteArray" c:type="GByteArray*">
  2652. <type name="guint8" c:type="guint8"/>
  2653. </array>
  2654. </parameter>
  2655. <parameter name="compare_func" transfer-ownership="none" closure="2">
  2656. <doc xml:space="preserve">comparison function</doc>
  2657. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  2658. </parameter>
  2659. <parameter name="user_data"
  2660. transfer-ownership="none"
  2661. nullable="1"
  2662. allow-none="1">
  2663. <doc xml:space="preserve">data to pass to @compare_func</doc>
  2664. <type name="gpointer" c:type="gpointer"/>
  2665. </parameter>
  2666. </parameters>
  2667. </function>
  2668. <function name="unref" c:identifier="g_byte_array_unref" version="2.22">
  2669. <doc xml:space="preserve">Atomically decrements the reference count of @array by one. If the
  2670. reference count drops to 0, all memory allocated by the array is
  2671. released. This function is thread-safe and may be called from any
  2672. thread.</doc>
  2673. <return-value transfer-ownership="none">
  2674. <type name="none" c:type="void"/>
  2675. </return-value>
  2676. <parameters>
  2677. <parameter name="array" transfer-ownership="none">
  2678. <doc xml:space="preserve">A #GByteArray</doc>
  2679. <array name="GLib.ByteArray" c:type="GByteArray*">
  2680. <type name="guint8" c:type="guint8"/>
  2681. </array>
  2682. </parameter>
  2683. </parameters>
  2684. </function>
  2685. </record>
  2686. <record name="Bytes"
  2687. c:type="GBytes"
  2688. version="2.32"
  2689. glib:type-name="GBytes"
  2690. glib:get-type="g_bytes_get_type"
  2691. c:symbol-prefix="bytes">
  2692. <doc xml:space="preserve">A simple refcounted data type representing an immutable sequence of zero or
  2693. more bytes from an unspecified origin.
  2694. The purpose of a #GBytes is to keep the memory region that it holds
  2695. alive for as long as anyone holds a reference to the bytes. When
  2696. the last reference count is dropped, the memory is released. Multiple
  2697. unrelated callers can use byte data in the #GBytes without coordinating
  2698. their activities, resting assured that the byte data will not change or
  2699. move while they hold a reference.
  2700. A #GBytes can come from many different origins that may have
  2701. different procedures for freeing the memory region. Examples are
  2702. memory from g_malloc(), from memory slices, from a #GMappedFile or
  2703. memory from other allocators.
  2704. #GBytes work well as keys in #GHashTable. Use g_bytes_equal() and
  2705. g_bytes_hash() as parameters to g_hash_table_new() or g_hash_table_new_full().
  2706. #GBytes can also be used as keys in a #GTree by passing the g_bytes_compare()
  2707. function to g_tree_new().
  2708. The data pointed to by this bytes must not be modified. For a mutable
  2709. array of bytes see #GByteArray. Use g_bytes_unref_to_array() to create a
  2710. mutable array for a #GBytes sequence. To create an immutable #GBytes from
  2711. a mutable #GByteArray, use the g_byte_array_free_to_bytes() function.</doc>
  2712. <constructor name="new" c:identifier="g_bytes_new" version="2.32">
  2713. <doc xml:space="preserve">Creates a new #GBytes from @data.
  2714. @data is copied. If @size is 0, @data may be %NULL.</doc>
  2715. <return-value transfer-ownership="full">
  2716. <doc xml:space="preserve">a new #GBytes</doc>
  2717. <type name="Bytes" c:type="GBytes*"/>
  2718. </return-value>
  2719. <parameters>
  2720. <parameter name="data"
  2721. transfer-ownership="none"
  2722. nullable="1"
  2723. allow-none="1">
  2724. <doc xml:space="preserve">
  2725. the data to be used for the bytes</doc>
  2726. <array length="1" zero-terminated="0" c:type="gconstpointer">
  2727. <type name="guint8"/>
  2728. </array>
  2729. </parameter>
  2730. <parameter name="size" transfer-ownership="none">
  2731. <doc xml:space="preserve">the size of @data</doc>
  2732. <type name="gsize" c:type="gsize"/>
  2733. </parameter>
  2734. </parameters>
  2735. </constructor>
  2736. <constructor name="new_static"
  2737. c:identifier="g_bytes_new_static"
  2738. version="2.32"
  2739. introspectable="0">
  2740. <doc xml:space="preserve">Creates a new #GBytes from static data.
  2741. @data must be static (ie: never modified or freed). It may be %NULL if @size
  2742. is 0.</doc>
  2743. <return-value transfer-ownership="full">
  2744. <doc xml:space="preserve">a new #GBytes</doc>
  2745. <type name="Bytes" c:type="GBytes*"/>
  2746. </return-value>
  2747. <parameters>
  2748. <parameter name="data"
  2749. transfer-ownership="full"
  2750. nullable="1"
  2751. allow-none="1">
  2752. <doc xml:space="preserve">
  2753. the data to be used for the bytes</doc>
  2754. <array length="1" zero-terminated="0" c:type="gconstpointer">
  2755. <type name="guint8"/>
  2756. </array>
  2757. </parameter>
  2758. <parameter name="size" transfer-ownership="none">
  2759. <doc xml:space="preserve">the size of @data</doc>
  2760. <type name="gsize" c:type="gsize"/>
  2761. </parameter>
  2762. </parameters>
  2763. </constructor>
  2764. <constructor name="new_take"
  2765. c:identifier="g_bytes_new_take"
  2766. version="2.32">
  2767. <doc xml:space="preserve">Creates a new #GBytes from @data.
  2768. After this call, @data belongs to the bytes and may no longer be
  2769. modified by the caller. g_free() will be called on @data when the
  2770. bytes is no longer in use. Because of this @data must have been created by
  2771. a call to g_malloc(), g_malloc0() or g_realloc() or by one of the many
  2772. functions that wrap these calls (such as g_new(), g_strdup(), etc).
  2773. For creating #GBytes with memory from other allocators, see
  2774. g_bytes_new_with_free_func().
  2775. @data may be %NULL if @size is 0.</doc>
  2776. <return-value transfer-ownership="full">
  2777. <doc xml:space="preserve">a new #GBytes</doc>
  2778. <type name="Bytes" c:type="GBytes*"/>
  2779. </return-value>
  2780. <parameters>
  2781. <parameter name="data"
  2782. transfer-ownership="full"
  2783. nullable="1"
  2784. allow-none="1">
  2785. <doc xml:space="preserve">
  2786. the data to be used for the bytes</doc>
  2787. <array length="1" zero-terminated="0" c:type="gpointer">
  2788. <type name="guint8"/>
  2789. </array>
  2790. </parameter>
  2791. <parameter name="size" transfer-ownership="none">
  2792. <doc xml:space="preserve">the size of @data</doc>
  2793. <type name="gsize" c:type="gsize"/>
  2794. </parameter>
  2795. </parameters>
  2796. </constructor>
  2797. <constructor name="new_with_free_func"
  2798. c:identifier="g_bytes_new_with_free_func"
  2799. version="2.32"
  2800. introspectable="0">
  2801. <doc xml:space="preserve">Creates a #GBytes from @data.
  2802. When the last reference is dropped, @free_func will be called with the
  2803. @user_data argument.
  2804. @data must not be modified after this call is made until @free_func has
  2805. been called to indicate that the bytes is no longer in use.
  2806. @data may be %NULL if @size is 0.</doc>
  2807. <return-value transfer-ownership="full">
  2808. <doc xml:space="preserve">a new #GBytes</doc>
  2809. <type name="Bytes" c:type="GBytes*"/>
  2810. </return-value>
  2811. <parameters>
  2812. <parameter name="data"
  2813. transfer-ownership="none"
  2814. nullable="1"
  2815. allow-none="1">
  2816. <doc xml:space="preserve">
  2817. the data to be used for the bytes</doc>
  2818. <array length="1" zero-terminated="0" c:type="gconstpointer">
  2819. <type name="guint8"/>
  2820. </array>
  2821. </parameter>
  2822. <parameter name="size" transfer-ownership="none">
  2823. <doc xml:space="preserve">the size of @data</doc>
  2824. <type name="gsize" c:type="gsize"/>
  2825. </parameter>
  2826. <parameter name="free_func" transfer-ownership="none" scope="async">
  2827. <doc xml:space="preserve">the function to call to release the data</doc>
  2828. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  2829. </parameter>
  2830. <parameter name="user_data"
  2831. transfer-ownership="none"
  2832. nullable="1"
  2833. allow-none="1">
  2834. <doc xml:space="preserve">data to pass to @free_func</doc>
  2835. <type name="gpointer" c:type="gpointer"/>
  2836. </parameter>
  2837. </parameters>
  2838. </constructor>
  2839. <method name="compare" c:identifier="g_bytes_compare" version="2.32">
  2840. <doc xml:space="preserve">Compares the two #GBytes values.
  2841. This function can be used to sort GBytes instances in lexographical order.</doc>
  2842. <return-value transfer-ownership="none">
  2843. <doc xml:space="preserve">a negative value if bytes2 is lesser, a positive value if bytes2 is
  2844. greater, and zero if bytes2 is equal to bytes1</doc>
  2845. <type name="gint" c:type="gint"/>
  2846. </return-value>
  2847. <parameters>
  2848. <instance-parameter name="bytes1" transfer-ownership="none">
  2849. <doc xml:space="preserve">a pointer to a #GBytes</doc>
  2850. <type name="Bytes" c:type="gconstpointer"/>
  2851. </instance-parameter>
  2852. <parameter name="bytes2" transfer-ownership="none">
  2853. <doc xml:space="preserve">a pointer to a #GBytes to compare with @bytes1</doc>
  2854. <type name="Bytes" c:type="gconstpointer"/>
  2855. </parameter>
  2856. </parameters>
  2857. </method>
  2858. <method name="equal" c:identifier="g_bytes_equal" version="2.32">
  2859. <doc xml:space="preserve">Compares the two #GBytes values being pointed to and returns
  2860. %TRUE if they are equal.
  2861. This function can be passed to g_hash_table_new() as the @key_equal_func
  2862. parameter, when using non-%NULL #GBytes pointers as keys in a #GHashTable.</doc>
  2863. <return-value transfer-ownership="none">
  2864. <doc xml:space="preserve">%TRUE if the two keys match.</doc>
  2865. <type name="gboolean" c:type="gboolean"/>
  2866. </return-value>
  2867. <parameters>
  2868. <instance-parameter name="bytes1" transfer-ownership="none">
  2869. <doc xml:space="preserve">a pointer to a #GBytes</doc>
  2870. <type name="Bytes" c:type="gconstpointer"/>
  2871. </instance-parameter>
  2872. <parameter name="bytes2" transfer-ownership="none">
  2873. <doc xml:space="preserve">a pointer to a #GBytes to compare with @bytes1</doc>
  2874. <type name="Bytes" c:type="gconstpointer"/>
  2875. </parameter>
  2876. </parameters>
  2877. </method>
  2878. <method name="get_data" c:identifier="g_bytes_get_data" version="2.32">
  2879. <doc xml:space="preserve">Get the byte data in the #GBytes. This data should not be modified.
  2880. This function will always return the same pointer for a given #GBytes.
  2881. %NULL may be returned if @size is 0. This is not guaranteed, as the #GBytes
  2882. may represent an empty string with @data non-%NULL and @size as 0. %NULL will
  2883. not be returned if @size is non-zero.</doc>
  2884. <return-value transfer-ownership="none" nullable="1">
  2885. <doc xml:space="preserve">
  2886. a pointer to the byte data, or %NULL</doc>
  2887. <array length="0" zero-terminated="0" c:type="gconstpointer">
  2888. <type name="guint8"/>
  2889. </array>
  2890. </return-value>
  2891. <parameters>
  2892. <instance-parameter name="bytes" transfer-ownership="none">
  2893. <doc xml:space="preserve">a #GBytes</doc>
  2894. <type name="Bytes" c:type="GBytes*"/>
  2895. </instance-parameter>
  2896. <parameter name="size"
  2897. direction="out"
  2898. caller-allocates="0"
  2899. transfer-ownership="full"
  2900. optional="1"
  2901. allow-none="1">
  2902. <doc xml:space="preserve">location to return size of byte data</doc>
  2903. <type name="gsize" c:type="gsize*"/>
  2904. </parameter>
  2905. </parameters>
  2906. </method>
  2907. <method name="get_size" c:identifier="g_bytes_get_size" version="2.32">
  2908. <doc xml:space="preserve">Get the size of the byte data in the #GBytes.
  2909. This function will always return the same value for a given #GBytes.</doc>
  2910. <return-value transfer-ownership="none">
  2911. <doc xml:space="preserve">the size</doc>
  2912. <type name="gsize" c:type="gsize"/>
  2913. </return-value>
  2914. <parameters>
  2915. <instance-parameter name="bytes" transfer-ownership="none">
  2916. <doc xml:space="preserve">a #GBytes</doc>
  2917. <type name="Bytes" c:type="GBytes*"/>
  2918. </instance-parameter>
  2919. </parameters>
  2920. </method>
  2921. <method name="hash" c:identifier="g_bytes_hash" version="2.32">
  2922. <doc xml:space="preserve">Creates an integer hash code for the byte data in the #GBytes.
  2923. This function can be passed to g_hash_table_new() as the @key_hash_func
  2924. parameter, when using non-%NULL #GBytes pointers as keys in a #GHashTable.</doc>
  2925. <return-value transfer-ownership="none">
  2926. <doc xml:space="preserve">a hash value corresponding to the key.</doc>
  2927. <type name="guint" c:type="guint"/>
  2928. </return-value>
  2929. <parameters>
  2930. <instance-parameter name="bytes" transfer-ownership="none">
  2931. <doc xml:space="preserve">a pointer to a #GBytes key</doc>
  2932. <type name="Bytes" c:type="gconstpointer"/>
  2933. </instance-parameter>
  2934. </parameters>
  2935. </method>
  2936. <method name="new_from_bytes"
  2937. c:identifier="g_bytes_new_from_bytes"
  2938. version="2.32">
  2939. <doc xml:space="preserve">Creates a #GBytes which is a subsection of another #GBytes. The @offset +
  2940. @length may not be longer than the size of @bytes.
  2941. A reference to @bytes will be held by the newly created #GBytes until
  2942. the byte data is no longer needed.</doc>
  2943. <return-value transfer-ownership="full">
  2944. <doc xml:space="preserve">a new #GBytes</doc>
  2945. <type name="Bytes" c:type="GBytes*"/>
  2946. </return-value>
  2947. <parameters>
  2948. <instance-parameter name="bytes" transfer-ownership="none">
  2949. <doc xml:space="preserve">a #GBytes</doc>
  2950. <type name="Bytes" c:type="GBytes*"/>
  2951. </instance-parameter>
  2952. <parameter name="offset" transfer-ownership="none">
  2953. <doc xml:space="preserve">offset which subsection starts at</doc>
  2954. <type name="gsize" c:type="gsize"/>
  2955. </parameter>
  2956. <parameter name="length" transfer-ownership="none">
  2957. <doc xml:space="preserve">length of subsection</doc>
  2958. <type name="gsize" c:type="gsize"/>
  2959. </parameter>
  2960. </parameters>
  2961. </method>
  2962. <method name="ref" c:identifier="g_bytes_ref" version="2.32">
  2963. <doc xml:space="preserve">Increase the reference count on @bytes.</doc>
  2964. <return-value transfer-ownership="full">
  2965. <doc xml:space="preserve">the #GBytes</doc>
  2966. <type name="Bytes" c:type="GBytes*"/>
  2967. </return-value>
  2968. <parameters>
  2969. <instance-parameter name="bytes" transfer-ownership="none">
  2970. <doc xml:space="preserve">a #GBytes</doc>
  2971. <type name="Bytes" c:type="GBytes*"/>
  2972. </instance-parameter>
  2973. </parameters>
  2974. </method>
  2975. <method name="unref" c:identifier="g_bytes_unref" version="2.32">
  2976. <doc xml:space="preserve">Releases a reference on @bytes. This may result in the bytes being
  2977. freed.</doc>
  2978. <return-value transfer-ownership="none">
  2979. <type name="none" c:type="void"/>
  2980. </return-value>
  2981. <parameters>
  2982. <instance-parameter name="bytes"
  2983. transfer-ownership="none"
  2984. nullable="1"
  2985. allow-none="1">
  2986. <doc xml:space="preserve">a #GBytes</doc>
  2987. <type name="Bytes" c:type="GBytes*"/>
  2988. </instance-parameter>
  2989. </parameters>
  2990. </method>
  2991. <method name="unref_to_array"
  2992. c:identifier="g_bytes_unref_to_array"
  2993. version="2.32">
  2994. <doc xml:space="preserve">Unreferences the bytes, and returns a new mutable #GByteArray containing
  2995. the same byte data.
  2996. As an optimization, the byte data is transferred to the array without copying
  2997. if this was the last reference to bytes and bytes was created with
  2998. g_bytes_new(), g_bytes_new_take() or g_byte_array_free_to_bytes(). In all
  2999. other cases the data is copied.</doc>
  3000. <return-value transfer-ownership="full">
  3001. <doc xml:space="preserve">a new mutable #GByteArray containing the same byte data</doc>
  3002. <array name="GLib.ByteArray" c:type="GByteArray*">
  3003. <type name="guint8" c:type="guint8"/>
  3004. </array>
  3005. </return-value>
  3006. <parameters>
  3007. <instance-parameter name="bytes" transfer-ownership="full">
  3008. <doc xml:space="preserve">a #GBytes</doc>
  3009. <type name="Bytes" c:type="GBytes*"/>
  3010. </instance-parameter>
  3011. </parameters>
  3012. </method>
  3013. <method name="unref_to_data"
  3014. c:identifier="g_bytes_unref_to_data"
  3015. version="2.32">
  3016. <doc xml:space="preserve">Unreferences the bytes, and returns a pointer the same byte data
  3017. contents.
  3018. As an optimization, the byte data is returned without copying if this was
  3019. the last reference to bytes and bytes was created with g_bytes_new(),
  3020. g_bytes_new_take() or g_byte_array_free_to_bytes(). In all other cases the
  3021. data is copied.</doc>
  3022. <return-value transfer-ownership="full">
  3023. <doc xml:space="preserve">a pointer to the same byte data, which should be
  3024. freed with g_free()</doc>
  3025. <array length="0" zero-terminated="0" c:type="gpointer">
  3026. <type name="guint8"/>
  3027. </array>
  3028. </return-value>
  3029. <parameters>
  3030. <instance-parameter name="bytes" transfer-ownership="full">
  3031. <doc xml:space="preserve">a #GBytes</doc>
  3032. <type name="Bytes" c:type="GBytes*"/>
  3033. </instance-parameter>
  3034. <parameter name="size"
  3035. direction="out"
  3036. caller-allocates="0"
  3037. transfer-ownership="full">
  3038. <doc xml:space="preserve">location to place the length of the returned data</doc>
  3039. <type name="gsize" c:type="gsize*"/>
  3040. </parameter>
  3041. </parameters>
  3042. </method>
  3043. </record>
  3044. <constant name="CSET_A_2_Z"
  3045. value="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  3046. c:type="G_CSET_A_2_Z">
  3047. <doc xml:space="preserve">The set of uppercase ASCII alphabet characters.
  3048. Used for specifying valid identifier characters
  3049. in #GScannerConfig.</doc>
  3050. <type name="utf8" c:type="gchar*"/>
  3051. </constant>
  3052. <constant name="CSET_DIGITS" value="0123456789" c:type="G_CSET_DIGITS">
  3053. <doc xml:space="preserve">The set of ASCII digits.
  3054. Used for specifying valid identifier characters
  3055. in #GScannerConfig.</doc>
  3056. <type name="utf8" c:type="gchar*"/>
  3057. </constant>
  3058. <constant name="CSET_a_2_z"
  3059. value="abcdefghijklmnopqrstuvwxyz"
  3060. c:type="G_CSET_a_2_z">
  3061. <doc xml:space="preserve">The set of lowercase ASCII alphabet characters.
  3062. Used for specifying valid identifier characters
  3063. in #GScannerConfig.</doc>
  3064. <type name="utf8" c:type="gchar*"/>
  3065. </constant>
  3066. <record name="Checksum"
  3067. c:type="GChecksum"
  3068. version="2.16"
  3069. glib:type-name="GChecksum"
  3070. glib:get-type="g_checksum_get_type"
  3071. c:symbol-prefix="checksum">
  3072. <doc xml:space="preserve">An opaque structure representing a checksumming operation.
  3073. To create a new GChecksum, use g_checksum_new(). To free
  3074. a GChecksum, use g_checksum_free().</doc>
  3075. <constructor name="new" c:identifier="g_checksum_new" version="2.16">
  3076. <doc xml:space="preserve">Creates a new #GChecksum, using the checksum algorithm @checksum_type.
  3077. If the @checksum_type is not known, %NULL is returned.
  3078. A #GChecksum can be used to compute the checksum, or digest, of an
  3079. arbitrary binary blob, using different hashing algorithms.
  3080. A #GChecksum works by feeding a binary blob through g_checksum_update()
  3081. until there is data to be checked; the digest can then be extracted
  3082. using g_checksum_get_string(), which will return the checksum as a
  3083. hexadecimal string; or g_checksum_get_digest(), which will return a
  3084. vector of raw bytes. Once either g_checksum_get_string() or
  3085. g_checksum_get_digest() have been called on a #GChecksum, the checksum
  3086. will be closed and it won't be possible to call g_checksum_update()
  3087. on it anymore.</doc>
  3088. <return-value transfer-ownership="full">
  3089. <doc xml:space="preserve">the newly created #GChecksum, or %NULL.
  3090. Use g_checksum_free() to free the memory allocated by it.</doc>
  3091. <type name="Checksum" c:type="GChecksum*"/>
  3092. </return-value>
  3093. <parameters>
  3094. <parameter name="checksum_type" transfer-ownership="none">
  3095. <doc xml:space="preserve">the desired type of checksum</doc>
  3096. <type name="ChecksumType" c:type="GChecksumType"/>
  3097. </parameter>
  3098. </parameters>
  3099. </constructor>
  3100. <method name="copy" c:identifier="g_checksum_copy" version="2.16">
  3101. <doc xml:space="preserve">Copies a #GChecksum. If @checksum has been closed, by calling
  3102. g_checksum_get_string() or g_checksum_get_digest(), the copied
  3103. checksum will be closed as well.</doc>
  3104. <return-value transfer-ownership="full">
  3105. <doc xml:space="preserve">the copy of the passed #GChecksum. Use g_checksum_free()
  3106. when finished using it.</doc>
  3107. <type name="Checksum" c:type="GChecksum*"/>
  3108. </return-value>
  3109. <parameters>
  3110. <instance-parameter name="checksum" transfer-ownership="none">
  3111. <doc xml:space="preserve">the #GChecksum to copy</doc>
  3112. <type name="Checksum" c:type="const GChecksum*"/>
  3113. </instance-parameter>
  3114. </parameters>
  3115. </method>
  3116. <method name="free" c:identifier="g_checksum_free" version="2.16">
  3117. <doc xml:space="preserve">Frees the memory allocated for @checksum.</doc>
  3118. <return-value transfer-ownership="none">
  3119. <type name="none" c:type="void"/>
  3120. </return-value>
  3121. <parameters>
  3122. <instance-parameter name="checksum" transfer-ownership="none">
  3123. <doc xml:space="preserve">a #GChecksum</doc>
  3124. <type name="Checksum" c:type="GChecksum*"/>
  3125. </instance-parameter>
  3126. </parameters>
  3127. </method>
  3128. <method name="get_digest"
  3129. c:identifier="g_checksum_get_digest"
  3130. version="2.16"
  3131. introspectable="0">
  3132. <doc xml:space="preserve">Gets the digest from @checksum as a raw binary vector and places it
  3133. into @buffer. The size of the digest depends on the type of checksum.
  3134. Once this function has been called, the #GChecksum is closed and can
  3135. no longer be updated with g_checksum_update().</doc>
  3136. <return-value transfer-ownership="none">
  3137. <type name="none" c:type="void"/>
  3138. </return-value>
  3139. <parameters>
  3140. <instance-parameter name="checksum" transfer-ownership="none">
  3141. <doc xml:space="preserve">a #GChecksum</doc>
  3142. <type name="Checksum" c:type="GChecksum*"/>
  3143. </instance-parameter>
  3144. <parameter name="buffer" transfer-ownership="none">
  3145. <doc xml:space="preserve">output buffer</doc>
  3146. <type name="guint8" c:type="guint8*"/>
  3147. </parameter>
  3148. <parameter name="digest_len" transfer-ownership="none">
  3149. <doc xml:space="preserve">an inout parameter. The caller initializes it to the size of @buffer.
  3150. After the call it contains the length of the digest.</doc>
  3151. <type name="gsize" c:type="gsize*"/>
  3152. </parameter>
  3153. </parameters>
  3154. </method>
  3155. <method name="get_string"
  3156. c:identifier="g_checksum_get_string"
  3157. version="2.16">
  3158. <doc xml:space="preserve">Gets the digest as an hexadecimal string.
  3159. Once this function has been called the #GChecksum can no longer be
  3160. updated with g_checksum_update().
  3161. The hexadecimal characters will be lower case.</doc>
  3162. <return-value transfer-ownership="none">
  3163. <doc xml:space="preserve">the hexadecimal representation of the checksum. The
  3164. returned string is owned by the checksum and should not be modified
  3165. or freed.</doc>
  3166. <type name="utf8" c:type="const gchar*"/>
  3167. </return-value>
  3168. <parameters>
  3169. <instance-parameter name="checksum" transfer-ownership="none">
  3170. <doc xml:space="preserve">a #GChecksum</doc>
  3171. <type name="Checksum" c:type="GChecksum*"/>
  3172. </instance-parameter>
  3173. </parameters>
  3174. </method>
  3175. <method name="reset" c:identifier="g_checksum_reset" version="2.18">
  3176. <doc xml:space="preserve">Resets the state of the @checksum back to its initial state.</doc>
  3177. <return-value transfer-ownership="none">
  3178. <type name="none" c:type="void"/>
  3179. </return-value>
  3180. <parameters>
  3181. <instance-parameter name="checksum" transfer-ownership="none">
  3182. <doc xml:space="preserve">the #GChecksum to reset</doc>
  3183. <type name="Checksum" c:type="GChecksum*"/>
  3184. </instance-parameter>
  3185. </parameters>
  3186. </method>
  3187. <method name="update" c:identifier="g_checksum_update" version="2.16">
  3188. <doc xml:space="preserve">Feeds @data into an existing #GChecksum. The checksum must still be
  3189. open, that is g_checksum_get_string() or g_checksum_get_digest() must
  3190. not have been called on @checksum.</doc>
  3191. <return-value transfer-ownership="none">
  3192. <type name="none" c:type="void"/>
  3193. </return-value>
  3194. <parameters>
  3195. <instance-parameter name="checksum" transfer-ownership="none">
  3196. <doc xml:space="preserve">a #GChecksum</doc>
  3197. <type name="Checksum" c:type="GChecksum*"/>
  3198. </instance-parameter>
  3199. <parameter name="data" transfer-ownership="none">
  3200. <doc xml:space="preserve">buffer used to compute the checksum</doc>
  3201. <array length="1" zero-terminated="0" c:type="guchar*">
  3202. <type name="guint8"/>
  3203. </array>
  3204. </parameter>
  3205. <parameter name="length" transfer-ownership="none">
  3206. <doc xml:space="preserve">size of the buffer, or -1 if it is a null-terminated string.</doc>
  3207. <type name="gssize" c:type="gssize"/>
  3208. </parameter>
  3209. </parameters>
  3210. </method>
  3211. <function name="type_get_length"
  3212. c:identifier="g_checksum_type_get_length"
  3213. version="2.16">
  3214. <doc xml:space="preserve">Gets the length in bytes of digests of type @checksum_type</doc>
  3215. <return-value transfer-ownership="none">
  3216. <doc xml:space="preserve">the checksum length, or -1 if @checksum_type is
  3217. not supported.</doc>
  3218. <type name="gssize" c:type="gssize"/>
  3219. </return-value>
  3220. <parameters>
  3221. <parameter name="checksum_type" transfer-ownership="none">
  3222. <doc xml:space="preserve">a #GChecksumType</doc>
  3223. <type name="ChecksumType" c:type="GChecksumType"/>
  3224. </parameter>
  3225. </parameters>
  3226. </function>
  3227. </record>
  3228. <enumeration name="ChecksumType" version="2.16" c:type="GChecksumType">
  3229. <doc xml:space="preserve">The hashing algorithm to be used by #GChecksum when performing the
  3230. digest of some data.
  3231. Note that the #GChecksumType enumeration may be extended at a later
  3232. date to include new hashing algorithm types.</doc>
  3233. <member name="md5" value="0" c:identifier="G_CHECKSUM_MD5">
  3234. <doc xml:space="preserve">Use the MD5 hashing algorithm</doc>
  3235. </member>
  3236. <member name="sha1" value="1" c:identifier="G_CHECKSUM_SHA1">
  3237. <doc xml:space="preserve">Use the SHA-1 hashing algorithm</doc>
  3238. </member>
  3239. <member name="sha256" value="2" c:identifier="G_CHECKSUM_SHA256">
  3240. <doc xml:space="preserve">Use the SHA-256 hashing algorithm</doc>
  3241. </member>
  3242. <member name="sha512" value="3" c:identifier="G_CHECKSUM_SHA512">
  3243. <doc xml:space="preserve">Use the SHA-512 hashing algorithm (Since: 2.36)</doc>
  3244. </member>
  3245. </enumeration>
  3246. <callback name="ChildWatchFunc" c:type="GChildWatchFunc">
  3247. <doc xml:space="preserve">Prototype of a #GChildWatchSource callback, called when a child
  3248. process has exited. To interpret @status, see the documentation
  3249. for g_spawn_check_exit_status().</doc>
  3250. <return-value transfer-ownership="none">
  3251. <type name="none" c:type="void"/>
  3252. </return-value>
  3253. <parameters>
  3254. <parameter name="pid" transfer-ownership="none">
  3255. <doc xml:space="preserve">the process id of the child process</doc>
  3256. <type name="Pid" c:type="GPid"/>
  3257. </parameter>
  3258. <parameter name="status" transfer-ownership="none">
  3259. <doc xml:space="preserve">Status information about the child process, encoded
  3260. in a platform-specific manner</doc>
  3261. <type name="gint" c:type="gint"/>
  3262. </parameter>
  3263. <parameter name="user_data"
  3264. transfer-ownership="none"
  3265. nullable="1"
  3266. allow-none="1"
  3267. closure="2">
  3268. <doc xml:space="preserve">user data passed to g_child_watch_add()</doc>
  3269. <type name="gpointer" c:type="gpointer"/>
  3270. </parameter>
  3271. </parameters>
  3272. </callback>
  3273. <callback name="CompareDataFunc" c:type="GCompareDataFunc">
  3274. <doc xml:space="preserve">Specifies the type of a comparison function used to compare two
  3275. values. The function should return a negative integer if the first
  3276. value comes before the second, 0 if they are equal, or a positive
  3277. integer if the first value comes after the second.</doc>
  3278. <return-value transfer-ownership="none">
  3279. <doc xml:space="preserve">negative value if @a &lt; @b; zero if @a = @b; positive
  3280. value if @a &gt; @b</doc>
  3281. <type name="gint" c:type="gint"/>
  3282. </return-value>
  3283. <parameters>
  3284. <parameter name="a"
  3285. transfer-ownership="none"
  3286. nullable="1"
  3287. allow-none="1">
  3288. <doc xml:space="preserve">a value</doc>
  3289. <type name="gpointer" c:type="gconstpointer"/>
  3290. </parameter>
  3291. <parameter name="b"
  3292. transfer-ownership="none"
  3293. nullable="1"
  3294. allow-none="1">
  3295. <doc xml:space="preserve">a value to compare with</doc>
  3296. <type name="gpointer" c:type="gconstpointer"/>
  3297. </parameter>
  3298. <parameter name="user_data"
  3299. transfer-ownership="none"
  3300. nullable="1"
  3301. allow-none="1"
  3302. closure="2">
  3303. <doc xml:space="preserve">user data</doc>
  3304. <type name="gpointer" c:type="gpointer"/>
  3305. </parameter>
  3306. </parameters>
  3307. </callback>
  3308. <callback name="CompareFunc" c:type="GCompareFunc">
  3309. <doc xml:space="preserve">Specifies the type of a comparison function used to compare two
  3310. values. The function should return a negative integer if the first
  3311. value comes before the second, 0 if they are equal, or a positive
  3312. integer if the first value comes after the second.</doc>
  3313. <return-value transfer-ownership="none">
  3314. <doc xml:space="preserve">negative value if @a &lt; @b; zero if @a = @b; positive
  3315. value if @a &gt; @b</doc>
  3316. <type name="gint" c:type="gint"/>
  3317. </return-value>
  3318. <parameters>
  3319. <parameter name="a"
  3320. transfer-ownership="none"
  3321. nullable="1"
  3322. allow-none="1">
  3323. <doc xml:space="preserve">a value</doc>
  3324. <type name="gpointer" c:type="gconstpointer"/>
  3325. </parameter>
  3326. <parameter name="b"
  3327. transfer-ownership="none"
  3328. nullable="1"
  3329. allow-none="1">
  3330. <doc xml:space="preserve">a value to compare with</doc>
  3331. <type name="gpointer" c:type="gconstpointer"/>
  3332. </parameter>
  3333. </parameters>
  3334. </callback>
  3335. <record name="Cond" c:type="GCond">
  3336. <doc xml:space="preserve">The #GCond struct is an opaque data structure that represents a
  3337. condition. Threads can block on a #GCond if they find a certain
  3338. condition to be false. If other threads change the state of this
  3339. condition they signal the #GCond, and that causes the waiting
  3340. threads to be woken up.
  3341. Consider the following example of a shared variable. One or more
  3342. threads can wait for data to be published to the variable and when
  3343. another thread publishes the data, it can signal one of the waiting
  3344. threads to wake up to collect the data.
  3345. Here is an example for using GCond to block a thread until a condition
  3346. is satisfied:
  3347. |[&lt;!-- language="C" --&gt;
  3348. gpointer current_data = NULL;
  3349. GMutex data_mutex;
  3350. GCond data_cond;
  3351. void
  3352. push_data (gpointer data)
  3353. {
  3354. g_mutex_lock (&amp;data_mutex);
  3355. current_data = data;
  3356. g_cond_signal (&amp;data_cond);
  3357. g_mutex_unlock (&amp;data_mutex);
  3358. }
  3359. gpointer
  3360. pop_data (void)
  3361. {
  3362. gpointer data;
  3363. g_mutex_lock (&amp;data_mutex);
  3364. while (!current_data)
  3365. g_cond_wait (&amp;data_cond, &amp;data_mutex);
  3366. data = current_data;
  3367. current_data = NULL;
  3368. g_mutex_unlock (&amp;data_mutex);
  3369. return data;
  3370. }
  3371. ]|
  3372. Whenever a thread calls pop_data() now, it will wait until
  3373. current_data is non-%NULL, i.e. until some other thread
  3374. has called push_data().
  3375. The example shows that use of a condition variable must always be
  3376. paired with a mutex. Without the use of a mutex, there would be a
  3377. race between the check of @current_data by the while loop in
  3378. pop_data() and waiting. Specifically, another thread could set
  3379. @current_data after the check, and signal the cond (with nobody
  3380. waiting on it) before the first thread goes to sleep. #GCond is
  3381. specifically useful for its ability to release the mutex and go
  3382. to sleep atomically.
  3383. It is also important to use the g_cond_wait() and g_cond_wait_until()
  3384. functions only inside a loop which checks for the condition to be
  3385. true. See g_cond_wait() for an explanation of why the condition may
  3386. not be true even after it returns.
  3387. If a #GCond is allocated in static storage then it can be used
  3388. without initialisation. Otherwise, you should call g_cond_init()
  3389. on it and g_cond_clear() when done.
  3390. A #GCond should only be accessed via the g_cond_ functions.</doc>
  3391. <field name="p" readable="0" private="1">
  3392. <type name="gpointer" c:type="gpointer"/>
  3393. </field>
  3394. <field name="i" readable="0" private="1">
  3395. <array zero-terminated="0" c:type="guint" fixed-size="2">
  3396. <type name="guint" c:type="guint"/>
  3397. </array>
  3398. </field>
  3399. <method name="broadcast" c:identifier="g_cond_broadcast">
  3400. <doc xml:space="preserve">If threads are waiting for @cond, all of them are unblocked.
  3401. If no threads are waiting for @cond, this function has no effect.
  3402. It is good practice to lock the same mutex as the waiting threads
  3403. while calling this function, though not required.</doc>
  3404. <return-value transfer-ownership="none">
  3405. <type name="none" c:type="void"/>
  3406. </return-value>
  3407. <parameters>
  3408. <instance-parameter name="cond" transfer-ownership="none">
  3409. <doc xml:space="preserve">a #GCond</doc>
  3410. <type name="Cond" c:type="GCond*"/>
  3411. </instance-parameter>
  3412. </parameters>
  3413. </method>
  3414. <method name="clear" c:identifier="g_cond_clear" version="2.32">
  3415. <doc xml:space="preserve">Frees the resources allocated to a #GCond with g_cond_init().
  3416. This function should not be used with a #GCond that has been
  3417. statically allocated.
  3418. Calling g_cond_clear() for a #GCond on which threads are
  3419. blocking leads to undefined behaviour.</doc>
  3420. <return-value transfer-ownership="none">
  3421. <type name="none" c:type="void"/>
  3422. </return-value>
  3423. <parameters>
  3424. <instance-parameter name="cond" transfer-ownership="none">
  3425. <doc xml:space="preserve">an initialised #GCond</doc>
  3426. <type name="Cond" c:type="GCond*"/>
  3427. </instance-parameter>
  3428. </parameters>
  3429. </method>
  3430. <method name="init" c:identifier="g_cond_init" version="2.32">
  3431. <doc xml:space="preserve">Initialises a #GCond so that it can be used.
  3432. This function is useful to initialise a #GCond that has been
  3433. allocated as part of a larger structure. It is not necessary to
  3434. initialise a #GCond that has been statically allocated.
  3435. To undo the effect of g_cond_init() when a #GCond is no longer
  3436. needed, use g_cond_clear().
  3437. Calling g_cond_init() on an already-initialised #GCond leads
  3438. to undefined behaviour.</doc>
  3439. <return-value transfer-ownership="none">
  3440. <type name="none" c:type="void"/>
  3441. </return-value>
  3442. <parameters>
  3443. <instance-parameter name="cond" transfer-ownership="none">
  3444. <doc xml:space="preserve">an uninitialized #GCond</doc>
  3445. <type name="Cond" c:type="GCond*"/>
  3446. </instance-parameter>
  3447. </parameters>
  3448. </method>
  3449. <method name="signal" c:identifier="g_cond_signal">
  3450. <doc xml:space="preserve">If threads are waiting for @cond, at least one of them is unblocked.
  3451. If no threads are waiting for @cond, this function has no effect.
  3452. It is good practice to hold the same lock as the waiting thread
  3453. while calling this function, though not required.</doc>
  3454. <return-value transfer-ownership="none">
  3455. <type name="none" c:type="void"/>
  3456. </return-value>
  3457. <parameters>
  3458. <instance-parameter name="cond" transfer-ownership="none">
  3459. <doc xml:space="preserve">a #GCond</doc>
  3460. <type name="Cond" c:type="GCond*"/>
  3461. </instance-parameter>
  3462. </parameters>
  3463. </method>
  3464. <method name="wait" c:identifier="g_cond_wait">
  3465. <doc xml:space="preserve">Atomically releases @mutex and waits until @cond is signalled.
  3466. When this function returns, @mutex is locked again and owned by the
  3467. calling thread.
  3468. When using condition variables, it is possible that a spurious wakeup
  3469. may occur (ie: g_cond_wait() returns even though g_cond_signal() was
  3470. not called). It's also possible that a stolen wakeup may occur.
  3471. This is when g_cond_signal() is called, but another thread acquires
  3472. @mutex before this thread and modifies the state of the program in
  3473. such a way that when g_cond_wait() is able to return, the expected
  3474. condition is no longer met.
  3475. For this reason, g_cond_wait() must always be used in a loop. See
  3476. the documentation for #GCond for a complete example.</doc>
  3477. <return-value transfer-ownership="none">
  3478. <type name="none" c:type="void"/>
  3479. </return-value>
  3480. <parameters>
  3481. <instance-parameter name="cond" transfer-ownership="none">
  3482. <doc xml:space="preserve">a #GCond</doc>
  3483. <type name="Cond" c:type="GCond*"/>
  3484. </instance-parameter>
  3485. <parameter name="mutex" transfer-ownership="none">
  3486. <doc xml:space="preserve">a #GMutex that is currently locked</doc>
  3487. <type name="Mutex" c:type="GMutex*"/>
  3488. </parameter>
  3489. </parameters>
  3490. </method>
  3491. <method name="wait_until"
  3492. c:identifier="g_cond_wait_until"
  3493. version="2.32">
  3494. <doc xml:space="preserve">Waits until either @cond is signalled or @end_time has passed.
  3495. As with g_cond_wait() it is possible that a spurious or stolen wakeup
  3496. could occur. For that reason, waiting on a condition variable should
  3497. always be in a loop, based on an explicitly-checked predicate.
  3498. %TRUE is returned if the condition variable was signalled (or in the
  3499. case of a spurious wakeup). %FALSE is returned if @end_time has
  3500. passed.
  3501. The following code shows how to correctly perform a timed wait on a
  3502. condition variable (extending the example presented in the
  3503. documentation for #GCond):
  3504. |[&lt;!-- language="C" --&gt;
  3505. gpointer
  3506. pop_data_timed (void)
  3507. {
  3508. gint64 end_time;
  3509. gpointer data;
  3510. g_mutex_lock (&amp;data_mutex);
  3511. end_time = g_get_monotonic_time () + 5 * G_TIME_SPAN_SECOND;
  3512. while (!current_data)
  3513. if (!g_cond_wait_until (&amp;data_cond, &amp;data_mutex, end_time))
  3514. {
  3515. // timeout has passed.
  3516. g_mutex_unlock (&amp;data_mutex);
  3517. return NULL;
  3518. }
  3519. // there is data for us
  3520. data = current_data;
  3521. current_data = NULL;
  3522. g_mutex_unlock (&amp;data_mutex);
  3523. return data;
  3524. }
  3525. ]|
  3526. Notice that the end time is calculated once, before entering the
  3527. loop and reused. This is the motivation behind the use of absolute
  3528. time on this API -- if a relative time of 5 seconds were passed
  3529. directly to the call and a spurious wakeup occurred, the program would
  3530. have to start over waiting again (which would lead to a total wait
  3531. time of more than 5 seconds).</doc>
  3532. <return-value transfer-ownership="none">
  3533. <doc xml:space="preserve">%TRUE on a signal, %FALSE on a timeout</doc>
  3534. <type name="gboolean" c:type="gboolean"/>
  3535. </return-value>
  3536. <parameters>
  3537. <instance-parameter name="cond" transfer-ownership="none">
  3538. <doc xml:space="preserve">a #GCond</doc>
  3539. <type name="Cond" c:type="GCond*"/>
  3540. </instance-parameter>
  3541. <parameter name="mutex" transfer-ownership="none">
  3542. <doc xml:space="preserve">a #GMutex that is currently locked</doc>
  3543. <type name="Mutex" c:type="GMutex*"/>
  3544. </parameter>
  3545. <parameter name="end_time" transfer-ownership="none">
  3546. <doc xml:space="preserve">the monotonic time to wait until</doc>
  3547. <type name="gint64" c:type="gint64"/>
  3548. </parameter>
  3549. </parameters>
  3550. </method>
  3551. </record>
  3552. <enumeration name="ConvertError"
  3553. c:type="GConvertError"
  3554. glib:error-domain="g_convert_error">
  3555. <doc xml:space="preserve">Error codes returned by character set conversion routines.</doc>
  3556. <member name="no_conversion"
  3557. value="0"
  3558. c:identifier="G_CONVERT_ERROR_NO_CONVERSION">
  3559. <doc xml:space="preserve">Conversion between the requested character
  3560. sets is not supported.</doc>
  3561. </member>
  3562. <member name="illegal_sequence"
  3563. value="1"
  3564. c:identifier="G_CONVERT_ERROR_ILLEGAL_SEQUENCE">
  3565. <doc xml:space="preserve">Invalid byte sequence in conversion input.</doc>
  3566. </member>
  3567. <member name="failed" value="2" c:identifier="G_CONVERT_ERROR_FAILED">
  3568. <doc xml:space="preserve">Conversion failed for some reason.</doc>
  3569. </member>
  3570. <member name="partial_input"
  3571. value="3"
  3572. c:identifier="G_CONVERT_ERROR_PARTIAL_INPUT">
  3573. <doc xml:space="preserve">Partial character sequence at end of input.</doc>
  3574. </member>
  3575. <member name="bad_uri" value="4" c:identifier="G_CONVERT_ERROR_BAD_URI">
  3576. <doc xml:space="preserve">URI is invalid.</doc>
  3577. </member>
  3578. <member name="not_absolute_path"
  3579. value="5"
  3580. c:identifier="G_CONVERT_ERROR_NOT_ABSOLUTE_PATH">
  3581. <doc xml:space="preserve">Pathname is not an absolute path.</doc>
  3582. </member>
  3583. <member name="no_memory"
  3584. value="6"
  3585. c:identifier="G_CONVERT_ERROR_NO_MEMORY">
  3586. <doc xml:space="preserve">No memory available. Since: 2.40</doc>
  3587. </member>
  3588. </enumeration>
  3589. <callback name="CopyFunc" c:type="GCopyFunc" version="2.4">
  3590. <doc xml:space="preserve">A function of this signature is used to copy the node data
  3591. when doing a deep-copy of a tree.</doc>
  3592. <return-value transfer-ownership="none">
  3593. <doc xml:space="preserve">A pointer to the copy</doc>
  3594. <type name="gpointer" c:type="gpointer"/>
  3595. </return-value>
  3596. <parameters>
  3597. <parameter name="src" transfer-ownership="none">
  3598. <doc xml:space="preserve">A pointer to the data which should be copied</doc>
  3599. <type name="gpointer" c:type="gconstpointer"/>
  3600. </parameter>
  3601. <parameter name="data"
  3602. transfer-ownership="none"
  3603. nullable="1"
  3604. allow-none="1">
  3605. <doc xml:space="preserve">Additional data</doc>
  3606. <type name="gpointer" c:type="gpointer"/>
  3607. </parameter>
  3608. </parameters>
  3609. </callback>
  3610. <constant name="DATALIST_FLAGS_MASK"
  3611. value="3"
  3612. c:type="G_DATALIST_FLAGS_MASK">
  3613. <doc xml:space="preserve">A bitmask that restricts the possible flags passed to
  3614. g_datalist_set_flags(). Passing a flags value where
  3615. flags &amp; ~G_DATALIST_FLAGS_MASK != 0 is an error.</doc>
  3616. <type name="gint" c:type="gint"/>
  3617. </constant>
  3618. <constant name="DATE_BAD_DAY" value="0" c:type="G_DATE_BAD_DAY">
  3619. <doc xml:space="preserve">Represents an invalid #GDateDay.</doc>
  3620. <type name="gint" c:type="gint"/>
  3621. </constant>
  3622. <constant name="DATE_BAD_JULIAN" value="0" c:type="G_DATE_BAD_JULIAN">
  3623. <doc xml:space="preserve">Represents an invalid Julian day number.</doc>
  3624. <type name="gint" c:type="gint"/>
  3625. </constant>
  3626. <constant name="DATE_BAD_YEAR" value="0" c:type="G_DATE_BAD_YEAR">
  3627. <doc xml:space="preserve">Represents an invalid year.</doc>
  3628. <type name="gint" c:type="gint"/>
  3629. </constant>
  3630. <constant name="DIR_SEPARATOR" value="92" c:type="G_DIR_SEPARATOR">
  3631. <doc xml:space="preserve">The directory separator character.
  3632. This is '/' on UNIX machines and '\' under Windows.</doc>
  3633. <type name="gint" c:type="gint"/>
  3634. </constant>
  3635. <constant name="DIR_SEPARATOR_S" value="\" c:type="G_DIR_SEPARATOR_S">
  3636. <doc xml:space="preserve">The directory separator as a string.
  3637. This is "/" on UNIX machines and "\" under Windows.</doc>
  3638. <type name="utf8" c:type="gchar*"/>
  3639. </constant>
  3640. <record name="Data" c:type="GData" disguised="1">
  3641. <doc xml:space="preserve">The #GData struct is an opaque data structure to represent a
  3642. [Keyed Data List][glib-Keyed-Data-Lists]. It should only be
  3643. accessed via the following functions.</doc>
  3644. </record>
  3645. <callback name="DataForeachFunc" c:type="GDataForeachFunc">
  3646. <doc xml:space="preserve">Specifies the type of function passed to g_dataset_foreach(). It is
  3647. called with each #GQuark id and associated data element, together
  3648. with the @user_data parameter supplied to g_dataset_foreach().</doc>
  3649. <return-value transfer-ownership="none">
  3650. <type name="none" c:type="void"/>
  3651. </return-value>
  3652. <parameters>
  3653. <parameter name="key_id" transfer-ownership="none">
  3654. <doc xml:space="preserve">the #GQuark id to identifying the data element.</doc>
  3655. <type name="Quark" c:type="GQuark"/>
  3656. </parameter>
  3657. <parameter name="data"
  3658. transfer-ownership="none"
  3659. nullable="1"
  3660. allow-none="1">
  3661. <doc xml:space="preserve">the data element.</doc>
  3662. <type name="gpointer" c:type="gpointer"/>
  3663. </parameter>
  3664. <parameter name="user_data"
  3665. transfer-ownership="none"
  3666. nullable="1"
  3667. allow-none="1"
  3668. closure="2">
  3669. <doc xml:space="preserve">user data passed to g_dataset_foreach().</doc>
  3670. <type name="gpointer" c:type="gpointer"/>
  3671. </parameter>
  3672. </parameters>
  3673. </callback>
  3674. <record name="Date"
  3675. c:type="GDate"
  3676. glib:type-name="GDate"
  3677. glib:get-type="g_date_get_type"
  3678. c:symbol-prefix="date">
  3679. <doc xml:space="preserve">Represents a day between January 1, Year 1 and a few thousand years in
  3680. the future. None of its members should be accessed directly.
  3681. If the #GDate-struct is obtained from g_date_new(), it will be safe
  3682. to mutate but invalid and thus not safe for calendrical computations.
  3683. If it's declared on the stack, it will contain garbage so must be
  3684. initialized with g_date_clear(). g_date_clear() makes the date invalid
  3685. but sane. An invalid date doesn't represent a day, it's "empty." A date
  3686. becomes valid after you set it to a Julian day or you set a day, month,
  3687. and year.</doc>
  3688. <field name="julian_days" writable="1" bits="32">
  3689. <doc xml:space="preserve">the Julian representation of the date</doc>
  3690. <type name="guint" c:type="guint"/>
  3691. </field>
  3692. <field name="julian" writable="1" bits="1">
  3693. <doc xml:space="preserve">this bit is set if @julian_days is valid</doc>
  3694. <type name="guint" c:type="guint"/>
  3695. </field>
  3696. <field name="dmy" writable="1" bits="1">
  3697. <doc xml:space="preserve">this is set if @day, @month and @year are valid</doc>
  3698. <type name="guint" c:type="guint"/>
  3699. </field>
  3700. <field name="day" writable="1" bits="6">
  3701. <doc xml:space="preserve">the day of the day-month-year representation of the date,
  3702. as a number between 1 and 31</doc>
  3703. <type name="guint" c:type="guint"/>
  3704. </field>
  3705. <field name="month" writable="1" bits="4">
  3706. <doc xml:space="preserve">the day of the day-month-year representation of the date,
  3707. as a number between 1 and 12</doc>
  3708. <type name="guint" c:type="guint"/>
  3709. </field>
  3710. <field name="year" writable="1" bits="16">
  3711. <doc xml:space="preserve">the day of the day-month-year representation of the date</doc>
  3712. <type name="guint" c:type="guint"/>
  3713. </field>
  3714. <constructor name="new" c:identifier="g_date_new">
  3715. <doc xml:space="preserve">Allocates a #GDate and initializes
  3716. it to a sane state. The new date will
  3717. be cleared (as if you'd called g_date_clear()) but invalid (it won't
  3718. represent an existing day). Free the return value with g_date_free().</doc>
  3719. <return-value transfer-ownership="full">
  3720. <doc xml:space="preserve">a newly-allocated #GDate</doc>
  3721. <type name="Date" c:type="GDate*"/>
  3722. </return-value>
  3723. </constructor>
  3724. <constructor name="new_dmy" c:identifier="g_date_new_dmy">
  3725. <doc xml:space="preserve">Like g_date_new(), but also sets the value of the date. Assuming the
  3726. day-month-year triplet you pass in represents an existing day, the
  3727. returned date will be valid.</doc>
  3728. <return-value transfer-ownership="full">
  3729. <doc xml:space="preserve">a newly-allocated #GDate initialized with @day, @month, and @year</doc>
  3730. <type name="Date" c:type="GDate*"/>
  3731. </return-value>
  3732. <parameters>
  3733. <parameter name="day" transfer-ownership="none">
  3734. <doc xml:space="preserve">day of the month</doc>
  3735. <type name="DateDay" c:type="GDateDay"/>
  3736. </parameter>
  3737. <parameter name="month" transfer-ownership="none">
  3738. <doc xml:space="preserve">month of the year</doc>
  3739. <type name="DateMonth" c:type="GDateMonth"/>
  3740. </parameter>
  3741. <parameter name="year" transfer-ownership="none">
  3742. <doc xml:space="preserve">year</doc>
  3743. <type name="DateYear" c:type="GDateYear"/>
  3744. </parameter>
  3745. </parameters>
  3746. </constructor>
  3747. <constructor name="new_julian" c:identifier="g_date_new_julian">
  3748. <doc xml:space="preserve">Like g_date_new(), but also sets the value of the date. Assuming the
  3749. Julian day number you pass in is valid (greater than 0, less than an
  3750. unreasonably large number), the returned date will be valid.</doc>
  3751. <return-value transfer-ownership="full">
  3752. <doc xml:space="preserve">a newly-allocated #GDate initialized with @julian_day</doc>
  3753. <type name="Date" c:type="GDate*"/>
  3754. </return-value>
  3755. <parameters>
  3756. <parameter name="julian_day" transfer-ownership="none">
  3757. <doc xml:space="preserve">days since January 1, Year 1</doc>
  3758. <type name="guint32" c:type="guint32"/>
  3759. </parameter>
  3760. </parameters>
  3761. </constructor>
  3762. <method name="add_days" c:identifier="g_date_add_days">
  3763. <doc xml:space="preserve">Increments a date some number of days.
  3764. To move forward by weeks, add weeks*7 days.
  3765. The date must be valid.</doc>
  3766. <return-value transfer-ownership="none">
  3767. <type name="none" c:type="void"/>
  3768. </return-value>
  3769. <parameters>
  3770. <instance-parameter name="date" transfer-ownership="none">
  3771. <doc xml:space="preserve">a #GDate to increment</doc>
  3772. <type name="Date" c:type="GDate*"/>
  3773. </instance-parameter>
  3774. <parameter name="n_days" transfer-ownership="none">
  3775. <doc xml:space="preserve">number of days to move the date forward</doc>
  3776. <type name="guint" c:type="guint"/>
  3777. </parameter>
  3778. </parameters>
  3779. </method>
  3780. <method name="add_months" c:identifier="g_date_add_months">
  3781. <doc xml:space="preserve">Increments a date by some number of months.
  3782. If the day of the month is greater than 28,
  3783. this routine may change the day of the month
  3784. (because the destination month may not have
  3785. the current day in it). The date must be valid.</doc>
  3786. <return-value transfer-ownership="none">
  3787. <type name="none" c:type="void"/>
  3788. </return-value>
  3789. <parameters>
  3790. <instance-parameter name="date" transfer-ownership="none">
  3791. <doc xml:space="preserve">a #GDate to increment</doc>
  3792. <type name="Date" c:type="GDate*"/>
  3793. </instance-parameter>
  3794. <parameter name="n_months" transfer-ownership="none">
  3795. <doc xml:space="preserve">number of months to move forward</doc>
  3796. <type name="guint" c:type="guint"/>
  3797. </parameter>
  3798. </parameters>
  3799. </method>
  3800. <method name="add_years" c:identifier="g_date_add_years">
  3801. <doc xml:space="preserve">Increments a date by some number of years.
  3802. If the date is February 29, and the destination
  3803. year is not a leap year, the date will be changed
  3804. to February 28. The date must be valid.</doc>
  3805. <return-value transfer-ownership="none">
  3806. <type name="none" c:type="void"/>
  3807. </return-value>
  3808. <parameters>
  3809. <instance-parameter name="date" transfer-ownership="none">
  3810. <doc xml:space="preserve">a #GDate to increment</doc>
  3811. <type name="Date" c:type="GDate*"/>
  3812. </instance-parameter>
  3813. <parameter name="n_years" transfer-ownership="none">
  3814. <doc xml:space="preserve">number of years to move forward</doc>
  3815. <type name="guint" c:type="guint"/>
  3816. </parameter>
  3817. </parameters>
  3818. </method>
  3819. <method name="clamp" c:identifier="g_date_clamp">
  3820. <doc xml:space="preserve">If @date is prior to @min_date, sets @date equal to @min_date.
  3821. If @date falls after @max_date, sets @date equal to @max_date.
  3822. Otherwise, @date is unchanged.
  3823. Either of @min_date and @max_date may be %NULL.
  3824. All non-%NULL dates must be valid.</doc>
  3825. <return-value transfer-ownership="none">
  3826. <type name="none" c:type="void"/>
  3827. </return-value>
  3828. <parameters>
  3829. <instance-parameter name="date" transfer-ownership="none">
  3830. <doc xml:space="preserve">a #GDate to clamp</doc>
  3831. <type name="Date" c:type="GDate*"/>
  3832. </instance-parameter>
  3833. <parameter name="min_date" transfer-ownership="none">
  3834. <doc xml:space="preserve">minimum accepted value for @date</doc>
  3835. <type name="Date" c:type="const GDate*"/>
  3836. </parameter>
  3837. <parameter name="max_date" transfer-ownership="none">
  3838. <doc xml:space="preserve">maximum accepted value for @date</doc>
  3839. <type name="Date" c:type="const GDate*"/>
  3840. </parameter>
  3841. </parameters>
  3842. </method>
  3843. <method name="clear" c:identifier="g_date_clear">
  3844. <doc xml:space="preserve">Initializes one or more #GDate structs to a sane but invalid
  3845. state. The cleared dates will not represent an existing date, but will
  3846. not contain garbage. Useful to init a date declared on the stack.
  3847. Validity can be tested with g_date_valid().</doc>
  3848. <return-value transfer-ownership="none">
  3849. <type name="none" c:type="void"/>
  3850. </return-value>
  3851. <parameters>
  3852. <instance-parameter name="date" transfer-ownership="none">
  3853. <doc xml:space="preserve">pointer to one or more dates to clear</doc>
  3854. <type name="Date" c:type="GDate*"/>
  3855. </instance-parameter>
  3856. <parameter name="n_dates" transfer-ownership="none">
  3857. <doc xml:space="preserve">number of dates to clear</doc>
  3858. <type name="guint" c:type="guint"/>
  3859. </parameter>
  3860. </parameters>
  3861. </method>
  3862. <method name="compare" c:identifier="g_date_compare">
  3863. <doc xml:space="preserve">qsort()-style comparison function for dates.
  3864. Both dates must be valid.</doc>
  3865. <return-value transfer-ownership="none">
  3866. <doc xml:space="preserve">0 for equal, less than zero if @lhs is less than @rhs,
  3867. greater than zero if @lhs is greater than @rhs</doc>
  3868. <type name="gint" c:type="gint"/>
  3869. </return-value>
  3870. <parameters>
  3871. <instance-parameter name="lhs" transfer-ownership="none">
  3872. <doc xml:space="preserve">first date to compare</doc>
  3873. <type name="Date" c:type="const GDate*"/>
  3874. </instance-parameter>
  3875. <parameter name="rhs" transfer-ownership="none">
  3876. <doc xml:space="preserve">second date to compare</doc>
  3877. <type name="Date" c:type="const GDate*"/>
  3878. </parameter>
  3879. </parameters>
  3880. </method>
  3881. <method name="days_between" c:identifier="g_date_days_between">
  3882. <doc xml:space="preserve">Computes the number of days between two dates.
  3883. If @date2 is prior to @date1, the returned value is negative.
  3884. Both dates must be valid.</doc>
  3885. <return-value transfer-ownership="none">
  3886. <doc xml:space="preserve">the number of days between @date1 and @date2</doc>
  3887. <type name="gint" c:type="gint"/>
  3888. </return-value>
  3889. <parameters>
  3890. <instance-parameter name="date1" transfer-ownership="none">
  3891. <doc xml:space="preserve">the first date</doc>
  3892. <type name="Date" c:type="const GDate*"/>
  3893. </instance-parameter>
  3894. <parameter name="date2" transfer-ownership="none">
  3895. <doc xml:space="preserve">the second date</doc>
  3896. <type name="Date" c:type="const GDate*"/>
  3897. </parameter>
  3898. </parameters>
  3899. </method>
  3900. <method name="free" c:identifier="g_date_free">
  3901. <doc xml:space="preserve">Frees a #GDate returned from g_date_new().</doc>
  3902. <return-value transfer-ownership="none">
  3903. <type name="none" c:type="void"/>
  3904. </return-value>
  3905. <parameters>
  3906. <instance-parameter name="date" transfer-ownership="none">
  3907. <doc xml:space="preserve">a #GDate to free</doc>
  3908. <type name="Date" c:type="GDate*"/>
  3909. </instance-parameter>
  3910. </parameters>
  3911. </method>
  3912. <method name="get_day" c:identifier="g_date_get_day">
  3913. <doc xml:space="preserve">Returns the day of the month. The date must be valid.</doc>
  3914. <return-value transfer-ownership="none">
  3915. <doc xml:space="preserve">day of the month</doc>
  3916. <type name="DateDay" c:type="GDateDay"/>
  3917. </return-value>
  3918. <parameters>
  3919. <instance-parameter name="date" transfer-ownership="none">
  3920. <doc xml:space="preserve">a #GDate to extract the day of the month from</doc>
  3921. <type name="Date" c:type="const GDate*"/>
  3922. </instance-parameter>
  3923. </parameters>
  3924. </method>
  3925. <method name="get_day_of_year" c:identifier="g_date_get_day_of_year">
  3926. <doc xml:space="preserve">Returns the day of the year, where Jan 1 is the first day of the
  3927. year. The date must be valid.</doc>
  3928. <return-value transfer-ownership="none">
  3929. <doc xml:space="preserve">day of the year</doc>
  3930. <type name="guint" c:type="guint"/>
  3931. </return-value>
  3932. <parameters>
  3933. <instance-parameter name="date" transfer-ownership="none">
  3934. <doc xml:space="preserve">a #GDate to extract day of year from</doc>
  3935. <type name="Date" c:type="const GDate*"/>
  3936. </instance-parameter>
  3937. </parameters>
  3938. </method>
  3939. <method name="get_iso8601_week_of_year"
  3940. c:identifier="g_date_get_iso8601_week_of_year"
  3941. version="2.6">
  3942. <doc xml:space="preserve">Returns the week of the year, where weeks are interpreted according
  3943. to ISO 8601.</doc>
  3944. <return-value transfer-ownership="none">
  3945. <doc xml:space="preserve">ISO 8601 week number of the year.</doc>
  3946. <type name="guint" c:type="guint"/>
  3947. </return-value>
  3948. <parameters>
  3949. <instance-parameter name="date" transfer-ownership="none">
  3950. <doc xml:space="preserve">a valid #GDate</doc>
  3951. <type name="Date" c:type="const GDate*"/>
  3952. </instance-parameter>
  3953. </parameters>
  3954. </method>
  3955. <method name="get_julian" c:identifier="g_date_get_julian">
  3956. <doc xml:space="preserve">Returns the Julian day or "serial number" of the #GDate. The
  3957. Julian day is simply the number of days since January 1, Year 1; i.e.,
  3958. January 1, Year 1 is Julian day 1; January 2, Year 1 is Julian day 2,
  3959. etc. The date must be valid.</doc>
  3960. <return-value transfer-ownership="none">
  3961. <doc xml:space="preserve">Julian day</doc>
  3962. <type name="guint32" c:type="guint32"/>
  3963. </return-value>
  3964. <parameters>
  3965. <instance-parameter name="date" transfer-ownership="none">
  3966. <doc xml:space="preserve">a #GDate to extract the Julian day from</doc>
  3967. <type name="Date" c:type="const GDate*"/>
  3968. </instance-parameter>
  3969. </parameters>
  3970. </method>
  3971. <method name="get_monday_week_of_year"
  3972. c:identifier="g_date_get_monday_week_of_year">
  3973. <doc xml:space="preserve">Returns the week of the year, where weeks are understood to start on
  3974. Monday. If the date is before the first Monday of the year, return 0.
  3975. The date must be valid.</doc>
  3976. <return-value transfer-ownership="none">
  3977. <doc xml:space="preserve">week of the year</doc>
  3978. <type name="guint" c:type="guint"/>
  3979. </return-value>
  3980. <parameters>
  3981. <instance-parameter name="date" transfer-ownership="none">
  3982. <doc xml:space="preserve">a #GDate</doc>
  3983. <type name="Date" c:type="const GDate*"/>
  3984. </instance-parameter>
  3985. </parameters>
  3986. </method>
  3987. <method name="get_month" c:identifier="g_date_get_month">
  3988. <doc xml:space="preserve">Returns the month of the year. The date must be valid.</doc>
  3989. <return-value transfer-ownership="none">
  3990. <doc xml:space="preserve">month of the year as a #GDateMonth</doc>
  3991. <type name="DateMonth" c:type="GDateMonth"/>
  3992. </return-value>
  3993. <parameters>
  3994. <instance-parameter name="date" transfer-ownership="none">
  3995. <doc xml:space="preserve">a #GDate to get the month from</doc>
  3996. <type name="Date" c:type="const GDate*"/>
  3997. </instance-parameter>
  3998. </parameters>
  3999. </method>
  4000. <method name="get_sunday_week_of_year"
  4001. c:identifier="g_date_get_sunday_week_of_year">
  4002. <doc xml:space="preserve">Returns the week of the year during which this date falls, if
  4003. weeks are understood to being on Sunday. The date must be valid.
  4004. Can return 0 if the day is before the first Sunday of the year.</doc>
  4005. <return-value transfer-ownership="none">
  4006. <doc xml:space="preserve">week number</doc>
  4007. <type name="guint" c:type="guint"/>
  4008. </return-value>
  4009. <parameters>
  4010. <instance-parameter name="date" transfer-ownership="none">
  4011. <doc xml:space="preserve">a #GDate</doc>
  4012. <type name="Date" c:type="const GDate*"/>
  4013. </instance-parameter>
  4014. </parameters>
  4015. </method>
  4016. <method name="get_weekday" c:identifier="g_date_get_weekday">
  4017. <doc xml:space="preserve">Returns the day of the week for a #GDate. The date must be valid.</doc>
  4018. <return-value transfer-ownership="none">
  4019. <doc xml:space="preserve">day of the week as a #GDateWeekday.</doc>
  4020. <type name="DateWeekday" c:type="GDateWeekday"/>
  4021. </return-value>
  4022. <parameters>
  4023. <instance-parameter name="date" transfer-ownership="none">
  4024. <doc xml:space="preserve">a #GDate</doc>
  4025. <type name="Date" c:type="const GDate*"/>
  4026. </instance-parameter>
  4027. </parameters>
  4028. </method>
  4029. <method name="get_year" c:identifier="g_date_get_year">
  4030. <doc xml:space="preserve">Returns the year of a #GDate. The date must be valid.</doc>
  4031. <return-value transfer-ownership="none">
  4032. <doc xml:space="preserve">year in which the date falls</doc>
  4033. <type name="DateYear" c:type="GDateYear"/>
  4034. </return-value>
  4035. <parameters>
  4036. <instance-parameter name="date" transfer-ownership="none">
  4037. <doc xml:space="preserve">a #GDate</doc>
  4038. <type name="Date" c:type="const GDate*"/>
  4039. </instance-parameter>
  4040. </parameters>
  4041. </method>
  4042. <method name="is_first_of_month" c:identifier="g_date_is_first_of_month">
  4043. <doc xml:space="preserve">Returns %TRUE if the date is on the first of a month.
  4044. The date must be valid.</doc>
  4045. <return-value transfer-ownership="none">
  4046. <doc xml:space="preserve">%TRUE if the date is the first of the month</doc>
  4047. <type name="gboolean" c:type="gboolean"/>
  4048. </return-value>
  4049. <parameters>
  4050. <instance-parameter name="date" transfer-ownership="none">
  4051. <doc xml:space="preserve">a #GDate to check</doc>
  4052. <type name="Date" c:type="const GDate*"/>
  4053. </instance-parameter>
  4054. </parameters>
  4055. </method>
  4056. <method name="is_last_of_month" c:identifier="g_date_is_last_of_month">
  4057. <doc xml:space="preserve">Returns %TRUE if the date is the last day of the month.
  4058. The date must be valid.</doc>
  4059. <return-value transfer-ownership="none">
  4060. <doc xml:space="preserve">%TRUE if the date is the last day of the month</doc>
  4061. <type name="gboolean" c:type="gboolean"/>
  4062. </return-value>
  4063. <parameters>
  4064. <instance-parameter name="date" transfer-ownership="none">
  4065. <doc xml:space="preserve">a #GDate to check</doc>
  4066. <type name="Date" c:type="const GDate*"/>
  4067. </instance-parameter>
  4068. </parameters>
  4069. </method>
  4070. <method name="order" c:identifier="g_date_order">
  4071. <doc xml:space="preserve">Checks if @date1 is less than or equal to @date2,
  4072. and swap the values if this is not the case.</doc>
  4073. <return-value transfer-ownership="none">
  4074. <type name="none" c:type="void"/>
  4075. </return-value>
  4076. <parameters>
  4077. <instance-parameter name="date1" transfer-ownership="none">
  4078. <doc xml:space="preserve">the first date</doc>
  4079. <type name="Date" c:type="GDate*"/>
  4080. </instance-parameter>
  4081. <parameter name="date2" transfer-ownership="none">
  4082. <doc xml:space="preserve">the second date</doc>
  4083. <type name="Date" c:type="GDate*"/>
  4084. </parameter>
  4085. </parameters>
  4086. </method>
  4087. <method name="set_day" c:identifier="g_date_set_day">
  4088. <doc xml:space="preserve">Sets the day of the month for a #GDate. If the resulting
  4089. day-month-year triplet is invalid, the date will be invalid.</doc>
  4090. <return-value transfer-ownership="none">
  4091. <type name="none" c:type="void"/>
  4092. </return-value>
  4093. <parameters>
  4094. <instance-parameter name="date" transfer-ownership="none">
  4095. <doc xml:space="preserve">a #GDate</doc>
  4096. <type name="Date" c:type="GDate*"/>
  4097. </instance-parameter>
  4098. <parameter name="day" transfer-ownership="none">
  4099. <doc xml:space="preserve">day to set</doc>
  4100. <type name="DateDay" c:type="GDateDay"/>
  4101. </parameter>
  4102. </parameters>
  4103. </method>
  4104. <method name="set_dmy" c:identifier="g_date_set_dmy">
  4105. <doc xml:space="preserve">Sets the value of a #GDate from a day, month, and year.
  4106. The day-month-year triplet must be valid; if you aren't
  4107. sure it is, call g_date_valid_dmy() to check before you
  4108. set it.</doc>
  4109. <return-value transfer-ownership="none">
  4110. <type name="none" c:type="void"/>
  4111. </return-value>
  4112. <parameters>
  4113. <instance-parameter name="date" transfer-ownership="none">
  4114. <doc xml:space="preserve">a #GDate</doc>
  4115. <type name="Date" c:type="GDate*"/>
  4116. </instance-parameter>
  4117. <parameter name="day" transfer-ownership="none">
  4118. <doc xml:space="preserve">day</doc>
  4119. <type name="DateDay" c:type="GDateDay"/>
  4120. </parameter>
  4121. <parameter name="month" transfer-ownership="none">
  4122. <doc xml:space="preserve">month</doc>
  4123. <type name="DateMonth" c:type="GDateMonth"/>
  4124. </parameter>
  4125. <parameter name="y" transfer-ownership="none">
  4126. <doc xml:space="preserve">year</doc>
  4127. <type name="DateYear" c:type="GDateYear"/>
  4128. </parameter>
  4129. </parameters>
  4130. </method>
  4131. <method name="set_julian" c:identifier="g_date_set_julian">
  4132. <doc xml:space="preserve">Sets the value of a #GDate from a Julian day number.</doc>
  4133. <return-value transfer-ownership="none">
  4134. <type name="none" c:type="void"/>
  4135. </return-value>
  4136. <parameters>
  4137. <instance-parameter name="date" transfer-ownership="none">
  4138. <doc xml:space="preserve">a #GDate</doc>
  4139. <type name="Date" c:type="GDate*"/>
  4140. </instance-parameter>
  4141. <parameter name="julian_date" transfer-ownership="none">
  4142. <doc xml:space="preserve">Julian day number (days since January 1, Year 1)</doc>
  4143. <type name="guint32" c:type="guint32"/>
  4144. </parameter>
  4145. </parameters>
  4146. </method>
  4147. <method name="set_month" c:identifier="g_date_set_month">
  4148. <doc xml:space="preserve">Sets the month of the year for a #GDate. If the resulting
  4149. day-month-year triplet is invalid, the date will be invalid.</doc>
  4150. <return-value transfer-ownership="none">
  4151. <type name="none" c:type="void"/>
  4152. </return-value>
  4153. <parameters>
  4154. <instance-parameter name="date" transfer-ownership="none">
  4155. <doc xml:space="preserve">a #GDate</doc>
  4156. <type name="Date" c:type="GDate*"/>
  4157. </instance-parameter>
  4158. <parameter name="month" transfer-ownership="none">
  4159. <doc xml:space="preserve">month to set</doc>
  4160. <type name="DateMonth" c:type="GDateMonth"/>
  4161. </parameter>
  4162. </parameters>
  4163. </method>
  4164. <method name="set_parse" c:identifier="g_date_set_parse">
  4165. <doc xml:space="preserve">Parses a user-inputted string @str, and try to figure out what date it
  4166. represents, taking the [current locale][setlocale] into account. If the
  4167. string is successfully parsed, the date will be valid after the call.
  4168. Otherwise, it will be invalid. You should check using g_date_valid()
  4169. to see whether the parsing succeeded.
  4170. This function is not appropriate for file formats and the like; it
  4171. isn't very precise, and its exact behavior varies with the locale.
  4172. It's intended to be a heuristic routine that guesses what the user
  4173. means by a given string (and it does work pretty well in that
  4174. capacity).</doc>
  4175. <return-value transfer-ownership="none">
  4176. <type name="none" c:type="void"/>
  4177. </return-value>
  4178. <parameters>
  4179. <instance-parameter name="date" transfer-ownership="none">
  4180. <doc xml:space="preserve">a #GDate to fill in</doc>
  4181. <type name="Date" c:type="GDate*"/>
  4182. </instance-parameter>
  4183. <parameter name="str" transfer-ownership="none">
  4184. <doc xml:space="preserve">string to parse</doc>
  4185. <type name="utf8" c:type="const gchar*"/>
  4186. </parameter>
  4187. </parameters>
  4188. </method>
  4189. <method name="set_time"
  4190. c:identifier="g_date_set_time"
  4191. deprecated="1"
  4192. deprecated-version="2.10">
  4193. <doc xml:space="preserve">Sets the value of a date from a #GTime value.
  4194. The time to date conversion is done using the user's current timezone.</doc>
  4195. <doc-deprecated xml:space="preserve">Use g_date_set_time_t() instead.</doc-deprecated>
  4196. <return-value transfer-ownership="none">
  4197. <type name="none" c:type="void"/>
  4198. </return-value>
  4199. <parameters>
  4200. <instance-parameter name="date" transfer-ownership="none">
  4201. <doc xml:space="preserve">a #GDate.</doc>
  4202. <type name="Date" c:type="GDate*"/>
  4203. </instance-parameter>
  4204. <parameter name="time_" transfer-ownership="none">
  4205. <doc xml:space="preserve">#GTime value to set.</doc>
  4206. <type name="Time" c:type="GTime"/>
  4207. </parameter>
  4208. </parameters>
  4209. </method>
  4210. <method name="set_time_t"
  4211. c:identifier="g_date_set_time_t"
  4212. version="2.10">
  4213. <doc xml:space="preserve">Sets the value of a date to the date corresponding to a time
  4214. specified as a time_t. The time to date conversion is done using
  4215. the user's current timezone.
  4216. To set the value of a date to the current day, you could write:
  4217. |[&lt;!-- language="C" --&gt;
  4218. g_date_set_time_t (date, time (NULL));
  4219. ]|</doc>
  4220. <return-value transfer-ownership="none">
  4221. <type name="none" c:type="void"/>
  4222. </return-value>
  4223. <parameters>
  4224. <instance-parameter name="date" transfer-ownership="none">
  4225. <doc xml:space="preserve">a #GDate</doc>
  4226. <type name="Date" c:type="GDate*"/>
  4227. </instance-parameter>
  4228. <parameter name="timet" transfer-ownership="none">
  4229. <doc xml:space="preserve">time_t value to set</doc>
  4230. <type name="glong" c:type="time_t"/>
  4231. </parameter>
  4232. </parameters>
  4233. </method>
  4234. <method name="set_time_val"
  4235. c:identifier="g_date_set_time_val"
  4236. version="2.10">
  4237. <doc xml:space="preserve">Sets the value of a date from a #GTimeVal value. Note that the
  4238. @tv_usec member is ignored, because #GDate can't make use of the
  4239. additional precision.
  4240. The time to date conversion is done using the user's current timezone.</doc>
  4241. <return-value transfer-ownership="none">
  4242. <type name="none" c:type="void"/>
  4243. </return-value>
  4244. <parameters>
  4245. <instance-parameter name="date" transfer-ownership="none">
  4246. <doc xml:space="preserve">a #GDate</doc>
  4247. <type name="Date" c:type="GDate*"/>
  4248. </instance-parameter>
  4249. <parameter name="timeval" transfer-ownership="none">
  4250. <doc xml:space="preserve">#GTimeVal value to set</doc>
  4251. <type name="TimeVal" c:type="GTimeVal*"/>
  4252. </parameter>
  4253. </parameters>
  4254. </method>
  4255. <method name="set_year" c:identifier="g_date_set_year">
  4256. <doc xml:space="preserve">Sets the year for a #GDate. If the resulting day-month-year
  4257. triplet is invalid, the date will be invalid.</doc>
  4258. <return-value transfer-ownership="none">
  4259. <type name="none" c:type="void"/>
  4260. </return-value>
  4261. <parameters>
  4262. <instance-parameter name="date" transfer-ownership="none">
  4263. <doc xml:space="preserve">a #GDate</doc>
  4264. <type name="Date" c:type="GDate*"/>
  4265. </instance-parameter>
  4266. <parameter name="year" transfer-ownership="none">
  4267. <doc xml:space="preserve">year to set</doc>
  4268. <type name="DateYear" c:type="GDateYear"/>
  4269. </parameter>
  4270. </parameters>
  4271. </method>
  4272. <method name="subtract_days" c:identifier="g_date_subtract_days">
  4273. <doc xml:space="preserve">Moves a date some number of days into the past.
  4274. To move by weeks, just move by weeks*7 days.
  4275. The date must be valid.</doc>
  4276. <return-value transfer-ownership="none">
  4277. <type name="none" c:type="void"/>
  4278. </return-value>
  4279. <parameters>
  4280. <instance-parameter name="date" transfer-ownership="none">
  4281. <doc xml:space="preserve">a #GDate to decrement</doc>
  4282. <type name="Date" c:type="GDate*"/>
  4283. </instance-parameter>
  4284. <parameter name="n_days" transfer-ownership="none">
  4285. <doc xml:space="preserve">number of days to move</doc>
  4286. <type name="guint" c:type="guint"/>
  4287. </parameter>
  4288. </parameters>
  4289. </method>
  4290. <method name="subtract_months" c:identifier="g_date_subtract_months">
  4291. <doc xml:space="preserve">Moves a date some number of months into the past.
  4292. If the current day of the month doesn't exist in
  4293. the destination month, the day of the month
  4294. may change. The date must be valid.</doc>
  4295. <return-value transfer-ownership="none">
  4296. <type name="none" c:type="void"/>
  4297. </return-value>
  4298. <parameters>
  4299. <instance-parameter name="date" transfer-ownership="none">
  4300. <doc xml:space="preserve">a #GDate to decrement</doc>
  4301. <type name="Date" c:type="GDate*"/>
  4302. </instance-parameter>
  4303. <parameter name="n_months" transfer-ownership="none">
  4304. <doc xml:space="preserve">number of months to move</doc>
  4305. <type name="guint" c:type="guint"/>
  4306. </parameter>
  4307. </parameters>
  4308. </method>
  4309. <method name="subtract_years" c:identifier="g_date_subtract_years">
  4310. <doc xml:space="preserve">Moves a date some number of years into the past.
  4311. If the current day doesn't exist in the destination
  4312. year (i.e. it's February 29 and you move to a non-leap-year)
  4313. then the day is changed to February 29. The date
  4314. must be valid.</doc>
  4315. <return-value transfer-ownership="none">
  4316. <type name="none" c:type="void"/>
  4317. </return-value>
  4318. <parameters>
  4319. <instance-parameter name="date" transfer-ownership="none">
  4320. <doc xml:space="preserve">a #GDate to decrement</doc>
  4321. <type name="Date" c:type="GDate*"/>
  4322. </instance-parameter>
  4323. <parameter name="n_years" transfer-ownership="none">
  4324. <doc xml:space="preserve">number of years to move</doc>
  4325. <type name="guint" c:type="guint"/>
  4326. </parameter>
  4327. </parameters>
  4328. </method>
  4329. <method name="to_struct_tm" c:identifier="g_date_to_struct_tm">
  4330. <doc xml:space="preserve">Fills in the date-related bits of a struct tm using the @date value.
  4331. Initializes the non-date parts with something sane but meaningless.</doc>
  4332. <return-value transfer-ownership="none">
  4333. <type name="none" c:type="void"/>
  4334. </return-value>
  4335. <parameters>
  4336. <instance-parameter name="date" transfer-ownership="none">
  4337. <doc xml:space="preserve">a #GDate to set the struct tm from</doc>
  4338. <type name="Date" c:type="const GDate*"/>
  4339. </instance-parameter>
  4340. <parameter name="tm" transfer-ownership="none">
  4341. <doc xml:space="preserve">struct tm to fill</doc>
  4342. <type name="gpointer" c:type="tm*"/>
  4343. </parameter>
  4344. </parameters>
  4345. </method>
  4346. <method name="valid" c:identifier="g_date_valid">
  4347. <doc xml:space="preserve">Returns %TRUE if the #GDate represents an existing day. The date must not
  4348. contain garbage; it should have been initialized with g_date_clear()
  4349. if it wasn't allocated by one of the g_date_new() variants.</doc>
  4350. <return-value transfer-ownership="none">
  4351. <doc xml:space="preserve">Whether the date is valid</doc>
  4352. <type name="gboolean" c:type="gboolean"/>
  4353. </return-value>
  4354. <parameters>
  4355. <instance-parameter name="date" transfer-ownership="none">
  4356. <doc xml:space="preserve">a #GDate to check</doc>
  4357. <type name="Date" c:type="const GDate*"/>
  4358. </instance-parameter>
  4359. </parameters>
  4360. </method>
  4361. <function name="get_days_in_month"
  4362. c:identifier="g_date_get_days_in_month">
  4363. <doc xml:space="preserve">Returns the number of days in a month, taking leap
  4364. years into account.</doc>
  4365. <return-value transfer-ownership="none">
  4366. <doc xml:space="preserve">number of days in @month during the @year</doc>
  4367. <type name="guint8" c:type="guint8"/>
  4368. </return-value>
  4369. <parameters>
  4370. <parameter name="month" transfer-ownership="none">
  4371. <doc xml:space="preserve">month</doc>
  4372. <type name="DateMonth" c:type="GDateMonth"/>
  4373. </parameter>
  4374. <parameter name="year" transfer-ownership="none">
  4375. <doc xml:space="preserve">year</doc>
  4376. <type name="DateYear" c:type="GDateYear"/>
  4377. </parameter>
  4378. </parameters>
  4379. </function>
  4380. <function name="get_monday_weeks_in_year"
  4381. c:identifier="g_date_get_monday_weeks_in_year">
  4382. <doc xml:space="preserve">Returns the number of weeks in the year, where weeks
  4383. are taken to start on Monday. Will be 52 or 53. The
  4384. date must be valid. (Years always have 52 7-day periods,
  4385. plus 1 or 2 extra days depending on whether it's a leap
  4386. year. This function is basically telling you how many
  4387. Mondays are in the year, i.e. there are 53 Mondays if
  4388. one of the extra days happens to be a Monday.)</doc>
  4389. <return-value transfer-ownership="none">
  4390. <doc xml:space="preserve">number of Mondays in the year</doc>
  4391. <type name="guint8" c:type="guint8"/>
  4392. </return-value>
  4393. <parameters>
  4394. <parameter name="year" transfer-ownership="none">
  4395. <doc xml:space="preserve">a year</doc>
  4396. <type name="DateYear" c:type="GDateYear"/>
  4397. </parameter>
  4398. </parameters>
  4399. </function>
  4400. <function name="get_sunday_weeks_in_year"
  4401. c:identifier="g_date_get_sunday_weeks_in_year">
  4402. <doc xml:space="preserve">Returns the number of weeks in the year, where weeks
  4403. are taken to start on Sunday. Will be 52 or 53. The
  4404. date must be valid. (Years always have 52 7-day periods,
  4405. plus 1 or 2 extra days depending on whether it's a leap
  4406. year. This function is basically telling you how many
  4407. Sundays are in the year, i.e. there are 53 Sundays if
  4408. one of the extra days happens to be a Sunday.)</doc>
  4409. <return-value transfer-ownership="none">
  4410. <doc xml:space="preserve">the number of weeks in @year</doc>
  4411. <type name="guint8" c:type="guint8"/>
  4412. </return-value>
  4413. <parameters>
  4414. <parameter name="year" transfer-ownership="none">
  4415. <doc xml:space="preserve">year to count weeks in</doc>
  4416. <type name="DateYear" c:type="GDateYear"/>
  4417. </parameter>
  4418. </parameters>
  4419. </function>
  4420. <function name="is_leap_year" c:identifier="g_date_is_leap_year">
  4421. <doc xml:space="preserve">Returns %TRUE if the year is a leap year.
  4422. For the purposes of this function, leap year is every year
  4423. divisible by 4 unless that year is divisible by 100. If it
  4424. is divisible by 100 it would be a leap year only if that year
  4425. is also divisible by 400.</doc>
  4426. <return-value transfer-ownership="none">
  4427. <doc xml:space="preserve">%TRUE if the year is a leap year</doc>
  4428. <type name="gboolean" c:type="gboolean"/>
  4429. </return-value>
  4430. <parameters>
  4431. <parameter name="year" transfer-ownership="none">
  4432. <doc xml:space="preserve">year to check</doc>
  4433. <type name="DateYear" c:type="GDateYear"/>
  4434. </parameter>
  4435. </parameters>
  4436. </function>
  4437. <function name="strftime" c:identifier="g_date_strftime">
  4438. <doc xml:space="preserve">Generates a printed representation of the date, in a
  4439. [locale][setlocale]-specific way.
  4440. Works just like the platform's C library strftime() function,
  4441. but only accepts date-related formats; time-related formats
  4442. give undefined results. Date must be valid. Unlike strftime()
  4443. (which uses the locale encoding), works on a UTF-8 format
  4444. string and stores a UTF-8 result.
  4445. This function does not provide any conversion specifiers in
  4446. addition to those implemented by the platform's C library.
  4447. For example, don't expect that using g_date_strftime() would
  4448. make the \%F provided by the C99 strftime() work on Windows
  4449. where the C library only complies to C89.</doc>
  4450. <return-value transfer-ownership="none">
  4451. <doc xml:space="preserve">number of characters written to the buffer, or 0 the buffer was too small</doc>
  4452. <type name="gsize" c:type="gsize"/>
  4453. </return-value>
  4454. <parameters>
  4455. <parameter name="s" transfer-ownership="none">
  4456. <doc xml:space="preserve">destination buffer</doc>
  4457. <type name="utf8" c:type="gchar*"/>
  4458. </parameter>
  4459. <parameter name="slen" transfer-ownership="none">
  4460. <doc xml:space="preserve">buffer size</doc>
  4461. <type name="gsize" c:type="gsize"/>
  4462. </parameter>
  4463. <parameter name="format" transfer-ownership="none">
  4464. <doc xml:space="preserve">format string</doc>
  4465. <type name="utf8" c:type="const gchar*"/>
  4466. </parameter>
  4467. <parameter name="date" transfer-ownership="none">
  4468. <doc xml:space="preserve">valid #GDate</doc>
  4469. <type name="Date" c:type="const GDate*"/>
  4470. </parameter>
  4471. </parameters>
  4472. </function>
  4473. <function name="valid_day" c:identifier="g_date_valid_day">
  4474. <doc xml:space="preserve">Returns %TRUE if the day of the month is valid (a day is valid if it's
  4475. between 1 and 31 inclusive).</doc>
  4476. <return-value transfer-ownership="none">
  4477. <doc xml:space="preserve">%TRUE if the day is valid</doc>
  4478. <type name="gboolean" c:type="gboolean"/>
  4479. </return-value>
  4480. <parameters>
  4481. <parameter name="day" transfer-ownership="none">
  4482. <doc xml:space="preserve">day to check</doc>
  4483. <type name="DateDay" c:type="GDateDay"/>
  4484. </parameter>
  4485. </parameters>
  4486. </function>
  4487. <function name="valid_dmy" c:identifier="g_date_valid_dmy">
  4488. <doc xml:space="preserve">Returns %TRUE if the day-month-year triplet forms a valid, existing day
  4489. in the range of days #GDate understands (Year 1 or later, no more than
  4490. a few thousand years in the future).</doc>
  4491. <return-value transfer-ownership="none">
  4492. <doc xml:space="preserve">%TRUE if the date is a valid one</doc>
  4493. <type name="gboolean" c:type="gboolean"/>
  4494. </return-value>
  4495. <parameters>
  4496. <parameter name="day" transfer-ownership="none">
  4497. <doc xml:space="preserve">day</doc>
  4498. <type name="DateDay" c:type="GDateDay"/>
  4499. </parameter>
  4500. <parameter name="month" transfer-ownership="none">
  4501. <doc xml:space="preserve">month</doc>
  4502. <type name="DateMonth" c:type="GDateMonth"/>
  4503. </parameter>
  4504. <parameter name="year" transfer-ownership="none">
  4505. <doc xml:space="preserve">year</doc>
  4506. <type name="DateYear" c:type="GDateYear"/>
  4507. </parameter>
  4508. </parameters>
  4509. </function>
  4510. <function name="valid_julian" c:identifier="g_date_valid_julian">
  4511. <doc xml:space="preserve">Returns %TRUE if the Julian day is valid. Anything greater than zero
  4512. is basically a valid Julian, though there is a 32-bit limit.</doc>
  4513. <return-value transfer-ownership="none">
  4514. <doc xml:space="preserve">%TRUE if the Julian day is valid</doc>
  4515. <type name="gboolean" c:type="gboolean"/>
  4516. </return-value>
  4517. <parameters>
  4518. <parameter name="julian_date" transfer-ownership="none">
  4519. <doc xml:space="preserve">Julian day to check</doc>
  4520. <type name="guint32" c:type="guint32"/>
  4521. </parameter>
  4522. </parameters>
  4523. </function>
  4524. <function name="valid_month" c:identifier="g_date_valid_month">
  4525. <doc xml:space="preserve">Returns %TRUE if the month value is valid. The 12 #GDateMonth
  4526. enumeration values are the only valid months.</doc>
  4527. <return-value transfer-ownership="none">
  4528. <doc xml:space="preserve">%TRUE if the month is valid</doc>
  4529. <type name="gboolean" c:type="gboolean"/>
  4530. </return-value>
  4531. <parameters>
  4532. <parameter name="month" transfer-ownership="none">
  4533. <doc xml:space="preserve">month</doc>
  4534. <type name="DateMonth" c:type="GDateMonth"/>
  4535. </parameter>
  4536. </parameters>
  4537. </function>
  4538. <function name="valid_weekday" c:identifier="g_date_valid_weekday">
  4539. <doc xml:space="preserve">Returns %TRUE if the weekday is valid. The seven #GDateWeekday enumeration
  4540. values are the only valid weekdays.</doc>
  4541. <return-value transfer-ownership="none">
  4542. <doc xml:space="preserve">%TRUE if the weekday is valid</doc>
  4543. <type name="gboolean" c:type="gboolean"/>
  4544. </return-value>
  4545. <parameters>
  4546. <parameter name="weekday" transfer-ownership="none">
  4547. <doc xml:space="preserve">weekday</doc>
  4548. <type name="DateWeekday" c:type="GDateWeekday"/>
  4549. </parameter>
  4550. </parameters>
  4551. </function>
  4552. <function name="valid_year" c:identifier="g_date_valid_year">
  4553. <doc xml:space="preserve">Returns %TRUE if the year is valid. Any year greater than 0 is valid,
  4554. though there is a 16-bit limit to what #GDate will understand.</doc>
  4555. <return-value transfer-ownership="none">
  4556. <doc xml:space="preserve">%TRUE if the year is valid</doc>
  4557. <type name="gboolean" c:type="gboolean"/>
  4558. </return-value>
  4559. <parameters>
  4560. <parameter name="year" transfer-ownership="none">
  4561. <doc xml:space="preserve">year</doc>
  4562. <type name="DateYear" c:type="GDateYear"/>
  4563. </parameter>
  4564. </parameters>
  4565. </function>
  4566. </record>
  4567. <enumeration name="DateDMY" c:type="GDateDMY">
  4568. <doc xml:space="preserve">This enumeration isn't used in the API, but may be useful if you need
  4569. to mark a number as a day, month, or year.</doc>
  4570. <member name="day" value="0" c:identifier="G_DATE_DAY">
  4571. <doc xml:space="preserve">a day</doc>
  4572. </member>
  4573. <member name="month" value="1" c:identifier="G_DATE_MONTH">
  4574. <doc xml:space="preserve">a month</doc>
  4575. </member>
  4576. <member name="year" value="2" c:identifier="G_DATE_YEAR">
  4577. <doc xml:space="preserve">a year</doc>
  4578. </member>
  4579. </enumeration>
  4580. <enumeration name="DateMonth" c:type="GDateMonth">
  4581. <doc xml:space="preserve">Enumeration representing a month; values are #G_DATE_JANUARY,
  4582. #G_DATE_FEBRUARY, etc. #G_DATE_BAD_MONTH is the invalid value.</doc>
  4583. <member name="bad_month" value="0" c:identifier="G_DATE_BAD_MONTH">
  4584. <doc xml:space="preserve">invalid value</doc>
  4585. </member>
  4586. <member name="january" value="1" c:identifier="G_DATE_JANUARY">
  4587. <doc xml:space="preserve">January</doc>
  4588. </member>
  4589. <member name="february" value="2" c:identifier="G_DATE_FEBRUARY">
  4590. <doc xml:space="preserve">February</doc>
  4591. </member>
  4592. <member name="march" value="3" c:identifier="G_DATE_MARCH">
  4593. <doc xml:space="preserve">March</doc>
  4594. </member>
  4595. <member name="april" value="4" c:identifier="G_DATE_APRIL">
  4596. <doc xml:space="preserve">April</doc>
  4597. </member>
  4598. <member name="may" value="5" c:identifier="G_DATE_MAY">
  4599. <doc xml:space="preserve">May</doc>
  4600. </member>
  4601. <member name="june" value="6" c:identifier="G_DATE_JUNE">
  4602. <doc xml:space="preserve">June</doc>
  4603. </member>
  4604. <member name="july" value="7" c:identifier="G_DATE_JULY">
  4605. <doc xml:space="preserve">July</doc>
  4606. </member>
  4607. <member name="august" value="8" c:identifier="G_DATE_AUGUST">
  4608. <doc xml:space="preserve">August</doc>
  4609. </member>
  4610. <member name="september" value="9" c:identifier="G_DATE_SEPTEMBER">
  4611. <doc xml:space="preserve">September</doc>
  4612. </member>
  4613. <member name="october" value="10" c:identifier="G_DATE_OCTOBER">
  4614. <doc xml:space="preserve">October</doc>
  4615. </member>
  4616. <member name="november" value="11" c:identifier="G_DATE_NOVEMBER">
  4617. <doc xml:space="preserve">November</doc>
  4618. </member>
  4619. <member name="december" value="12" c:identifier="G_DATE_DECEMBER">
  4620. <doc xml:space="preserve">December</doc>
  4621. </member>
  4622. </enumeration>
  4623. <record name="DateTime"
  4624. c:type="GDateTime"
  4625. version="2.26"
  4626. glib:type-name="GDateTime"
  4627. glib:get-type="g_date_time_get_type"
  4628. c:symbol-prefix="date_time">
  4629. <doc xml:space="preserve">`GDateTime` is an opaque structure whose members
  4630. cannot be accessed directly.</doc>
  4631. <constructor name="new" c:identifier="g_date_time_new" version="2.26">
  4632. <doc xml:space="preserve">Creates a new #GDateTime corresponding to the given date and time in
  4633. the time zone @tz.
  4634. The @year must be between 1 and 9999, @month between 1 and 12 and @day
  4635. between 1 and 28, 29, 30 or 31 depending on the month and the year.
  4636. @hour must be between 0 and 23 and @minute must be between 0 and 59.
  4637. @seconds must be at least 0.0 and must be strictly less than 60.0.
  4638. It will be rounded down to the nearest microsecond.
  4639. If the given time is not representable in the given time zone (for
  4640. example, 02:30 on March 14th 2010 in Toronto, due to daylight savings
  4641. time) then the time will be rounded up to the nearest existing time
  4642. (in this case, 03:00). If this matters to you then you should verify
  4643. the return value for containing the same as the numbers you gave.
  4644. In the case that the given time is ambiguous in the given time zone
  4645. (for example, 01:30 on November 7th 2010 in Toronto, due to daylight
  4646. savings time) then the time falling within standard (ie:
  4647. non-daylight) time is taken.
  4648. It not considered a programmer error for the values to this function
  4649. to be out of range, but in the case that they are, the function will
  4650. return %NULL.
  4651. You should release the return value by calling g_date_time_unref()
  4652. when you are done with it.</doc>
  4653. <return-value transfer-ownership="full">
  4654. <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
  4655. <type name="DateTime" c:type="GDateTime*"/>
  4656. </return-value>
  4657. <parameters>
  4658. <parameter name="tz" transfer-ownership="none">
  4659. <doc xml:space="preserve">a #GTimeZone</doc>
  4660. <type name="TimeZone" c:type="GTimeZone*"/>
  4661. </parameter>
  4662. <parameter name="year" transfer-ownership="none">
  4663. <doc xml:space="preserve">the year component of the date</doc>
  4664. <type name="gint" c:type="gint"/>
  4665. </parameter>
  4666. <parameter name="month" transfer-ownership="none">
  4667. <doc xml:space="preserve">the month component of the date</doc>
  4668. <type name="gint" c:type="gint"/>
  4669. </parameter>
  4670. <parameter name="day" transfer-ownership="none">
  4671. <doc xml:space="preserve">the day component of the date</doc>
  4672. <type name="gint" c:type="gint"/>
  4673. </parameter>
  4674. <parameter name="hour" transfer-ownership="none">
  4675. <doc xml:space="preserve">the hour component of the date</doc>
  4676. <type name="gint" c:type="gint"/>
  4677. </parameter>
  4678. <parameter name="minute" transfer-ownership="none">
  4679. <doc xml:space="preserve">the minute component of the date</doc>
  4680. <type name="gint" c:type="gint"/>
  4681. </parameter>
  4682. <parameter name="seconds" transfer-ownership="none">
  4683. <doc xml:space="preserve">the number of seconds past the minute</doc>
  4684. <type name="gdouble" c:type="gdouble"/>
  4685. </parameter>
  4686. </parameters>
  4687. </constructor>
  4688. <constructor name="new_from_timeval_local"
  4689. c:identifier="g_date_time_new_from_timeval_local"
  4690. version="2.26">
  4691. <doc xml:space="preserve">Creates a #GDateTime corresponding to the given #GTimeVal @tv in the
  4692. local time zone.
  4693. The time contained in a #GTimeVal is always stored in the form of
  4694. seconds elapsed since 1970-01-01 00:00:00 UTC, regardless of the
  4695. local time offset.
  4696. This call can fail (returning %NULL) if @tv represents a time outside
  4697. of the supported range of #GDateTime.
  4698. You should release the return value by calling g_date_time_unref()
  4699. when you are done with it.</doc>
  4700. <return-value transfer-ownership="full">
  4701. <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
  4702. <type name="DateTime" c:type="GDateTime*"/>
  4703. </return-value>
  4704. <parameters>
  4705. <parameter name="tv" transfer-ownership="none">
  4706. <doc xml:space="preserve">a #GTimeVal</doc>
  4707. <type name="TimeVal" c:type="const GTimeVal*"/>
  4708. </parameter>
  4709. </parameters>
  4710. </constructor>
  4711. <constructor name="new_from_timeval_utc"
  4712. c:identifier="g_date_time_new_from_timeval_utc"
  4713. version="2.26">
  4714. <doc xml:space="preserve">Creates a #GDateTime corresponding to the given #GTimeVal @tv in UTC.
  4715. The time contained in a #GTimeVal is always stored in the form of
  4716. seconds elapsed since 1970-01-01 00:00:00 UTC.
  4717. This call can fail (returning %NULL) if @tv represents a time outside
  4718. of the supported range of #GDateTime.
  4719. You should release the return value by calling g_date_time_unref()
  4720. when you are done with it.</doc>
  4721. <return-value transfer-ownership="full">
  4722. <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
  4723. <type name="DateTime" c:type="GDateTime*"/>
  4724. </return-value>
  4725. <parameters>
  4726. <parameter name="tv" transfer-ownership="none">
  4727. <doc xml:space="preserve">a #GTimeVal</doc>
  4728. <type name="TimeVal" c:type="const GTimeVal*"/>
  4729. </parameter>
  4730. </parameters>
  4731. </constructor>
  4732. <constructor name="new_from_unix_local"
  4733. c:identifier="g_date_time_new_from_unix_local"
  4734. version="2.26">
  4735. <doc xml:space="preserve">Creates a #GDateTime corresponding to the given Unix time @t in the
  4736. local time zone.
  4737. Unix time is the number of seconds that have elapsed since 1970-01-01
  4738. 00:00:00 UTC, regardless of the local time offset.
  4739. This call can fail (returning %NULL) if @t represents a time outside
  4740. of the supported range of #GDateTime.
  4741. You should release the return value by calling g_date_time_unref()
  4742. when you are done with it.</doc>
  4743. <return-value transfer-ownership="full">
  4744. <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
  4745. <type name="DateTime" c:type="GDateTime*"/>
  4746. </return-value>
  4747. <parameters>
  4748. <parameter name="t" transfer-ownership="none">
  4749. <doc xml:space="preserve">the Unix time</doc>
  4750. <type name="gint64" c:type="gint64"/>
  4751. </parameter>
  4752. </parameters>
  4753. </constructor>
  4754. <constructor name="new_from_unix_utc"
  4755. c:identifier="g_date_time_new_from_unix_utc"
  4756. version="2.26">
  4757. <doc xml:space="preserve">Creates a #GDateTime corresponding to the given Unix time @t in UTC.
  4758. Unix time is the number of seconds that have elapsed since 1970-01-01
  4759. 00:00:00 UTC.
  4760. This call can fail (returning %NULL) if @t represents a time outside
  4761. of the supported range of #GDateTime.
  4762. You should release the return value by calling g_date_time_unref()
  4763. when you are done with it.</doc>
  4764. <return-value transfer-ownership="full">
  4765. <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
  4766. <type name="DateTime" c:type="GDateTime*"/>
  4767. </return-value>
  4768. <parameters>
  4769. <parameter name="t" transfer-ownership="none">
  4770. <doc xml:space="preserve">the Unix time</doc>
  4771. <type name="gint64" c:type="gint64"/>
  4772. </parameter>
  4773. </parameters>
  4774. </constructor>
  4775. <constructor name="new_local"
  4776. c:identifier="g_date_time_new_local"
  4777. version="2.26">
  4778. <doc xml:space="preserve">Creates a new #GDateTime corresponding to the given date and time in
  4779. the local time zone.
  4780. This call is equivalent to calling g_date_time_new() with the time
  4781. zone returned by g_time_zone_new_local().</doc>
  4782. <return-value transfer-ownership="full">
  4783. <doc xml:space="preserve">a #GDateTime, or %NULL</doc>
  4784. <type name="DateTime" c:type="GDateTime*"/>
  4785. </return-value>
  4786. <parameters>
  4787. <parameter name="year" transfer-ownership="none">
  4788. <doc xml:space="preserve">the year component of the date</doc>
  4789. <type name="gint" c:type="gint"/>
  4790. </parameter>
  4791. <parameter name="month" transfer-ownership="none">
  4792. <doc xml:space="preserve">the month component of the date</doc>
  4793. <type name="gint" c:type="gint"/>
  4794. </parameter>
  4795. <parameter name="day" transfer-ownership="none">
  4796. <doc xml:space="preserve">the day component of the date</doc>
  4797. <type name="gint" c:type="gint"/>
  4798. </parameter>
  4799. <parameter name="hour" transfer-ownership="none">
  4800. <doc xml:space="preserve">the hour component of the date</doc>
  4801. <type name="gint" c:type="gint"/>
  4802. </parameter>
  4803. <parameter name="minute" transfer-ownership="none">
  4804. <doc xml:space="preserve">the minute component of the date</doc>
  4805. <type name="gint" c:type="gint"/>
  4806. </parameter>
  4807. <parameter name="seconds" transfer-ownership="none">
  4808. <doc xml:space="preserve">the number of seconds past the minute</doc>
  4809. <type name="gdouble" c:type="gdouble"/>
  4810. </parameter>
  4811. </parameters>
  4812. </constructor>
  4813. <constructor name="new_now"
  4814. c:identifier="g_date_time_new_now"
  4815. version="2.26">
  4816. <doc xml:space="preserve">Creates a #GDateTime corresponding to this exact instant in the given
  4817. time zone @tz. The time is as accurate as the system allows, to a
  4818. maximum accuracy of 1 microsecond.
  4819. This function will always succeed unless the system clock is set to
  4820. truly insane values (or unless GLib is still being used after the
  4821. year 9999).
  4822. You should release the return value by calling g_date_time_unref()
  4823. when you are done with it.</doc>
  4824. <return-value transfer-ownership="full">
  4825. <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
  4826. <type name="DateTime" c:type="GDateTime*"/>
  4827. </return-value>
  4828. <parameters>
  4829. <parameter name="tz" transfer-ownership="none">
  4830. <doc xml:space="preserve">a #GTimeZone</doc>
  4831. <type name="TimeZone" c:type="GTimeZone*"/>
  4832. </parameter>
  4833. </parameters>
  4834. </constructor>
  4835. <constructor name="new_now_local"
  4836. c:identifier="g_date_time_new_now_local"
  4837. version="2.26">
  4838. <doc xml:space="preserve">Creates a #GDateTime corresponding to this exact instant in the local
  4839. time zone.
  4840. This is equivalent to calling g_date_time_new_now() with the time
  4841. zone returned by g_time_zone_new_local().</doc>
  4842. <return-value transfer-ownership="full">
  4843. <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
  4844. <type name="DateTime" c:type="GDateTime*"/>
  4845. </return-value>
  4846. </constructor>
  4847. <constructor name="new_now_utc"
  4848. c:identifier="g_date_time_new_now_utc"
  4849. version="2.26">
  4850. <doc xml:space="preserve">Creates a #GDateTime corresponding to this exact instant in UTC.
  4851. This is equivalent to calling g_date_time_new_now() with the time
  4852. zone returned by g_time_zone_new_utc().</doc>
  4853. <return-value transfer-ownership="full">
  4854. <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
  4855. <type name="DateTime" c:type="GDateTime*"/>
  4856. </return-value>
  4857. </constructor>
  4858. <constructor name="new_utc"
  4859. c:identifier="g_date_time_new_utc"
  4860. version="2.26">
  4861. <doc xml:space="preserve">Creates a new #GDateTime corresponding to the given date and time in
  4862. UTC.
  4863. This call is equivalent to calling g_date_time_new() with the time
  4864. zone returned by g_time_zone_new_utc().</doc>
  4865. <return-value transfer-ownership="full">
  4866. <doc xml:space="preserve">a #GDateTime, or %NULL</doc>
  4867. <type name="DateTime" c:type="GDateTime*"/>
  4868. </return-value>
  4869. <parameters>
  4870. <parameter name="year" transfer-ownership="none">
  4871. <doc xml:space="preserve">the year component of the date</doc>
  4872. <type name="gint" c:type="gint"/>
  4873. </parameter>
  4874. <parameter name="month" transfer-ownership="none">
  4875. <doc xml:space="preserve">the month component of the date</doc>
  4876. <type name="gint" c:type="gint"/>
  4877. </parameter>
  4878. <parameter name="day" transfer-ownership="none">
  4879. <doc xml:space="preserve">the day component of the date</doc>
  4880. <type name="gint" c:type="gint"/>
  4881. </parameter>
  4882. <parameter name="hour" transfer-ownership="none">
  4883. <doc xml:space="preserve">the hour component of the date</doc>
  4884. <type name="gint" c:type="gint"/>
  4885. </parameter>
  4886. <parameter name="minute" transfer-ownership="none">
  4887. <doc xml:space="preserve">the minute component of the date</doc>
  4888. <type name="gint" c:type="gint"/>
  4889. </parameter>
  4890. <parameter name="seconds" transfer-ownership="none">
  4891. <doc xml:space="preserve">the number of seconds past the minute</doc>
  4892. <type name="gdouble" c:type="gdouble"/>
  4893. </parameter>
  4894. </parameters>
  4895. </constructor>
  4896. <method name="add" c:identifier="g_date_time_add" version="2.26">
  4897. <doc xml:space="preserve">Creates a copy of @datetime and adds the specified timespan to the copy.</doc>
  4898. <return-value transfer-ownership="full">
  4899. <doc xml:space="preserve">the newly created #GDateTime which should be freed with
  4900. g_date_time_unref().</doc>
  4901. <type name="DateTime" c:type="GDateTime*"/>
  4902. </return-value>
  4903. <parameters>
  4904. <instance-parameter name="datetime" transfer-ownership="none">
  4905. <doc xml:space="preserve">a #GDateTime</doc>
  4906. <type name="DateTime" c:type="GDateTime*"/>
  4907. </instance-parameter>
  4908. <parameter name="timespan" transfer-ownership="none">
  4909. <doc xml:space="preserve">a #GTimeSpan</doc>
  4910. <type name="TimeSpan" c:type="GTimeSpan"/>
  4911. </parameter>
  4912. </parameters>
  4913. </method>
  4914. <method name="add_days"
  4915. c:identifier="g_date_time_add_days"
  4916. version="2.26">
  4917. <doc xml:space="preserve">Creates a copy of @datetime and adds the specified number of days to the
  4918. copy. Add negative values to subtract days.</doc>
  4919. <return-value transfer-ownership="full">
  4920. <doc xml:space="preserve">the newly created #GDateTime which should be freed with
  4921. g_date_time_unref().</doc>
  4922. <type name="DateTime" c:type="GDateTime*"/>
  4923. </return-value>
  4924. <parameters>
  4925. <instance-parameter name="datetime" transfer-ownership="none">
  4926. <doc xml:space="preserve">a #GDateTime</doc>
  4927. <type name="DateTime" c:type="GDateTime*"/>
  4928. </instance-parameter>
  4929. <parameter name="days" transfer-ownership="none">
  4930. <doc xml:space="preserve">the number of days</doc>
  4931. <type name="gint" c:type="gint"/>
  4932. </parameter>
  4933. </parameters>
  4934. </method>
  4935. <method name="add_full"
  4936. c:identifier="g_date_time_add_full"
  4937. version="2.26">
  4938. <doc xml:space="preserve">Creates a new #GDateTime adding the specified values to the current date and
  4939. time in @datetime. Add negative values to subtract.</doc>
  4940. <return-value transfer-ownership="full">
  4941. <doc xml:space="preserve">the newly created #GDateTime that should be freed with
  4942. g_date_time_unref().</doc>
  4943. <type name="DateTime" c:type="GDateTime*"/>
  4944. </return-value>
  4945. <parameters>
  4946. <instance-parameter name="datetime" transfer-ownership="none">
  4947. <doc xml:space="preserve">a #GDateTime</doc>
  4948. <type name="DateTime" c:type="GDateTime*"/>
  4949. </instance-parameter>
  4950. <parameter name="years" transfer-ownership="none">
  4951. <doc xml:space="preserve">the number of years to add</doc>
  4952. <type name="gint" c:type="gint"/>
  4953. </parameter>
  4954. <parameter name="months" transfer-ownership="none">
  4955. <doc xml:space="preserve">the number of months to add</doc>
  4956. <type name="gint" c:type="gint"/>
  4957. </parameter>
  4958. <parameter name="days" transfer-ownership="none">
  4959. <doc xml:space="preserve">the number of days to add</doc>
  4960. <type name="gint" c:type="gint"/>
  4961. </parameter>
  4962. <parameter name="hours" transfer-ownership="none">
  4963. <doc xml:space="preserve">the number of hours to add</doc>
  4964. <type name="gint" c:type="gint"/>
  4965. </parameter>
  4966. <parameter name="minutes" transfer-ownership="none">
  4967. <doc xml:space="preserve">the number of minutes to add</doc>
  4968. <type name="gint" c:type="gint"/>
  4969. </parameter>
  4970. <parameter name="seconds" transfer-ownership="none">
  4971. <doc xml:space="preserve">the number of seconds to add</doc>
  4972. <type name="gdouble" c:type="gdouble"/>
  4973. </parameter>
  4974. </parameters>
  4975. </method>
  4976. <method name="add_hours"
  4977. c:identifier="g_date_time_add_hours"
  4978. version="2.26">
  4979. <doc xml:space="preserve">Creates a copy of @datetime and adds the specified number of hours.
  4980. Add negative values to subtract hours.</doc>
  4981. <return-value transfer-ownership="full">
  4982. <doc xml:space="preserve">the newly created #GDateTime which should be freed with
  4983. g_date_time_unref().</doc>
  4984. <type name="DateTime" c:type="GDateTime*"/>
  4985. </return-value>
  4986. <parameters>
  4987. <instance-parameter name="datetime" transfer-ownership="none">
  4988. <doc xml:space="preserve">a #GDateTime</doc>
  4989. <type name="DateTime" c:type="GDateTime*"/>
  4990. </instance-parameter>
  4991. <parameter name="hours" transfer-ownership="none">
  4992. <doc xml:space="preserve">the number of hours to add</doc>
  4993. <type name="gint" c:type="gint"/>
  4994. </parameter>
  4995. </parameters>
  4996. </method>
  4997. <method name="add_minutes"
  4998. c:identifier="g_date_time_add_minutes"
  4999. version="2.26">
  5000. <doc xml:space="preserve">Creates a copy of @datetime adding the specified number of minutes.
  5001. Add negative values to subtract minutes.</doc>
  5002. <return-value transfer-ownership="full">
  5003. <doc xml:space="preserve">the newly created #GDateTime which should be freed with
  5004. g_date_time_unref().</doc>
  5005. <type name="DateTime" c:type="GDateTime*"/>
  5006. </return-value>
  5007. <parameters>
  5008. <instance-parameter name="datetime" transfer-ownership="none">
  5009. <doc xml:space="preserve">a #GDateTime</doc>
  5010. <type name="DateTime" c:type="GDateTime*"/>
  5011. </instance-parameter>
  5012. <parameter name="minutes" transfer-ownership="none">
  5013. <doc xml:space="preserve">the number of minutes to add</doc>
  5014. <type name="gint" c:type="gint"/>
  5015. </parameter>
  5016. </parameters>
  5017. </method>
  5018. <method name="add_months"
  5019. c:identifier="g_date_time_add_months"
  5020. version="2.26">
  5021. <doc xml:space="preserve">Creates a copy of @datetime and adds the specified number of months to the
  5022. copy. Add negative values to subtract months.</doc>
  5023. <return-value transfer-ownership="full">
  5024. <doc xml:space="preserve">the newly created #GDateTime which should be freed with
  5025. g_date_time_unref().</doc>
  5026. <type name="DateTime" c:type="GDateTime*"/>
  5027. </return-value>
  5028. <parameters>
  5029. <instance-parameter name="datetime" transfer-ownership="none">
  5030. <doc xml:space="preserve">a #GDateTime</doc>
  5031. <type name="DateTime" c:type="GDateTime*"/>
  5032. </instance-parameter>
  5033. <parameter name="months" transfer-ownership="none">
  5034. <doc xml:space="preserve">the number of months</doc>
  5035. <type name="gint" c:type="gint"/>
  5036. </parameter>
  5037. </parameters>
  5038. </method>
  5039. <method name="add_seconds"
  5040. c:identifier="g_date_time_add_seconds"
  5041. version="2.26">
  5042. <doc xml:space="preserve">Creates a copy of @datetime and adds the specified number of seconds.
  5043. Add negative values to subtract seconds.</doc>
  5044. <return-value transfer-ownership="full">
  5045. <doc xml:space="preserve">the newly created #GDateTime which should be freed with
  5046. g_date_time_unref().</doc>
  5047. <type name="DateTime" c:type="GDateTime*"/>
  5048. </return-value>
  5049. <parameters>
  5050. <instance-parameter name="datetime" transfer-ownership="none">
  5051. <doc xml:space="preserve">a #GDateTime</doc>
  5052. <type name="DateTime" c:type="GDateTime*"/>
  5053. </instance-parameter>
  5054. <parameter name="seconds" transfer-ownership="none">
  5055. <doc xml:space="preserve">the number of seconds to add</doc>
  5056. <type name="gdouble" c:type="gdouble"/>
  5057. </parameter>
  5058. </parameters>
  5059. </method>
  5060. <method name="add_weeks"
  5061. c:identifier="g_date_time_add_weeks"
  5062. version="2.26">
  5063. <doc xml:space="preserve">Creates a copy of @datetime and adds the specified number of weeks to the
  5064. copy. Add negative values to subtract weeks.</doc>
  5065. <return-value transfer-ownership="full">
  5066. <doc xml:space="preserve">the newly created #GDateTime which should be freed with
  5067. g_date_time_unref().</doc>
  5068. <type name="DateTime" c:type="GDateTime*"/>
  5069. </return-value>
  5070. <parameters>
  5071. <instance-parameter name="datetime" transfer-ownership="none">
  5072. <doc xml:space="preserve">a #GDateTime</doc>
  5073. <type name="DateTime" c:type="GDateTime*"/>
  5074. </instance-parameter>
  5075. <parameter name="weeks" transfer-ownership="none">
  5076. <doc xml:space="preserve">the number of weeks</doc>
  5077. <type name="gint" c:type="gint"/>
  5078. </parameter>
  5079. </parameters>
  5080. </method>
  5081. <method name="add_years"
  5082. c:identifier="g_date_time_add_years"
  5083. version="2.26">
  5084. <doc xml:space="preserve">Creates a copy of @datetime and adds the specified number of years to the
  5085. copy. Add negative values to subtract years.</doc>
  5086. <return-value transfer-ownership="full">
  5087. <doc xml:space="preserve">the newly created #GDateTime which should be freed with
  5088. g_date_time_unref().</doc>
  5089. <type name="DateTime" c:type="GDateTime*"/>
  5090. </return-value>
  5091. <parameters>
  5092. <instance-parameter name="datetime" transfer-ownership="none">
  5093. <doc xml:space="preserve">a #GDateTime</doc>
  5094. <type name="DateTime" c:type="GDateTime*"/>
  5095. </instance-parameter>
  5096. <parameter name="years" transfer-ownership="none">
  5097. <doc xml:space="preserve">the number of years</doc>
  5098. <type name="gint" c:type="gint"/>
  5099. </parameter>
  5100. </parameters>
  5101. </method>
  5102. <method name="difference"
  5103. c:identifier="g_date_time_difference"
  5104. version="2.26">
  5105. <doc xml:space="preserve">Calculates the difference in time between @end and @begin. The
  5106. #GTimeSpan that is returned is effectively @end - @begin (ie:
  5107. positive if the first parameter is larger).</doc>
  5108. <return-value transfer-ownership="none">
  5109. <doc xml:space="preserve">the difference between the two #GDateTime, as a time
  5110. span expressed in microseconds.</doc>
  5111. <type name="TimeSpan" c:type="GTimeSpan"/>
  5112. </return-value>
  5113. <parameters>
  5114. <instance-parameter name="end" transfer-ownership="none">
  5115. <doc xml:space="preserve">a #GDateTime</doc>
  5116. <type name="DateTime" c:type="GDateTime*"/>
  5117. </instance-parameter>
  5118. <parameter name="begin" transfer-ownership="none">
  5119. <doc xml:space="preserve">a #GDateTime</doc>
  5120. <type name="DateTime" c:type="GDateTime*"/>
  5121. </parameter>
  5122. </parameters>
  5123. </method>
  5124. <method name="format" c:identifier="g_date_time_format" version="2.26">
  5125. <doc xml:space="preserve">Creates a newly allocated string representing the requested @format.
  5126. The format strings understood by this function are a subset of the
  5127. strftime() format language as specified by C99. The \%D, \%U and \%W
  5128. conversions are not supported, nor is the 'E' modifier. The GNU
  5129. extensions \%k, \%l, \%s and \%P are supported, however, as are the
  5130. '0', '_' and '-' modifiers.
  5131. In contrast to strftime(), this function always produces a UTF-8
  5132. string, regardless of the current locale. Note that the rendering of
  5133. many formats is locale-dependent and may not match the strftime()
  5134. output exactly.
  5135. The following format specifiers are supported:
  5136. - \%a: the abbreviated weekday name according to the current locale
  5137. - \%A: the full weekday name according to the current locale
  5138. - \%b: the abbreviated month name according to the current locale
  5139. - \%B: the full month name according to the current locale
  5140. - \%c: the preferred date and time representation for the current locale
  5141. - \%C: the century number (year/100) as a 2-digit integer (00-99)
  5142. - \%d: the day of the month as a decimal number (range 01 to 31)
  5143. - \%e: the day of the month as a decimal number (range 1 to 31)
  5144. - \%F: equivalent to `%Y-%m-%d` (the ISO 8601 date format)
  5145. - \%g: the last two digits of the ISO 8601 week-based year as a
  5146. decimal number (00-99). This works well with \%V and \%u.
  5147. - \%G: the ISO 8601 week-based year as a decimal number. This works
  5148. well with \%V and \%u.
  5149. - \%h: equivalent to \%b
  5150. - \%H: the hour as a decimal number using a 24-hour clock (range 00 to 23)
  5151. - \%I: the hour as a decimal number using a 12-hour clock (range 01 to 12)
  5152. - \%j: the day of the year as a decimal number (range 001 to 366)
  5153. - \%k: the hour (24-hour clock) as a decimal number (range 0 to 23);
  5154. single digits are preceded by a blank
  5155. - \%l: the hour (12-hour clock) as a decimal number (range 1 to 12);
  5156. single digits are preceded by a blank
  5157. - \%m: the month as a decimal number (range 01 to 12)
  5158. - \%M: the minute as a decimal number (range 00 to 59)
  5159. - \%p: either "AM" or "PM" according to the given time value, or the
  5160. corresponding strings for the current locale. Noon is treated as
  5161. "PM" and midnight as "AM".
  5162. - \%P: like \%p but lowercase: "am" or "pm" or a corresponding string for
  5163. the current locale
  5164. - \%r: the time in a.m. or p.m. notation
  5165. - \%R: the time in 24-hour notation (\%H:\%M)
  5166. - \%s: the number of seconds since the Epoch, that is, since 1970-01-01
  5167. 00:00:00 UTC
  5168. - \%S: the second as a decimal number (range 00 to 60)
  5169. - \%t: a tab character
  5170. - \%T: the time in 24-hour notation with seconds (\%H:\%M:\%S)
  5171. - \%u: the ISO 8601 standard day of the week as a decimal, range 1 to 7,
  5172. Monday being 1. This works well with \%G and \%V.
  5173. - \%V: the ISO 8601 standard week number of the current year as a decimal
  5174. number, range 01 to 53, where week 1 is the first week that has at
  5175. least 4 days in the new year. See g_date_time_get_week_of_year().
  5176. This works well with \%G and \%u.
  5177. - \%w: the day of the week as a decimal, range 0 to 6, Sunday being 0.
  5178. This is not the ISO 8601 standard format -- use \%u instead.
  5179. - \%x: the preferred date representation for the current locale without
  5180. the time
  5181. - \%X: the preferred time representation for the current locale without
  5182. the date
  5183. - \%y: the year as a decimal number without the century
  5184. - \%Y: the year as a decimal number including the century
  5185. - \%z: the time zone as an offset from UTC (+hhmm)
  5186. - \%:z: the time zone as an offset from UTC (+hh:mm).
  5187. This is a gnulib strftime() extension. Since: 2.38
  5188. - \%::z: the time zone as an offset from UTC (+hh:mm:ss). This is a
  5189. gnulib strftime() extension. Since: 2.38
  5190. - \%:::z: the time zone as an offset from UTC, with : to necessary
  5191. precision (e.g., -04, +05:30). This is a gnulib strftime() extension. Since: 2.38
  5192. - \%Z: the time zone or name or abbreviation
  5193. - \%\%: a literal \% character
  5194. Some conversion specifications can be modified by preceding the
  5195. conversion specifier by one or more modifier characters. The
  5196. following modifiers are supported for many of the numeric
  5197. conversions:
  5198. - O: Use alternative numeric symbols, if the current locale supports those.
  5199. - _: Pad a numeric result with spaces. This overrides the default padding
  5200. for the specifier.
  5201. - -: Do not pad a numeric result. This overrides the default padding
  5202. for the specifier.
  5203. - 0: Pad a numeric result with zeros. This overrides the default padding
  5204. for the specifier.</doc>
  5205. <return-value transfer-ownership="full">
  5206. <doc xml:space="preserve">a newly allocated string formatted to the requested format
  5207. or %NULL in the case that there was an error. The string
  5208. should be freed with g_free().</doc>
  5209. <type name="utf8" c:type="gchar*"/>
  5210. </return-value>
  5211. <parameters>
  5212. <instance-parameter name="datetime" transfer-ownership="none">
  5213. <doc xml:space="preserve">A #GDateTime</doc>
  5214. <type name="DateTime" c:type="GDateTime*"/>
  5215. </instance-parameter>
  5216. <parameter name="format" transfer-ownership="none">
  5217. <doc xml:space="preserve">a valid UTF-8 string, containing the format for the
  5218. #GDateTime</doc>
  5219. <type name="utf8" c:type="const gchar*"/>
  5220. </parameter>
  5221. </parameters>
  5222. </method>
  5223. <method name="get_day_of_month"
  5224. c:identifier="g_date_time_get_day_of_month"
  5225. version="2.26">
  5226. <doc xml:space="preserve">Retrieves the day of the month represented by @datetime in the gregorian
  5227. calendar.</doc>
  5228. <return-value transfer-ownership="none">
  5229. <doc xml:space="preserve">the day of the month</doc>
  5230. <type name="gint" c:type="gint"/>
  5231. </return-value>
  5232. <parameters>
  5233. <instance-parameter name="datetime" transfer-ownership="none">
  5234. <doc xml:space="preserve">a #GDateTime</doc>
  5235. <type name="DateTime" c:type="GDateTime*"/>
  5236. </instance-parameter>
  5237. </parameters>
  5238. </method>
  5239. <method name="get_day_of_week"
  5240. c:identifier="g_date_time_get_day_of_week"
  5241. version="2.26">
  5242. <doc xml:space="preserve">Retrieves the ISO 8601 day of the week on which @datetime falls (1 is
  5243. Monday, 2 is Tuesday... 7 is Sunday).</doc>
  5244. <return-value transfer-ownership="none">
  5245. <doc xml:space="preserve">the day of the week</doc>
  5246. <type name="gint" c:type="gint"/>
  5247. </return-value>
  5248. <parameters>
  5249. <instance-parameter name="datetime" transfer-ownership="none">
  5250. <doc xml:space="preserve">a #GDateTime</doc>
  5251. <type name="DateTime" c:type="GDateTime*"/>
  5252. </instance-parameter>
  5253. </parameters>
  5254. </method>
  5255. <method name="get_day_of_year"
  5256. c:identifier="g_date_time_get_day_of_year"
  5257. version="2.26">
  5258. <doc xml:space="preserve">Retrieves the day of the year represented by @datetime in the Gregorian
  5259. calendar.</doc>
  5260. <return-value transfer-ownership="none">
  5261. <doc xml:space="preserve">the day of the year</doc>
  5262. <type name="gint" c:type="gint"/>
  5263. </return-value>
  5264. <parameters>
  5265. <instance-parameter name="datetime" transfer-ownership="none">
  5266. <doc xml:space="preserve">a #GDateTime</doc>
  5267. <type name="DateTime" c:type="GDateTime*"/>
  5268. </instance-parameter>
  5269. </parameters>
  5270. </method>
  5271. <method name="get_hour"
  5272. c:identifier="g_date_time_get_hour"
  5273. version="2.26">
  5274. <doc xml:space="preserve">Retrieves the hour of the day represented by @datetime</doc>
  5275. <return-value transfer-ownership="none">
  5276. <doc xml:space="preserve">the hour of the day</doc>
  5277. <type name="gint" c:type="gint"/>
  5278. </return-value>
  5279. <parameters>
  5280. <instance-parameter name="datetime" transfer-ownership="none">
  5281. <doc xml:space="preserve">a #GDateTime</doc>
  5282. <type name="DateTime" c:type="GDateTime*"/>
  5283. </instance-parameter>
  5284. </parameters>
  5285. </method>
  5286. <method name="get_microsecond"
  5287. c:identifier="g_date_time_get_microsecond"
  5288. version="2.26">
  5289. <doc xml:space="preserve">Retrieves the microsecond of the date represented by @datetime</doc>
  5290. <return-value transfer-ownership="none">
  5291. <doc xml:space="preserve">the microsecond of the second</doc>
  5292. <type name="gint" c:type="gint"/>
  5293. </return-value>
  5294. <parameters>
  5295. <instance-parameter name="datetime" transfer-ownership="none">
  5296. <doc xml:space="preserve">a #GDateTime</doc>
  5297. <type name="DateTime" c:type="GDateTime*"/>
  5298. </instance-parameter>
  5299. </parameters>
  5300. </method>
  5301. <method name="get_minute"
  5302. c:identifier="g_date_time_get_minute"
  5303. version="2.26">
  5304. <doc xml:space="preserve">Retrieves the minute of the hour represented by @datetime</doc>
  5305. <return-value transfer-ownership="none">
  5306. <doc xml:space="preserve">the minute of the hour</doc>
  5307. <type name="gint" c:type="gint"/>
  5308. </return-value>
  5309. <parameters>
  5310. <instance-parameter name="datetime" transfer-ownership="none">
  5311. <doc xml:space="preserve">a #GDateTime</doc>
  5312. <type name="DateTime" c:type="GDateTime*"/>
  5313. </instance-parameter>
  5314. </parameters>
  5315. </method>
  5316. <method name="get_month"
  5317. c:identifier="g_date_time_get_month"
  5318. version="2.26">
  5319. <doc xml:space="preserve">Retrieves the month of the year represented by @datetime in the Gregorian
  5320. calendar.</doc>
  5321. <return-value transfer-ownership="none">
  5322. <doc xml:space="preserve">the month represented by @datetime</doc>
  5323. <type name="gint" c:type="gint"/>
  5324. </return-value>
  5325. <parameters>
  5326. <instance-parameter name="datetime" transfer-ownership="none">
  5327. <doc xml:space="preserve">a #GDateTime</doc>
  5328. <type name="DateTime" c:type="GDateTime*"/>
  5329. </instance-parameter>
  5330. </parameters>
  5331. </method>
  5332. <method name="get_second"
  5333. c:identifier="g_date_time_get_second"
  5334. version="2.26">
  5335. <doc xml:space="preserve">Retrieves the second of the minute represented by @datetime</doc>
  5336. <return-value transfer-ownership="none">
  5337. <doc xml:space="preserve">the second represented by @datetime</doc>
  5338. <type name="gint" c:type="gint"/>
  5339. </return-value>
  5340. <parameters>
  5341. <instance-parameter name="datetime" transfer-ownership="none">
  5342. <doc xml:space="preserve">a #GDateTime</doc>
  5343. <type name="DateTime" c:type="GDateTime*"/>
  5344. </instance-parameter>
  5345. </parameters>
  5346. </method>
  5347. <method name="get_seconds"
  5348. c:identifier="g_date_time_get_seconds"
  5349. version="2.26">
  5350. <doc xml:space="preserve">Retrieves the number of seconds since the start of the last minute,
  5351. including the fractional part.</doc>
  5352. <return-value transfer-ownership="none">
  5353. <doc xml:space="preserve">the number of seconds</doc>
  5354. <type name="gdouble" c:type="gdouble"/>
  5355. </return-value>
  5356. <parameters>
  5357. <instance-parameter name="datetime" transfer-ownership="none">
  5358. <doc xml:space="preserve">a #GDateTime</doc>
  5359. <type name="DateTime" c:type="GDateTime*"/>
  5360. </instance-parameter>
  5361. </parameters>
  5362. </method>
  5363. <method name="get_timezone_abbreviation"
  5364. c:identifier="g_date_time_get_timezone_abbreviation"
  5365. version="2.26">
  5366. <doc xml:space="preserve">Determines the time zone abbreviation to be used at the time and in
  5367. the time zone of @datetime.
  5368. For example, in Toronto this is currently "EST" during the winter
  5369. months and "EDT" during the summer months when daylight savings
  5370. time is in effect.</doc>
  5371. <return-value transfer-ownership="none">
  5372. <doc xml:space="preserve">the time zone abbreviation. The returned
  5373. string is owned by the #GDateTime and it should not be
  5374. modified or freed</doc>
  5375. <type name="utf8" c:type="const gchar*"/>
  5376. </return-value>
  5377. <parameters>
  5378. <instance-parameter name="datetime" transfer-ownership="none">
  5379. <doc xml:space="preserve">a #GDateTime</doc>
  5380. <type name="DateTime" c:type="GDateTime*"/>
  5381. </instance-parameter>
  5382. </parameters>
  5383. </method>
  5384. <method name="get_utc_offset"
  5385. c:identifier="g_date_time_get_utc_offset"
  5386. version="2.26">
  5387. <doc xml:space="preserve">Determines the offset to UTC in effect at the time and in the time
  5388. zone of @datetime.
  5389. The offset is the number of microseconds that you add to UTC time to
  5390. arrive at local time for the time zone (ie: negative numbers for time
  5391. zones west of GMT, positive numbers for east).
  5392. If @datetime represents UTC time, then the offset is always zero.</doc>
  5393. <return-value transfer-ownership="none">
  5394. <doc xml:space="preserve">the number of microseconds that should be added to UTC to
  5395. get the local time</doc>
  5396. <type name="TimeSpan" c:type="GTimeSpan"/>
  5397. </return-value>
  5398. <parameters>
  5399. <instance-parameter name="datetime" transfer-ownership="none">
  5400. <doc xml:space="preserve">a #GDateTime</doc>
  5401. <type name="DateTime" c:type="GDateTime*"/>
  5402. </instance-parameter>
  5403. </parameters>
  5404. </method>
  5405. <method name="get_week_numbering_year"
  5406. c:identifier="g_date_time_get_week_numbering_year"
  5407. version="2.26">
  5408. <doc xml:space="preserve">Returns the ISO 8601 week-numbering year in which the week containing
  5409. @datetime falls.
  5410. This function, taken together with g_date_time_get_week_of_year() and
  5411. g_date_time_get_day_of_week() can be used to determine the full ISO
  5412. week date on which @datetime falls.
  5413. This is usually equal to the normal Gregorian year (as returned by
  5414. g_date_time_get_year()), except as detailed below:
  5415. For Thursday, the week-numbering year is always equal to the usual
  5416. calendar year. For other days, the number is such that every day
  5417. within a complete week (Monday to Sunday) is contained within the
  5418. same week-numbering year.
  5419. For Monday, Tuesday and Wednesday occurring near the end of the year,
  5420. this may mean that the week-numbering year is one greater than the
  5421. calendar year (so that these days have the same week-numbering year
  5422. as the Thursday occurring early in the next year).
  5423. For Friday, Saturday and Sunday occurring near the start of the year,
  5424. this may mean that the week-numbering year is one less than the
  5425. calendar year (so that these days have the same week-numbering year
  5426. as the Thursday occurring late in the previous year).
  5427. An equivalent description is that the week-numbering year is equal to
  5428. the calendar year containing the majority of the days in the current
  5429. week (Monday to Sunday).
  5430. Note that January 1 0001 in the proleptic Gregorian calendar is a
  5431. Monday, so this function never returns 0.</doc>
  5432. <return-value transfer-ownership="none">
  5433. <doc xml:space="preserve">the ISO 8601 week-numbering year for @datetime</doc>
  5434. <type name="gint" c:type="gint"/>
  5435. </return-value>
  5436. <parameters>
  5437. <instance-parameter name="datetime" transfer-ownership="none">
  5438. <doc xml:space="preserve">a #GDateTime</doc>
  5439. <type name="DateTime" c:type="GDateTime*"/>
  5440. </instance-parameter>
  5441. </parameters>
  5442. </method>
  5443. <method name="get_week_of_year"
  5444. c:identifier="g_date_time_get_week_of_year"
  5445. version="2.26">
  5446. <doc xml:space="preserve">Returns the ISO 8601 week number for the week containing @datetime.
  5447. The ISO 8601 week number is the same for every day of the week (from
  5448. Moday through Sunday). That can produce some unusual results
  5449. (described below).
  5450. The first week of the year is week 1. This is the week that contains
  5451. the first Thursday of the year. Equivalently, this is the first week
  5452. that has more than 4 of its days falling within the calendar year.
  5453. The value 0 is never returned by this function. Days contained
  5454. within a year but occurring before the first ISO 8601 week of that
  5455. year are considered as being contained in the last week of the
  5456. previous year. Similarly, the final days of a calendar year may be
  5457. considered as being part of the first ISO 8601 week of the next year
  5458. if 4 or more days of that week are contained within the new year.</doc>
  5459. <return-value transfer-ownership="none">
  5460. <doc xml:space="preserve">the ISO 8601 week number for @datetime.</doc>
  5461. <type name="gint" c:type="gint"/>
  5462. </return-value>
  5463. <parameters>
  5464. <instance-parameter name="datetime" transfer-ownership="none">
  5465. <doc xml:space="preserve">a #GDateTime</doc>
  5466. <type name="DateTime" c:type="GDateTime*"/>
  5467. </instance-parameter>
  5468. </parameters>
  5469. </method>
  5470. <method name="get_year"
  5471. c:identifier="g_date_time_get_year"
  5472. version="2.26">
  5473. <doc xml:space="preserve">Retrieves the year represented by @datetime in the Gregorian calendar.</doc>
  5474. <return-value transfer-ownership="none">
  5475. <doc xml:space="preserve">the year represented by @datetime</doc>
  5476. <type name="gint" c:type="gint"/>
  5477. </return-value>
  5478. <parameters>
  5479. <instance-parameter name="datetime" transfer-ownership="none">
  5480. <doc xml:space="preserve">A #GDateTime</doc>
  5481. <type name="DateTime" c:type="GDateTime*"/>
  5482. </instance-parameter>
  5483. </parameters>
  5484. </method>
  5485. <method name="get_ymd" c:identifier="g_date_time_get_ymd" version="2.26">
  5486. <doc xml:space="preserve">Retrieves the Gregorian day, month, and year of a given #GDateTime.</doc>
  5487. <return-value transfer-ownership="none">
  5488. <type name="none" c:type="void"/>
  5489. </return-value>
  5490. <parameters>
  5491. <instance-parameter name="datetime" transfer-ownership="none">
  5492. <doc xml:space="preserve">a #GDateTime.</doc>
  5493. <type name="DateTime" c:type="GDateTime*"/>
  5494. </instance-parameter>
  5495. <parameter name="year"
  5496. direction="out"
  5497. caller-allocates="0"
  5498. transfer-ownership="full"
  5499. optional="1"
  5500. allow-none="1">
  5501. <doc xml:space="preserve">the return location for the gregorian year, or %NULL.</doc>
  5502. <type name="gint" c:type="gint*"/>
  5503. </parameter>
  5504. <parameter name="month"
  5505. direction="out"
  5506. caller-allocates="0"
  5507. transfer-ownership="full"
  5508. optional="1"
  5509. allow-none="1">
  5510. <doc xml:space="preserve">the return location for the month of the year, or %NULL.</doc>
  5511. <type name="gint" c:type="gint*"/>
  5512. </parameter>
  5513. <parameter name="day"
  5514. direction="out"
  5515. caller-allocates="0"
  5516. transfer-ownership="full"
  5517. optional="1"
  5518. allow-none="1">
  5519. <doc xml:space="preserve">the return location for the day of the month, or %NULL.</doc>
  5520. <type name="gint" c:type="gint*"/>
  5521. </parameter>
  5522. </parameters>
  5523. </method>
  5524. <method name="is_daylight_savings"
  5525. c:identifier="g_date_time_is_daylight_savings"
  5526. version="2.26">
  5527. <doc xml:space="preserve">Determines if daylight savings time is in effect at the time and in
  5528. the time zone of @datetime.</doc>
  5529. <return-value transfer-ownership="none">
  5530. <doc xml:space="preserve">%TRUE if daylight savings time is in effect</doc>
  5531. <type name="gboolean" c:type="gboolean"/>
  5532. </return-value>
  5533. <parameters>
  5534. <instance-parameter name="datetime" transfer-ownership="none">
  5535. <doc xml:space="preserve">a #GDateTime</doc>
  5536. <type name="DateTime" c:type="GDateTime*"/>
  5537. </instance-parameter>
  5538. </parameters>
  5539. </method>
  5540. <method name="ref" c:identifier="g_date_time_ref" version="2.26">
  5541. <doc xml:space="preserve">Atomically increments the reference count of @datetime by one.</doc>
  5542. <return-value transfer-ownership="full">
  5543. <doc xml:space="preserve">the #GDateTime with the reference count increased</doc>
  5544. <type name="DateTime" c:type="GDateTime*"/>
  5545. </return-value>
  5546. <parameters>
  5547. <instance-parameter name="datetime" transfer-ownership="none">
  5548. <doc xml:space="preserve">a #GDateTime</doc>
  5549. <type name="DateTime" c:type="GDateTime*"/>
  5550. </instance-parameter>
  5551. </parameters>
  5552. </method>
  5553. <method name="to_local"
  5554. c:identifier="g_date_time_to_local"
  5555. version="2.26">
  5556. <doc xml:space="preserve">Creates a new #GDateTime corresponding to the same instant in time as
  5557. @datetime, but in the local time zone.
  5558. This call is equivalent to calling g_date_time_to_timezone() with the
  5559. time zone returned by g_time_zone_new_local().</doc>
  5560. <return-value transfer-ownership="full">
  5561. <doc xml:space="preserve">the newly created #GDateTime</doc>
  5562. <type name="DateTime" c:type="GDateTime*"/>
  5563. </return-value>
  5564. <parameters>
  5565. <instance-parameter name="datetime" transfer-ownership="none">
  5566. <doc xml:space="preserve">a #GDateTime</doc>
  5567. <type name="DateTime" c:type="GDateTime*"/>
  5568. </instance-parameter>
  5569. </parameters>
  5570. </method>
  5571. <method name="to_timeval"
  5572. c:identifier="g_date_time_to_timeval"
  5573. version="2.26">
  5574. <doc xml:space="preserve">Stores the instant in time that @datetime represents into @tv.
  5575. The time contained in a #GTimeVal is always stored in the form of
  5576. seconds elapsed since 1970-01-01 00:00:00 UTC, regardless of the time
  5577. zone associated with @datetime.
  5578. On systems where 'long' is 32bit (ie: all 32bit systems and all
  5579. Windows systems), a #GTimeVal is incapable of storing the entire
  5580. range of values that #GDateTime is capable of expressing. On those
  5581. systems, this function returns %FALSE to indicate that the time is
  5582. out of range.
  5583. On systems where 'long' is 64bit, this function never fails.</doc>
  5584. <return-value transfer-ownership="none">
  5585. <doc xml:space="preserve">%TRUE if successful, else %FALSE</doc>
  5586. <type name="gboolean" c:type="gboolean"/>
  5587. </return-value>
  5588. <parameters>
  5589. <instance-parameter name="datetime" transfer-ownership="none">
  5590. <doc xml:space="preserve">a #GDateTime</doc>
  5591. <type name="DateTime" c:type="GDateTime*"/>
  5592. </instance-parameter>
  5593. <parameter name="tv" transfer-ownership="none">
  5594. <doc xml:space="preserve">a #GTimeVal to modify</doc>
  5595. <type name="TimeVal" c:type="GTimeVal*"/>
  5596. </parameter>
  5597. </parameters>
  5598. </method>
  5599. <method name="to_timezone"
  5600. c:identifier="g_date_time_to_timezone"
  5601. version="2.26">
  5602. <doc xml:space="preserve">Create a new #GDateTime corresponding to the same instant in time as
  5603. @datetime, but in the time zone @tz.
  5604. This call can fail in the case that the time goes out of bounds. For
  5605. example, converting 0001-01-01 00:00:00 UTC to a time zone west of
  5606. Greenwich will fail (due to the year 0 being out of range).
  5607. You should release the return value by calling g_date_time_unref()
  5608. when you are done with it.</doc>
  5609. <return-value transfer-ownership="full">
  5610. <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
  5611. <type name="DateTime" c:type="GDateTime*"/>
  5612. </return-value>
  5613. <parameters>
  5614. <instance-parameter name="datetime" transfer-ownership="none">
  5615. <doc xml:space="preserve">a #GDateTime</doc>
  5616. <type name="DateTime" c:type="GDateTime*"/>
  5617. </instance-parameter>
  5618. <parameter name="tz" transfer-ownership="none">
  5619. <doc xml:space="preserve">the new #GTimeZone</doc>
  5620. <type name="TimeZone" c:type="GTimeZone*"/>
  5621. </parameter>
  5622. </parameters>
  5623. </method>
  5624. <method name="to_unix" c:identifier="g_date_time_to_unix" version="2.26">
  5625. <doc xml:space="preserve">Gives the Unix time corresponding to @datetime, rounding down to the
  5626. nearest second.
  5627. Unix time is the number of seconds that have elapsed since 1970-01-01
  5628. 00:00:00 UTC, regardless of the time zone associated with @datetime.</doc>
  5629. <return-value transfer-ownership="none">
  5630. <doc xml:space="preserve">the Unix time corresponding to @datetime</doc>
  5631. <type name="gint64" c:type="gint64"/>
  5632. </return-value>
  5633. <parameters>
  5634. <instance-parameter name="datetime" transfer-ownership="none">
  5635. <doc xml:space="preserve">a #GDateTime</doc>
  5636. <type name="DateTime" c:type="GDateTime*"/>
  5637. </instance-parameter>
  5638. </parameters>
  5639. </method>
  5640. <method name="to_utc" c:identifier="g_date_time_to_utc" version="2.26">
  5641. <doc xml:space="preserve">Creates a new #GDateTime corresponding to the same instant in time as
  5642. @datetime, but in UTC.
  5643. This call is equivalent to calling g_date_time_to_timezone() with the
  5644. time zone returned by g_time_zone_new_utc().</doc>
  5645. <return-value transfer-ownership="full">
  5646. <doc xml:space="preserve">the newly created #GDateTime</doc>
  5647. <type name="DateTime" c:type="GDateTime*"/>
  5648. </return-value>
  5649. <parameters>
  5650. <instance-parameter name="datetime" transfer-ownership="none">
  5651. <doc xml:space="preserve">a #GDateTime</doc>
  5652. <type name="DateTime" c:type="GDateTime*"/>
  5653. </instance-parameter>
  5654. </parameters>
  5655. </method>
  5656. <method name="unref" c:identifier="g_date_time_unref" version="2.26">
  5657. <doc xml:space="preserve">Atomically decrements the reference count of @datetime by one.
  5658. When the reference count reaches zero, the resources allocated by
  5659. @datetime are freed</doc>
  5660. <return-value transfer-ownership="none">
  5661. <type name="none" c:type="void"/>
  5662. </return-value>
  5663. <parameters>
  5664. <instance-parameter name="datetime" transfer-ownership="none">
  5665. <doc xml:space="preserve">a #GDateTime</doc>
  5666. <type name="DateTime" c:type="GDateTime*"/>
  5667. </instance-parameter>
  5668. </parameters>
  5669. </method>
  5670. <function name="compare"
  5671. c:identifier="g_date_time_compare"
  5672. version="2.26">
  5673. <doc xml:space="preserve">A comparison function for #GDateTimes that is suitable
  5674. as a #GCompareFunc. Both #GDateTimes must be non-%NULL.</doc>
  5675. <return-value transfer-ownership="none">
  5676. <doc xml:space="preserve">-1, 0 or 1 if @dt1 is less than, equal to or greater
  5677. than @dt2.</doc>
  5678. <type name="gint" c:type="gint"/>
  5679. </return-value>
  5680. <parameters>
  5681. <parameter name="dt1" transfer-ownership="none">
  5682. <doc xml:space="preserve">first #GDateTime to compare</doc>
  5683. <type name="gpointer" c:type="gconstpointer"/>
  5684. </parameter>
  5685. <parameter name="dt2" transfer-ownership="none">
  5686. <doc xml:space="preserve">second #GDateTime to compare</doc>
  5687. <type name="gpointer" c:type="gconstpointer"/>
  5688. </parameter>
  5689. </parameters>
  5690. </function>
  5691. <function name="equal" c:identifier="g_date_time_equal" version="2.26">
  5692. <doc xml:space="preserve">Checks to see if @dt1 and @dt2 are equal.
  5693. Equal here means that they represent the same moment after converting
  5694. them to the same time zone.</doc>
  5695. <return-value transfer-ownership="none">
  5696. <doc xml:space="preserve">%TRUE if @dt1 and @dt2 are equal</doc>
  5697. <type name="gboolean" c:type="gboolean"/>
  5698. </return-value>
  5699. <parameters>
  5700. <parameter name="dt1" transfer-ownership="none">
  5701. <doc xml:space="preserve">a #GDateTime</doc>
  5702. <type name="gpointer" c:type="gconstpointer"/>
  5703. </parameter>
  5704. <parameter name="dt2" transfer-ownership="none">
  5705. <doc xml:space="preserve">a #GDateTime</doc>
  5706. <type name="gpointer" c:type="gconstpointer"/>
  5707. </parameter>
  5708. </parameters>
  5709. </function>
  5710. <function name="hash" c:identifier="g_date_time_hash" version="2.26">
  5711. <doc xml:space="preserve">Hashes @datetime into a #guint, suitable for use within #GHashTable.</doc>
  5712. <return-value transfer-ownership="none">
  5713. <doc xml:space="preserve">a #guint containing the hash</doc>
  5714. <type name="guint" c:type="guint"/>
  5715. </return-value>
  5716. <parameters>
  5717. <parameter name="datetime" transfer-ownership="none">
  5718. <doc xml:space="preserve">a #GDateTime</doc>
  5719. <type name="gpointer" c:type="gconstpointer"/>
  5720. </parameter>
  5721. </parameters>
  5722. </function>
  5723. </record>
  5724. <enumeration name="DateWeekday" c:type="GDateWeekday">
  5725. <doc xml:space="preserve">Enumeration representing a day of the week; #G_DATE_MONDAY,
  5726. #G_DATE_TUESDAY, etc. #G_DATE_BAD_WEEKDAY is an invalid weekday.</doc>
  5727. <member name="bad_weekday" value="0" c:identifier="G_DATE_BAD_WEEKDAY">
  5728. <doc xml:space="preserve">invalid value</doc>
  5729. </member>
  5730. <member name="monday" value="1" c:identifier="G_DATE_MONDAY">
  5731. <doc xml:space="preserve">Monday</doc>
  5732. </member>
  5733. <member name="tuesday" value="2" c:identifier="G_DATE_TUESDAY">
  5734. <doc xml:space="preserve">Tuesday</doc>
  5735. </member>
  5736. <member name="wednesday" value="3" c:identifier="G_DATE_WEDNESDAY">
  5737. <doc xml:space="preserve">Wednesday</doc>
  5738. </member>
  5739. <member name="thursday" value="4" c:identifier="G_DATE_THURSDAY">
  5740. <doc xml:space="preserve">Thursday</doc>
  5741. </member>
  5742. <member name="friday" value="5" c:identifier="G_DATE_FRIDAY">
  5743. <doc xml:space="preserve">Friday</doc>
  5744. </member>
  5745. <member name="saturday" value="6" c:identifier="G_DATE_SATURDAY">
  5746. <doc xml:space="preserve">Saturday</doc>
  5747. </member>
  5748. <member name="sunday" value="7" c:identifier="G_DATE_SUNDAY">
  5749. <doc xml:space="preserve">Sunday</doc>
  5750. </member>
  5751. </enumeration>
  5752. <record name="DebugKey" c:type="GDebugKey">
  5753. <doc xml:space="preserve">Associates a string with a bit flag.
  5754. Used in g_parse_debug_string().</doc>
  5755. <field name="key" writable="1">
  5756. <doc xml:space="preserve">the string</doc>
  5757. <type name="utf8" c:type="const gchar*"/>
  5758. </field>
  5759. <field name="value" writable="1">
  5760. <doc xml:space="preserve">the flag</doc>
  5761. <type name="guint" c:type="guint"/>
  5762. </field>
  5763. </record>
  5764. <callback name="DestroyNotify" c:type="GDestroyNotify">
  5765. <doc xml:space="preserve">Specifies the type of function which is called when a data element
  5766. is destroyed. It is passed the pointer to the data element and
  5767. should free any memory and resources allocated for it.</doc>
  5768. <return-value transfer-ownership="none">
  5769. <type name="none" c:type="void"/>
  5770. </return-value>
  5771. <parameters>
  5772. <parameter name="data"
  5773. transfer-ownership="none"
  5774. nullable="1"
  5775. allow-none="1">
  5776. <doc xml:space="preserve">the data element.</doc>
  5777. <type name="gpointer" c:type="gpointer"/>
  5778. </parameter>
  5779. </parameters>
  5780. </callback>
  5781. <record name="Dir" c:type="GDir" disguised="1">
  5782. <doc xml:space="preserve">An opaque structure representing an opened directory.</doc>
  5783. <method name="close" c:identifier="g_dir_close">
  5784. <doc xml:space="preserve">Closes the directory and deallocates all related resources.</doc>
  5785. <return-value transfer-ownership="none">
  5786. <type name="none" c:type="void"/>
  5787. </return-value>
  5788. <parameters>
  5789. <instance-parameter name="dir" transfer-ownership="none">
  5790. <doc xml:space="preserve">a #GDir* created by g_dir_open()</doc>
  5791. <type name="Dir" c:type="GDir*"/>
  5792. </instance-parameter>
  5793. </parameters>
  5794. </method>
  5795. <method name="read_name" c:identifier="g_dir_read_name">
  5796. <doc xml:space="preserve">Retrieves the name of another entry in the directory, or %NULL.
  5797. The order of entries returned from this function is not defined,
  5798. and may vary by file system or other operating-system dependent
  5799. factors.
  5800. %NULL may also be returned in case of errors. On Unix, you can
  5801. check `errno` to find out if %NULL was returned because of an error.
  5802. On Unix, the '.' and '..' entries are omitted, and the returned
  5803. name is in the on-disk encoding.
  5804. On Windows, as is true of all GLib functions which operate on
  5805. filenames, the returned name is in UTF-8.</doc>
  5806. <return-value transfer-ownership="none">
  5807. <doc xml:space="preserve">The entry's name or %NULL if there are no
  5808. more entries. The return value is owned by GLib and
  5809. must not be modified or freed.</doc>
  5810. <type name="utf8" c:type="const gchar*"/>
  5811. </return-value>
  5812. <parameters>
  5813. <instance-parameter name="dir" transfer-ownership="none">
  5814. <doc xml:space="preserve">a #GDir* created by g_dir_open()</doc>
  5815. <type name="Dir" c:type="GDir*"/>
  5816. </instance-parameter>
  5817. </parameters>
  5818. </method>
  5819. <method name="rewind" c:identifier="g_dir_rewind">
  5820. <doc xml:space="preserve">Resets the given directory. The next call to g_dir_read_name()
  5821. will return the first entry again.</doc>
  5822. <return-value transfer-ownership="none">
  5823. <type name="none" c:type="void"/>
  5824. </return-value>
  5825. <parameters>
  5826. <instance-parameter name="dir" transfer-ownership="none">
  5827. <doc xml:space="preserve">a #GDir* created by g_dir_open()</doc>
  5828. <type name="Dir" c:type="GDir*"/>
  5829. </instance-parameter>
  5830. </parameters>
  5831. </method>
  5832. <function name="make_tmp"
  5833. c:identifier="g_dir_make_tmp"
  5834. version="2.30"
  5835. throws="1">
  5836. <doc xml:space="preserve">Creates a subdirectory in the preferred directory for temporary
  5837. files (as returned by g_get_tmp_dir()).
  5838. @tmpl should be a string in the GLib file name encoding containing
  5839. a sequence of six 'X' characters, as the parameter to g_mkstemp().
  5840. However, unlike these functions, the template should only be a
  5841. basename, no directory components are allowed. If template is
  5842. %NULL, a default template is used.
  5843. Note that in contrast to g_mkdtemp() (and mkdtemp()) @tmpl is not
  5844. modified, and might thus be a read-only literal string.</doc>
  5845. <return-value transfer-ownership="full">
  5846. <doc xml:space="preserve">The actual name used. This string
  5847. should be freed with g_free() when not needed any longer and is
  5848. is in the GLib file name encoding. In case of errors, %NULL is
  5849. returned and @error will be set.</doc>
  5850. <type name="filename" c:type="gchar*"/>
  5851. </return-value>
  5852. <parameters>
  5853. <parameter name="tmpl"
  5854. transfer-ownership="none"
  5855. nullable="1"
  5856. allow-none="1">
  5857. <doc xml:space="preserve">Template for directory name,
  5858. as in g_mkdtemp(), basename only, or %NULL for a default template</doc>
  5859. <type name="filename" c:type="gchar*"/>
  5860. </parameter>
  5861. </parameters>
  5862. </function>
  5863. <function name="open"
  5864. c:identifier="g_dir_open"
  5865. introspectable="0"
  5866. throws="1">
  5867. <doc xml:space="preserve">Opens a directory for reading. The names of the files in the
  5868. directory can then be retrieved using g_dir_read_name(). Note
  5869. that the ordering is not defined.</doc>
  5870. <return-value>
  5871. <doc xml:space="preserve">a newly allocated #GDir on success, %NULL on failure.
  5872. If non-%NULL, you must free the result with g_dir_close()
  5873. when you are finished with it.</doc>
  5874. <type name="Dir" c:type="GDir*"/>
  5875. </return-value>
  5876. <parameters>
  5877. <parameter name="path" transfer-ownership="none">
  5878. <doc xml:space="preserve">the path to the directory you are interested in. On Unix
  5879. in the on-disk encoding. On Windows in UTF-8</doc>
  5880. <type name="utf8" c:type="const gchar*"/>
  5881. </parameter>
  5882. <parameter name="flags" transfer-ownership="none">
  5883. <doc xml:space="preserve">Currently must be set to 0. Reserved for future use.</doc>
  5884. <type name="guint" c:type="guint"/>
  5885. </parameter>
  5886. </parameters>
  5887. </function>
  5888. </record>
  5889. <union name="DoubleIEEE754" c:type="GDoubleIEEE754">
  5890. <doc xml:space="preserve">The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the sign,
  5891. mantissa and exponent of IEEE floats and doubles. These unions are defined
  5892. as appropriate for a given platform. IEEE floats and doubles are supported
  5893. (used for storage) by at least Intel, PPC and Sparc.</doc>
  5894. <field name="v_double" writable="1">
  5895. <doc xml:space="preserve">the double value</doc>
  5896. <type name="gdouble" c:type="gdouble"/>
  5897. </field>
  5898. <record name="mpn" c:type="mpn">
  5899. <field name="mantissa_low" writable="1" bits="32">
  5900. <type name="guint" c:type="guint"/>
  5901. </field>
  5902. <field name="mantissa_high" writable="1" bits="20">
  5903. <type name="guint" c:type="guint"/>
  5904. </field>
  5905. <field name="biased_exponent" writable="1" bits="11">
  5906. <type name="guint" c:type="guint"/>
  5907. </field>
  5908. <field name="sign" writable="1" bits="1">
  5909. <type name="guint" c:type="guint"/>
  5910. </field>
  5911. </record>
  5912. </union>
  5913. <callback name="DuplicateFunc" c:type="GDuplicateFunc">
  5914. <doc xml:space="preserve">The type of functions that are used to 'duplicate' an object.
  5915. What this means depends on the context, it could just be
  5916. incrementing the reference count, if @data is a ref-counted
  5917. object.</doc>
  5918. <return-value transfer-ownership="none" nullable="1">
  5919. <doc xml:space="preserve">a duplicate of data</doc>
  5920. <type name="gpointer" c:type="gpointer"/>
  5921. </return-value>
  5922. <parameters>
  5923. <parameter name="data"
  5924. transfer-ownership="none"
  5925. nullable="1"
  5926. allow-none="1">
  5927. <doc xml:space="preserve">the data to duplicate</doc>
  5928. <type name="gpointer" c:type="gpointer"/>
  5929. </parameter>
  5930. <parameter name="user_data"
  5931. transfer-ownership="none"
  5932. nullable="1"
  5933. allow-none="1"
  5934. closure="1">
  5935. <doc xml:space="preserve">user data that was specified in g_datalist_id_dup_data()</doc>
  5936. <type name="gpointer" c:type="gpointer"/>
  5937. </parameter>
  5938. </parameters>
  5939. </callback>
  5940. <constant name="E" value="2.718282" c:type="G_E">
  5941. <doc xml:space="preserve">The base of natural logarithms.</doc>
  5942. <type name="gdouble" c:type="gdouble"/>
  5943. </constant>
  5944. <callback name="EqualFunc" c:type="GEqualFunc">
  5945. <doc xml:space="preserve">Specifies the type of a function used to test two values for
  5946. equality. The function should return %TRUE if both values are equal
  5947. and %FALSE otherwise.</doc>
  5948. <return-value transfer-ownership="none">
  5949. <doc xml:space="preserve">%TRUE if @a = @b; %FALSE otherwise</doc>
  5950. <type name="gboolean" c:type="gboolean"/>
  5951. </return-value>
  5952. <parameters>
  5953. <parameter name="a"
  5954. transfer-ownership="none"
  5955. nullable="1"
  5956. allow-none="1">
  5957. <doc xml:space="preserve">a value</doc>
  5958. <type name="gpointer" c:type="gconstpointer"/>
  5959. </parameter>
  5960. <parameter name="b"
  5961. transfer-ownership="none"
  5962. nullable="1"
  5963. allow-none="1">
  5964. <doc xml:space="preserve">a value to compare with</doc>
  5965. <type name="gpointer" c:type="gconstpointer"/>
  5966. </parameter>
  5967. </parameters>
  5968. </callback>
  5969. <record name="Error"
  5970. c:type="GError"
  5971. glib:type-name="GError"
  5972. glib:get-type="g_error_get_type"
  5973. c:symbol-prefix="error">
  5974. <doc xml:space="preserve">The `GError` structure contains information about
  5975. an error that has occurred.</doc>
  5976. <field name="domain" writable="1">
  5977. <doc xml:space="preserve">error domain, e.g. #G_FILE_ERROR</doc>
  5978. <type name="Quark" c:type="GQuark"/>
  5979. </field>
  5980. <field name="code" writable="1">
  5981. <doc xml:space="preserve">error code, e.g. %G_FILE_ERROR_NOENT</doc>
  5982. <type name="gint" c:type="gint"/>
  5983. </field>
  5984. <field name="message" writable="1">
  5985. <doc xml:space="preserve">human-readable informative error message</doc>
  5986. <type name="utf8" c:type="gchar*"/>
  5987. </field>
  5988. <constructor name="new" c:identifier="g_error_new" introspectable="0">
  5989. <doc xml:space="preserve">Creates a new #GError with the given @domain and @code,
  5990. and a message formatted with @format.</doc>
  5991. <return-value transfer-ownership="full">
  5992. <doc xml:space="preserve">a new #GError</doc>
  5993. <type name="Error" c:type="GError*"/>
  5994. </return-value>
  5995. <parameters>
  5996. <parameter name="domain" transfer-ownership="none">
  5997. <doc xml:space="preserve">error domain</doc>
  5998. <type name="Quark" c:type="GQuark"/>
  5999. </parameter>
  6000. <parameter name="code" transfer-ownership="none">
  6001. <doc xml:space="preserve">error code</doc>
  6002. <type name="gint" c:type="gint"/>
  6003. </parameter>
  6004. <parameter name="format" transfer-ownership="none">
  6005. <doc xml:space="preserve">printf()-style format for error message</doc>
  6006. <type name="utf8" c:type="const gchar*"/>
  6007. </parameter>
  6008. <parameter name="..." transfer-ownership="none">
  6009. <doc xml:space="preserve">parameters for message format</doc>
  6010. <varargs/>
  6011. </parameter>
  6012. </parameters>
  6013. </constructor>
  6014. <constructor name="new_literal" c:identifier="g_error_new_literal">
  6015. <doc xml:space="preserve">Creates a new #GError; unlike g_error_new(), @message is
  6016. not a printf()-style format string. Use this function if
  6017. @message contains text you don't have control over,
  6018. that could include printf() escape sequences.</doc>
  6019. <return-value transfer-ownership="full">
  6020. <doc xml:space="preserve">a new #GError</doc>
  6021. <type name="Error" c:type="GError*"/>
  6022. </return-value>
  6023. <parameters>
  6024. <parameter name="domain" transfer-ownership="none">
  6025. <doc xml:space="preserve">error domain</doc>
  6026. <type name="Quark" c:type="GQuark"/>
  6027. </parameter>
  6028. <parameter name="code" transfer-ownership="none">
  6029. <doc xml:space="preserve">error code</doc>
  6030. <type name="gint" c:type="gint"/>
  6031. </parameter>
  6032. <parameter name="message" transfer-ownership="none">
  6033. <doc xml:space="preserve">error message</doc>
  6034. <type name="utf8" c:type="const gchar*"/>
  6035. </parameter>
  6036. </parameters>
  6037. </constructor>
  6038. <constructor name="new_valist"
  6039. c:identifier="g_error_new_valist"
  6040. version="2.22"
  6041. introspectable="0">
  6042. <doc xml:space="preserve">Creates a new #GError with the given @domain and @code,
  6043. and a message formatted with @format.</doc>
  6044. <return-value transfer-ownership="full">
  6045. <doc xml:space="preserve">a new #GError</doc>
  6046. <type name="Error" c:type="GError*"/>
  6047. </return-value>
  6048. <parameters>
  6049. <parameter name="domain" transfer-ownership="none">
  6050. <doc xml:space="preserve">error domain</doc>
  6051. <type name="Quark" c:type="GQuark"/>
  6052. </parameter>
  6053. <parameter name="code" transfer-ownership="none">
  6054. <doc xml:space="preserve">error code</doc>
  6055. <type name="gint" c:type="gint"/>
  6056. </parameter>
  6057. <parameter name="format" transfer-ownership="none">
  6058. <doc xml:space="preserve">printf()-style format for error message</doc>
  6059. <type name="utf8" c:type="const gchar*"/>
  6060. </parameter>
  6061. <parameter name="args" transfer-ownership="none">
  6062. <doc xml:space="preserve">#va_list of parameters for the message format</doc>
  6063. <type name="va_list" c:type="va_list"/>
  6064. </parameter>
  6065. </parameters>
  6066. </constructor>
  6067. <method name="copy" c:identifier="g_error_copy">
  6068. <doc xml:space="preserve">Makes a copy of @error.</doc>
  6069. <return-value transfer-ownership="full">
  6070. <doc xml:space="preserve">a new #GError</doc>
  6071. <type name="Error" c:type="GError*"/>
  6072. </return-value>
  6073. <parameters>
  6074. <instance-parameter name="error" transfer-ownership="none">
  6075. <doc xml:space="preserve">a #GError</doc>
  6076. <type name="Error" c:type="const GError*"/>
  6077. </instance-parameter>
  6078. </parameters>
  6079. </method>
  6080. <method name="free" c:identifier="g_error_free">
  6081. <doc xml:space="preserve">Frees a #GError and associated resources.</doc>
  6082. <return-value transfer-ownership="none">
  6083. <type name="none" c:type="void"/>
  6084. </return-value>
  6085. <parameters>
  6086. <instance-parameter name="error" transfer-ownership="none">
  6087. <doc xml:space="preserve">a #GError</doc>
  6088. <type name="Error" c:type="GError*"/>
  6089. </instance-parameter>
  6090. </parameters>
  6091. </method>
  6092. <method name="matches" c:identifier="g_error_matches">
  6093. <doc xml:space="preserve">Returns %TRUE if @error matches @domain and @code, %FALSE
  6094. otherwise. In particular, when @error is %NULL, %FALSE will
  6095. be returned.
  6096. If @domain contains a `FAILED` (or otherwise generic) error code,
  6097. you should generally not check for it explicitly, but should
  6098. instead treat any not-explicitly-recognized error code as being
  6099. equivalent to the `FAILED` code. This way, if the domain is
  6100. extended in the future to provide a more specific error code for
  6101. a certain case, your code will still work.</doc>
  6102. <return-value transfer-ownership="none">
  6103. <doc xml:space="preserve">whether @error has @domain and @code</doc>
  6104. <type name="gboolean" c:type="gboolean"/>
  6105. </return-value>
  6106. <parameters>
  6107. <instance-parameter name="error"
  6108. transfer-ownership="none"
  6109. nullable="1"
  6110. allow-none="1">
  6111. <doc xml:space="preserve">a #GError</doc>
  6112. <type name="Error" c:type="const GError*"/>
  6113. </instance-parameter>
  6114. <parameter name="domain" transfer-ownership="none">
  6115. <doc xml:space="preserve">an error domain</doc>
  6116. <type name="Quark" c:type="GQuark"/>
  6117. </parameter>
  6118. <parameter name="code" transfer-ownership="none">
  6119. <doc xml:space="preserve">an error code</doc>
  6120. <type name="gint" c:type="gint"/>
  6121. </parameter>
  6122. </parameters>
  6123. </method>
  6124. </record>
  6125. <enumeration name="ErrorType" c:type="GErrorType">
  6126. <doc xml:space="preserve">The possible errors, used in the @v_error field
  6127. of #GTokenValue, when the token is a %G_TOKEN_ERROR.</doc>
  6128. <member name="unknown" value="0" c:identifier="G_ERR_UNKNOWN">
  6129. <doc xml:space="preserve">unknown error</doc>
  6130. </member>
  6131. <member name="unexp_eof" value="1" c:identifier="G_ERR_UNEXP_EOF">
  6132. <doc xml:space="preserve">unexpected end of file</doc>
  6133. </member>
  6134. <member name="unexp_eof_in_string"
  6135. value="2"
  6136. c:identifier="G_ERR_UNEXP_EOF_IN_STRING">
  6137. <doc xml:space="preserve">unterminated string constant</doc>
  6138. </member>
  6139. <member name="unexp_eof_in_comment"
  6140. value="3"
  6141. c:identifier="G_ERR_UNEXP_EOF_IN_COMMENT">
  6142. <doc xml:space="preserve">unterminated comment</doc>
  6143. </member>
  6144. <member name="non_digit_in_const"
  6145. value="4"
  6146. c:identifier="G_ERR_NON_DIGIT_IN_CONST">
  6147. <doc xml:space="preserve">non-digit character in a number</doc>
  6148. </member>
  6149. <member name="digit_radix" value="5" c:identifier="G_ERR_DIGIT_RADIX">
  6150. <doc xml:space="preserve">digit beyond radix in a number</doc>
  6151. </member>
  6152. <member name="float_radix" value="6" c:identifier="G_ERR_FLOAT_RADIX">
  6153. <doc xml:space="preserve">non-decimal floating point number</doc>
  6154. </member>
  6155. <member name="float_malformed"
  6156. value="7"
  6157. c:identifier="G_ERR_FLOAT_MALFORMED">
  6158. <doc xml:space="preserve">malformed floating point number</doc>
  6159. </member>
  6160. </enumeration>
  6161. <enumeration name="FileError"
  6162. c:type="GFileError"
  6163. glib:error-domain="g-file-error-quark">
  6164. <doc xml:space="preserve">Values corresponding to @errno codes returned from file operations
  6165. on UNIX. Unlike @errno codes, GFileError values are available on
  6166. all systems, even Windows. The exact meaning of each code depends
  6167. on what sort of file operation you were performing; the UNIX
  6168. documentation gives more details. The following error code descriptions
  6169. come from the GNU C Library manual, and are under the copyright
  6170. of that manual.
  6171. It's not very portable to make detailed assumptions about exactly
  6172. which errors will be returned from a given operation. Some errors
  6173. don't occur on some systems, etc., sometimes there are subtle
  6174. differences in when a system will report a given error, etc.</doc>
  6175. <member name="exist" value="0" c:identifier="G_FILE_ERROR_EXIST">
  6176. <doc xml:space="preserve">Operation not permitted; only the owner of
  6177. the file (or other resource) or processes with special privileges
  6178. can perform the operation.</doc>
  6179. </member>
  6180. <member name="isdir" value="1" c:identifier="G_FILE_ERROR_ISDIR">
  6181. <doc xml:space="preserve">File is a directory; you cannot open a directory
  6182. for writing, or create or remove hard links to it.</doc>
  6183. </member>
  6184. <member name="acces" value="2" c:identifier="G_FILE_ERROR_ACCES">
  6185. <doc xml:space="preserve">Permission denied; the file permissions do not
  6186. allow the attempted operation.</doc>
  6187. </member>
  6188. <member name="nametoolong"
  6189. value="3"
  6190. c:identifier="G_FILE_ERROR_NAMETOOLONG">
  6191. <doc xml:space="preserve">Filename too long.</doc>
  6192. </member>
  6193. <member name="noent" value="4" c:identifier="G_FILE_ERROR_NOENT">
  6194. <doc xml:space="preserve">No such file or directory. This is a "file
  6195. doesn't exist" error for ordinary files that are referenced in
  6196. contexts where they are expected to already exist.</doc>
  6197. </member>
  6198. <member name="notdir" value="5" c:identifier="G_FILE_ERROR_NOTDIR">
  6199. <doc xml:space="preserve">A file that isn't a directory was specified when
  6200. a directory is required.</doc>
  6201. </member>
  6202. <member name="nxio" value="6" c:identifier="G_FILE_ERROR_NXIO">
  6203. <doc xml:space="preserve">No such device or address. The system tried to
  6204. use the device represented by a file you specified, and it
  6205. couldn't find the device. This can mean that the device file was
  6206. installed incorrectly, or that the physical device is missing or
  6207. not correctly attached to the computer.</doc>
  6208. </member>
  6209. <member name="nodev" value="7" c:identifier="G_FILE_ERROR_NODEV">
  6210. <doc xml:space="preserve">The underlying file system of the specified file
  6211. does not support memory mapping.</doc>
  6212. </member>
  6213. <member name="rofs" value="8" c:identifier="G_FILE_ERROR_ROFS">
  6214. <doc xml:space="preserve">The directory containing the new link can't be
  6215. modified because it's on a read-only file system.</doc>
  6216. </member>
  6217. <member name="txtbsy" value="9" c:identifier="G_FILE_ERROR_TXTBSY">
  6218. <doc xml:space="preserve">Text file busy.</doc>
  6219. </member>
  6220. <member name="fault" value="10" c:identifier="G_FILE_ERROR_FAULT">
  6221. <doc xml:space="preserve">You passed in a pointer to bad memory.
  6222. (GLib won't reliably return this, don't pass in pointers to bad
  6223. memory.)</doc>
  6224. </member>
  6225. <member name="loop" value="11" c:identifier="G_FILE_ERROR_LOOP">
  6226. <doc xml:space="preserve">Too many levels of symbolic links were encountered
  6227. in looking up a file name. This often indicates a cycle of symbolic
  6228. links.</doc>
  6229. </member>
  6230. <member name="nospc" value="12" c:identifier="G_FILE_ERROR_NOSPC">
  6231. <doc xml:space="preserve">No space left on device; write operation on a
  6232. file failed because the disk is full.</doc>
  6233. </member>
  6234. <member name="nomem" value="13" c:identifier="G_FILE_ERROR_NOMEM">
  6235. <doc xml:space="preserve">No memory available. The system cannot allocate
  6236. more virtual memory because its capacity is full.</doc>
  6237. </member>
  6238. <member name="mfile" value="14" c:identifier="G_FILE_ERROR_MFILE">
  6239. <doc xml:space="preserve">The current process has too many files open and
  6240. can't open any more. Duplicate descriptors do count toward this
  6241. limit.</doc>
  6242. </member>
  6243. <member name="nfile" value="15" c:identifier="G_FILE_ERROR_NFILE">
  6244. <doc xml:space="preserve">There are too many distinct file openings in the
  6245. entire system.</doc>
  6246. </member>
  6247. <member name="badf" value="16" c:identifier="G_FILE_ERROR_BADF">
  6248. <doc xml:space="preserve">Bad file descriptor; for example, I/O on a
  6249. descriptor that has been closed or reading from a descriptor open
  6250. only for writing (or vice versa).</doc>
  6251. </member>
  6252. <member name="inval" value="17" c:identifier="G_FILE_ERROR_INVAL">
  6253. <doc xml:space="preserve">Invalid argument. This is used to indicate
  6254. various kinds of problems with passing the wrong argument to a
  6255. library function.</doc>
  6256. </member>
  6257. <member name="pipe" value="18" c:identifier="G_FILE_ERROR_PIPE">
  6258. <doc xml:space="preserve">Broken pipe; there is no process reading from the
  6259. other end of a pipe. Every library function that returns this
  6260. error code also generates a 'SIGPIPE' signal; this signal
  6261. terminates the program if not handled or blocked. Thus, your
  6262. program will never actually see this code unless it has handled
  6263. or blocked 'SIGPIPE'.</doc>
  6264. </member>
  6265. <member name="again" value="19" c:identifier="G_FILE_ERROR_AGAIN">
  6266. <doc xml:space="preserve">Resource temporarily unavailable; the call might
  6267. work if you try again later.</doc>
  6268. </member>
  6269. <member name="intr" value="20" c:identifier="G_FILE_ERROR_INTR">
  6270. <doc xml:space="preserve">Interrupted function call; an asynchronous signal
  6271. occurred and prevented completion of the call. When this
  6272. happens, you should try the call again.</doc>
  6273. </member>
  6274. <member name="io" value="21" c:identifier="G_FILE_ERROR_IO">
  6275. <doc xml:space="preserve">Input/output error; usually used for physical read
  6276. or write errors. i.e. the disk or other physical device hardware
  6277. is returning errors.</doc>
  6278. </member>
  6279. <member name="perm" value="22" c:identifier="G_FILE_ERROR_PERM">
  6280. <doc xml:space="preserve">Operation not permitted; only the owner of the
  6281. file (or other resource) or processes with special privileges can
  6282. perform the operation.</doc>
  6283. </member>
  6284. <member name="nosys" value="23" c:identifier="G_FILE_ERROR_NOSYS">
  6285. <doc xml:space="preserve">Function not implemented; this indicates that
  6286. the system is missing some functionality.</doc>
  6287. </member>
  6288. <member name="failed" value="24" c:identifier="G_FILE_ERROR_FAILED">
  6289. <doc xml:space="preserve">Does not correspond to a UNIX error code; this
  6290. is the standard "failed for unspecified reason" error code present
  6291. in all #GError error code enumerations. Returned if no specific
  6292. code applies.</doc>
  6293. </member>
  6294. </enumeration>
  6295. <bitfield name="FileTest" c:type="GFileTest">
  6296. <doc xml:space="preserve">A test to perform on a file using g_file_test().</doc>
  6297. <member name="is_regular"
  6298. value="1"
  6299. c:identifier="G_FILE_TEST_IS_REGULAR">
  6300. <doc xml:space="preserve">%TRUE if the file is a regular file
  6301. (not a directory). Note that this test will also return %TRUE
  6302. if the tested file is a symlink to a regular file.</doc>
  6303. </member>
  6304. <member name="is_symlink"
  6305. value="2"
  6306. c:identifier="G_FILE_TEST_IS_SYMLINK">
  6307. <doc xml:space="preserve">%TRUE if the file is a symlink.</doc>
  6308. </member>
  6309. <member name="is_dir" value="4" c:identifier="G_FILE_TEST_IS_DIR">
  6310. <doc xml:space="preserve">%TRUE if the file is a directory.</doc>
  6311. </member>
  6312. <member name="is_executable"
  6313. value="8"
  6314. c:identifier="G_FILE_TEST_IS_EXECUTABLE">
  6315. <doc xml:space="preserve">%TRUE if the file is executable.</doc>
  6316. </member>
  6317. <member name="exists" value="16" c:identifier="G_FILE_TEST_EXISTS">
  6318. <doc xml:space="preserve">%TRUE if the file exists. It may or may not
  6319. be a regular file.</doc>
  6320. </member>
  6321. </bitfield>
  6322. <union name="FloatIEEE754" c:type="GFloatIEEE754">
  6323. <doc xml:space="preserve">The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the sign,
  6324. mantissa and exponent of IEEE floats and doubles. These unions are defined
  6325. as appropriate for a given platform. IEEE floats and doubles are supported
  6326. (used for storage) by at least Intel, PPC and Sparc.</doc>
  6327. <field name="v_float" writable="1">
  6328. <doc xml:space="preserve">the double value</doc>
  6329. <type name="gfloat" c:type="gfloat"/>
  6330. </field>
  6331. <record name="mpn" c:type="mpn">
  6332. <field name="mantissa" writable="1" bits="23">
  6333. <type name="guint" c:type="guint"/>
  6334. </field>
  6335. <field name="biased_exponent" writable="1" bits="8">
  6336. <type name="guint" c:type="guint"/>
  6337. </field>
  6338. <field name="sign" writable="1" bits="1">
  6339. <type name="guint" c:type="guint"/>
  6340. </field>
  6341. </record>
  6342. </union>
  6343. <bitfield name="FormatSizeFlags" c:type="GFormatSizeFlags">
  6344. <doc xml:space="preserve">Flags to modify the format of the string returned by g_format_size_full().</doc>
  6345. <member name="default" value="0" c:identifier="G_FORMAT_SIZE_DEFAULT">
  6346. <doc xml:space="preserve">behave the same as g_format_size()</doc>
  6347. </member>
  6348. <member name="long_format"
  6349. value="1"
  6350. c:identifier="G_FORMAT_SIZE_LONG_FORMAT">
  6351. <doc xml:space="preserve">include the exact number of bytes as part
  6352. of the returned string. For example, "45.6 kB (45,612 bytes)".</doc>
  6353. </member>
  6354. <member name="iec_units"
  6355. value="2"
  6356. c:identifier="G_FORMAT_SIZE_IEC_UNITS">
  6357. <doc xml:space="preserve">use IEC (base 1024) units with "KiB"-style
  6358. suffixes. IEC units should only be used for reporting things with
  6359. a strong "power of 2" basis, like RAM sizes or RAID stripe sizes.
  6360. Network and storage sizes should be reported in the normal SI units.</doc>
  6361. </member>
  6362. </bitfield>
  6363. <callback name="FreeFunc" c:type="GFreeFunc">
  6364. <doc xml:space="preserve">Declares a type of function which takes an arbitrary
  6365. data pointer argument and has no return value. It is
  6366. not currently used in GLib or GTK+.</doc>
  6367. <return-value transfer-ownership="none">
  6368. <type name="none" c:type="void"/>
  6369. </return-value>
  6370. <parameters>
  6371. <parameter name="data"
  6372. transfer-ownership="none"
  6373. nullable="1"
  6374. allow-none="1">
  6375. <doc xml:space="preserve">a data pointer</doc>
  6376. <type name="gpointer" c:type="gpointer"/>
  6377. </parameter>
  6378. </parameters>
  6379. </callback>
  6380. <callback name="Func" c:type="GFunc">
  6381. <doc xml:space="preserve">Specifies the type of functions passed to g_list_foreach() and
  6382. g_slist_foreach().</doc>
  6383. <return-value transfer-ownership="none">
  6384. <type name="none" c:type="void"/>
  6385. </return-value>
  6386. <parameters>
  6387. <parameter name="data"
  6388. transfer-ownership="none"
  6389. nullable="1"
  6390. allow-none="1">
  6391. <doc xml:space="preserve">the element's data</doc>
  6392. <type name="gpointer" c:type="gpointer"/>
  6393. </parameter>
  6394. <parameter name="user_data"
  6395. transfer-ownership="none"
  6396. nullable="1"
  6397. allow-none="1"
  6398. closure="1">
  6399. <doc xml:space="preserve">user data passed to g_list_foreach() or g_slist_foreach()</doc>
  6400. <type name="gpointer" c:type="gpointer"/>
  6401. </parameter>
  6402. </parameters>
  6403. </callback>
  6404. <constant name="GINT16_FORMAT" value="hi" c:type="G_GINT16_FORMAT">
  6405. <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning and
  6406. printing values of type #gint16. It is a string literal, but doesn't
  6407. include the percent-sign, such that you can add precision and length
  6408. modifiers between percent-sign and conversion specifier.
  6409. |[&lt;!-- language="C" --&gt;
  6410. gint16 in;
  6411. gint32 out;
  6412. sscanf ("42", "%" G_GINT16_FORMAT, &amp;in)
  6413. out = in * 1000;
  6414. g_print ("%" G_GINT32_FORMAT, out);
  6415. ]|</doc>
  6416. <type name="utf8" c:type="gchar*"/>
  6417. </constant>
  6418. <constant name="GINT16_MODIFIER"
  6419. value="h"
  6420. c:type="G_GINT16_MODIFIER"
  6421. version="2.4">
  6422. <doc xml:space="preserve">The platform dependent length modifier for conversion specifiers
  6423. for scanning and printing values of type #gint16 or #guint16. It
  6424. is a string literal, but doesn't include the percent-sign, such
  6425. that you can add precision and length modifiers between percent-sign
  6426. and conversion specifier and append a conversion specifier.
  6427. The following example prints "0x7b";
  6428. |[&lt;!-- language="C" --&gt;
  6429. gint16 value = 123;
  6430. g_print ("%#" G_GINT16_MODIFIER "x", value);
  6431. ]|</doc>
  6432. <type name="utf8" c:type="gchar*"/>
  6433. </constant>
  6434. <constant name="GINT32_FORMAT" value="i" c:type="G_GINT32_FORMAT">
  6435. <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
  6436. and printing values of type #gint32. See also #G_GINT16_FORMAT.</doc>
  6437. <type name="utf8" c:type="gchar*"/>
  6438. </constant>
  6439. <constant name="GINT32_MODIFIER"
  6440. value=""
  6441. c:type="G_GINT32_MODIFIER"
  6442. version="2.4">
  6443. <doc xml:space="preserve">The platform dependent length modifier for conversion specifiers
  6444. for scanning and printing values of type #gint32 or #guint32. It
  6445. is a string literal. See also #G_GINT16_MODIFIER.</doc>
  6446. <type name="utf8" c:type="gchar*"/>
  6447. </constant>
  6448. <constant name="GINT64_FORMAT" value="lli" c:type="G_GINT64_FORMAT">
  6449. <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
  6450. and printing values of type #gint64. See also #G_GINT16_FORMAT.
  6451. Some platforms do not support scanning and printing 64-bit integers,
  6452. even though the types are supported. On such platforms %G_GINT64_FORMAT
  6453. is not defined. Note that scanf() may not support 64-bit integers, even
  6454. if %G_GINT64_FORMAT is defined. Due to its weak error handling, scanf()
  6455. is not recommended for parsing anyway; consider using g_ascii_strtoull()
  6456. instead.</doc>
  6457. <type name="utf8" c:type="gchar*"/>
  6458. </constant>
  6459. <constant name="GINT64_MODIFIER"
  6460. value="ll"
  6461. c:type="G_GINT64_MODIFIER"
  6462. version="2.4">
  6463. <doc xml:space="preserve">The platform dependent length modifier for conversion specifiers
  6464. for scanning and printing values of type #gint64 or #guint64.
  6465. It is a string literal.
  6466. Some platforms do not support printing 64-bit integers, even
  6467. though the types are supported. On such platforms %G_GINT64_MODIFIER
  6468. is not defined.</doc>
  6469. <type name="utf8" c:type="gchar*"/>
  6470. </constant>
  6471. <constant name="GINTPTR_FORMAT"
  6472. value="i"
  6473. c:type="G_GINTPTR_FORMAT"
  6474. version="2.22">
  6475. <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
  6476. and printing values of type #gintptr.</doc>
  6477. <type name="utf8" c:type="gchar*"/>
  6478. </constant>
  6479. <constant name="GINTPTR_MODIFIER"
  6480. value=""
  6481. c:type="G_GINTPTR_MODIFIER"
  6482. version="2.22">
  6483. <doc xml:space="preserve">The platform dependent length modifier for conversion specifiers
  6484. for scanning and printing values of type #gintptr or #guintptr.
  6485. It is a string literal.</doc>
  6486. <type name="utf8" c:type="gchar*"/>
  6487. </constant>
  6488. <constant name="GNUC_FUNCTION"
  6489. value=""
  6490. c:type="G_GNUC_FUNCTION"
  6491. deprecated="1"
  6492. deprecated-version="2.16">
  6493. <doc xml:space="preserve">Expands to "" on all modern compilers, and to __FUNCTION__ on gcc
  6494. version 2.x. Don't use it.</doc>
  6495. <doc-deprecated xml:space="preserve">Use G_STRFUNC() instead</doc-deprecated>
  6496. <type name="utf8" c:type="gchar*"/>
  6497. </constant>
  6498. <constant name="GNUC_PRETTY_FUNCTION"
  6499. value=""
  6500. c:type="G_GNUC_PRETTY_FUNCTION"
  6501. deprecated="1"
  6502. deprecated-version="2.16">
  6503. <doc xml:space="preserve">Expands to "" on all modern compilers, and to __PRETTY_FUNCTION__
  6504. on gcc version 2.x. Don't use it.</doc>
  6505. <doc-deprecated xml:space="preserve">Use G_STRFUNC() instead</doc-deprecated>
  6506. <type name="utf8" c:type="gchar*"/>
  6507. </constant>
  6508. <constant name="GSIZE_FORMAT"
  6509. value="u"
  6510. c:type="G_GSIZE_FORMAT"
  6511. version="2.6">
  6512. <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
  6513. and printing values of type #gsize. See also #G_GINT16_FORMAT.</doc>
  6514. <type name="utf8" c:type="gchar*"/>
  6515. </constant>
  6516. <constant name="GSIZE_MODIFIER"
  6517. value=""
  6518. c:type="G_GSIZE_MODIFIER"
  6519. version="2.6">
  6520. <doc xml:space="preserve">The platform dependent length modifier for conversion specifiers
  6521. for scanning and printing values of type #gsize. It
  6522. is a string literal.</doc>
  6523. <type name="utf8" c:type="gchar*"/>
  6524. </constant>
  6525. <constant name="GSSIZE_FORMAT"
  6526. value="i"
  6527. c:type="G_GSSIZE_FORMAT"
  6528. version="2.6">
  6529. <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
  6530. and printing values of type #gssize. See also #G_GINT16_FORMAT.</doc>
  6531. <type name="utf8" c:type="gchar*"/>
  6532. </constant>
  6533. <constant name="GSSIZE_MODIFIER"
  6534. value=""
  6535. c:type="G_GSSIZE_MODIFIER"
  6536. version="2.6">
  6537. <doc xml:space="preserve">The platform dependent length modifier for conversion specifiers
  6538. for scanning and printing values of type #gssize. It
  6539. is a string literal.</doc>
  6540. <type name="utf8" c:type="gchar*"/>
  6541. </constant>
  6542. <constant name="GUINT16_FORMAT" value="hu" c:type="G_GUINT16_FORMAT">
  6543. <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
  6544. and printing values of type #guint16. See also #G_GINT16_FORMAT</doc>
  6545. <type name="utf8" c:type="gchar*"/>
  6546. </constant>
  6547. <constant name="GUINT32_FORMAT" value="u" c:type="G_GUINT32_FORMAT">
  6548. <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
  6549. and printing values of type #guint32. See also #G_GINT16_FORMAT.</doc>
  6550. <type name="utf8" c:type="gchar*"/>
  6551. </constant>
  6552. <constant name="GUINT64_FORMAT" value="llu" c:type="G_GUINT64_FORMAT">
  6553. <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
  6554. and printing values of type #guint64. See also #G_GINT16_FORMAT.
  6555. Some platforms do not support scanning and printing 64-bit integers,
  6556. even though the types are supported. On such platforms %G_GUINT64_FORMAT
  6557. is not defined. Note that scanf() may not support 64-bit integers, even
  6558. if %G_GINT64_FORMAT is defined. Due to its weak error handling, scanf()
  6559. is not recommended for parsing anyway; consider using g_ascii_strtoull()
  6560. instead.</doc>
  6561. <type name="utf8" c:type="gchar*"/>
  6562. </constant>
  6563. <constant name="GUINTPTR_FORMAT"
  6564. value="u"
  6565. c:type="G_GUINTPTR_FORMAT"
  6566. version="2.22">
  6567. <doc xml:space="preserve">This is the platform dependent conversion specifier
  6568. for scanning and printing values of type #guintptr.</doc>
  6569. <type name="utf8" c:type="gchar*"/>
  6570. </constant>
  6571. <constant name="HAVE_GINT64" value="1" c:type="G_HAVE_GINT64">
  6572. <type name="gint" c:type="gint"/>
  6573. </constant>
  6574. <constant name="HAVE_GNUC_VARARGS" value="1" c:type="G_HAVE_GNUC_VARARGS">
  6575. <type name="gint" c:type="gint"/>
  6576. </constant>
  6577. <constant name="HAVE_GNUC_VISIBILITY"
  6578. value="1"
  6579. c:type="G_HAVE_GNUC_VISIBILITY">
  6580. <doc xml:space="preserve">Defined to 1 if gcc-style visibility handling is supported.</doc>
  6581. <type name="gint" c:type="gint"/>
  6582. </constant>
  6583. <constant name="HAVE_GROWING_STACK"
  6584. value="0"
  6585. c:type="G_HAVE_GROWING_STACK">
  6586. <type name="gint" c:type="gint"/>
  6587. </constant>
  6588. <constant name="HAVE_ISO_VARARGS" value="1" c:type="G_HAVE_ISO_VARARGS">
  6589. <type name="gint" c:type="gint"/>
  6590. </constant>
  6591. <callback name="HFunc" c:type="GHFunc">
  6592. <doc xml:space="preserve">Specifies the type of the function passed to g_hash_table_foreach().
  6593. It is called with each key/value pair, together with the @user_data
  6594. parameter which is passed to g_hash_table_foreach().</doc>
  6595. <return-value transfer-ownership="none">
  6596. <type name="none" c:type="void"/>
  6597. </return-value>
  6598. <parameters>
  6599. <parameter name="key"
  6600. transfer-ownership="none"
  6601. nullable="1"
  6602. allow-none="1">
  6603. <doc xml:space="preserve">a key</doc>
  6604. <type name="gpointer" c:type="gpointer"/>
  6605. </parameter>
  6606. <parameter name="value"
  6607. transfer-ownership="none"
  6608. nullable="1"
  6609. allow-none="1">
  6610. <doc xml:space="preserve">the value corresponding to the key</doc>
  6611. <type name="gpointer" c:type="gpointer"/>
  6612. </parameter>
  6613. <parameter name="user_data"
  6614. transfer-ownership="none"
  6615. nullable="1"
  6616. allow-none="1"
  6617. closure="2">
  6618. <doc xml:space="preserve">user data passed to g_hash_table_foreach()</doc>
  6619. <type name="gpointer" c:type="gpointer"/>
  6620. </parameter>
  6621. </parameters>
  6622. </callback>
  6623. <constant name="HOOK_FLAG_USER_SHIFT"
  6624. value="4"
  6625. c:type="G_HOOK_FLAG_USER_SHIFT">
  6626. <doc xml:space="preserve">The position of the first bit which is not reserved for internal
  6627. use be the #GHook implementation, i.e.
  6628. `1 &lt;&lt; G_HOOK_FLAG_USER_SHIFT` is the first
  6629. bit which can be used for application-defined flags.</doc>
  6630. <type name="gint" c:type="gint"/>
  6631. </constant>
  6632. <callback name="HRFunc" c:type="GHRFunc">
  6633. <doc xml:space="preserve">Specifies the type of the function passed to
  6634. g_hash_table_foreach_remove(). It is called with each key/value
  6635. pair, together with the @user_data parameter passed to
  6636. g_hash_table_foreach_remove(). It should return %TRUE if the
  6637. key/value pair should be removed from the #GHashTable.</doc>
  6638. <return-value transfer-ownership="none">
  6639. <doc xml:space="preserve">%TRUE if the key/value pair should be removed from the
  6640. #GHashTable</doc>
  6641. <type name="gboolean" c:type="gboolean"/>
  6642. </return-value>
  6643. <parameters>
  6644. <parameter name="key"
  6645. transfer-ownership="none"
  6646. nullable="1"
  6647. allow-none="1">
  6648. <doc xml:space="preserve">a key</doc>
  6649. <type name="gpointer" c:type="gpointer"/>
  6650. </parameter>
  6651. <parameter name="value"
  6652. transfer-ownership="none"
  6653. nullable="1"
  6654. allow-none="1">
  6655. <doc xml:space="preserve">the value associated with the key</doc>
  6656. <type name="gpointer" c:type="gpointer"/>
  6657. </parameter>
  6658. <parameter name="user_data"
  6659. transfer-ownership="none"
  6660. nullable="1"
  6661. allow-none="1"
  6662. closure="2">
  6663. <doc xml:space="preserve">user data passed to g_hash_table_remove()</doc>
  6664. <type name="gpointer" c:type="gpointer"/>
  6665. </parameter>
  6666. </parameters>
  6667. </callback>
  6668. <callback name="HashFunc" c:type="GHashFunc">
  6669. <doc xml:space="preserve">Specifies the type of the hash function which is passed to
  6670. g_hash_table_new() when a #GHashTable is created.
  6671. The function is passed a key and should return a #guint hash value.
  6672. The functions g_direct_hash(), g_int_hash() and g_str_hash() provide
  6673. hash functions which can be used when the key is a #gpointer, #gint*,
  6674. and #gchar* respectively.
  6675. g_direct_hash() is also the appropriate hash function for keys
  6676. of the form `GINT_TO_POINTER (n)` (or similar macros).
  6677. &lt;!-- FIXME: Need more here. --&gt; A good hash functions should produce
  6678. hash values that are evenly distributed over a fairly large range.
  6679. The modulus is taken with the hash table size (a prime number) to
  6680. find the 'bucket' to place each key into. The function should also
  6681. be very fast, since it is called for each key lookup.
  6682. Note that the hash functions provided by GLib have these qualities,
  6683. but are not particularly robust against manufactured keys that
  6684. cause hash collisions. Therefore, you should consider choosing
  6685. a more secure hash function when using a GHashTable with keys
  6686. that originate in untrusted data (such as HTTP requests).
  6687. Using g_str_hash() in that situation might make your application
  6688. vulerable to
  6689. [Algorithmic Complexity Attacks](https://lwn.net/Articles/474912/).
  6690. The key to choosing a good hash is unpredictability. Even
  6691. cryptographic hashes are very easy to find collisions for when the
  6692. remainder is taken modulo a somewhat predictable prime number. There
  6693. must be an element of randomness that an attacker is unable to guess.</doc>
  6694. <return-value transfer-ownership="none">
  6695. <doc xml:space="preserve">the hash value corresponding to the key</doc>
  6696. <type name="guint" c:type="guint"/>
  6697. </return-value>
  6698. <parameters>
  6699. <parameter name="key"
  6700. transfer-ownership="none"
  6701. nullable="1"
  6702. allow-none="1">
  6703. <doc xml:space="preserve">a key</doc>
  6704. <type name="gpointer" c:type="gconstpointer"/>
  6705. </parameter>
  6706. </parameters>
  6707. </callback>
  6708. <record name="HashTable"
  6709. c:type="GHashTable"
  6710. glib:type-name="GHashTable"
  6711. glib:get-type="g_hash_table_get_type"
  6712. c:symbol-prefix="hash_table">
  6713. <doc xml:space="preserve">The #GHashTable struct is an opaque data structure to represent a
  6714. [Hash Table][glib-Hash-Tables]. It should only be accessed via the
  6715. following functions.</doc>
  6716. <function name="add" c:identifier="g_hash_table_add" version="2.32">
  6717. <doc xml:space="preserve">This is a convenience function for using a #GHashTable as a set. It
  6718. is equivalent to calling g_hash_table_replace() with @key as both the
  6719. key and the value.
  6720. When a hash table only ever contains keys that have themselves as the
  6721. corresponding value it is able to be stored more efficiently. See
  6722. the discussion in the section description.</doc>
  6723. <return-value transfer-ownership="none">
  6724. <doc xml:space="preserve">%TRUE if the key did not exist yet</doc>
  6725. <type name="gboolean" c:type="gboolean"/>
  6726. </return-value>
  6727. <parameters>
  6728. <parameter name="hash_table" transfer-ownership="none">
  6729. <doc xml:space="preserve">a #GHashTable</doc>
  6730. <type name="GLib.HashTable" c:type="GHashTable*">
  6731. <type name="gpointer" c:type="gpointer"/>
  6732. <type name="gpointer" c:type="gpointer"/>
  6733. </type>
  6734. </parameter>
  6735. <parameter name="key"
  6736. transfer-ownership="none"
  6737. nullable="1"
  6738. allow-none="1">
  6739. <doc xml:space="preserve">a key to insert</doc>
  6740. <type name="gpointer" c:type="gpointer"/>
  6741. </parameter>
  6742. </parameters>
  6743. </function>
  6744. <function name="contains"
  6745. c:identifier="g_hash_table_contains"
  6746. version="2.32">
  6747. <doc xml:space="preserve">Checks if @key is in @hash_table.</doc>
  6748. <return-value transfer-ownership="none">
  6749. <doc xml:space="preserve">%TRUE if @key is in @hash_table, %FALSE otherwise.</doc>
  6750. <type name="gboolean" c:type="gboolean"/>
  6751. </return-value>
  6752. <parameters>
  6753. <parameter name="hash_table" transfer-ownership="none">
  6754. <doc xml:space="preserve">a #GHashTable</doc>
  6755. <type name="GLib.HashTable" c:type="GHashTable*">
  6756. <type name="gpointer" c:type="gpointer"/>
  6757. <type name="gpointer" c:type="gpointer"/>
  6758. </type>
  6759. </parameter>
  6760. <parameter name="key"
  6761. transfer-ownership="none"
  6762. nullable="1"
  6763. allow-none="1">
  6764. <doc xml:space="preserve">a key to check</doc>
  6765. <type name="gpointer" c:type="gconstpointer"/>
  6766. </parameter>
  6767. </parameters>
  6768. </function>
  6769. <function name="destroy" c:identifier="g_hash_table_destroy">
  6770. <doc xml:space="preserve">Destroys all keys and values in the #GHashTable and decrements its
  6771. reference count by 1. If keys and/or values are dynamically allocated,
  6772. you should either free them first or create the #GHashTable with destroy
  6773. notifiers using g_hash_table_new_full(). In the latter case the destroy
  6774. functions you supplied will be called on all keys and values during the
  6775. destruction phase.</doc>
  6776. <return-value transfer-ownership="none">
  6777. <type name="none" c:type="void"/>
  6778. </return-value>
  6779. <parameters>
  6780. <parameter name="hash_table" transfer-ownership="none">
  6781. <doc xml:space="preserve">a #GHashTable</doc>
  6782. <type name="GLib.HashTable" c:type="GHashTable*">
  6783. <type name="gpointer" c:type="gpointer"/>
  6784. <type name="gpointer" c:type="gpointer"/>
  6785. </type>
  6786. </parameter>
  6787. </parameters>
  6788. </function>
  6789. <function name="find"
  6790. c:identifier="g_hash_table_find"
  6791. version="2.4"
  6792. introspectable="0">
  6793. <doc xml:space="preserve">Calls the given function for key/value pairs in the #GHashTable
  6794. until @predicate returns %TRUE. The function is passed the key
  6795. and value of each pair, and the given @user_data parameter. The
  6796. hash table may not be modified while iterating over it (you can't
  6797. add/remove items).
  6798. Note, that hash tables are really only optimized for forward
  6799. lookups, i.e. g_hash_table_lookup(). So code that frequently issues
  6800. g_hash_table_find() or g_hash_table_foreach() (e.g. in the order of
  6801. once per every entry in a hash table) should probably be reworked
  6802. to use additional or different data structures for reverse lookups
  6803. (keep in mind that an O(n) find/foreach operation issued for all n
  6804. values in a hash table ends up needing O(n*n) operations).</doc>
  6805. <return-value transfer-ownership="none" nullable="1">
  6806. <doc xml:space="preserve">The value of the first key/value pair is returned,
  6807. for which @predicate evaluates to %TRUE. If no pair with the
  6808. requested property is found, %NULL is returned.</doc>
  6809. <type name="gpointer" c:type="gpointer"/>
  6810. </return-value>
  6811. <parameters>
  6812. <parameter name="hash_table" transfer-ownership="none">
  6813. <doc xml:space="preserve">a #GHashTable</doc>
  6814. <type name="GLib.HashTable" c:type="GHashTable*">
  6815. <type name="gpointer" c:type="gpointer"/>
  6816. <type name="gpointer" c:type="gpointer"/>
  6817. </type>
  6818. </parameter>
  6819. <parameter name="predicate" transfer-ownership="none" closure="2">
  6820. <doc xml:space="preserve">function to test the key/value pairs for a certain property</doc>
  6821. <type name="HRFunc" c:type="GHRFunc"/>
  6822. </parameter>
  6823. <parameter name="user_data"
  6824. transfer-ownership="none"
  6825. nullable="1"
  6826. allow-none="1">
  6827. <doc xml:space="preserve">user data to pass to the function</doc>
  6828. <type name="gpointer" c:type="gpointer"/>
  6829. </parameter>
  6830. </parameters>
  6831. </function>
  6832. <function name="foreach"
  6833. c:identifier="g_hash_table_foreach"
  6834. introspectable="0">
  6835. <doc xml:space="preserve">Calls the given function for each of the key/value pairs in the
  6836. #GHashTable. The function is passed the key and value of each
  6837. pair, and the given @user_data parameter. The hash table may not
  6838. be modified while iterating over it (you can't add/remove
  6839. items). To remove all items matching a predicate, use
  6840. g_hash_table_foreach_remove().
  6841. See g_hash_table_find() for performance caveats for linear
  6842. order searches in contrast to g_hash_table_lookup().</doc>
  6843. <return-value transfer-ownership="none">
  6844. <type name="none" c:type="void"/>
  6845. </return-value>
  6846. <parameters>
  6847. <parameter name="hash_table" transfer-ownership="none">
  6848. <doc xml:space="preserve">a #GHashTable</doc>
  6849. <type name="GLib.HashTable" c:type="GHashTable*">
  6850. <type name="gpointer" c:type="gpointer"/>
  6851. <type name="gpointer" c:type="gpointer"/>
  6852. </type>
  6853. </parameter>
  6854. <parameter name="func" transfer-ownership="none" closure="2">
  6855. <doc xml:space="preserve">the function to call for each key/value pair</doc>
  6856. <type name="HFunc" c:type="GHFunc"/>
  6857. </parameter>
  6858. <parameter name="user_data"
  6859. transfer-ownership="none"
  6860. nullable="1"
  6861. allow-none="1">
  6862. <doc xml:space="preserve">user data to pass to the function</doc>
  6863. <type name="gpointer" c:type="gpointer"/>
  6864. </parameter>
  6865. </parameters>
  6866. </function>
  6867. <function name="foreach_remove"
  6868. c:identifier="g_hash_table_foreach_remove"
  6869. introspectable="0">
  6870. <doc xml:space="preserve">Calls the given function for each key/value pair in the
  6871. #GHashTable. If the function returns %TRUE, then the key/value
  6872. pair is removed from the #GHashTable. If you supplied key or
  6873. value destroy functions when creating the #GHashTable, they are
  6874. used to free the memory allocated for the removed keys and values.
  6875. See #GHashTableIter for an alternative way to loop over the
  6876. key/value pairs in the hash table.</doc>
  6877. <return-value transfer-ownership="none">
  6878. <doc xml:space="preserve">the number of key/value pairs removed</doc>
  6879. <type name="guint" c:type="guint"/>
  6880. </return-value>
  6881. <parameters>
  6882. <parameter name="hash_table" transfer-ownership="none">
  6883. <doc xml:space="preserve">a #GHashTable</doc>
  6884. <type name="GLib.HashTable" c:type="GHashTable*">
  6885. <type name="gpointer" c:type="gpointer"/>
  6886. <type name="gpointer" c:type="gpointer"/>
  6887. </type>
  6888. </parameter>
  6889. <parameter name="func" transfer-ownership="none" closure="2">
  6890. <doc xml:space="preserve">the function to call for each key/value pair</doc>
  6891. <type name="HRFunc" c:type="GHRFunc"/>
  6892. </parameter>
  6893. <parameter name="user_data"
  6894. transfer-ownership="none"
  6895. nullable="1"
  6896. allow-none="1">
  6897. <doc xml:space="preserve">user data to pass to the function</doc>
  6898. <type name="gpointer" c:type="gpointer"/>
  6899. </parameter>
  6900. </parameters>
  6901. </function>
  6902. <function name="foreach_steal"
  6903. c:identifier="g_hash_table_foreach_steal"
  6904. introspectable="0">
  6905. <doc xml:space="preserve">Calls the given function for each key/value pair in the
  6906. #GHashTable. If the function returns %TRUE, then the key/value
  6907. pair is removed from the #GHashTable, but no key or value
  6908. destroy functions are called.
  6909. See #GHashTableIter for an alternative way to loop over the
  6910. key/value pairs in the hash table.</doc>
  6911. <return-value transfer-ownership="none">
  6912. <doc xml:space="preserve">the number of key/value pairs removed.</doc>
  6913. <type name="guint" c:type="guint"/>
  6914. </return-value>
  6915. <parameters>
  6916. <parameter name="hash_table" transfer-ownership="none">
  6917. <doc xml:space="preserve">a #GHashTable</doc>
  6918. <type name="GLib.HashTable" c:type="GHashTable*">
  6919. <type name="gpointer" c:type="gpointer"/>
  6920. <type name="gpointer" c:type="gpointer"/>
  6921. </type>
  6922. </parameter>
  6923. <parameter name="func" transfer-ownership="none" closure="2">
  6924. <doc xml:space="preserve">the function to call for each key/value pair</doc>
  6925. <type name="HRFunc" c:type="GHRFunc"/>
  6926. </parameter>
  6927. <parameter name="user_data"
  6928. transfer-ownership="none"
  6929. nullable="1"
  6930. allow-none="1">
  6931. <doc xml:space="preserve">user data to pass to the function</doc>
  6932. <type name="gpointer" c:type="gpointer"/>
  6933. </parameter>
  6934. </parameters>
  6935. </function>
  6936. <function name="get_keys"
  6937. c:identifier="g_hash_table_get_keys"
  6938. version="2.14"
  6939. introspectable="0">
  6940. <doc xml:space="preserve">Retrieves every key inside @hash_table. The returned data is valid
  6941. until changes to the hash release those keys.
  6942. This iterates over every entry in the hash table to build its return value.
  6943. To iterate over the entries in a #GHashTable more efficiently, use a
  6944. #GHashTableIter.</doc>
  6945. <return-value transfer-ownership="container">
  6946. <doc xml:space="preserve">a #GList containing all the keys
  6947. inside the hash table. The content of the list is owned by the
  6948. hash table and should not be modified or freed. Use g_list_free()
  6949. when done using the list.</doc>
  6950. <type name="GLib.List" c:type="GList*">
  6951. <type name="gpointer" c:type="gpointer"/>
  6952. </type>
  6953. </return-value>
  6954. <parameters>
  6955. <parameter name="hash_table" transfer-ownership="none">
  6956. <doc xml:space="preserve">a #GHashTable</doc>
  6957. <type name="GLib.HashTable" c:type="GHashTable*">
  6958. <type name="gpointer" c:type="gpointer"/>
  6959. <type name="gpointer" c:type="gpointer"/>
  6960. </type>
  6961. </parameter>
  6962. </parameters>
  6963. </function>
  6964. <function name="get_keys_as_array"
  6965. c:identifier="g_hash_table_get_keys_as_array"
  6966. version="2.40"
  6967. introspectable="0">
  6968. <doc xml:space="preserve">Retrieves every key inside @hash_table, as an array.
  6969. The returned array is %NULL-terminated but may contain %NULL as a
  6970. key. Use @length to determine the true length if it's possible that
  6971. %NULL was used as the value for a key.
  6972. Note: in the common case of a string-keyed #GHashTable, the return
  6973. value of this function can be conveniently cast to (const gchar **).
  6974. This iterates over every entry in the hash table to build its return value.
  6975. To iterate over the entries in a #GHashTable more efficiently, use a
  6976. #GHashTableIter.
  6977. You should always free the return result with g_free(). In the
  6978. above-mentioned case of a string-keyed hash table, it may be
  6979. appropriate to use g_strfreev() if you call g_hash_table_steal_all()
  6980. first to transfer ownership of the keys.</doc>
  6981. <return-value transfer-ownership="container">
  6982. <doc xml:space="preserve">a
  6983. %NULL-terminated array containing each key from the table.</doc>
  6984. <array length="1" zero-terminated="0" c:type="gpointer*">
  6985. <type name="gpointer" c:type="gpointer"/>
  6986. </array>
  6987. </return-value>
  6988. <parameters>
  6989. <parameter name="hash_table" transfer-ownership="none">
  6990. <doc xml:space="preserve">a #GHashTable</doc>
  6991. <type name="GLib.HashTable" c:type="GHashTable*">
  6992. <type name="gpointer" c:type="gpointer"/>
  6993. <type name="gpointer" c:type="gpointer"/>
  6994. </type>
  6995. </parameter>
  6996. <parameter name="length"
  6997. direction="out"
  6998. caller-allocates="0"
  6999. transfer-ownership="full">
  7000. <doc xml:space="preserve">the length of the returned array</doc>
  7001. <type name="guint" c:type="guint*"/>
  7002. </parameter>
  7003. </parameters>
  7004. </function>
  7005. <function name="get_values"
  7006. c:identifier="g_hash_table_get_values"
  7007. version="2.14"
  7008. introspectable="0">
  7009. <doc xml:space="preserve">Retrieves every value inside @hash_table. The returned data
  7010. is valid until @hash_table is modified.
  7011. This iterates over every entry in the hash table to build its return value.
  7012. To iterate over the entries in a #GHashTable more efficiently, use a
  7013. #GHashTableIter.</doc>
  7014. <return-value transfer-ownership="container">
  7015. <doc xml:space="preserve">a #GList containing all the values
  7016. inside the hash table. The content of the list is owned by the
  7017. hash table and should not be modified or freed. Use g_list_free()
  7018. when done using the list.</doc>
  7019. <type name="GLib.List" c:type="GList*">
  7020. <type name="gpointer" c:type="gpointer"/>
  7021. </type>
  7022. </return-value>
  7023. <parameters>
  7024. <parameter name="hash_table" transfer-ownership="none">
  7025. <doc xml:space="preserve">a #GHashTable</doc>
  7026. <type name="GLib.HashTable" c:type="GHashTable*">
  7027. <type name="gpointer" c:type="gpointer"/>
  7028. <type name="gpointer" c:type="gpointer"/>
  7029. </type>
  7030. </parameter>
  7031. </parameters>
  7032. </function>
  7033. <function name="insert" c:identifier="g_hash_table_insert">
  7034. <doc xml:space="preserve">Inserts a new key and value into a #GHashTable.
  7035. If the key already exists in the #GHashTable its current
  7036. value is replaced with the new value. If you supplied a
  7037. @value_destroy_func when creating the #GHashTable, the old
  7038. value is freed using that function. If you supplied a
  7039. @key_destroy_func when creating the #GHashTable, the passed
  7040. key is freed using that function.</doc>
  7041. <return-value transfer-ownership="none">
  7042. <doc xml:space="preserve">%TRUE if the key did not exist yet</doc>
  7043. <type name="gboolean" c:type="gboolean"/>
  7044. </return-value>
  7045. <parameters>
  7046. <parameter name="hash_table" transfer-ownership="none">
  7047. <doc xml:space="preserve">a #GHashTable</doc>
  7048. <type name="GLib.HashTable" c:type="GHashTable*">
  7049. <type name="gpointer" c:type="gpointer"/>
  7050. <type name="gpointer" c:type="gpointer"/>
  7051. </type>
  7052. </parameter>
  7053. <parameter name="key"
  7054. transfer-ownership="none"
  7055. nullable="1"
  7056. allow-none="1">
  7057. <doc xml:space="preserve">a key to insert</doc>
  7058. <type name="gpointer" c:type="gpointer"/>
  7059. </parameter>
  7060. <parameter name="value"
  7061. transfer-ownership="none"
  7062. nullable="1"
  7063. allow-none="1">
  7064. <doc xml:space="preserve">the value to associate with the key</doc>
  7065. <type name="gpointer" c:type="gpointer"/>
  7066. </parameter>
  7067. </parameters>
  7068. </function>
  7069. <function name="lookup" c:identifier="g_hash_table_lookup">
  7070. <doc xml:space="preserve">Looks up a key in a #GHashTable. Note that this function cannot
  7071. distinguish between a key that is not present and one which is present
  7072. and has the value %NULL. If you need this distinction, use
  7073. g_hash_table_lookup_extended().</doc>
  7074. <return-value transfer-ownership="none" nullable="1">
  7075. <doc xml:space="preserve">the associated value, or %NULL if the key is not found</doc>
  7076. <type name="gpointer" c:type="gpointer"/>
  7077. </return-value>
  7078. <parameters>
  7079. <parameter name="hash_table" transfer-ownership="none">
  7080. <doc xml:space="preserve">a #GHashTable</doc>
  7081. <type name="GLib.HashTable" c:type="GHashTable*">
  7082. <type name="gpointer" c:type="gpointer"/>
  7083. <type name="gpointer" c:type="gpointer"/>
  7084. </type>
  7085. </parameter>
  7086. <parameter name="key"
  7087. transfer-ownership="none"
  7088. nullable="1"
  7089. allow-none="1">
  7090. <doc xml:space="preserve">the key to look up</doc>
  7091. <type name="gpointer" c:type="gconstpointer"/>
  7092. </parameter>
  7093. </parameters>
  7094. </function>
  7095. <function name="lookup_extended"
  7096. c:identifier="g_hash_table_lookup_extended">
  7097. <doc xml:space="preserve">Looks up a key in the #GHashTable, returning the original key and the
  7098. associated value and a #gboolean which is %TRUE if the key was found. This
  7099. is useful if you need to free the memory allocated for the original key,
  7100. for example before calling g_hash_table_remove().
  7101. You can actually pass %NULL for @lookup_key to test
  7102. whether the %NULL key exists, provided the hash and equal functions
  7103. of @hash_table are %NULL-safe.</doc>
  7104. <return-value transfer-ownership="none">
  7105. <doc xml:space="preserve">%TRUE if the key was found in the #GHashTable</doc>
  7106. <type name="gboolean" c:type="gboolean"/>
  7107. </return-value>
  7108. <parameters>
  7109. <parameter name="hash_table" transfer-ownership="none">
  7110. <doc xml:space="preserve">a #GHashTable</doc>
  7111. <type name="GLib.HashTable" c:type="GHashTable*">
  7112. <type name="gpointer" c:type="gpointer"/>
  7113. <type name="gpointer" c:type="gpointer"/>
  7114. </type>
  7115. </parameter>
  7116. <parameter name="lookup_key"
  7117. transfer-ownership="none"
  7118. nullable="1"
  7119. allow-none="1">
  7120. <doc xml:space="preserve">the key to look up</doc>
  7121. <type name="gpointer" c:type="gconstpointer"/>
  7122. </parameter>
  7123. <parameter name="orig_key"
  7124. direction="out"
  7125. caller-allocates="0"
  7126. transfer-ownership="full"
  7127. nullable="1"
  7128. optional="1"
  7129. allow-none="1">
  7130. <doc xml:space="preserve">return location for the original key</doc>
  7131. <type name="gpointer" c:type="gpointer*"/>
  7132. </parameter>
  7133. <parameter name="value"
  7134. direction="out"
  7135. caller-allocates="0"
  7136. transfer-ownership="full"
  7137. nullable="1"
  7138. optional="1"
  7139. allow-none="1">
  7140. <doc xml:space="preserve">return location for the value associated
  7141. with the key</doc>
  7142. <type name="gpointer" c:type="gpointer*"/>
  7143. </parameter>
  7144. </parameters>
  7145. </function>
  7146. <function name="new" c:identifier="g_hash_table_new" introspectable="0">
  7147. <doc xml:space="preserve">Creates a new #GHashTable with a reference count of 1.
  7148. Hash values returned by @hash_func are used to determine where keys
  7149. are stored within the #GHashTable data structure. The g_direct_hash(),
  7150. g_int_hash(), g_int64_hash(), g_double_hash() and g_str_hash()
  7151. functions are provided for some common types of keys.
  7152. If @hash_func is %NULL, g_direct_hash() is used.
  7153. @key_equal_func is used when looking up keys in the #GHashTable.
  7154. The g_direct_equal(), g_int_equal(), g_int64_equal(), g_double_equal()
  7155. and g_str_equal() functions are provided for the most common types
  7156. of keys. If @key_equal_func is %NULL, keys are compared directly in
  7157. a similar fashion to g_direct_equal(), but without the overhead of
  7158. a function call.</doc>
  7159. <return-value>
  7160. <doc xml:space="preserve">a new #GHashTable</doc>
  7161. <type name="GLib.HashTable" c:type="GHashTable*">
  7162. <type name="gpointer" c:type="gpointer"/>
  7163. <type name="gpointer" c:type="gpointer"/>
  7164. </type>
  7165. </return-value>
  7166. <parameters>
  7167. <parameter name="hash_func" transfer-ownership="none">
  7168. <doc xml:space="preserve">a function to create a hash value from a key</doc>
  7169. <type name="HashFunc" c:type="GHashFunc"/>
  7170. </parameter>
  7171. <parameter name="key_equal_func" transfer-ownership="none">
  7172. <doc xml:space="preserve">a function to check two keys for equality</doc>
  7173. <type name="EqualFunc" c:type="GEqualFunc"/>
  7174. </parameter>
  7175. </parameters>
  7176. </function>
  7177. <function name="new_full"
  7178. c:identifier="g_hash_table_new_full"
  7179. introspectable="0">
  7180. <doc xml:space="preserve">Creates a new #GHashTable like g_hash_table_new() with a reference
  7181. count of 1 and allows to specify functions to free the memory
  7182. allocated for the key and value that get called when removing the
  7183. entry from the #GHashTable.
  7184. Since version 2.42 it is permissible for destroy notify functions to
  7185. recursively remove further items from the hash table. This is only
  7186. permissible if the application still holds a reference to the hash table.
  7187. This means that you may need to ensure that the hash table is empty by
  7188. calling g_hash_table_remove_all before releasing the last reference using
  7189. g_hash_table_unref().</doc>
  7190. <return-value>
  7191. <doc xml:space="preserve">a new #GHashTable</doc>
  7192. <type name="GLib.HashTable" c:type="GHashTable*">
  7193. <type name="gpointer" c:type="gpointer"/>
  7194. <type name="gpointer" c:type="gpointer"/>
  7195. </type>
  7196. </return-value>
  7197. <parameters>
  7198. <parameter name="hash_func" transfer-ownership="none">
  7199. <doc xml:space="preserve">a function to create a hash value from a key</doc>
  7200. <type name="HashFunc" c:type="GHashFunc"/>
  7201. </parameter>
  7202. <parameter name="key_equal_func"
  7203. transfer-ownership="none"
  7204. scope="notified"
  7205. destroy="3">
  7206. <doc xml:space="preserve">a function to check two keys for equality</doc>
  7207. <type name="EqualFunc" c:type="GEqualFunc"/>
  7208. </parameter>
  7209. <parameter name="key_destroy_func"
  7210. transfer-ownership="none"
  7211. nullable="1"
  7212. allow-none="1"
  7213. scope="async">
  7214. <doc xml:space="preserve">a function to free the memory allocated for the key
  7215. used when removing the entry from the #GHashTable, or %NULL
  7216. if you don't want to supply such a function.</doc>
  7217. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  7218. </parameter>
  7219. <parameter name="value_destroy_func"
  7220. transfer-ownership="none"
  7221. nullable="1"
  7222. allow-none="1"
  7223. scope="async">
  7224. <doc xml:space="preserve">a function to free the memory allocated for the
  7225. value used when removing the entry from the #GHashTable, or %NULL
  7226. if you don't want to supply such a function.</doc>
  7227. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  7228. </parameter>
  7229. </parameters>
  7230. </function>
  7231. <function name="ref"
  7232. c:identifier="g_hash_table_ref"
  7233. version="2.10"
  7234. introspectable="0">
  7235. <doc xml:space="preserve">Atomically increments the reference count of @hash_table by one.
  7236. This function is MT-safe and may be called from any thread.</doc>
  7237. <return-value>
  7238. <doc xml:space="preserve">the passed in #GHashTable</doc>
  7239. <type name="GLib.HashTable" c:type="GHashTable*">
  7240. <type name="gpointer" c:type="gpointer"/>
  7241. <type name="gpointer" c:type="gpointer"/>
  7242. </type>
  7243. </return-value>
  7244. <parameters>
  7245. <parameter name="hash_table" transfer-ownership="none">
  7246. <doc xml:space="preserve">a valid #GHashTable</doc>
  7247. <type name="GLib.HashTable" c:type="GHashTable*">
  7248. <type name="gpointer" c:type="gpointer"/>
  7249. <type name="gpointer" c:type="gpointer"/>
  7250. </type>
  7251. </parameter>
  7252. </parameters>
  7253. </function>
  7254. <function name="remove" c:identifier="g_hash_table_remove">
  7255. <doc xml:space="preserve">Removes a key and its associated value from a #GHashTable.
  7256. If the #GHashTable was created using g_hash_table_new_full(), the
  7257. key and value are freed using the supplied destroy functions, otherwise
  7258. you have to make sure that any dynamically allocated values are freed
  7259. yourself.</doc>
  7260. <return-value transfer-ownership="none">
  7261. <doc xml:space="preserve">%TRUE if the key was found and removed from the #GHashTable</doc>
  7262. <type name="gboolean" c:type="gboolean"/>
  7263. </return-value>
  7264. <parameters>
  7265. <parameter name="hash_table" transfer-ownership="none">
  7266. <doc xml:space="preserve">a #GHashTable</doc>
  7267. <type name="GLib.HashTable" c:type="GHashTable*">
  7268. <type name="gpointer" c:type="gpointer"/>
  7269. <type name="gpointer" c:type="gpointer"/>
  7270. </type>
  7271. </parameter>
  7272. <parameter name="key"
  7273. transfer-ownership="none"
  7274. nullable="1"
  7275. allow-none="1">
  7276. <doc xml:space="preserve">the key to remove</doc>
  7277. <type name="gpointer" c:type="gconstpointer"/>
  7278. </parameter>
  7279. </parameters>
  7280. </function>
  7281. <function name="remove_all"
  7282. c:identifier="g_hash_table_remove_all"
  7283. version="2.12">
  7284. <doc xml:space="preserve">Removes all keys and their associated values from a #GHashTable.
  7285. If the #GHashTable was created using g_hash_table_new_full(),
  7286. the keys and values are freed using the supplied destroy functions,
  7287. otherwise you have to make sure that any dynamically allocated
  7288. values are freed yourself.</doc>
  7289. <return-value transfer-ownership="none">
  7290. <type name="none" c:type="void"/>
  7291. </return-value>
  7292. <parameters>
  7293. <parameter name="hash_table" transfer-ownership="none">
  7294. <doc xml:space="preserve">a #GHashTable</doc>
  7295. <type name="GLib.HashTable" c:type="GHashTable*">
  7296. <type name="gpointer" c:type="gpointer"/>
  7297. <type name="gpointer" c:type="gpointer"/>
  7298. </type>
  7299. </parameter>
  7300. </parameters>
  7301. </function>
  7302. <function name="replace" c:identifier="g_hash_table_replace">
  7303. <doc xml:space="preserve">Inserts a new key and value into a #GHashTable similar to
  7304. g_hash_table_insert(). The difference is that if the key
  7305. already exists in the #GHashTable, it gets replaced by the
  7306. new key. If you supplied a @value_destroy_func when creating
  7307. the #GHashTable, the old value is freed using that function.
  7308. If you supplied a @key_destroy_func when creating the
  7309. #GHashTable, the old key is freed using that function.</doc>
  7310. <return-value transfer-ownership="none">
  7311. <doc xml:space="preserve">%TRUE if the key did not exist yet</doc>
  7312. <type name="gboolean" c:type="gboolean"/>
  7313. </return-value>
  7314. <parameters>
  7315. <parameter name="hash_table" transfer-ownership="none">
  7316. <doc xml:space="preserve">a #GHashTable</doc>
  7317. <type name="GLib.HashTable" c:type="GHashTable*">
  7318. <type name="gpointer" c:type="gpointer"/>
  7319. <type name="gpointer" c:type="gpointer"/>
  7320. </type>
  7321. </parameter>
  7322. <parameter name="key"
  7323. transfer-ownership="none"
  7324. nullable="1"
  7325. allow-none="1">
  7326. <doc xml:space="preserve">a key to insert</doc>
  7327. <type name="gpointer" c:type="gpointer"/>
  7328. </parameter>
  7329. <parameter name="value"
  7330. transfer-ownership="none"
  7331. nullable="1"
  7332. allow-none="1">
  7333. <doc xml:space="preserve">the value to associate with the key</doc>
  7334. <type name="gpointer" c:type="gpointer"/>
  7335. </parameter>
  7336. </parameters>
  7337. </function>
  7338. <function name="size" c:identifier="g_hash_table_size">
  7339. <doc xml:space="preserve">Returns the number of elements contained in the #GHashTable.</doc>
  7340. <return-value transfer-ownership="none">
  7341. <doc xml:space="preserve">the number of key/value pairs in the #GHashTable.</doc>
  7342. <type name="guint" c:type="guint"/>
  7343. </return-value>
  7344. <parameters>
  7345. <parameter name="hash_table" transfer-ownership="none">
  7346. <doc xml:space="preserve">a #GHashTable</doc>
  7347. <type name="GLib.HashTable" c:type="GHashTable*">
  7348. <type name="gpointer" c:type="gpointer"/>
  7349. <type name="gpointer" c:type="gpointer"/>
  7350. </type>
  7351. </parameter>
  7352. </parameters>
  7353. </function>
  7354. <function name="steal" c:identifier="g_hash_table_steal">
  7355. <doc xml:space="preserve">Removes a key and its associated value from a #GHashTable without
  7356. calling the key and value destroy functions.</doc>
  7357. <return-value transfer-ownership="none">
  7358. <doc xml:space="preserve">%TRUE if the key was found and removed from the #GHashTable</doc>
  7359. <type name="gboolean" c:type="gboolean"/>
  7360. </return-value>
  7361. <parameters>
  7362. <parameter name="hash_table" transfer-ownership="none">
  7363. <doc xml:space="preserve">a #GHashTable</doc>
  7364. <type name="GLib.HashTable" c:type="GHashTable*">
  7365. <type name="gpointer" c:type="gpointer"/>
  7366. <type name="gpointer" c:type="gpointer"/>
  7367. </type>
  7368. </parameter>
  7369. <parameter name="key"
  7370. transfer-ownership="none"
  7371. nullable="1"
  7372. allow-none="1">
  7373. <doc xml:space="preserve">the key to remove</doc>
  7374. <type name="gpointer" c:type="gconstpointer"/>
  7375. </parameter>
  7376. </parameters>
  7377. </function>
  7378. <function name="steal_all"
  7379. c:identifier="g_hash_table_steal_all"
  7380. version="2.12">
  7381. <doc xml:space="preserve">Removes all keys and their associated values from a #GHashTable
  7382. without calling the key and value destroy functions.</doc>
  7383. <return-value transfer-ownership="none">
  7384. <type name="none" c:type="void"/>
  7385. </return-value>
  7386. <parameters>
  7387. <parameter name="hash_table" transfer-ownership="none">
  7388. <doc xml:space="preserve">a #GHashTable</doc>
  7389. <type name="GLib.HashTable" c:type="GHashTable*">
  7390. <type name="gpointer" c:type="gpointer"/>
  7391. <type name="gpointer" c:type="gpointer"/>
  7392. </type>
  7393. </parameter>
  7394. </parameters>
  7395. </function>
  7396. <function name="unref" c:identifier="g_hash_table_unref" version="2.10">
  7397. <doc xml:space="preserve">Atomically decrements the reference count of @hash_table by one.
  7398. If the reference count drops to 0, all keys and values will be
  7399. destroyed, and all memory allocated by the hash table is released.
  7400. This function is MT-safe and may be called from any thread.</doc>
  7401. <return-value transfer-ownership="none">
  7402. <type name="none" c:type="void"/>
  7403. </return-value>
  7404. <parameters>
  7405. <parameter name="hash_table" transfer-ownership="none">
  7406. <doc xml:space="preserve">a valid #GHashTable</doc>
  7407. <type name="GLib.HashTable" c:type="GHashTable*">
  7408. <type name="gpointer" c:type="gpointer"/>
  7409. <type name="gpointer" c:type="gpointer"/>
  7410. </type>
  7411. </parameter>
  7412. </parameters>
  7413. </function>
  7414. </record>
  7415. <record name="HashTableIter" c:type="GHashTableIter">
  7416. <doc xml:space="preserve">A GHashTableIter structure represents an iterator that can be used
  7417. to iterate over the elements of a #GHashTable. GHashTableIter
  7418. structures are typically allocated on the stack and then initialized
  7419. with g_hash_table_iter_init().</doc>
  7420. <field name="dummy1" readable="0" private="1">
  7421. <type name="gpointer" c:type="gpointer"/>
  7422. </field>
  7423. <field name="dummy2" readable="0" private="1">
  7424. <type name="gpointer" c:type="gpointer"/>
  7425. </field>
  7426. <field name="dummy3" readable="0" private="1">
  7427. <type name="gpointer" c:type="gpointer"/>
  7428. </field>
  7429. <field name="dummy4" readable="0" private="1">
  7430. <type name="gint" c:type="int"/>
  7431. </field>
  7432. <field name="dummy5" readable="0" private="1">
  7433. <type name="gboolean" c:type="gboolean"/>
  7434. </field>
  7435. <field name="dummy6" readable="0" private="1">
  7436. <type name="gpointer" c:type="gpointer"/>
  7437. </field>
  7438. <method name="get_hash_table"
  7439. c:identifier="g_hash_table_iter_get_hash_table"
  7440. version="2.16"
  7441. introspectable="0">
  7442. <doc xml:space="preserve">Returns the #GHashTable associated with @iter.</doc>
  7443. <return-value>
  7444. <doc xml:space="preserve">the #GHashTable associated with @iter.</doc>
  7445. <type name="GLib.HashTable" c:type="GHashTable*">
  7446. <type name="gpointer" c:type="gpointer"/>
  7447. <type name="gpointer" c:type="gpointer"/>
  7448. </type>
  7449. </return-value>
  7450. <parameters>
  7451. <instance-parameter name="iter" transfer-ownership="none">
  7452. <doc xml:space="preserve">an initialized #GHashTableIter</doc>
  7453. <type name="HashTableIter" c:type="GHashTableIter*"/>
  7454. </instance-parameter>
  7455. </parameters>
  7456. </method>
  7457. <method name="init" c:identifier="g_hash_table_iter_init" version="2.16">
  7458. <doc xml:space="preserve">Initializes a key/value pair iterator and associates it with
  7459. @hash_table. Modifying the hash table after calling this function
  7460. invalidates the returned iterator.
  7461. |[&lt;!-- language="C" --&gt;
  7462. GHashTableIter iter;
  7463. gpointer key, value;
  7464. g_hash_table_iter_init (&amp;iter, hash_table);
  7465. while (g_hash_table_iter_next (&amp;iter, &amp;key, &amp;value))
  7466. {
  7467. // do something with key and value
  7468. }
  7469. ]|</doc>
  7470. <return-value transfer-ownership="none">
  7471. <type name="none" c:type="void"/>
  7472. </return-value>
  7473. <parameters>
  7474. <instance-parameter name="iter" transfer-ownership="none">
  7475. <doc xml:space="preserve">an uninitialized #GHashTableIter</doc>
  7476. <type name="HashTableIter" c:type="GHashTableIter*"/>
  7477. </instance-parameter>
  7478. <parameter name="hash_table" transfer-ownership="none">
  7479. <doc xml:space="preserve">a #GHashTable</doc>
  7480. <type name="GLib.HashTable" c:type="GHashTable*">
  7481. <type name="gpointer" c:type="gpointer"/>
  7482. <type name="gpointer" c:type="gpointer"/>
  7483. </type>
  7484. </parameter>
  7485. </parameters>
  7486. </method>
  7487. <method name="next" c:identifier="g_hash_table_iter_next" version="2.16">
  7488. <doc xml:space="preserve">Advances @iter and retrieves the key and/or value that are now
  7489. pointed to as a result of this advancement. If %FALSE is returned,
  7490. @key and @value are not set, and the iterator becomes invalid.</doc>
  7491. <return-value transfer-ownership="none">
  7492. <doc xml:space="preserve">%FALSE if the end of the #GHashTable has been reached.</doc>
  7493. <type name="gboolean" c:type="gboolean"/>
  7494. </return-value>
  7495. <parameters>
  7496. <instance-parameter name="iter" transfer-ownership="none">
  7497. <doc xml:space="preserve">an initialized #GHashTableIter</doc>
  7498. <type name="HashTableIter" c:type="GHashTableIter*"/>
  7499. </instance-parameter>
  7500. <parameter name="key"
  7501. direction="out"
  7502. caller-allocates="0"
  7503. transfer-ownership="full"
  7504. nullable="1"
  7505. optional="1"
  7506. allow-none="1">
  7507. <doc xml:space="preserve">a location to store the key</doc>
  7508. <type name="gpointer" c:type="gpointer*"/>
  7509. </parameter>
  7510. <parameter name="value"
  7511. direction="out"
  7512. caller-allocates="0"
  7513. transfer-ownership="full"
  7514. nullable="1"
  7515. optional="1"
  7516. allow-none="1">
  7517. <doc xml:space="preserve">a location to store the value</doc>
  7518. <type name="gpointer" c:type="gpointer*"/>
  7519. </parameter>
  7520. </parameters>
  7521. </method>
  7522. <method name="remove"
  7523. c:identifier="g_hash_table_iter_remove"
  7524. version="2.16">
  7525. <doc xml:space="preserve">Removes the key/value pair currently pointed to by the iterator
  7526. from its associated #GHashTable. Can only be called after
  7527. g_hash_table_iter_next() returned %TRUE, and cannot be called
  7528. more than once for the same key/value pair.
  7529. If the #GHashTable was created using g_hash_table_new_full(),
  7530. the key and value are freed using the supplied destroy functions,
  7531. otherwise you have to make sure that any dynamically allocated
  7532. values are freed yourself.
  7533. It is safe to continue iterating the #GHashTable afterward:
  7534. |[&lt;!-- language="C" --&gt;
  7535. while (g_hash_table_iter_next (&amp;iter, &amp;key, &amp;value))
  7536. {
  7537. if (condition)
  7538. g_hash_table_iter_remove (&amp;iter);
  7539. }
  7540. ]|</doc>
  7541. <return-value transfer-ownership="none">
  7542. <type name="none" c:type="void"/>
  7543. </return-value>
  7544. <parameters>
  7545. <instance-parameter name="iter" transfer-ownership="none">
  7546. <doc xml:space="preserve">an initialized #GHashTableIter</doc>
  7547. <type name="HashTableIter" c:type="GHashTableIter*"/>
  7548. </instance-parameter>
  7549. </parameters>
  7550. </method>
  7551. <method name="replace"
  7552. c:identifier="g_hash_table_iter_replace"
  7553. version="2.30">
  7554. <doc xml:space="preserve">Replaces the value currently pointed to by the iterator
  7555. from its associated #GHashTable. Can only be called after
  7556. g_hash_table_iter_next() returned %TRUE.
  7557. If you supplied a @value_destroy_func when creating the
  7558. #GHashTable, the old value is freed using that function.</doc>
  7559. <return-value transfer-ownership="none">
  7560. <type name="none" c:type="void"/>
  7561. </return-value>
  7562. <parameters>
  7563. <instance-parameter name="iter" transfer-ownership="none">
  7564. <doc xml:space="preserve">an initialized #GHashTableIter</doc>
  7565. <type name="HashTableIter" c:type="GHashTableIter*"/>
  7566. </instance-parameter>
  7567. <parameter name="value"
  7568. transfer-ownership="none"
  7569. nullable="1"
  7570. allow-none="1">
  7571. <doc xml:space="preserve">the value to replace with</doc>
  7572. <type name="gpointer" c:type="gpointer"/>
  7573. </parameter>
  7574. </parameters>
  7575. </method>
  7576. <method name="steal"
  7577. c:identifier="g_hash_table_iter_steal"
  7578. version="2.16">
  7579. <doc xml:space="preserve">Removes the key/value pair currently pointed to by the
  7580. iterator from its associated #GHashTable, without calling
  7581. the key and value destroy functions. Can only be called
  7582. after g_hash_table_iter_next() returned %TRUE, and cannot
  7583. be called more than once for the same key/value pair.</doc>
  7584. <return-value transfer-ownership="none">
  7585. <type name="none" c:type="void"/>
  7586. </return-value>
  7587. <parameters>
  7588. <instance-parameter name="iter" transfer-ownership="none">
  7589. <doc xml:space="preserve">an initialized #GHashTableIter</doc>
  7590. <type name="HashTableIter" c:type="GHashTableIter*"/>
  7591. </instance-parameter>
  7592. </parameters>
  7593. </method>
  7594. </record>
  7595. <record name="Hmac" c:type="GHmac" disguised="1" version="2.30">
  7596. <doc xml:space="preserve">An opaque structure representing a HMAC operation.
  7597. To create a new GHmac, use g_hmac_new(). To free
  7598. a GHmac, use g_hmac_unref().</doc>
  7599. <method name="copy"
  7600. c:identifier="g_hmac_copy"
  7601. version="2.30"
  7602. introspectable="0">
  7603. <doc xml:space="preserve">Copies a #GHmac. If @hmac has been closed, by calling
  7604. g_hmac_get_string() or g_hmac_get_digest(), the copied
  7605. HMAC will be closed as well.</doc>
  7606. <return-value>
  7607. <doc xml:space="preserve">the copy of the passed #GHmac. Use g_hmac_unref()
  7608. when finished using it.</doc>
  7609. <type name="Hmac" c:type="GHmac*"/>
  7610. </return-value>
  7611. <parameters>
  7612. <instance-parameter name="hmac" transfer-ownership="none">
  7613. <doc xml:space="preserve">the #GHmac to copy</doc>
  7614. <type name="Hmac" c:type="const GHmac*"/>
  7615. </instance-parameter>
  7616. </parameters>
  7617. </method>
  7618. <method name="get_digest"
  7619. c:identifier="g_hmac_get_digest"
  7620. version="2.30">
  7621. <doc xml:space="preserve">Gets the digest from @checksum as a raw binary array and places it
  7622. into @buffer. The size of the digest depends on the type of checksum.
  7623. Once this function has been called, the #GHmac is closed and can
  7624. no longer be updated with g_checksum_update().</doc>
  7625. <return-value transfer-ownership="none">
  7626. <type name="none" c:type="void"/>
  7627. </return-value>
  7628. <parameters>
  7629. <instance-parameter name="hmac" transfer-ownership="none">
  7630. <doc xml:space="preserve">a #GHmac</doc>
  7631. <type name="Hmac" c:type="GHmac*"/>
  7632. </instance-parameter>
  7633. <parameter name="buffer" transfer-ownership="none">
  7634. <doc xml:space="preserve">output buffer</doc>
  7635. <type name="guint8" c:type="guint8*"/>
  7636. </parameter>
  7637. <parameter name="digest_len" transfer-ownership="none">
  7638. <doc xml:space="preserve">an inout parameter. The caller initializes it to the
  7639. size of @buffer. After the call it contains the length of the digest</doc>
  7640. <type name="gsize" c:type="gsize*"/>
  7641. </parameter>
  7642. </parameters>
  7643. </method>
  7644. <method name="get_string"
  7645. c:identifier="g_hmac_get_string"
  7646. version="2.30">
  7647. <doc xml:space="preserve">Gets the HMAC as an hexadecimal string.
  7648. Once this function has been called the #GHmac can no longer be
  7649. updated with g_hmac_update().
  7650. The hexadecimal characters will be lower case.</doc>
  7651. <return-value transfer-ownership="none">
  7652. <doc xml:space="preserve">the hexadecimal representation of the HMAC. The
  7653. returned string is owned by the HMAC and should not be modified
  7654. or freed.</doc>
  7655. <type name="utf8" c:type="const gchar*"/>
  7656. </return-value>
  7657. <parameters>
  7658. <instance-parameter name="hmac" transfer-ownership="none">
  7659. <doc xml:space="preserve">a #GHmac</doc>
  7660. <type name="Hmac" c:type="GHmac*"/>
  7661. </instance-parameter>
  7662. </parameters>
  7663. </method>
  7664. <method name="ref"
  7665. c:identifier="g_hmac_ref"
  7666. version="2.30"
  7667. introspectable="0">
  7668. <doc xml:space="preserve">Atomically increments the reference count of @hmac by one.
  7669. This function is MT-safe and may be called from any thread.</doc>
  7670. <return-value>
  7671. <doc xml:space="preserve">the passed in #GHmac.</doc>
  7672. <type name="Hmac" c:type="GHmac*"/>
  7673. </return-value>
  7674. <parameters>
  7675. <instance-parameter name="hmac" transfer-ownership="none">
  7676. <doc xml:space="preserve">a valid #GHmac</doc>
  7677. <type name="Hmac" c:type="GHmac*"/>
  7678. </instance-parameter>
  7679. </parameters>
  7680. </method>
  7681. <method name="unref" c:identifier="g_hmac_unref" version="2.30">
  7682. <doc xml:space="preserve">Atomically decrements the reference count of @hmac by one.
  7683. If the reference count drops to 0, all keys and values will be
  7684. destroyed, and all memory allocated by the hash table is released.
  7685. This function is MT-safe and may be called from any thread.
  7686. Frees the memory allocated for @hmac.</doc>
  7687. <return-value transfer-ownership="none">
  7688. <type name="none" c:type="void"/>
  7689. </return-value>
  7690. <parameters>
  7691. <instance-parameter name="hmac" transfer-ownership="none">
  7692. <doc xml:space="preserve">a #GHmac</doc>
  7693. <type name="Hmac" c:type="GHmac*"/>
  7694. </instance-parameter>
  7695. </parameters>
  7696. </method>
  7697. <method name="update" c:identifier="g_hmac_update" version="2.30">
  7698. <doc xml:space="preserve">Feeds @data into an existing #GHmac.
  7699. The HMAC must still be open, that is g_hmac_get_string() or
  7700. g_hmac_get_digest() must not have been called on @hmac.</doc>
  7701. <return-value transfer-ownership="none">
  7702. <type name="none" c:type="void"/>
  7703. </return-value>
  7704. <parameters>
  7705. <instance-parameter name="hmac" transfer-ownership="none">
  7706. <doc xml:space="preserve">a #GHmac</doc>
  7707. <type name="Hmac" c:type="GHmac*"/>
  7708. </instance-parameter>
  7709. <parameter name="data" transfer-ownership="none">
  7710. <doc xml:space="preserve">buffer used to compute the checksum</doc>
  7711. <array length="1" zero-terminated="0" c:type="guchar*">
  7712. <type name="guint8" c:type="guchar"/>
  7713. </array>
  7714. </parameter>
  7715. <parameter name="length" transfer-ownership="none">
  7716. <doc xml:space="preserve">size of the buffer, or -1 if it is a nul-terminated string</doc>
  7717. <type name="gssize" c:type="gssize"/>
  7718. </parameter>
  7719. </parameters>
  7720. </method>
  7721. <function name="new"
  7722. c:identifier="g_hmac_new"
  7723. version="2.30"
  7724. introspectable="0">
  7725. <doc xml:space="preserve">Creates a new #GHmac, using the digest algorithm @digest_type.
  7726. If the @digest_type is not known, %NULL is returned.
  7727. A #GHmac can be used to compute the HMAC of a key and an
  7728. arbitrary binary blob, using different hashing algorithms.
  7729. A #GHmac works by feeding a binary blob through g_hmac_update()
  7730. until the data is complete; the digest can then be extracted
  7731. using g_hmac_get_string(), which will return the checksum as a
  7732. hexadecimal string; or g_hmac_get_digest(), which will return a
  7733. array of raw bytes. Once either g_hmac_get_string() or
  7734. g_hmac_get_digest() have been called on a #GHmac, the HMAC
  7735. will be closed and it won't be possible to call g_hmac_update()
  7736. on it anymore.
  7737. Support for digests of type %G_CHECKSUM_SHA512 has been added in GLib 2.42.</doc>
  7738. <return-value>
  7739. <doc xml:space="preserve">the newly created #GHmac, or %NULL.
  7740. Use g_hmac_unref() to free the memory allocated by it.</doc>
  7741. <type name="Hmac" c:type="GHmac*"/>
  7742. </return-value>
  7743. <parameters>
  7744. <parameter name="digest_type" transfer-ownership="none">
  7745. <doc xml:space="preserve">the desired type of digest</doc>
  7746. <type name="ChecksumType" c:type="GChecksumType"/>
  7747. </parameter>
  7748. <parameter name="key" transfer-ownership="none">
  7749. <doc xml:space="preserve">the key for the HMAC</doc>
  7750. <array length="2" zero-terminated="0" c:type="guchar*">
  7751. <type name="guint8" c:type="guchar"/>
  7752. </array>
  7753. </parameter>
  7754. <parameter name="key_len" transfer-ownership="none">
  7755. <doc xml:space="preserve">the length of the keys</doc>
  7756. <type name="gsize" c:type="gsize"/>
  7757. </parameter>
  7758. </parameters>
  7759. </function>
  7760. </record>
  7761. <record name="Hook" c:type="GHook">
  7762. <doc xml:space="preserve">The #GHook struct represents a single hook function in a #GHookList.</doc>
  7763. <field name="data" writable="1">
  7764. <doc xml:space="preserve">data which is passed to func when this hook is invoked</doc>
  7765. <type name="gpointer" c:type="gpointer"/>
  7766. </field>
  7767. <field name="next" writable="1">
  7768. <doc xml:space="preserve">pointer to the next hook in the list</doc>
  7769. <type name="Hook" c:type="GHook*"/>
  7770. </field>
  7771. <field name="prev" writable="1">
  7772. <doc xml:space="preserve">pointer to the previous hook in the list</doc>
  7773. <type name="Hook" c:type="GHook*"/>
  7774. </field>
  7775. <field name="ref_count" writable="1">
  7776. <doc xml:space="preserve">the reference count of this hook</doc>
  7777. <type name="guint" c:type="guint"/>
  7778. </field>
  7779. <field name="hook_id" writable="1">
  7780. <doc xml:space="preserve">the id of this hook, which is unique within its list</doc>
  7781. <type name="gulong" c:type="gulong"/>
  7782. </field>
  7783. <field name="flags" writable="1">
  7784. <doc xml:space="preserve">flags which are set for this hook. See #GHookFlagMask for
  7785. predefined flags</doc>
  7786. <type name="guint" c:type="guint"/>
  7787. </field>
  7788. <field name="func" writable="1">
  7789. <doc xml:space="preserve">the function to call when this hook is invoked. The possible
  7790. signatures for this function are #GHookFunc and #GHookCheckFunc</doc>
  7791. <type name="gpointer" c:type="gpointer"/>
  7792. </field>
  7793. <field name="destroy" writable="1">
  7794. <doc xml:space="preserve">the default @finalize_hook function of a #GHookList calls
  7795. this member of the hook that is being finalized</doc>
  7796. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  7797. </field>
  7798. <method name="compare_ids" c:identifier="g_hook_compare_ids">
  7799. <doc xml:space="preserve">Compares the ids of two #GHook elements, returning a negative value
  7800. if the second id is greater than the first.</doc>
  7801. <return-value transfer-ownership="none">
  7802. <doc xml:space="preserve">a value &lt;= 0 if the id of @sibling is &gt;= the id of @new_hook</doc>
  7803. <type name="gint" c:type="gint"/>
  7804. </return-value>
  7805. <parameters>
  7806. <instance-parameter name="new_hook" transfer-ownership="none">
  7807. <doc xml:space="preserve">a #GHook</doc>
  7808. <type name="Hook" c:type="GHook*"/>
  7809. </instance-parameter>
  7810. <parameter name="sibling" transfer-ownership="none">
  7811. <doc xml:space="preserve">a #GHook to compare with @new_hook</doc>
  7812. <type name="Hook" c:type="GHook*"/>
  7813. </parameter>
  7814. </parameters>
  7815. </method>
  7816. <function name="alloc" c:identifier="g_hook_alloc" introspectable="0">
  7817. <doc xml:space="preserve">Allocates space for a #GHook and initializes it.</doc>
  7818. <return-value>
  7819. <doc xml:space="preserve">a new #GHook</doc>
  7820. <type name="Hook" c:type="GHook*"/>
  7821. </return-value>
  7822. <parameters>
  7823. <parameter name="hook_list" transfer-ownership="none">
  7824. <doc xml:space="preserve">a #GHookList</doc>
  7825. <type name="HookList" c:type="GHookList*"/>
  7826. </parameter>
  7827. </parameters>
  7828. </function>
  7829. <function name="destroy" c:identifier="g_hook_destroy">
  7830. <doc xml:space="preserve">Destroys a #GHook, given its ID.</doc>
  7831. <return-value transfer-ownership="none">
  7832. <doc xml:space="preserve">%TRUE if the #GHook was found in the #GHookList and destroyed</doc>
  7833. <type name="gboolean" c:type="gboolean"/>
  7834. </return-value>
  7835. <parameters>
  7836. <parameter name="hook_list" transfer-ownership="none">
  7837. <doc xml:space="preserve">a #GHookList</doc>
  7838. <type name="HookList" c:type="GHookList*"/>
  7839. </parameter>
  7840. <parameter name="hook_id" transfer-ownership="none">
  7841. <doc xml:space="preserve">a hook ID</doc>
  7842. <type name="gulong" c:type="gulong"/>
  7843. </parameter>
  7844. </parameters>
  7845. </function>
  7846. <function name="destroy_link" c:identifier="g_hook_destroy_link">
  7847. <doc xml:space="preserve">Removes one #GHook from a #GHookList, marking it
  7848. inactive and calling g_hook_unref() on it.</doc>
  7849. <return-value transfer-ownership="none">
  7850. <type name="none" c:type="void"/>
  7851. </return-value>
  7852. <parameters>
  7853. <parameter name="hook_list" transfer-ownership="none">
  7854. <doc xml:space="preserve">a #GHookList</doc>
  7855. <type name="HookList" c:type="GHookList*"/>
  7856. </parameter>
  7857. <parameter name="hook" transfer-ownership="none">
  7858. <doc xml:space="preserve">the #GHook to remove</doc>
  7859. <type name="Hook" c:type="GHook*"/>
  7860. </parameter>
  7861. </parameters>
  7862. </function>
  7863. <function name="find" c:identifier="g_hook_find" introspectable="0">
  7864. <doc xml:space="preserve">Finds a #GHook in a #GHookList using the given function to
  7865. test for a match.</doc>
  7866. <return-value>
  7867. <doc xml:space="preserve">the found #GHook or %NULL if no matching #GHook is found</doc>
  7868. <type name="Hook" c:type="GHook*"/>
  7869. </return-value>
  7870. <parameters>
  7871. <parameter name="hook_list" transfer-ownership="none">
  7872. <doc xml:space="preserve">a #GHookList</doc>
  7873. <type name="HookList" c:type="GHookList*"/>
  7874. </parameter>
  7875. <parameter name="need_valids" transfer-ownership="none">
  7876. <doc xml:space="preserve">%TRUE if #GHook elements which have been destroyed
  7877. should be skipped</doc>
  7878. <type name="gboolean" c:type="gboolean"/>
  7879. </parameter>
  7880. <parameter name="func" transfer-ownership="none" closure="3">
  7881. <doc xml:space="preserve">the function to call for each #GHook, which should return
  7882. %TRUE when the #GHook has been found</doc>
  7883. <type name="HookFindFunc" c:type="GHookFindFunc"/>
  7884. </parameter>
  7885. <parameter name="data"
  7886. transfer-ownership="none"
  7887. nullable="1"
  7888. allow-none="1">
  7889. <doc xml:space="preserve">the data to pass to @func</doc>
  7890. <type name="gpointer" c:type="gpointer"/>
  7891. </parameter>
  7892. </parameters>
  7893. </function>
  7894. <function name="find_data"
  7895. c:identifier="g_hook_find_data"
  7896. introspectable="0">
  7897. <doc xml:space="preserve">Finds a #GHook in a #GHookList with the given data.</doc>
  7898. <return-value>
  7899. <doc xml:space="preserve">the #GHook with the given @data or %NULL if no matching
  7900. #GHook is found</doc>
  7901. <type name="Hook" c:type="GHook*"/>
  7902. </return-value>
  7903. <parameters>
  7904. <parameter name="hook_list" transfer-ownership="none">
  7905. <doc xml:space="preserve">a #GHookList</doc>
  7906. <type name="HookList" c:type="GHookList*"/>
  7907. </parameter>
  7908. <parameter name="need_valids" transfer-ownership="none">
  7909. <doc xml:space="preserve">%TRUE if #GHook elements which have been destroyed
  7910. should be skipped</doc>
  7911. <type name="gboolean" c:type="gboolean"/>
  7912. </parameter>
  7913. <parameter name="data"
  7914. transfer-ownership="none"
  7915. nullable="1"
  7916. allow-none="1">
  7917. <doc xml:space="preserve">the data to find</doc>
  7918. <type name="gpointer" c:type="gpointer"/>
  7919. </parameter>
  7920. </parameters>
  7921. </function>
  7922. <function name="find_func"
  7923. c:identifier="g_hook_find_func"
  7924. introspectable="0">
  7925. <doc xml:space="preserve">Finds a #GHook in a #GHookList with the given function.</doc>
  7926. <return-value>
  7927. <doc xml:space="preserve">the #GHook with the given @func or %NULL if no matching
  7928. #GHook is found</doc>
  7929. <type name="Hook" c:type="GHook*"/>
  7930. </return-value>
  7931. <parameters>
  7932. <parameter name="hook_list" transfer-ownership="none">
  7933. <doc xml:space="preserve">a #GHookList</doc>
  7934. <type name="HookList" c:type="GHookList*"/>
  7935. </parameter>
  7936. <parameter name="need_valids" transfer-ownership="none">
  7937. <doc xml:space="preserve">%TRUE if #GHook elements which have been destroyed
  7938. should be skipped</doc>
  7939. <type name="gboolean" c:type="gboolean"/>
  7940. </parameter>
  7941. <parameter name="func"
  7942. transfer-ownership="none"
  7943. nullable="1"
  7944. allow-none="1">
  7945. <doc xml:space="preserve">the function to find</doc>
  7946. <type name="gpointer" c:type="gpointer"/>
  7947. </parameter>
  7948. </parameters>
  7949. </function>
  7950. <function name="find_func_data"
  7951. c:identifier="g_hook_find_func_data"
  7952. introspectable="0">
  7953. <doc xml:space="preserve">Finds a #GHook in a #GHookList with the given function and data.</doc>
  7954. <return-value>
  7955. <doc xml:space="preserve">the #GHook with the given @func and @data or %NULL if
  7956. no matching #GHook is found</doc>
  7957. <type name="Hook" c:type="GHook*"/>
  7958. </return-value>
  7959. <parameters>
  7960. <parameter name="hook_list" transfer-ownership="none">
  7961. <doc xml:space="preserve">a #GHookList</doc>
  7962. <type name="HookList" c:type="GHookList*"/>
  7963. </parameter>
  7964. <parameter name="need_valids" transfer-ownership="none">
  7965. <doc xml:space="preserve">%TRUE if #GHook elements which have been destroyed
  7966. should be skipped</doc>
  7967. <type name="gboolean" c:type="gboolean"/>
  7968. </parameter>
  7969. <parameter name="func" transfer-ownership="none">
  7970. <doc xml:space="preserve">the function to find</doc>
  7971. <type name="gpointer" c:type="gpointer"/>
  7972. </parameter>
  7973. <parameter name="data"
  7974. transfer-ownership="none"
  7975. nullable="1"
  7976. allow-none="1">
  7977. <doc xml:space="preserve">the data to find</doc>
  7978. <type name="gpointer" c:type="gpointer"/>
  7979. </parameter>
  7980. </parameters>
  7981. </function>
  7982. <function name="first_valid"
  7983. c:identifier="g_hook_first_valid"
  7984. introspectable="0">
  7985. <doc xml:space="preserve">Returns the first #GHook in a #GHookList which has not been destroyed.
  7986. The reference count for the #GHook is incremented, so you must call
  7987. g_hook_unref() to restore it when no longer needed. (Or call
  7988. g_hook_next_valid() if you are stepping through the #GHookList.)</doc>
  7989. <return-value>
  7990. <doc xml:space="preserve">the first valid #GHook, or %NULL if none are valid</doc>
  7991. <type name="Hook" c:type="GHook*"/>
  7992. </return-value>
  7993. <parameters>
  7994. <parameter name="hook_list" transfer-ownership="none">
  7995. <doc xml:space="preserve">a #GHookList</doc>
  7996. <type name="HookList" c:type="GHookList*"/>
  7997. </parameter>
  7998. <parameter name="may_be_in_call" transfer-ownership="none">
  7999. <doc xml:space="preserve">%TRUE if hooks which are currently running
  8000. (e.g. in another thread) are considered valid. If set to %FALSE,
  8001. these are skipped</doc>
  8002. <type name="gboolean" c:type="gboolean"/>
  8003. </parameter>
  8004. </parameters>
  8005. </function>
  8006. <function name="free" c:identifier="g_hook_free">
  8007. <doc xml:space="preserve">Calls the #GHookList @finalize_hook function if it exists,
  8008. and frees the memory allocated for the #GHook.</doc>
  8009. <return-value transfer-ownership="none">
  8010. <type name="none" c:type="void"/>
  8011. </return-value>
  8012. <parameters>
  8013. <parameter name="hook_list" transfer-ownership="none">
  8014. <doc xml:space="preserve">a #GHookList</doc>
  8015. <type name="HookList" c:type="GHookList*"/>
  8016. </parameter>
  8017. <parameter name="hook" transfer-ownership="none">
  8018. <doc xml:space="preserve">the #GHook to free</doc>
  8019. <type name="Hook" c:type="GHook*"/>
  8020. </parameter>
  8021. </parameters>
  8022. </function>
  8023. <function name="get" c:identifier="g_hook_get" introspectable="0">
  8024. <doc xml:space="preserve">Returns the #GHook with the given id, or %NULL if it is not found.</doc>
  8025. <return-value>
  8026. <doc xml:space="preserve">the #GHook with the given id, or %NULL if it is not found</doc>
  8027. <type name="Hook" c:type="GHook*"/>
  8028. </return-value>
  8029. <parameters>
  8030. <parameter name="hook_list" transfer-ownership="none">
  8031. <doc xml:space="preserve">a #GHookList</doc>
  8032. <type name="HookList" c:type="GHookList*"/>
  8033. </parameter>
  8034. <parameter name="hook_id" transfer-ownership="none">
  8035. <doc xml:space="preserve">a hook id</doc>
  8036. <type name="gulong" c:type="gulong"/>
  8037. </parameter>
  8038. </parameters>
  8039. </function>
  8040. <function name="insert_before" c:identifier="g_hook_insert_before">
  8041. <doc xml:space="preserve">Inserts a #GHook into a #GHookList, before a given #GHook.</doc>
  8042. <return-value transfer-ownership="none">
  8043. <type name="none" c:type="void"/>
  8044. </return-value>
  8045. <parameters>
  8046. <parameter name="hook_list" transfer-ownership="none">
  8047. <doc xml:space="preserve">a #GHookList</doc>
  8048. <type name="HookList" c:type="GHookList*"/>
  8049. </parameter>
  8050. <parameter name="sibling"
  8051. transfer-ownership="none"
  8052. nullable="1"
  8053. allow-none="1">
  8054. <doc xml:space="preserve">the #GHook to insert the new #GHook before</doc>
  8055. <type name="Hook" c:type="GHook*"/>
  8056. </parameter>
  8057. <parameter name="hook" transfer-ownership="none">
  8058. <doc xml:space="preserve">the #GHook to insert</doc>
  8059. <type name="Hook" c:type="GHook*"/>
  8060. </parameter>
  8061. </parameters>
  8062. </function>
  8063. <function name="insert_sorted"
  8064. c:identifier="g_hook_insert_sorted"
  8065. introspectable="0">
  8066. <doc xml:space="preserve">Inserts a #GHook into a #GHookList, sorted by the given function.</doc>
  8067. <return-value transfer-ownership="none">
  8068. <type name="none" c:type="void"/>
  8069. </return-value>
  8070. <parameters>
  8071. <parameter name="hook_list" transfer-ownership="none">
  8072. <doc xml:space="preserve">a #GHookList</doc>
  8073. <type name="HookList" c:type="GHookList*"/>
  8074. </parameter>
  8075. <parameter name="hook" transfer-ownership="none">
  8076. <doc xml:space="preserve">the #GHook to insert</doc>
  8077. <type name="Hook" c:type="GHook*"/>
  8078. </parameter>
  8079. <parameter name="func" transfer-ownership="none">
  8080. <doc xml:space="preserve">the comparison function used to sort the #GHook elements</doc>
  8081. <type name="HookCompareFunc" c:type="GHookCompareFunc"/>
  8082. </parameter>
  8083. </parameters>
  8084. </function>
  8085. <function name="next_valid"
  8086. c:identifier="g_hook_next_valid"
  8087. introspectable="0">
  8088. <doc xml:space="preserve">Returns the next #GHook in a #GHookList which has not been destroyed.
  8089. The reference count for the #GHook is incremented, so you must call
  8090. g_hook_unref() to restore it when no longer needed. (Or continue to call
  8091. g_hook_next_valid() until %NULL is returned.)</doc>
  8092. <return-value>
  8093. <doc xml:space="preserve">the next valid #GHook, or %NULL if none are valid</doc>
  8094. <type name="Hook" c:type="GHook*"/>
  8095. </return-value>
  8096. <parameters>
  8097. <parameter name="hook_list" transfer-ownership="none">
  8098. <doc xml:space="preserve">a #GHookList</doc>
  8099. <type name="HookList" c:type="GHookList*"/>
  8100. </parameter>
  8101. <parameter name="hook" transfer-ownership="none">
  8102. <doc xml:space="preserve">the current #GHook</doc>
  8103. <type name="Hook" c:type="GHook*"/>
  8104. </parameter>
  8105. <parameter name="may_be_in_call" transfer-ownership="none">
  8106. <doc xml:space="preserve">%TRUE if hooks which are currently running
  8107. (e.g. in another thread) are considered valid. If set to %FALSE,
  8108. these are skipped</doc>
  8109. <type name="gboolean" c:type="gboolean"/>
  8110. </parameter>
  8111. </parameters>
  8112. </function>
  8113. <function name="prepend" c:identifier="g_hook_prepend">
  8114. <doc xml:space="preserve">Prepends a #GHook on the start of a #GHookList.</doc>
  8115. <return-value transfer-ownership="none">
  8116. <type name="none" c:type="void"/>
  8117. </return-value>
  8118. <parameters>
  8119. <parameter name="hook_list" transfer-ownership="none">
  8120. <doc xml:space="preserve">a #GHookList</doc>
  8121. <type name="HookList" c:type="GHookList*"/>
  8122. </parameter>
  8123. <parameter name="hook" transfer-ownership="none">
  8124. <doc xml:space="preserve">the #GHook to add to the start of @hook_list</doc>
  8125. <type name="Hook" c:type="GHook*"/>
  8126. </parameter>
  8127. </parameters>
  8128. </function>
  8129. <function name="ref" c:identifier="g_hook_ref" introspectable="0">
  8130. <doc xml:space="preserve">Increments the reference count for a #GHook.</doc>
  8131. <return-value>
  8132. <doc xml:space="preserve">the @hook that was passed in (since 2.6)</doc>
  8133. <type name="Hook" c:type="GHook*"/>
  8134. </return-value>
  8135. <parameters>
  8136. <parameter name="hook_list" transfer-ownership="none">
  8137. <doc xml:space="preserve">a #GHookList</doc>
  8138. <type name="HookList" c:type="GHookList*"/>
  8139. </parameter>
  8140. <parameter name="hook" transfer-ownership="none">
  8141. <doc xml:space="preserve">the #GHook to increment the reference count of</doc>
  8142. <type name="Hook" c:type="GHook*"/>
  8143. </parameter>
  8144. </parameters>
  8145. </function>
  8146. <function name="unref" c:identifier="g_hook_unref">
  8147. <doc xml:space="preserve">Decrements the reference count of a #GHook.
  8148. If the reference count falls to 0, the #GHook is removed
  8149. from the #GHookList and g_hook_free() is called to free it.</doc>
  8150. <return-value transfer-ownership="none">
  8151. <type name="none" c:type="void"/>
  8152. </return-value>
  8153. <parameters>
  8154. <parameter name="hook_list" transfer-ownership="none">
  8155. <doc xml:space="preserve">a #GHookList</doc>
  8156. <type name="HookList" c:type="GHookList*"/>
  8157. </parameter>
  8158. <parameter name="hook" transfer-ownership="none">
  8159. <doc xml:space="preserve">the #GHook to unref</doc>
  8160. <type name="Hook" c:type="GHook*"/>
  8161. </parameter>
  8162. </parameters>
  8163. </function>
  8164. </record>
  8165. <callback name="HookCheckFunc" c:type="GHookCheckFunc">
  8166. <doc xml:space="preserve">Defines the type of a hook function that can be invoked
  8167. by g_hook_list_invoke_check().</doc>
  8168. <return-value transfer-ownership="none">
  8169. <doc xml:space="preserve">%FALSE if the #GHook should be destroyed</doc>
  8170. <type name="gboolean" c:type="gboolean"/>
  8171. </return-value>
  8172. <parameters>
  8173. <parameter name="data"
  8174. transfer-ownership="none"
  8175. nullable="1"
  8176. allow-none="1">
  8177. <doc xml:space="preserve">the data field of the #GHook is passed to the hook function here</doc>
  8178. <type name="gpointer" c:type="gpointer"/>
  8179. </parameter>
  8180. </parameters>
  8181. </callback>
  8182. <callback name="HookCheckMarshaller" c:type="GHookCheckMarshaller">
  8183. <doc xml:space="preserve">Defines the type of function used by g_hook_list_marshal_check().</doc>
  8184. <return-value transfer-ownership="none">
  8185. <doc xml:space="preserve">%FALSE if @hook should be destroyed</doc>
  8186. <type name="gboolean" c:type="gboolean"/>
  8187. </return-value>
  8188. <parameters>
  8189. <parameter name="hook" transfer-ownership="none">
  8190. <doc xml:space="preserve">a #GHook</doc>
  8191. <type name="Hook" c:type="GHook*"/>
  8192. </parameter>
  8193. <parameter name="marshal_data"
  8194. transfer-ownership="none"
  8195. nullable="1"
  8196. allow-none="1">
  8197. <doc xml:space="preserve">user data</doc>
  8198. <type name="gpointer" c:type="gpointer"/>
  8199. </parameter>
  8200. </parameters>
  8201. </callback>
  8202. <callback name="HookCompareFunc" c:type="GHookCompareFunc">
  8203. <doc xml:space="preserve">Defines the type of function used to compare #GHook elements in
  8204. g_hook_insert_sorted().</doc>
  8205. <return-value transfer-ownership="none">
  8206. <doc xml:space="preserve">a value &lt;= 0 if @new_hook should be before @sibling</doc>
  8207. <type name="gint" c:type="gint"/>
  8208. </return-value>
  8209. <parameters>
  8210. <parameter name="new_hook" transfer-ownership="none">
  8211. <doc xml:space="preserve">the #GHook being inserted</doc>
  8212. <type name="Hook" c:type="GHook*"/>
  8213. </parameter>
  8214. <parameter name="sibling" transfer-ownership="none">
  8215. <doc xml:space="preserve">the #GHook to compare with @new_hook</doc>
  8216. <type name="Hook" c:type="GHook*"/>
  8217. </parameter>
  8218. </parameters>
  8219. </callback>
  8220. <callback name="HookFinalizeFunc" c:type="GHookFinalizeFunc">
  8221. <doc xml:space="preserve">Defines the type of function to be called when a hook in a
  8222. list of hooks gets finalized.</doc>
  8223. <return-value transfer-ownership="none">
  8224. <type name="none" c:type="void"/>
  8225. </return-value>
  8226. <parameters>
  8227. <parameter name="hook_list" transfer-ownership="none">
  8228. <doc xml:space="preserve">a #GHookList</doc>
  8229. <type name="HookList" c:type="GHookList*"/>
  8230. </parameter>
  8231. <parameter name="hook" transfer-ownership="none">
  8232. <doc xml:space="preserve">the hook in @hook_list that gets finalized</doc>
  8233. <type name="Hook" c:type="GHook*"/>
  8234. </parameter>
  8235. </parameters>
  8236. </callback>
  8237. <callback name="HookFindFunc" c:type="GHookFindFunc">
  8238. <doc xml:space="preserve">Defines the type of the function passed to g_hook_find().</doc>
  8239. <return-value transfer-ownership="none">
  8240. <doc xml:space="preserve">%TRUE if the required #GHook has been found</doc>
  8241. <type name="gboolean" c:type="gboolean"/>
  8242. </return-value>
  8243. <parameters>
  8244. <parameter name="hook" transfer-ownership="none">
  8245. <doc xml:space="preserve">a #GHook</doc>
  8246. <type name="Hook" c:type="GHook*"/>
  8247. </parameter>
  8248. <parameter name="data"
  8249. transfer-ownership="none"
  8250. nullable="1"
  8251. allow-none="1">
  8252. <doc xml:space="preserve">user data passed to g_hook_find_func()</doc>
  8253. <type name="gpointer" c:type="gpointer"/>
  8254. </parameter>
  8255. </parameters>
  8256. </callback>
  8257. <bitfield name="HookFlagMask" c:type="GHookFlagMask">
  8258. <doc xml:space="preserve">Flags used internally in the #GHook implementation.</doc>
  8259. <member name="active" value="1" c:identifier="G_HOOK_FLAG_ACTIVE">
  8260. <doc xml:space="preserve">set if the hook has not been destroyed</doc>
  8261. </member>
  8262. <member name="in_call" value="2" c:identifier="G_HOOK_FLAG_IN_CALL">
  8263. <doc xml:space="preserve">set if the hook is currently being run</doc>
  8264. </member>
  8265. <member name="mask" value="15" c:identifier="G_HOOK_FLAG_MASK">
  8266. <doc xml:space="preserve">A mask covering all bits reserved for
  8267. hook flags; see %G_HOOK_FLAG_USER_SHIFT</doc>
  8268. </member>
  8269. </bitfield>
  8270. <callback name="HookFunc" c:type="GHookFunc">
  8271. <doc xml:space="preserve">Defines the type of a hook function that can be invoked
  8272. by g_hook_list_invoke().</doc>
  8273. <return-value transfer-ownership="none">
  8274. <type name="none" c:type="void"/>
  8275. </return-value>
  8276. <parameters>
  8277. <parameter name="data"
  8278. transfer-ownership="none"
  8279. nullable="1"
  8280. allow-none="1">
  8281. <doc xml:space="preserve">the data field of the #GHook is passed to the hook function here</doc>
  8282. <type name="gpointer" c:type="gpointer"/>
  8283. </parameter>
  8284. </parameters>
  8285. </callback>
  8286. <record name="HookList" c:type="GHookList">
  8287. <doc xml:space="preserve">The #GHookList struct represents a list of hook functions.</doc>
  8288. <field name="seq_id" writable="1">
  8289. <doc xml:space="preserve">the next free #GHook id</doc>
  8290. <type name="gulong" c:type="gulong"/>
  8291. </field>
  8292. <field name="hook_size" writable="1" bits="16">
  8293. <doc xml:space="preserve">the size of the #GHookList elements, in bytes</doc>
  8294. <type name="guint" c:type="guint"/>
  8295. </field>
  8296. <field name="is_setup" writable="1" bits="1">
  8297. <doc xml:space="preserve">1 if the #GHookList has been initialized</doc>
  8298. <type name="guint" c:type="guint"/>
  8299. </field>
  8300. <field name="hooks" writable="1">
  8301. <doc xml:space="preserve">the first #GHook element in the list</doc>
  8302. <type name="Hook" c:type="GHook*"/>
  8303. </field>
  8304. <field name="dummy3" writable="1">
  8305. <doc xml:space="preserve">unused</doc>
  8306. <type name="gpointer" c:type="gpointer"/>
  8307. </field>
  8308. <field name="finalize_hook" writable="1">
  8309. <doc xml:space="preserve">the function to call to finalize a #GHook element.
  8310. The default behaviour is to call the hooks @destroy function</doc>
  8311. <type name="HookFinalizeFunc" c:type="GHookFinalizeFunc"/>
  8312. </field>
  8313. <field name="dummy" writable="1">
  8314. <doc xml:space="preserve">unused</doc>
  8315. <array zero-terminated="0" c:type="gpointer" fixed-size="2">
  8316. <type name="gpointer" c:type="gpointer"/>
  8317. </array>
  8318. </field>
  8319. <method name="clear" c:identifier="g_hook_list_clear">
  8320. <doc xml:space="preserve">Removes all the #GHook elements from a #GHookList.</doc>
  8321. <return-value transfer-ownership="none">
  8322. <type name="none" c:type="void"/>
  8323. </return-value>
  8324. <parameters>
  8325. <instance-parameter name="hook_list" transfer-ownership="none">
  8326. <doc xml:space="preserve">a #GHookList</doc>
  8327. <type name="HookList" c:type="GHookList*"/>
  8328. </instance-parameter>
  8329. </parameters>
  8330. </method>
  8331. <method name="init" c:identifier="g_hook_list_init">
  8332. <doc xml:space="preserve">Initializes a #GHookList.
  8333. This must be called before the #GHookList is used.</doc>
  8334. <return-value transfer-ownership="none">
  8335. <type name="none" c:type="void"/>
  8336. </return-value>
  8337. <parameters>
  8338. <instance-parameter name="hook_list" transfer-ownership="none">
  8339. <doc xml:space="preserve">a #GHookList</doc>
  8340. <type name="HookList" c:type="GHookList*"/>
  8341. </instance-parameter>
  8342. <parameter name="hook_size" transfer-ownership="none">
  8343. <doc xml:space="preserve">the size of each element in the #GHookList,
  8344. typically `sizeof (GHook)`.</doc>
  8345. <type name="guint" c:type="guint"/>
  8346. </parameter>
  8347. </parameters>
  8348. </method>
  8349. <method name="invoke" c:identifier="g_hook_list_invoke">
  8350. <doc xml:space="preserve">Calls all of the #GHook functions in a #GHookList.</doc>
  8351. <return-value transfer-ownership="none">
  8352. <type name="none" c:type="void"/>
  8353. </return-value>
  8354. <parameters>
  8355. <instance-parameter name="hook_list" transfer-ownership="none">
  8356. <doc xml:space="preserve">a #GHookList</doc>
  8357. <type name="HookList" c:type="GHookList*"/>
  8358. </instance-parameter>
  8359. <parameter name="may_recurse" transfer-ownership="none">
  8360. <doc xml:space="preserve">%TRUE if functions which are already running
  8361. (e.g. in another thread) can be called. If set to %FALSE,
  8362. these are skipped</doc>
  8363. <type name="gboolean" c:type="gboolean"/>
  8364. </parameter>
  8365. </parameters>
  8366. </method>
  8367. <method name="invoke_check" c:identifier="g_hook_list_invoke_check">
  8368. <doc xml:space="preserve">Calls all of the #GHook functions in a #GHookList.
  8369. Any function which returns %FALSE is removed from the #GHookList.</doc>
  8370. <return-value transfer-ownership="none">
  8371. <type name="none" c:type="void"/>
  8372. </return-value>
  8373. <parameters>
  8374. <instance-parameter name="hook_list" transfer-ownership="none">
  8375. <doc xml:space="preserve">a #GHookList</doc>
  8376. <type name="HookList" c:type="GHookList*"/>
  8377. </instance-parameter>
  8378. <parameter name="may_recurse" transfer-ownership="none">
  8379. <doc xml:space="preserve">%TRUE if functions which are already running
  8380. (e.g. in another thread) can be called. If set to %FALSE,
  8381. these are skipped</doc>
  8382. <type name="gboolean" c:type="gboolean"/>
  8383. </parameter>
  8384. </parameters>
  8385. </method>
  8386. <method name="marshal"
  8387. c:identifier="g_hook_list_marshal"
  8388. introspectable="0">
  8389. <doc xml:space="preserve">Calls a function on each valid #GHook.</doc>
  8390. <return-value transfer-ownership="none">
  8391. <type name="none" c:type="void"/>
  8392. </return-value>
  8393. <parameters>
  8394. <instance-parameter name="hook_list" transfer-ownership="none">
  8395. <doc xml:space="preserve">a #GHookList</doc>
  8396. <type name="HookList" c:type="GHookList*"/>
  8397. </instance-parameter>
  8398. <parameter name="may_recurse" transfer-ownership="none">
  8399. <doc xml:space="preserve">%TRUE if hooks which are currently running
  8400. (e.g. in another thread) are considered valid. If set to %FALSE,
  8401. these are skipped</doc>
  8402. <type name="gboolean" c:type="gboolean"/>
  8403. </parameter>
  8404. <parameter name="marshaller" transfer-ownership="none" closure="2">
  8405. <doc xml:space="preserve">the function to call for each #GHook</doc>
  8406. <type name="HookMarshaller" c:type="GHookMarshaller"/>
  8407. </parameter>
  8408. <parameter name="marshal_data"
  8409. transfer-ownership="none"
  8410. nullable="1"
  8411. allow-none="1">
  8412. <doc xml:space="preserve">data to pass to @marshaller</doc>
  8413. <type name="gpointer" c:type="gpointer"/>
  8414. </parameter>
  8415. </parameters>
  8416. </method>
  8417. <method name="marshal_check"
  8418. c:identifier="g_hook_list_marshal_check"
  8419. introspectable="0">
  8420. <doc xml:space="preserve">Calls a function on each valid #GHook and destroys it if the
  8421. function returns %FALSE.</doc>
  8422. <return-value transfer-ownership="none">
  8423. <type name="none" c:type="void"/>
  8424. </return-value>
  8425. <parameters>
  8426. <instance-parameter name="hook_list" transfer-ownership="none">
  8427. <doc xml:space="preserve">a #GHookList</doc>
  8428. <type name="HookList" c:type="GHookList*"/>
  8429. </instance-parameter>
  8430. <parameter name="may_recurse" transfer-ownership="none">
  8431. <doc xml:space="preserve">%TRUE if hooks which are currently running
  8432. (e.g. in another thread) are considered valid. If set to %FALSE,
  8433. these are skipped</doc>
  8434. <type name="gboolean" c:type="gboolean"/>
  8435. </parameter>
  8436. <parameter name="marshaller" transfer-ownership="none" closure="2">
  8437. <doc xml:space="preserve">the function to call for each #GHook</doc>
  8438. <type name="HookCheckMarshaller" c:type="GHookCheckMarshaller"/>
  8439. </parameter>
  8440. <parameter name="marshal_data"
  8441. transfer-ownership="none"
  8442. nullable="1"
  8443. allow-none="1">
  8444. <doc xml:space="preserve">data to pass to @marshaller</doc>
  8445. <type name="gpointer" c:type="gpointer"/>
  8446. </parameter>
  8447. </parameters>
  8448. </method>
  8449. </record>
  8450. <callback name="HookMarshaller" c:type="GHookMarshaller">
  8451. <doc xml:space="preserve">Defines the type of function used by g_hook_list_marshal().</doc>
  8452. <return-value transfer-ownership="none">
  8453. <type name="none" c:type="void"/>
  8454. </return-value>
  8455. <parameters>
  8456. <parameter name="hook" transfer-ownership="none">
  8457. <doc xml:space="preserve">a #GHook</doc>
  8458. <type name="Hook" c:type="GHook*"/>
  8459. </parameter>
  8460. <parameter name="marshal_data"
  8461. transfer-ownership="none"
  8462. nullable="1"
  8463. allow-none="1">
  8464. <doc xml:space="preserve">user data</doc>
  8465. <type name="gpointer" c:type="gpointer"/>
  8466. </parameter>
  8467. </parameters>
  8468. </callback>
  8469. <record name="IConv" c:type="GIConv" disguised="1">
  8470. <doc xml:space="preserve">The GIConv struct wraps an iconv() conversion descriptor. It contains
  8471. private data and should only be accessed using the following functions.</doc>
  8472. <method name="" c:identifier="g_iconv" moved-to="iconv">
  8473. <doc xml:space="preserve">Same as the standard UNIX routine iconv(), but
  8474. may be implemented via libiconv on UNIX flavors that lack
  8475. a native implementation.
  8476. GLib provides g_convert() and g_locale_to_utf8() which are likely
  8477. more convenient than the raw iconv wrappers.</doc>
  8478. <return-value transfer-ownership="none">
  8479. <doc xml:space="preserve">count of non-reversible conversions, or -1 on error</doc>
  8480. <type name="gsize" c:type="gsize"/>
  8481. </return-value>
  8482. <parameters>
  8483. <instance-parameter name="converter" transfer-ownership="none">
  8484. <doc xml:space="preserve">conversion descriptor from g_iconv_open()</doc>
  8485. <type name="IConv" c:type="GIConv"/>
  8486. </instance-parameter>
  8487. <parameter name="inbuf" transfer-ownership="none">
  8488. <doc xml:space="preserve">bytes to convert</doc>
  8489. <type name="utf8" c:type="gchar**"/>
  8490. </parameter>
  8491. <parameter name="inbytes_left" transfer-ownership="none">
  8492. <doc xml:space="preserve">inout parameter, bytes remaining to convert in @inbuf</doc>
  8493. <type name="gsize" c:type="gsize*"/>
  8494. </parameter>
  8495. <parameter name="outbuf" transfer-ownership="none">
  8496. <doc xml:space="preserve">converted output bytes</doc>
  8497. <type name="utf8" c:type="gchar**"/>
  8498. </parameter>
  8499. <parameter name="outbytes_left" transfer-ownership="none">
  8500. <doc xml:space="preserve">inout parameter, bytes available to fill in @outbuf</doc>
  8501. <type name="gsize" c:type="gsize*"/>
  8502. </parameter>
  8503. </parameters>
  8504. </method>
  8505. <method name="close" c:identifier="g_iconv_close">
  8506. <doc xml:space="preserve">Same as the standard UNIX routine iconv_close(), but
  8507. may be implemented via libiconv on UNIX flavors that lack
  8508. a native implementation. Should be called to clean up
  8509. the conversion descriptor from g_iconv_open() when
  8510. you are done converting things.
  8511. GLib provides g_convert() and g_locale_to_utf8() which are likely
  8512. more convenient than the raw iconv wrappers.</doc>
  8513. <return-value transfer-ownership="none">
  8514. <doc xml:space="preserve">-1 on error, 0 on success</doc>
  8515. <type name="gint" c:type="gint"/>
  8516. </return-value>
  8517. <parameters>
  8518. <instance-parameter name="converter" transfer-ownership="none">
  8519. <doc xml:space="preserve">a conversion descriptor from g_iconv_open()</doc>
  8520. <type name="IConv" c:type="GIConv"/>
  8521. </instance-parameter>
  8522. </parameters>
  8523. </method>
  8524. <function name="open" c:identifier="g_iconv_open" introspectable="0">
  8525. <doc xml:space="preserve">Same as the standard UNIX routine iconv_open(), but
  8526. may be implemented via libiconv on UNIX flavors that lack
  8527. a native implementation.
  8528. GLib provides g_convert() and g_locale_to_utf8() which are likely
  8529. more convenient than the raw iconv wrappers.</doc>
  8530. <return-value>
  8531. <doc xml:space="preserve">a "conversion descriptor", or (GIConv)-1 if
  8532. opening the converter failed.</doc>
  8533. <type name="IConv" c:type="GIConv"/>
  8534. </return-value>
  8535. <parameters>
  8536. <parameter name="to_codeset" transfer-ownership="none">
  8537. <doc xml:space="preserve">destination codeset</doc>
  8538. <type name="utf8" c:type="const gchar*"/>
  8539. </parameter>
  8540. <parameter name="from_codeset" transfer-ownership="none">
  8541. <doc xml:space="preserve">source codeset</doc>
  8542. <type name="utf8" c:type="const gchar*"/>
  8543. </parameter>
  8544. </parameters>
  8545. </function>
  8546. </record>
  8547. <constant name="IEEE754_DOUBLE_BIAS"
  8548. value="1023"
  8549. c:type="G_IEEE754_DOUBLE_BIAS">
  8550. <doc xml:space="preserve">The bias by which exponents in double-precision floats are offset.</doc>
  8551. <type name="gint" c:type="gint"/>
  8552. </constant>
  8553. <constant name="IEEE754_FLOAT_BIAS"
  8554. value="127"
  8555. c:type="G_IEEE754_FLOAT_BIAS">
  8556. <doc xml:space="preserve">The bias by which exponents in single-precision floats are offset.</doc>
  8557. <type name="gint" c:type="gint"/>
  8558. </constant>
  8559. <record name="IOChannel"
  8560. c:type="GIOChannel"
  8561. glib:type-name="GIOChannel"
  8562. glib:get-type="g_io_channel_get_type"
  8563. c:symbol-prefix="io_channel">
  8564. <doc xml:space="preserve">A data structure representing an IO Channel. The fields should be
  8565. considered private and should only be accessed with the following
  8566. functions.</doc>
  8567. <field name="ref_count" readable="0" private="1">
  8568. <type name="gint" c:type="gint"/>
  8569. </field>
  8570. <field name="funcs" readable="0" private="1">
  8571. <type name="IOFuncs" c:type="GIOFuncs*"/>
  8572. </field>
  8573. <field name="encoding" readable="0" private="1">
  8574. <type name="utf8" c:type="gchar*"/>
  8575. </field>
  8576. <field name="read_cd" readable="0" private="1">
  8577. <type name="IConv" c:type="GIConv"/>
  8578. </field>
  8579. <field name="write_cd" readable="0" private="1">
  8580. <type name="IConv" c:type="GIConv"/>
  8581. </field>
  8582. <field name="line_term" readable="0" private="1">
  8583. <type name="utf8" c:type="gchar*"/>
  8584. </field>
  8585. <field name="line_term_len" readable="0" private="1">
  8586. <type name="guint" c:type="guint"/>
  8587. </field>
  8588. <field name="buf_size" readable="0" private="1">
  8589. <type name="gsize" c:type="gsize"/>
  8590. </field>
  8591. <field name="read_buf" readable="0" private="1">
  8592. <type name="String" c:type="GString*"/>
  8593. </field>
  8594. <field name="encoded_read_buf" readable="0" private="1">
  8595. <type name="String" c:type="GString*"/>
  8596. </field>
  8597. <field name="write_buf" readable="0" private="1">
  8598. <type name="String" c:type="GString*"/>
  8599. </field>
  8600. <field name="partial_write_buf" readable="0" private="1">
  8601. <array zero-terminated="0" c:type="gchar" fixed-size="6">
  8602. <type name="gchar" c:type="gchar"/>
  8603. </array>
  8604. </field>
  8605. <field name="use_buffer" readable="0" bits="1" private="1">
  8606. <type name="guint" c:type="guint"/>
  8607. </field>
  8608. <field name="do_encode" readable="0" bits="1" private="1">
  8609. <type name="guint" c:type="guint"/>
  8610. </field>
  8611. <field name="close_on_unref" readable="0" bits="1" private="1">
  8612. <type name="guint" c:type="guint"/>
  8613. </field>
  8614. <field name="is_readable" readable="0" bits="1" private="1">
  8615. <type name="guint" c:type="guint"/>
  8616. </field>
  8617. <field name="is_writeable" readable="0" bits="1" private="1">
  8618. <type name="guint" c:type="guint"/>
  8619. </field>
  8620. <field name="is_seekable" readable="0" bits="1" private="1">
  8621. <type name="guint" c:type="guint"/>
  8622. </field>
  8623. <field name="reserved1" readable="0" private="1">
  8624. <type name="gpointer" c:type="gpointer"/>
  8625. </field>
  8626. <field name="reserved2" readable="0" private="1">
  8627. <type name="gpointer" c:type="gpointer"/>
  8628. </field>
  8629. <constructor name="new_file"
  8630. c:identifier="g_io_channel_new_file"
  8631. throws="1">
  8632. <doc xml:space="preserve">Open a file @filename as a #GIOChannel using mode @mode. This
  8633. channel will be closed when the last reference to it is dropped,
  8634. so there is no need to call g_io_channel_close() (though doing
  8635. so will not cause problems, as long as no attempt is made to
  8636. access the channel after it is closed).</doc>
  8637. <return-value transfer-ownership="full">
  8638. <doc xml:space="preserve">A #GIOChannel on success, %NULL on failure.</doc>
  8639. <type name="IOChannel" c:type="GIOChannel*"/>
  8640. </return-value>
  8641. <parameters>
  8642. <parameter name="filename" transfer-ownership="none">
  8643. <doc xml:space="preserve">A string containing the name of a file</doc>
  8644. <type name="utf8" c:type="const gchar*"/>
  8645. </parameter>
  8646. <parameter name="mode" transfer-ownership="none">
  8647. <doc xml:space="preserve">One of "r", "w", "a", "r+", "w+", "a+". These have
  8648. the same meaning as in fopen()</doc>
  8649. <type name="utf8" c:type="const gchar*"/>
  8650. </parameter>
  8651. </parameters>
  8652. </constructor>
  8653. <constructor name="unix_new" c:identifier="g_io_channel_unix_new">
  8654. <doc xml:space="preserve">Creates a new #GIOChannel given a file descriptor. On UNIX systems
  8655. this works for plain files, pipes, and sockets.
  8656. The returned #GIOChannel has a reference count of 1.
  8657. The default encoding for #GIOChannel is UTF-8. If your application
  8658. is reading output from a command using via pipe, you may need to set
  8659. the encoding to the encoding of the current locale (see
  8660. g_get_charset()) with the g_io_channel_set_encoding() function.
  8661. If you want to read raw binary data without interpretation, then
  8662. call the g_io_channel_set_encoding() function with %NULL for the
  8663. encoding argument.
  8664. This function is available in GLib on Windows, too, but you should
  8665. avoid using it on Windows. The domain of file descriptors and
  8666. sockets overlap. There is no way for GLib to know which one you mean
  8667. in case the argument you pass to this function happens to be both a
  8668. valid file descriptor and socket. If that happens a warning is
  8669. issued, and GLib assumes that it is the file descriptor you mean.</doc>
  8670. <return-value transfer-ownership="full">
  8671. <doc xml:space="preserve">a new #GIOChannel.</doc>
  8672. <type name="IOChannel" c:type="GIOChannel*"/>
  8673. </return-value>
  8674. <parameters>
  8675. <parameter name="fd" transfer-ownership="none">
  8676. <doc xml:space="preserve">a file descriptor.</doc>
  8677. <type name="gint" c:type="int"/>
  8678. </parameter>
  8679. </parameters>
  8680. </constructor>
  8681. <method name="close"
  8682. c:identifier="g_io_channel_close"
  8683. deprecated="1"
  8684. deprecated-version="2.2">
  8685. <doc xml:space="preserve">Close an IO channel. Any pending data to be written will be
  8686. flushed, ignoring errors. The channel will not be freed until the
  8687. last reference is dropped using g_io_channel_unref().</doc>
  8688. <doc-deprecated xml:space="preserve">Use g_io_channel_shutdown() instead.</doc-deprecated>
  8689. <return-value transfer-ownership="none">
  8690. <type name="none" c:type="void"/>
  8691. </return-value>
  8692. <parameters>
  8693. <instance-parameter name="channel" transfer-ownership="none">
  8694. <doc xml:space="preserve">A #GIOChannel</doc>
  8695. <type name="IOChannel" c:type="GIOChannel*"/>
  8696. </instance-parameter>
  8697. </parameters>
  8698. </method>
  8699. <method name="flush" c:identifier="g_io_channel_flush" throws="1">
  8700. <doc xml:space="preserve">Flushes the write buffer for the GIOChannel.</doc>
  8701. <return-value transfer-ownership="none">
  8702. <doc xml:space="preserve">the status of the operation: One of
  8703. #G_IO_STATUS_NORMAL, #G_IO_STATUS_AGAIN, or
  8704. #G_IO_STATUS_ERROR.</doc>
  8705. <type name="IOStatus" c:type="GIOStatus"/>
  8706. </return-value>
  8707. <parameters>
  8708. <instance-parameter name="channel" transfer-ownership="none">
  8709. <doc xml:space="preserve">a #GIOChannel</doc>
  8710. <type name="IOChannel" c:type="GIOChannel*"/>
  8711. </instance-parameter>
  8712. </parameters>
  8713. </method>
  8714. <method name="get_buffer_condition"
  8715. c:identifier="g_io_channel_get_buffer_condition">
  8716. <doc xml:space="preserve">This function returns a #GIOCondition depending on whether there
  8717. is data to be read/space to write data in the internal buffers in
  8718. the #GIOChannel. Only the flags %G_IO_IN and %G_IO_OUT may be set.</doc>
  8719. <return-value transfer-ownership="none">
  8720. <doc xml:space="preserve">A #GIOCondition</doc>
  8721. <type name="IOCondition" c:type="GIOCondition"/>
  8722. </return-value>
  8723. <parameters>
  8724. <instance-parameter name="channel" transfer-ownership="none">
  8725. <doc xml:space="preserve">A #GIOChannel</doc>
  8726. <type name="IOChannel" c:type="GIOChannel*"/>
  8727. </instance-parameter>
  8728. </parameters>
  8729. </method>
  8730. <method name="get_buffer_size"
  8731. c:identifier="g_io_channel_get_buffer_size">
  8732. <doc xml:space="preserve">Gets the buffer size.</doc>
  8733. <return-value transfer-ownership="none">
  8734. <doc xml:space="preserve">the size of the buffer.</doc>
  8735. <type name="gsize" c:type="gsize"/>
  8736. </return-value>
  8737. <parameters>
  8738. <instance-parameter name="channel" transfer-ownership="none">
  8739. <doc xml:space="preserve">a #GIOChannel</doc>
  8740. <type name="IOChannel" c:type="GIOChannel*"/>
  8741. </instance-parameter>
  8742. </parameters>
  8743. </method>
  8744. <method name="get_buffered" c:identifier="g_io_channel_get_buffered">
  8745. <doc xml:space="preserve">Returns whether @channel is buffered.</doc>
  8746. <return-value transfer-ownership="none">
  8747. <doc xml:space="preserve">%TRUE if the @channel is buffered.</doc>
  8748. <type name="gboolean" c:type="gboolean"/>
  8749. </return-value>
  8750. <parameters>
  8751. <instance-parameter name="channel" transfer-ownership="none">
  8752. <doc xml:space="preserve">a #GIOChannel</doc>
  8753. <type name="IOChannel" c:type="GIOChannel*"/>
  8754. </instance-parameter>
  8755. </parameters>
  8756. </method>
  8757. <method name="get_close_on_unref"
  8758. c:identifier="g_io_channel_get_close_on_unref">
  8759. <doc xml:space="preserve">Returns whether the file/socket/whatever associated with @channel
  8760. will be closed when @channel receives its final unref and is
  8761. destroyed. The default value of this is %TRUE for channels created
  8762. by g_io_channel_new_file (), and %FALSE for all other channels.</doc>
  8763. <return-value transfer-ownership="none">
  8764. <doc xml:space="preserve">Whether the channel will be closed on the final unref of
  8765. the GIOChannel data structure.</doc>
  8766. <type name="gboolean" c:type="gboolean"/>
  8767. </return-value>
  8768. <parameters>
  8769. <instance-parameter name="channel" transfer-ownership="none">
  8770. <doc xml:space="preserve">a #GIOChannel.</doc>
  8771. <type name="IOChannel" c:type="GIOChannel*"/>
  8772. </instance-parameter>
  8773. </parameters>
  8774. </method>
  8775. <method name="get_encoding" c:identifier="g_io_channel_get_encoding">
  8776. <doc xml:space="preserve">Gets the encoding for the input/output of the channel.
  8777. The internal encoding is always UTF-8. The encoding %NULL
  8778. makes the channel safe for binary data.</doc>
  8779. <return-value transfer-ownership="none">
  8780. <doc xml:space="preserve">A string containing the encoding, this string is
  8781. owned by GLib and must not be freed.</doc>
  8782. <type name="utf8" c:type="const gchar*"/>
  8783. </return-value>
  8784. <parameters>
  8785. <instance-parameter name="channel" transfer-ownership="none">
  8786. <doc xml:space="preserve">a #GIOChannel</doc>
  8787. <type name="IOChannel" c:type="GIOChannel*"/>
  8788. </instance-parameter>
  8789. </parameters>
  8790. </method>
  8791. <method name="get_flags" c:identifier="g_io_channel_get_flags">
  8792. <doc xml:space="preserve">Gets the current flags for a #GIOChannel, including read-only
  8793. flags such as %G_IO_FLAG_IS_READABLE.
  8794. The values of the flags %G_IO_FLAG_IS_READABLE and %G_IO_FLAG_IS_WRITABLE
  8795. are cached for internal use by the channel when it is created.
  8796. If they should change at some later point (e.g. partial shutdown
  8797. of a socket with the UNIX shutdown() function), the user
  8798. should immediately call g_io_channel_get_flags() to update
  8799. the internal values of these flags.</doc>
  8800. <return-value transfer-ownership="none">
  8801. <doc xml:space="preserve">the flags which are set on the channel</doc>
  8802. <type name="IOFlags" c:type="GIOFlags"/>
  8803. </return-value>
  8804. <parameters>
  8805. <instance-parameter name="channel" transfer-ownership="none">
  8806. <doc xml:space="preserve">a #GIOChannel</doc>
  8807. <type name="IOChannel" c:type="GIOChannel*"/>
  8808. </instance-parameter>
  8809. </parameters>
  8810. </method>
  8811. <method name="get_line_term" c:identifier="g_io_channel_get_line_term">
  8812. <doc xml:space="preserve">This returns the string that #GIOChannel uses to determine
  8813. where in the file a line break occurs. A value of %NULL
  8814. indicates autodetection.</doc>
  8815. <return-value transfer-ownership="none">
  8816. <doc xml:space="preserve">The line termination string. This value
  8817. is owned by GLib and must not be freed.</doc>
  8818. <type name="utf8" c:type="const gchar*"/>
  8819. </return-value>
  8820. <parameters>
  8821. <instance-parameter name="channel" transfer-ownership="none">
  8822. <doc xml:space="preserve">a #GIOChannel</doc>
  8823. <type name="IOChannel" c:type="GIOChannel*"/>
  8824. </instance-parameter>
  8825. <parameter name="length" transfer-ownership="none">
  8826. <doc xml:space="preserve">a location to return the length of the line terminator</doc>
  8827. <type name="gint" c:type="gint*"/>
  8828. </parameter>
  8829. </parameters>
  8830. </method>
  8831. <method name="init" c:identifier="g_io_channel_init">
  8832. <doc xml:space="preserve">Initializes a #GIOChannel struct.
  8833. This is called by each of the above functions when creating a
  8834. #GIOChannel, and so is not often needed by the application
  8835. programmer (unless you are creating a new type of #GIOChannel).</doc>
  8836. <return-value transfer-ownership="none">
  8837. <type name="none" c:type="void"/>
  8838. </return-value>
  8839. <parameters>
  8840. <instance-parameter name="channel" transfer-ownership="none">
  8841. <doc xml:space="preserve">a #GIOChannel</doc>
  8842. <type name="IOChannel" c:type="GIOChannel*"/>
  8843. </instance-parameter>
  8844. </parameters>
  8845. </method>
  8846. <method name="read"
  8847. c:identifier="g_io_channel_read"
  8848. deprecated="1"
  8849. deprecated-version="2.2">
  8850. <doc xml:space="preserve">Reads data from a #GIOChannel.</doc>
  8851. <doc-deprecated xml:space="preserve">Use g_io_channel_read_chars() instead.</doc-deprecated>
  8852. <return-value transfer-ownership="none">
  8853. <doc xml:space="preserve">%G_IO_ERROR_NONE if the operation was successful.</doc>
  8854. <type name="IOError" c:type="GIOError"/>
  8855. </return-value>
  8856. <parameters>
  8857. <instance-parameter name="channel" transfer-ownership="none">
  8858. <doc xml:space="preserve">a #GIOChannel</doc>
  8859. <type name="IOChannel" c:type="GIOChannel*"/>
  8860. </instance-parameter>
  8861. <parameter name="buf" transfer-ownership="none">
  8862. <doc xml:space="preserve">a buffer to read the data into (which should be at least
  8863. count bytes long)</doc>
  8864. <type name="utf8" c:type="gchar*"/>
  8865. </parameter>
  8866. <parameter name="count" transfer-ownership="none">
  8867. <doc xml:space="preserve">the number of bytes to read from the #GIOChannel</doc>
  8868. <type name="gsize" c:type="gsize"/>
  8869. </parameter>
  8870. <parameter name="bytes_read" transfer-ownership="none">
  8871. <doc xml:space="preserve">returns the number of bytes actually read</doc>
  8872. <type name="gsize" c:type="gsize*"/>
  8873. </parameter>
  8874. </parameters>
  8875. </method>
  8876. <method name="read_chars"
  8877. c:identifier="g_io_channel_read_chars"
  8878. throws="1">
  8879. <doc xml:space="preserve">Replacement for g_io_channel_read() with the new API.</doc>
  8880. <return-value transfer-ownership="none">
  8881. <doc xml:space="preserve">the status of the operation.</doc>
  8882. <type name="IOStatus" c:type="GIOStatus"/>
  8883. </return-value>
  8884. <parameters>
  8885. <instance-parameter name="channel" transfer-ownership="none">
  8886. <doc xml:space="preserve">a #GIOChannel</doc>
  8887. <type name="IOChannel" c:type="GIOChannel*"/>
  8888. </instance-parameter>
  8889. <parameter name="buf"
  8890. direction="out"
  8891. caller-allocates="1"
  8892. transfer-ownership="none">
  8893. <doc xml:space="preserve">
  8894. a buffer to read data into</doc>
  8895. <array length="1" zero-terminated="0" c:type="gchar*">
  8896. <type name="guint8"/>
  8897. </array>
  8898. </parameter>
  8899. <parameter name="count" transfer-ownership="none">
  8900. <doc xml:space="preserve">the size of the buffer. Note that the buffer may not be
  8901. complelely filled even if there is data in the buffer if the
  8902. remaining data is not a complete character.</doc>
  8903. <type name="gsize" c:type="gsize"/>
  8904. </parameter>
  8905. <parameter name="bytes_read"
  8906. direction="out"
  8907. caller-allocates="0"
  8908. transfer-ownership="full"
  8909. optional="1"
  8910. allow-none="1">
  8911. <doc xml:space="preserve">The number of bytes read. This may be
  8912. zero even on success if count &lt; 6 and the channel's encoding
  8913. is non-%NULL. This indicates that the next UTF-8 character is
  8914. too wide for the buffer.</doc>
  8915. <type name="gsize" c:type="gsize*"/>
  8916. </parameter>
  8917. </parameters>
  8918. </method>
  8919. <method name="read_line"
  8920. c:identifier="g_io_channel_read_line"
  8921. throws="1">
  8922. <doc xml:space="preserve">Reads a line, including the terminating character(s),
  8923. from a #GIOChannel into a newly-allocated string.
  8924. @str_return will contain allocated memory if the return
  8925. is %G_IO_STATUS_NORMAL.</doc>
  8926. <return-value transfer-ownership="none">
  8927. <doc xml:space="preserve">the status of the operation.</doc>
  8928. <type name="IOStatus" c:type="GIOStatus"/>
  8929. </return-value>
  8930. <parameters>
  8931. <instance-parameter name="channel" transfer-ownership="none">
  8932. <doc xml:space="preserve">a #GIOChannel</doc>
  8933. <type name="IOChannel" c:type="GIOChannel*"/>
  8934. </instance-parameter>
  8935. <parameter name="str_return"
  8936. direction="out"
  8937. caller-allocates="0"
  8938. transfer-ownership="full">
  8939. <doc xml:space="preserve">The line read from the #GIOChannel, including the
  8940. line terminator. This data should be freed with g_free()
  8941. when no longer needed. This is a nul-terminated string.
  8942. If a @length of zero is returned, this will be %NULL instead.</doc>
  8943. <type name="utf8" c:type="gchar**"/>
  8944. </parameter>
  8945. <parameter name="length"
  8946. direction="out"
  8947. caller-allocates="0"
  8948. transfer-ownership="full"
  8949. optional="1"
  8950. allow-none="1">
  8951. <doc xml:space="preserve">location to store length of the read data, or %NULL</doc>
  8952. <type name="gsize" c:type="gsize*"/>
  8953. </parameter>
  8954. <parameter name="terminator_pos"
  8955. direction="out"
  8956. caller-allocates="0"
  8957. transfer-ownership="full"
  8958. optional="1"
  8959. allow-none="1">
  8960. <doc xml:space="preserve">location to store position of line terminator, or %NULL</doc>
  8961. <type name="gsize" c:type="gsize*"/>
  8962. </parameter>
  8963. </parameters>
  8964. </method>
  8965. <method name="read_line_string"
  8966. c:identifier="g_io_channel_read_line_string"
  8967. throws="1">
  8968. <doc xml:space="preserve">Reads a line from a #GIOChannel, using a #GString as a buffer.</doc>
  8969. <return-value transfer-ownership="none">
  8970. <doc xml:space="preserve">the status of the operation.</doc>
  8971. <type name="IOStatus" c:type="GIOStatus"/>
  8972. </return-value>
  8973. <parameters>
  8974. <instance-parameter name="channel" transfer-ownership="none">
  8975. <doc xml:space="preserve">a #GIOChannel</doc>
  8976. <type name="IOChannel" c:type="GIOChannel*"/>
  8977. </instance-parameter>
  8978. <parameter name="buffer" transfer-ownership="none">
  8979. <doc xml:space="preserve">a #GString into which the line will be written.
  8980. If @buffer already contains data, the old data will
  8981. be overwritten.</doc>
  8982. <type name="String" c:type="GString*"/>
  8983. </parameter>
  8984. <parameter name="terminator_pos"
  8985. transfer-ownership="none"
  8986. nullable="1"
  8987. allow-none="1">
  8988. <doc xml:space="preserve">location to store position of line terminator, or %NULL</doc>
  8989. <type name="gsize" c:type="gsize*"/>
  8990. </parameter>
  8991. </parameters>
  8992. </method>
  8993. <method name="read_to_end"
  8994. c:identifier="g_io_channel_read_to_end"
  8995. throws="1">
  8996. <doc xml:space="preserve">Reads all the remaining data from the file.</doc>
  8997. <return-value transfer-ownership="none">
  8998. <doc xml:space="preserve">%G_IO_STATUS_NORMAL on success.
  8999. This function never returns %G_IO_STATUS_EOF.</doc>
  9000. <type name="IOStatus" c:type="GIOStatus"/>
  9001. </return-value>
  9002. <parameters>
  9003. <instance-parameter name="channel" transfer-ownership="none">
  9004. <doc xml:space="preserve">a #GIOChannel</doc>
  9005. <type name="IOChannel" c:type="GIOChannel*"/>
  9006. </instance-parameter>
  9007. <parameter name="str_return"
  9008. direction="out"
  9009. caller-allocates="0"
  9010. transfer-ownership="full">
  9011. <doc xml:space="preserve">Location to
  9012. store a pointer to a string holding the remaining data in the
  9013. #GIOChannel. This data should be freed with g_free() when no
  9014. longer needed. This data is terminated by an extra nul
  9015. character, but there may be other nuls in the intervening data.</doc>
  9016. <array length="1" zero-terminated="0" c:type="gchar**">
  9017. <type name="guint8"/>
  9018. </array>
  9019. </parameter>
  9020. <parameter name="length"
  9021. direction="out"
  9022. caller-allocates="0"
  9023. transfer-ownership="full">
  9024. <doc xml:space="preserve">location to store length of the data</doc>
  9025. <type name="gsize" c:type="gsize*"/>
  9026. </parameter>
  9027. </parameters>
  9028. </method>
  9029. <method name="read_unichar"
  9030. c:identifier="g_io_channel_read_unichar"
  9031. throws="1">
  9032. <doc xml:space="preserve">Reads a Unicode character from @channel.
  9033. This function cannot be called on a channel with %NULL encoding.</doc>
  9034. <return-value transfer-ownership="none">
  9035. <doc xml:space="preserve">a #GIOStatus</doc>
  9036. <type name="IOStatus" c:type="GIOStatus"/>
  9037. </return-value>
  9038. <parameters>
  9039. <instance-parameter name="channel" transfer-ownership="none">
  9040. <doc xml:space="preserve">a #GIOChannel</doc>
  9041. <type name="IOChannel" c:type="GIOChannel*"/>
  9042. </instance-parameter>
  9043. <parameter name="thechar"
  9044. direction="out"
  9045. caller-allocates="0"
  9046. transfer-ownership="full">
  9047. <doc xml:space="preserve">a location to return a character</doc>
  9048. <type name="gunichar" c:type="gunichar*"/>
  9049. </parameter>
  9050. </parameters>
  9051. </method>
  9052. <method name="ref" c:identifier="g_io_channel_ref">
  9053. <doc xml:space="preserve">Increments the reference count of a #GIOChannel.</doc>
  9054. <return-value transfer-ownership="full">
  9055. <doc xml:space="preserve">the @channel that was passed in (since 2.6)</doc>
  9056. <type name="IOChannel" c:type="GIOChannel*"/>
  9057. </return-value>
  9058. <parameters>
  9059. <instance-parameter name="channel" transfer-ownership="none">
  9060. <doc xml:space="preserve">a #GIOChannel</doc>
  9061. <type name="IOChannel" c:type="GIOChannel*"/>
  9062. </instance-parameter>
  9063. </parameters>
  9064. </method>
  9065. <method name="seek"
  9066. c:identifier="g_io_channel_seek"
  9067. deprecated="1"
  9068. deprecated-version="2.2">
  9069. <doc xml:space="preserve">Sets the current position in the #GIOChannel, similar to the standard
  9070. library function fseek().</doc>
  9071. <doc-deprecated xml:space="preserve">Use g_io_channel_seek_position() instead.</doc-deprecated>
  9072. <return-value transfer-ownership="none">
  9073. <doc xml:space="preserve">%G_IO_ERROR_NONE if the operation was successful.</doc>
  9074. <type name="IOError" c:type="GIOError"/>
  9075. </return-value>
  9076. <parameters>
  9077. <instance-parameter name="channel" transfer-ownership="none">
  9078. <doc xml:space="preserve">a #GIOChannel</doc>
  9079. <type name="IOChannel" c:type="GIOChannel*"/>
  9080. </instance-parameter>
  9081. <parameter name="offset" transfer-ownership="none">
  9082. <doc xml:space="preserve">an offset, in bytes, which is added to the position specified
  9083. by @type</doc>
  9084. <type name="gint64" c:type="gint64"/>
  9085. </parameter>
  9086. <parameter name="type" transfer-ownership="none">
  9087. <doc xml:space="preserve">the position in the file, which can be %G_SEEK_CUR (the current
  9088. position), %G_SEEK_SET (the start of the file), or %G_SEEK_END
  9089. (the end of the file)</doc>
  9090. <type name="SeekType" c:type="GSeekType"/>
  9091. </parameter>
  9092. </parameters>
  9093. </method>
  9094. <method name="seek_position"
  9095. c:identifier="g_io_channel_seek_position"
  9096. throws="1">
  9097. <doc xml:space="preserve">Replacement for g_io_channel_seek() with the new API.</doc>
  9098. <return-value transfer-ownership="none">
  9099. <doc xml:space="preserve">the status of the operation.</doc>
  9100. <type name="IOStatus" c:type="GIOStatus"/>
  9101. </return-value>
  9102. <parameters>
  9103. <instance-parameter name="channel" transfer-ownership="none">
  9104. <doc xml:space="preserve">a #GIOChannel</doc>
  9105. <type name="IOChannel" c:type="GIOChannel*"/>
  9106. </instance-parameter>
  9107. <parameter name="offset" transfer-ownership="none">
  9108. <doc xml:space="preserve">The offset in bytes from the position specified by @type</doc>
  9109. <type name="gint64" c:type="gint64"/>
  9110. </parameter>
  9111. <parameter name="type" transfer-ownership="none">
  9112. <doc xml:space="preserve">a #GSeekType. The type %G_SEEK_CUR is only allowed in those
  9113. cases where a call to g_io_channel_set_encoding ()
  9114. is allowed. See the documentation for
  9115. g_io_channel_set_encoding () for details.</doc>
  9116. <type name="SeekType" c:type="GSeekType"/>
  9117. </parameter>
  9118. </parameters>
  9119. </method>
  9120. <method name="set_buffer_size"
  9121. c:identifier="g_io_channel_set_buffer_size">
  9122. <doc xml:space="preserve">Sets the buffer size.</doc>
  9123. <return-value transfer-ownership="none">
  9124. <type name="none" c:type="void"/>
  9125. </return-value>
  9126. <parameters>
  9127. <instance-parameter name="channel" transfer-ownership="none">
  9128. <doc xml:space="preserve">a #GIOChannel</doc>
  9129. <type name="IOChannel" c:type="GIOChannel*"/>
  9130. </instance-parameter>
  9131. <parameter name="size" transfer-ownership="none">
  9132. <doc xml:space="preserve">the size of the buffer, or 0 to let GLib pick a good size</doc>
  9133. <type name="gsize" c:type="gsize"/>
  9134. </parameter>
  9135. </parameters>
  9136. </method>
  9137. <method name="set_buffered" c:identifier="g_io_channel_set_buffered">
  9138. <doc xml:space="preserve">The buffering state can only be set if the channel's encoding
  9139. is %NULL. For any other encoding, the channel must be buffered.
  9140. A buffered channel can only be set unbuffered if the channel's
  9141. internal buffers have been flushed. Newly created channels or
  9142. channels which have returned %G_IO_STATUS_EOF
  9143. not require such a flush. For write-only channels, a call to
  9144. g_io_channel_flush () is sufficient. For all other channels,
  9145. the buffers may be flushed by a call to g_io_channel_seek_position ().
  9146. This includes the possibility of seeking with seek type %G_SEEK_CUR
  9147. and an offset of zero. Note that this means that socket-based
  9148. channels cannot be set unbuffered once they have had data
  9149. read from them.
  9150. On unbuffered channels, it is safe to mix read and write
  9151. calls from the new and old APIs, if this is necessary for
  9152. maintaining old code.
  9153. The default state of the channel is buffered.</doc>
  9154. <return-value transfer-ownership="none">
  9155. <type name="none" c:type="void"/>
  9156. </return-value>
  9157. <parameters>
  9158. <instance-parameter name="channel" transfer-ownership="none">
  9159. <doc xml:space="preserve">a #GIOChannel</doc>
  9160. <type name="IOChannel" c:type="GIOChannel*"/>
  9161. </instance-parameter>
  9162. <parameter name="buffered" transfer-ownership="none">
  9163. <doc xml:space="preserve">whether to set the channel buffered or unbuffered</doc>
  9164. <type name="gboolean" c:type="gboolean"/>
  9165. </parameter>
  9166. </parameters>
  9167. </method>
  9168. <method name="set_close_on_unref"
  9169. c:identifier="g_io_channel_set_close_on_unref">
  9170. <doc xml:space="preserve">Setting this flag to %TRUE for a channel you have already closed
  9171. can cause problems.</doc>
  9172. <return-value transfer-ownership="none">
  9173. <type name="none" c:type="void"/>
  9174. </return-value>
  9175. <parameters>
  9176. <instance-parameter name="channel" transfer-ownership="none">
  9177. <doc xml:space="preserve">a #GIOChannel</doc>
  9178. <type name="IOChannel" c:type="GIOChannel*"/>
  9179. </instance-parameter>
  9180. <parameter name="do_close" transfer-ownership="none">
  9181. <doc xml:space="preserve">Whether to close the channel on the final unref of
  9182. the GIOChannel data structure. The default value of
  9183. this is %TRUE for channels created by g_io_channel_new_file (),
  9184. and %FALSE for all other channels.</doc>
  9185. <type name="gboolean" c:type="gboolean"/>
  9186. </parameter>
  9187. </parameters>
  9188. </method>
  9189. <method name="set_encoding"
  9190. c:identifier="g_io_channel_set_encoding"
  9191. throws="1">
  9192. <doc xml:space="preserve">Sets the encoding for the input/output of the channel.
  9193. The internal encoding is always UTF-8. The default encoding
  9194. for the external file is UTF-8.
  9195. The encoding %NULL is safe to use with binary data.
  9196. The encoding can only be set if one of the following conditions
  9197. is true:
  9198. - The channel was just created, and has not been written to or read from yet.
  9199. - The channel is write-only.
  9200. - The channel is a file, and the file pointer was just repositioned
  9201. by a call to g_io_channel_seek_position(). (This flushes all the
  9202. internal buffers.)
  9203. - The current encoding is %NULL or UTF-8.
  9204. - One of the (new API) read functions has just returned %G_IO_STATUS_EOF
  9205. (or, in the case of g_io_channel_read_to_end(), %G_IO_STATUS_NORMAL).
  9206. - One of the functions g_io_channel_read_chars() or
  9207. g_io_channel_read_unichar() has returned %G_IO_STATUS_AGAIN or
  9208. %G_IO_STATUS_ERROR. This may be useful in the case of
  9209. %G_CONVERT_ERROR_ILLEGAL_SEQUENCE.
  9210. Returning one of these statuses from g_io_channel_read_line(),
  9211. g_io_channel_read_line_string(), or g_io_channel_read_to_end()
  9212. does not guarantee that the encoding can be changed.
  9213. Channels which do not meet one of the above conditions cannot call
  9214. g_io_channel_seek_position() with an offset of %G_SEEK_CUR, and, if
  9215. they are "seekable", cannot call g_io_channel_write_chars() after
  9216. calling one of the API "read" functions.</doc>
  9217. <return-value transfer-ownership="none">
  9218. <doc xml:space="preserve">%G_IO_STATUS_NORMAL if the encoding was successfully set</doc>
  9219. <type name="IOStatus" c:type="GIOStatus"/>
  9220. </return-value>
  9221. <parameters>
  9222. <instance-parameter name="channel" transfer-ownership="none">
  9223. <doc xml:space="preserve">a #GIOChannel</doc>
  9224. <type name="IOChannel" c:type="GIOChannel*"/>
  9225. </instance-parameter>
  9226. <parameter name="encoding"
  9227. transfer-ownership="none"
  9228. nullable="1"
  9229. allow-none="1">
  9230. <doc xml:space="preserve">the encoding type</doc>
  9231. <type name="utf8" c:type="const gchar*"/>
  9232. </parameter>
  9233. </parameters>
  9234. </method>
  9235. <method name="set_flags"
  9236. c:identifier="g_io_channel_set_flags"
  9237. throws="1">
  9238. <doc xml:space="preserve">Sets the (writeable) flags in @channel to (@flags &amp; %G_IO_FLAG_SET_MASK).</doc>
  9239. <return-value transfer-ownership="none">
  9240. <doc xml:space="preserve">the status of the operation.</doc>
  9241. <type name="IOStatus" c:type="GIOStatus"/>
  9242. </return-value>
  9243. <parameters>
  9244. <instance-parameter name="channel" transfer-ownership="none">
  9245. <doc xml:space="preserve">a #GIOChannel</doc>
  9246. <type name="IOChannel" c:type="GIOChannel*"/>
  9247. </instance-parameter>
  9248. <parameter name="flags" transfer-ownership="none">
  9249. <doc xml:space="preserve">the flags to set on the IO channel</doc>
  9250. <type name="IOFlags" c:type="GIOFlags"/>
  9251. </parameter>
  9252. </parameters>
  9253. </method>
  9254. <method name="set_line_term" c:identifier="g_io_channel_set_line_term">
  9255. <doc xml:space="preserve">This sets the string that #GIOChannel uses to determine
  9256. where in the file a line break occurs.</doc>
  9257. <return-value transfer-ownership="none">
  9258. <type name="none" c:type="void"/>
  9259. </return-value>
  9260. <parameters>
  9261. <instance-parameter name="channel" transfer-ownership="none">
  9262. <doc xml:space="preserve">a #GIOChannel</doc>
  9263. <type name="IOChannel" c:type="GIOChannel*"/>
  9264. </instance-parameter>
  9265. <parameter name="line_term"
  9266. transfer-ownership="none"
  9267. nullable="1"
  9268. allow-none="1">
  9269. <doc xml:space="preserve">The line termination string. Use %NULL for
  9270. autodetect. Autodetection breaks on "\n", "\r\n", "\r", "\0",
  9271. and the Unicode paragraph separator. Autodetection should not be
  9272. used for anything other than file-based channels.</doc>
  9273. <type name="utf8" c:type="const gchar*"/>
  9274. </parameter>
  9275. <parameter name="length" transfer-ownership="none">
  9276. <doc xml:space="preserve">The length of the termination string. If -1 is passed, the
  9277. string is assumed to be nul-terminated. This option allows
  9278. termination strings with embedded nuls.</doc>
  9279. <type name="gint" c:type="gint"/>
  9280. </parameter>
  9281. </parameters>
  9282. </method>
  9283. <method name="shutdown" c:identifier="g_io_channel_shutdown" throws="1">
  9284. <doc xml:space="preserve">Close an IO channel. Any pending data to be written will be
  9285. flushed if @flush is %TRUE. The channel will not be freed until the
  9286. last reference is dropped using g_io_channel_unref().</doc>
  9287. <return-value transfer-ownership="none">
  9288. <doc xml:space="preserve">the status of the operation.</doc>
  9289. <type name="IOStatus" c:type="GIOStatus"/>
  9290. </return-value>
  9291. <parameters>
  9292. <instance-parameter name="channel" transfer-ownership="none">
  9293. <doc xml:space="preserve">a #GIOChannel</doc>
  9294. <type name="IOChannel" c:type="GIOChannel*"/>
  9295. </instance-parameter>
  9296. <parameter name="flush" transfer-ownership="none">
  9297. <doc xml:space="preserve">if %TRUE, flush pending</doc>
  9298. <type name="gboolean" c:type="gboolean"/>
  9299. </parameter>
  9300. </parameters>
  9301. </method>
  9302. <method name="unix_get_fd" c:identifier="g_io_channel_unix_get_fd">
  9303. <doc xml:space="preserve">Returns the file descriptor of the #GIOChannel.
  9304. On Windows this function returns the file descriptor or socket of
  9305. the #GIOChannel.</doc>
  9306. <return-value transfer-ownership="none">
  9307. <doc xml:space="preserve">the file descriptor of the #GIOChannel.</doc>
  9308. <type name="gint" c:type="gint"/>
  9309. </return-value>
  9310. <parameters>
  9311. <instance-parameter name="channel" transfer-ownership="none">
  9312. <doc xml:space="preserve">a #GIOChannel, created with g_io_channel_unix_new().</doc>
  9313. <type name="IOChannel" c:type="GIOChannel*"/>
  9314. </instance-parameter>
  9315. </parameters>
  9316. </method>
  9317. <method name="unref" c:identifier="g_io_channel_unref">
  9318. <doc xml:space="preserve">Decrements the reference count of a #GIOChannel.</doc>
  9319. <return-value transfer-ownership="none">
  9320. <type name="none" c:type="void"/>
  9321. </return-value>
  9322. <parameters>
  9323. <instance-parameter name="channel" transfer-ownership="none">
  9324. <doc xml:space="preserve">a #GIOChannel</doc>
  9325. <type name="IOChannel" c:type="GIOChannel*"/>
  9326. </instance-parameter>
  9327. </parameters>
  9328. </method>
  9329. <method name="write"
  9330. c:identifier="g_io_channel_write"
  9331. deprecated="1"
  9332. deprecated-version="2.2">
  9333. <doc xml:space="preserve">Writes data to a #GIOChannel.</doc>
  9334. <doc-deprecated xml:space="preserve">Use g_io_channel_write_chars() instead.</doc-deprecated>
  9335. <return-value transfer-ownership="none">
  9336. <doc xml:space="preserve">%G_IO_ERROR_NONE if the operation was successful.</doc>
  9337. <type name="IOError" c:type="GIOError"/>
  9338. </return-value>
  9339. <parameters>
  9340. <instance-parameter name="channel" transfer-ownership="none">
  9341. <doc xml:space="preserve">a #GIOChannel</doc>
  9342. <type name="IOChannel" c:type="GIOChannel*"/>
  9343. </instance-parameter>
  9344. <parameter name="buf" transfer-ownership="none">
  9345. <doc xml:space="preserve">the buffer containing the data to write</doc>
  9346. <type name="utf8" c:type="const gchar*"/>
  9347. </parameter>
  9348. <parameter name="count" transfer-ownership="none">
  9349. <doc xml:space="preserve">the number of bytes to write</doc>
  9350. <type name="gsize" c:type="gsize"/>
  9351. </parameter>
  9352. <parameter name="bytes_written" transfer-ownership="none">
  9353. <doc xml:space="preserve">the number of bytes actually written</doc>
  9354. <type name="gsize" c:type="gsize*"/>
  9355. </parameter>
  9356. </parameters>
  9357. </method>
  9358. <method name="write_chars"
  9359. c:identifier="g_io_channel_write_chars"
  9360. throws="1">
  9361. <doc xml:space="preserve">Replacement for g_io_channel_write() with the new API.
  9362. On seekable channels with encodings other than %NULL or UTF-8, generic
  9363. mixing of reading and writing is not allowed. A call to g_io_channel_write_chars ()
  9364. may only be made on a channel from which data has been read in the
  9365. cases described in the documentation for g_io_channel_set_encoding ().</doc>
  9366. <return-value transfer-ownership="none">
  9367. <doc xml:space="preserve">the status of the operation.</doc>
  9368. <type name="IOStatus" c:type="GIOStatus"/>
  9369. </return-value>
  9370. <parameters>
  9371. <instance-parameter name="channel" transfer-ownership="none">
  9372. <doc xml:space="preserve">a #GIOChannel</doc>
  9373. <type name="IOChannel" c:type="GIOChannel*"/>
  9374. </instance-parameter>
  9375. <parameter name="buf" transfer-ownership="none">
  9376. <doc xml:space="preserve">a buffer to write data from</doc>
  9377. <array zero-terminated="0" c:type="gchar*">
  9378. <type name="guint8"/>
  9379. </array>
  9380. </parameter>
  9381. <parameter name="count" transfer-ownership="none">
  9382. <doc xml:space="preserve">the size of the buffer. If -1, the buffer
  9383. is taken to be a nul-terminated string.</doc>
  9384. <type name="gssize" c:type="gssize"/>
  9385. </parameter>
  9386. <parameter name="bytes_written"
  9387. direction="out"
  9388. caller-allocates="0"
  9389. transfer-ownership="full">
  9390. <doc xml:space="preserve">The number of bytes written. This can be nonzero
  9391. even if the return value is not %G_IO_STATUS_NORMAL.
  9392. If the return value is %G_IO_STATUS_NORMAL and the
  9393. channel is blocking, this will always be equal
  9394. to @count if @count &gt;= 0.</doc>
  9395. <type name="gsize" c:type="gsize*"/>
  9396. </parameter>
  9397. </parameters>
  9398. </method>
  9399. <method name="write_unichar"
  9400. c:identifier="g_io_channel_write_unichar"
  9401. throws="1">
  9402. <doc xml:space="preserve">Writes a Unicode character to @channel.
  9403. This function cannot be called on a channel with %NULL encoding.</doc>
  9404. <return-value transfer-ownership="none">
  9405. <doc xml:space="preserve">a #GIOStatus</doc>
  9406. <type name="IOStatus" c:type="GIOStatus"/>
  9407. </return-value>
  9408. <parameters>
  9409. <instance-parameter name="channel" transfer-ownership="none">
  9410. <doc xml:space="preserve">a #GIOChannel</doc>
  9411. <type name="IOChannel" c:type="GIOChannel*"/>
  9412. </instance-parameter>
  9413. <parameter name="thechar" transfer-ownership="none">
  9414. <doc xml:space="preserve">a character</doc>
  9415. <type name="gunichar" c:type="gunichar"/>
  9416. </parameter>
  9417. </parameters>
  9418. </method>
  9419. <function name="error_from_errno"
  9420. c:identifier="g_io_channel_error_from_errno">
  9421. <doc xml:space="preserve">Converts an `errno` error number to a #GIOChannelError.</doc>
  9422. <return-value transfer-ownership="none">
  9423. <doc xml:space="preserve">a #GIOChannelError error number, e.g.
  9424. %G_IO_CHANNEL_ERROR_INVAL.</doc>
  9425. <type name="IOChannelError" c:type="GIOChannelError"/>
  9426. </return-value>
  9427. <parameters>
  9428. <parameter name="en" transfer-ownership="none">
  9429. <doc xml:space="preserve">an `errno` error number, e.g. `EINVAL`</doc>
  9430. <type name="gint" c:type="gint"/>
  9431. </parameter>
  9432. </parameters>
  9433. </function>
  9434. <function name="error_quark" c:identifier="g_io_channel_error_quark">
  9435. <return-value transfer-ownership="none">
  9436. <type name="Quark" c:type="GQuark"/>
  9437. </return-value>
  9438. </function>
  9439. </record>
  9440. <enumeration name="IOChannelError"
  9441. c:type="GIOChannelError"
  9442. glib:error-domain="g-io-channel-error-quark">
  9443. <doc xml:space="preserve">Error codes returned by #GIOChannel operations.</doc>
  9444. <member name="fbig" value="0" c:identifier="G_IO_CHANNEL_ERROR_FBIG">
  9445. <doc xml:space="preserve">File too large.</doc>
  9446. </member>
  9447. <member name="inval" value="1" c:identifier="G_IO_CHANNEL_ERROR_INVAL">
  9448. <doc xml:space="preserve">Invalid argument.</doc>
  9449. </member>
  9450. <member name="io" value="2" c:identifier="G_IO_CHANNEL_ERROR_IO">
  9451. <doc xml:space="preserve">IO error.</doc>
  9452. </member>
  9453. <member name="isdir" value="3" c:identifier="G_IO_CHANNEL_ERROR_ISDIR">
  9454. <doc xml:space="preserve">File is a directory.</doc>
  9455. </member>
  9456. <member name="nospc" value="4" c:identifier="G_IO_CHANNEL_ERROR_NOSPC">
  9457. <doc xml:space="preserve">No space left on device.</doc>
  9458. </member>
  9459. <member name="nxio" value="5" c:identifier="G_IO_CHANNEL_ERROR_NXIO">
  9460. <doc xml:space="preserve">No such device or address.</doc>
  9461. </member>
  9462. <member name="overflow"
  9463. value="6"
  9464. c:identifier="G_IO_CHANNEL_ERROR_OVERFLOW">
  9465. <doc xml:space="preserve">Value too large for defined datatype.</doc>
  9466. </member>
  9467. <member name="pipe" value="7" c:identifier="G_IO_CHANNEL_ERROR_PIPE">
  9468. <doc xml:space="preserve">Broken pipe.</doc>
  9469. </member>
  9470. <member name="failed" value="8" c:identifier="G_IO_CHANNEL_ERROR_FAILED">
  9471. <doc xml:space="preserve">Some other error.</doc>
  9472. </member>
  9473. </enumeration>
  9474. <bitfield name="IOCondition"
  9475. glib:type-name="GIOCondition"
  9476. glib:get-type="g_io_condition_get_type"
  9477. c:type="GIOCondition">
  9478. <doc xml:space="preserve">A bitwise combination representing a condition to watch for on an
  9479. event source.</doc>
  9480. <member name="in" value="1" c:identifier="G_IO_IN" glib:nick="in">
  9481. <doc xml:space="preserve">There is data to read.</doc>
  9482. </member>
  9483. <member name="out" value="4" c:identifier="G_IO_OUT" glib:nick="out">
  9484. <doc xml:space="preserve">Data can be written (without blocking).</doc>
  9485. </member>
  9486. <member name="pri" value="2" c:identifier="G_IO_PRI" glib:nick="pri">
  9487. <doc xml:space="preserve">There is urgent data to read.</doc>
  9488. </member>
  9489. <member name="err" value="8" c:identifier="G_IO_ERR" glib:nick="err">
  9490. <doc xml:space="preserve">Error condition.</doc>
  9491. </member>
  9492. <member name="hup" value="16" c:identifier="G_IO_HUP" glib:nick="hup">
  9493. <doc xml:space="preserve">Hung up (the connection has been broken, usually for
  9494. pipes and sockets).</doc>
  9495. </member>
  9496. <member name="nval" value="32" c:identifier="G_IO_NVAL" glib:nick="nval">
  9497. <doc xml:space="preserve">Invalid request. The file descriptor is not open.</doc>
  9498. </member>
  9499. </bitfield>
  9500. <enumeration name="IOError" c:type="GIOError">
  9501. <doc xml:space="preserve">#GIOError is only used by the deprecated functions
  9502. g_io_channel_read(), g_io_channel_write(), and g_io_channel_seek().</doc>
  9503. <member name="none" value="0" c:identifier="G_IO_ERROR_NONE">
  9504. <doc xml:space="preserve">no error</doc>
  9505. </member>
  9506. <member name="again" value="1" c:identifier="G_IO_ERROR_AGAIN">
  9507. <doc xml:space="preserve">an EAGAIN error occurred</doc>
  9508. </member>
  9509. <member name="inval" value="2" c:identifier="G_IO_ERROR_INVAL">
  9510. <doc xml:space="preserve">an EINVAL error occurred</doc>
  9511. </member>
  9512. <member name="unknown" value="3" c:identifier="G_IO_ERROR_UNKNOWN">
  9513. <doc xml:space="preserve">another error occurred</doc>
  9514. </member>
  9515. </enumeration>
  9516. <bitfield name="IOFlags" c:type="GIOFlags">
  9517. <doc xml:space="preserve">Specifies properties of a #GIOChannel. Some of the flags can only be
  9518. read with g_io_channel_get_flags(), but not changed with
  9519. g_io_channel_set_flags().</doc>
  9520. <member name="append" value="1" c:identifier="G_IO_FLAG_APPEND">
  9521. <doc xml:space="preserve">turns on append mode, corresponds to %O_APPEND
  9522. (see the documentation of the UNIX open() syscall)</doc>
  9523. </member>
  9524. <member name="nonblock" value="2" c:identifier="G_IO_FLAG_NONBLOCK">
  9525. <doc xml:space="preserve">turns on nonblocking mode, corresponds to
  9526. %O_NONBLOCK/%O_NDELAY (see the documentation of the UNIX open()
  9527. syscall)</doc>
  9528. </member>
  9529. <member name="is_readable"
  9530. value="4"
  9531. c:identifier="G_IO_FLAG_IS_READABLE">
  9532. <doc xml:space="preserve">indicates that the io channel is readable.
  9533. This flag cannot be changed.</doc>
  9534. </member>
  9535. <member name="is_writable"
  9536. value="8"
  9537. c:identifier="G_IO_FLAG_IS_WRITABLE">
  9538. <doc xml:space="preserve">indicates that the io channel is writable.
  9539. This flag cannot be changed.</doc>
  9540. </member>
  9541. <member name="is_writeable"
  9542. value="8"
  9543. c:identifier="G_IO_FLAG_IS_WRITEABLE">
  9544. <doc xml:space="preserve">a misspelled version of @G_IO_FLAG_IS_WRITABLE
  9545. that existed before the spelling was fixed in GLib 2.30. It is kept
  9546. here for compatibility reasons. Deprecated since 2.30</doc>
  9547. </member>
  9548. <member name="is_seekable"
  9549. value="16"
  9550. c:identifier="G_IO_FLAG_IS_SEEKABLE">
  9551. <doc xml:space="preserve">indicates that the io channel is seekable,
  9552. i.e. that g_io_channel_seek_position() can be used on it.
  9553. This flag cannot be changed.</doc>
  9554. </member>
  9555. <member name="mask" value="31" c:identifier="G_IO_FLAG_MASK">
  9556. <doc xml:space="preserve">the mask that specifies all the valid flags.</doc>
  9557. </member>
  9558. <member name="get_mask" value="31" c:identifier="G_IO_FLAG_GET_MASK">
  9559. <doc xml:space="preserve">the mask of the flags that are returned from
  9560. g_io_channel_get_flags()</doc>
  9561. </member>
  9562. <member name="set_mask" value="3" c:identifier="G_IO_FLAG_SET_MASK">
  9563. <doc xml:space="preserve">the mask of the flags that the user can modify
  9564. with g_io_channel_set_flags()</doc>
  9565. </member>
  9566. </bitfield>
  9567. <callback name="IOFunc" c:type="GIOFunc">
  9568. <doc xml:space="preserve">Specifies the type of function passed to g_io_add_watch() or
  9569. g_io_add_watch_full(), which is called when the requested condition
  9570. on a #GIOChannel is satisfied.</doc>
  9571. <return-value transfer-ownership="none">
  9572. <doc xml:space="preserve">the function should return %FALSE if the event source
  9573. should be removed</doc>
  9574. <type name="gboolean" c:type="gboolean"/>
  9575. </return-value>
  9576. <parameters>
  9577. <parameter name="source" transfer-ownership="none">
  9578. <doc xml:space="preserve">the #GIOChannel event source</doc>
  9579. <type name="IOChannel" c:type="GIOChannel*"/>
  9580. </parameter>
  9581. <parameter name="condition" transfer-ownership="none">
  9582. <doc xml:space="preserve">the condition which has been satisfied</doc>
  9583. <type name="IOCondition" c:type="GIOCondition"/>
  9584. </parameter>
  9585. <parameter name="data"
  9586. transfer-ownership="none"
  9587. nullable="1"
  9588. allow-none="1">
  9589. <doc xml:space="preserve">user data set in g_io_add_watch() or g_io_add_watch_full()</doc>
  9590. <type name="gpointer" c:type="gpointer"/>
  9591. </parameter>
  9592. </parameters>
  9593. </callback>
  9594. <record name="IOFuncs" c:type="GIOFuncs">
  9595. <doc xml:space="preserve">A table of functions used to handle different types of #GIOChannel
  9596. in a generic way.</doc>
  9597. <field name="io_read">
  9598. <callback name="io_read" throws="1">
  9599. <return-value transfer-ownership="none">
  9600. <type name="IOStatus" c:type="GIOStatus"/>
  9601. </return-value>
  9602. <parameters>
  9603. <parameter name="channel" transfer-ownership="none">
  9604. <type name="IOChannel" c:type="GIOChannel*"/>
  9605. </parameter>
  9606. <parameter name="buf" transfer-ownership="none">
  9607. <type name="utf8" c:type="gchar*"/>
  9608. </parameter>
  9609. <parameter name="count" transfer-ownership="none">
  9610. <type name="gsize" c:type="gsize"/>
  9611. </parameter>
  9612. <parameter name="bytes_read" transfer-ownership="none">
  9613. <type name="gsize" c:type="gsize*"/>
  9614. </parameter>
  9615. </parameters>
  9616. </callback>
  9617. </field>
  9618. <field name="io_write">
  9619. <callback name="io_write" throws="1">
  9620. <return-value transfer-ownership="none">
  9621. <type name="IOStatus" c:type="GIOStatus"/>
  9622. </return-value>
  9623. <parameters>
  9624. <parameter name="channel" transfer-ownership="none">
  9625. <type name="IOChannel" c:type="GIOChannel*"/>
  9626. </parameter>
  9627. <parameter name="buf" transfer-ownership="none">
  9628. <type name="utf8" c:type="const gchar*"/>
  9629. </parameter>
  9630. <parameter name="count" transfer-ownership="none">
  9631. <type name="gsize" c:type="gsize"/>
  9632. </parameter>
  9633. <parameter name="bytes_written" transfer-ownership="none">
  9634. <type name="gsize" c:type="gsize*"/>
  9635. </parameter>
  9636. </parameters>
  9637. </callback>
  9638. </field>
  9639. <field name="io_seek">
  9640. <callback name="io_seek" throws="1">
  9641. <return-value transfer-ownership="none">
  9642. <type name="IOStatus" c:type="GIOStatus"/>
  9643. </return-value>
  9644. <parameters>
  9645. <parameter name="channel" transfer-ownership="none">
  9646. <type name="IOChannel" c:type="GIOChannel*"/>
  9647. </parameter>
  9648. <parameter name="offset" transfer-ownership="none">
  9649. <type name="gint64" c:type="gint64"/>
  9650. </parameter>
  9651. <parameter name="type" transfer-ownership="none">
  9652. <type name="SeekType" c:type="GSeekType"/>
  9653. </parameter>
  9654. </parameters>
  9655. </callback>
  9656. </field>
  9657. <field name="io_close">
  9658. <callback name="io_close" throws="1">
  9659. <return-value transfer-ownership="none">
  9660. <type name="IOStatus" c:type="GIOStatus"/>
  9661. </return-value>
  9662. <parameters>
  9663. <parameter name="channel" transfer-ownership="none">
  9664. <type name="IOChannel" c:type="GIOChannel*"/>
  9665. </parameter>
  9666. </parameters>
  9667. </callback>
  9668. </field>
  9669. <field name="io_create_watch">
  9670. <callback name="io_create_watch">
  9671. <return-value transfer-ownership="full">
  9672. <type name="Source" c:type="GSource*"/>
  9673. </return-value>
  9674. <parameters>
  9675. <parameter name="channel" transfer-ownership="none">
  9676. <type name="IOChannel" c:type="GIOChannel*"/>
  9677. </parameter>
  9678. <parameter name="condition" transfer-ownership="none">
  9679. <type name="IOCondition" c:type="GIOCondition"/>
  9680. </parameter>
  9681. </parameters>
  9682. </callback>
  9683. </field>
  9684. <field name="io_free">
  9685. <callback name="io_free">
  9686. <return-value transfer-ownership="none">
  9687. <type name="none" c:type="void"/>
  9688. </return-value>
  9689. <parameters>
  9690. <parameter name="channel" transfer-ownership="none">
  9691. <type name="IOChannel" c:type="GIOChannel*"/>
  9692. </parameter>
  9693. </parameters>
  9694. </callback>
  9695. </field>
  9696. <field name="io_set_flags">
  9697. <callback name="io_set_flags" throws="1">
  9698. <return-value transfer-ownership="none">
  9699. <type name="IOStatus" c:type="GIOStatus"/>
  9700. </return-value>
  9701. <parameters>
  9702. <parameter name="channel" transfer-ownership="none">
  9703. <type name="IOChannel" c:type="GIOChannel*"/>
  9704. </parameter>
  9705. <parameter name="flags" transfer-ownership="none">
  9706. <type name="IOFlags" c:type="GIOFlags"/>
  9707. </parameter>
  9708. </parameters>
  9709. </callback>
  9710. </field>
  9711. <field name="io_get_flags">
  9712. <callback name="io_get_flags">
  9713. <return-value transfer-ownership="none">
  9714. <type name="IOFlags" c:type="GIOFlags"/>
  9715. </return-value>
  9716. <parameters>
  9717. <parameter name="channel" transfer-ownership="none">
  9718. <type name="IOChannel" c:type="GIOChannel*"/>
  9719. </parameter>
  9720. </parameters>
  9721. </callback>
  9722. </field>
  9723. </record>
  9724. <enumeration name="IOStatus" c:type="GIOStatus">
  9725. <doc xml:space="preserve">Stati returned by most of the #GIOFuncs functions.</doc>
  9726. <member name="error" value="0" c:identifier="G_IO_STATUS_ERROR">
  9727. <doc xml:space="preserve">An error occurred.</doc>
  9728. </member>
  9729. <member name="normal" value="1" c:identifier="G_IO_STATUS_NORMAL">
  9730. <doc xml:space="preserve">Success.</doc>
  9731. </member>
  9732. <member name="eof" value="2" c:identifier="G_IO_STATUS_EOF">
  9733. <doc xml:space="preserve">End of file.</doc>
  9734. </member>
  9735. <member name="again" value="3" c:identifier="G_IO_STATUS_AGAIN">
  9736. <doc xml:space="preserve">Resource temporarily unavailable.</doc>
  9737. </member>
  9738. </enumeration>
  9739. <constant name="KEY_FILE_DESKTOP_GROUP"
  9740. value="Desktop Entry"
  9741. c:type="G_KEY_FILE_DESKTOP_GROUP"
  9742. version="2.14">
  9743. <doc xml:space="preserve">The name of the main group of a desktop entry file, as defined in the
  9744. [Desktop Entry Specification](http://freedesktop.org/Standards/desktop-entry-spec).
  9745. Consult the specification for more
  9746. details about the meanings of the keys below.</doc>
  9747. <type name="utf8" c:type="gchar*"/>
  9748. </constant>
  9749. <constant name="KEY_FILE_DESKTOP_KEY_ACTIONS"
  9750. value="Actions"
  9751. c:type="G_KEY_FILE_DESKTOP_KEY_ACTIONS"
  9752. version="2.38">
  9753. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a string list
  9754. giving the available application actions.</doc>
  9755. <type name="utf8" c:type="gchar*"/>
  9756. </constant>
  9757. <constant name="KEY_FILE_DESKTOP_KEY_CATEGORIES"
  9758. value="Categories"
  9759. c:type="G_KEY_FILE_DESKTOP_KEY_CATEGORIES"
  9760. version="2.14">
  9761. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a list
  9762. of strings giving the categories in which the desktop entry
  9763. should be shown in a menu.</doc>
  9764. <type name="utf8" c:type="gchar*"/>
  9765. </constant>
  9766. <constant name="KEY_FILE_DESKTOP_KEY_COMMENT"
  9767. value="Comment"
  9768. c:type="G_KEY_FILE_DESKTOP_KEY_COMMENT"
  9769. version="2.14">
  9770. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
  9771. string giving the tooltip for the desktop entry.</doc>
  9772. <type name="utf8" c:type="gchar*"/>
  9773. </constant>
  9774. <constant name="KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE"
  9775. value="DBusActivatable"
  9776. c:type="G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE"
  9777. version="2.38">
  9778. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean set to true
  9779. if the application is D-Bus activatable.</doc>
  9780. <type name="utf8" c:type="gchar*"/>
  9781. </constant>
  9782. <constant name="KEY_FILE_DESKTOP_KEY_EXEC"
  9783. value="Exec"
  9784. c:type="G_KEY_FILE_DESKTOP_KEY_EXEC"
  9785. version="2.14">
  9786. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a string
  9787. giving the command line to execute. It is only valid for desktop
  9788. entries with the `Application` type.</doc>
  9789. <type name="utf8" c:type="gchar*"/>
  9790. </constant>
  9791. <constant name="KEY_FILE_DESKTOP_KEY_GENERIC_NAME"
  9792. value="GenericName"
  9793. c:type="G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME"
  9794. version="2.14">
  9795. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
  9796. string giving the generic name of the desktop entry.</doc>
  9797. <type name="utf8" c:type="gchar*"/>
  9798. </constant>
  9799. <constant name="KEY_FILE_DESKTOP_KEY_HIDDEN"
  9800. value="Hidden"
  9801. c:type="G_KEY_FILE_DESKTOP_KEY_HIDDEN"
  9802. version="2.14">
  9803. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
  9804. stating whether the desktop entry has been deleted by the user.</doc>
  9805. <type name="utf8" c:type="gchar*"/>
  9806. </constant>
  9807. <constant name="KEY_FILE_DESKTOP_KEY_ICON"
  9808. value="Icon"
  9809. c:type="G_KEY_FILE_DESKTOP_KEY_ICON"
  9810. version="2.14">
  9811. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
  9812. string giving the name of the icon to be displayed for the desktop
  9813. entry.</doc>
  9814. <type name="utf8" c:type="gchar*"/>
  9815. </constant>
  9816. <constant name="KEY_FILE_DESKTOP_KEY_MIME_TYPE"
  9817. value="MimeType"
  9818. c:type="G_KEY_FILE_DESKTOP_KEY_MIME_TYPE"
  9819. version="2.14">
  9820. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a list
  9821. of strings giving the MIME types supported by this desktop entry.</doc>
  9822. <type name="utf8" c:type="gchar*"/>
  9823. </constant>
  9824. <constant name="KEY_FILE_DESKTOP_KEY_NAME"
  9825. value="Name"
  9826. c:type="G_KEY_FILE_DESKTOP_KEY_NAME"
  9827. version="2.14">
  9828. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
  9829. string giving the specific name of the desktop entry.</doc>
  9830. <type name="utf8" c:type="gchar*"/>
  9831. </constant>
  9832. <constant name="KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN"
  9833. value="NotShowIn"
  9834. c:type="G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN"
  9835. version="2.14">
  9836. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a list of
  9837. strings identifying the environments that should not display the
  9838. desktop entry.</doc>
  9839. <type name="utf8" c:type="gchar*"/>
  9840. </constant>
  9841. <constant name="KEY_FILE_DESKTOP_KEY_NO_DISPLAY"
  9842. value="NoDisplay"
  9843. c:type="G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY"
  9844. version="2.14">
  9845. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
  9846. stating whether the desktop entry should be shown in menus.</doc>
  9847. <type name="utf8" c:type="gchar*"/>
  9848. </constant>
  9849. <constant name="KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN"
  9850. value="OnlyShowIn"
  9851. c:type="G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN"
  9852. version="2.14">
  9853. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a list of
  9854. strings identifying the environments that should display the
  9855. desktop entry.</doc>
  9856. <type name="utf8" c:type="gchar*"/>
  9857. </constant>
  9858. <constant name="KEY_FILE_DESKTOP_KEY_PATH"
  9859. value="Path"
  9860. c:type="G_KEY_FILE_DESKTOP_KEY_PATH"
  9861. version="2.14">
  9862. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a string
  9863. containing the working directory to run the program in. It is only
  9864. valid for desktop entries with the `Application` type.</doc>
  9865. <type name="utf8" c:type="gchar*"/>
  9866. </constant>
  9867. <constant name="KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY"
  9868. value="StartupNotify"
  9869. c:type="G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY"
  9870. version="2.14">
  9871. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
  9872. stating whether the application supports the
  9873. [Startup Notification Protocol Specification](http://www.freedesktop.org/Standards/startup-notification-spec).</doc>
  9874. <type name="utf8" c:type="gchar*"/>
  9875. </constant>
  9876. <constant name="KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS"
  9877. value="StartupWMClass"
  9878. c:type="G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS"
  9879. version="2.14">
  9880. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is string
  9881. identifying the WM class or name hint of a window that the application
  9882. will create, which can be used to emulate Startup Notification with
  9883. older applications.</doc>
  9884. <type name="utf8" c:type="gchar*"/>
  9885. </constant>
  9886. <constant name="KEY_FILE_DESKTOP_KEY_TERMINAL"
  9887. value="Terminal"
  9888. c:type="G_KEY_FILE_DESKTOP_KEY_TERMINAL"
  9889. version="2.14">
  9890. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
  9891. stating whether the program should be run in a terminal window.
  9892. It is only valid for desktop entries with the
  9893. `Application` type.</doc>
  9894. <type name="utf8" c:type="gchar*"/>
  9895. </constant>
  9896. <constant name="KEY_FILE_DESKTOP_KEY_TRY_EXEC"
  9897. value="TryExec"
  9898. c:type="G_KEY_FILE_DESKTOP_KEY_TRY_EXEC"
  9899. version="2.14">
  9900. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a string
  9901. giving the file name of a binary on disk used to determine if the
  9902. program is actually installed. It is only valid for desktop entries
  9903. with the `Application` type.</doc>
  9904. <type name="utf8" c:type="gchar*"/>
  9905. </constant>
  9906. <constant name="KEY_FILE_DESKTOP_KEY_TYPE"
  9907. value="Type"
  9908. c:type="G_KEY_FILE_DESKTOP_KEY_TYPE"
  9909. version="2.14">
  9910. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a string
  9911. giving the type of the desktop entry. Usually
  9912. #G_KEY_FILE_DESKTOP_TYPE_APPLICATION,
  9913. #G_KEY_FILE_DESKTOP_TYPE_LINK, or
  9914. #G_KEY_FILE_DESKTOP_TYPE_DIRECTORY.</doc>
  9915. <type name="utf8" c:type="gchar*"/>
  9916. </constant>
  9917. <constant name="KEY_FILE_DESKTOP_KEY_URL"
  9918. value="URL"
  9919. c:type="G_KEY_FILE_DESKTOP_KEY_URL"
  9920. version="2.14">
  9921. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a string
  9922. giving the URL to access. It is only valid for desktop entries
  9923. with the `Link` type.</doc>
  9924. <type name="utf8" c:type="gchar*"/>
  9925. </constant>
  9926. <constant name="KEY_FILE_DESKTOP_KEY_VERSION"
  9927. value="Version"
  9928. c:type="G_KEY_FILE_DESKTOP_KEY_VERSION"
  9929. version="2.14">
  9930. <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a string
  9931. giving the version of the Desktop Entry Specification used for
  9932. the desktop entry file.</doc>
  9933. <type name="utf8" c:type="gchar*"/>
  9934. </constant>
  9935. <constant name="KEY_FILE_DESKTOP_TYPE_APPLICATION"
  9936. value="Application"
  9937. c:type="G_KEY_FILE_DESKTOP_TYPE_APPLICATION"
  9938. version="2.14">
  9939. <doc xml:space="preserve">The value of the #G_KEY_FILE_DESKTOP_KEY_TYPE, key for desktop
  9940. entries representing applications.</doc>
  9941. <type name="utf8" c:type="gchar*"/>
  9942. </constant>
  9943. <constant name="KEY_FILE_DESKTOP_TYPE_DIRECTORY"
  9944. value="Directory"
  9945. c:type="G_KEY_FILE_DESKTOP_TYPE_DIRECTORY"
  9946. version="2.14">
  9947. <doc xml:space="preserve">The value of the #G_KEY_FILE_DESKTOP_KEY_TYPE, key for desktop
  9948. entries representing directories.</doc>
  9949. <type name="utf8" c:type="gchar*"/>
  9950. </constant>
  9951. <constant name="KEY_FILE_DESKTOP_TYPE_LINK"
  9952. value="Link"
  9953. c:type="G_KEY_FILE_DESKTOP_TYPE_LINK"
  9954. version="2.14">
  9955. <doc xml:space="preserve">The value of the #G_KEY_FILE_DESKTOP_KEY_TYPE, key for desktop
  9956. entries representing links to documents.</doc>
  9957. <type name="utf8" c:type="gchar*"/>
  9958. </constant>
  9959. <record name="KeyFile"
  9960. c:type="GKeyFile"
  9961. glib:type-name="GKeyFile"
  9962. glib:get-type="g_key_file_get_type"
  9963. c:symbol-prefix="key_file">
  9964. <doc xml:space="preserve">The GKeyFile struct contains only private data
  9965. and should not be accessed directly.</doc>
  9966. <constructor name="new" c:identifier="g_key_file_new" version="2.6">
  9967. <doc xml:space="preserve">Creates a new empty #GKeyFile object. Use
  9968. g_key_file_load_from_file(), g_key_file_load_from_data(),
  9969. g_key_file_load_from_dirs() or g_key_file_load_from_data_dirs() to
  9970. read an existing key file.</doc>
  9971. <return-value transfer-ownership="full">
  9972. <doc xml:space="preserve">an empty #GKeyFile.</doc>
  9973. <type name="KeyFile" c:type="GKeyFile*"/>
  9974. </return-value>
  9975. </constructor>
  9976. <method name="free"
  9977. c:identifier="g_key_file_free"
  9978. version="2.6"
  9979. introspectable="0">
  9980. <doc xml:space="preserve">Clears all keys and groups from @key_file, and decreases the
  9981. reference count by 1. If the reference count reaches zero,
  9982. frees the key file and all its allocated memory.</doc>
  9983. <return-value transfer-ownership="none">
  9984. <type name="none" c:type="void"/>
  9985. </return-value>
  9986. <parameters>
  9987. <instance-parameter name="key_file" transfer-ownership="none">
  9988. <doc xml:space="preserve">a #GKeyFile</doc>
  9989. <type name="KeyFile" c:type="GKeyFile*"/>
  9990. </instance-parameter>
  9991. </parameters>
  9992. </method>
  9993. <method name="get_boolean"
  9994. c:identifier="g_key_file_get_boolean"
  9995. version="2.6"
  9996. throws="1">
  9997. <doc xml:space="preserve">Returns the value associated with @key under @group_name as a
  9998. boolean.
  9999. If @key cannot be found then %FALSE is returned and @error is set
  10000. to #G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the value
  10001. associated with @key cannot be interpreted as a boolean then %FALSE
  10002. is returned and @error is set to #G_KEY_FILE_ERROR_INVALID_VALUE.</doc>
  10003. <return-value transfer-ownership="none">
  10004. <doc xml:space="preserve">the value associated with the key as a boolean,
  10005. or %FALSE if the key was not found or could not be parsed.</doc>
  10006. <type name="gboolean" c:type="gboolean"/>
  10007. </return-value>
  10008. <parameters>
  10009. <instance-parameter name="key_file" transfer-ownership="none">
  10010. <doc xml:space="preserve">a #GKeyFile</doc>
  10011. <type name="KeyFile" c:type="GKeyFile*"/>
  10012. </instance-parameter>
  10013. <parameter name="group_name" transfer-ownership="none">
  10014. <doc xml:space="preserve">a group name</doc>
  10015. <type name="utf8" c:type="const gchar*"/>
  10016. </parameter>
  10017. <parameter name="key" transfer-ownership="none">
  10018. <doc xml:space="preserve">a key</doc>
  10019. <type name="utf8" c:type="const gchar*"/>
  10020. </parameter>
  10021. </parameters>
  10022. </method>
  10023. <method name="get_boolean_list"
  10024. c:identifier="g_key_file_get_boolean_list"
  10025. version="2.6"
  10026. throws="1">
  10027. <doc xml:space="preserve">Returns the values associated with @key under @group_name as
  10028. booleans.
  10029. If @key cannot be found then %NULL is returned and @error is set to
  10030. #G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the values associated
  10031. with @key cannot be interpreted as booleans then %NULL is returned
  10032. and @error is set to #G_KEY_FILE_ERROR_INVALID_VALUE.</doc>
  10033. <return-value transfer-ownership="container">
  10034. <doc xml:space="preserve">
  10035. the values associated with the key as a list of booleans, or %NULL if the
  10036. key was not found or could not be parsed. The returned list of booleans
  10037. should be freed with g_free() when no longer needed.</doc>
  10038. <array length="2" zero-terminated="0" c:type="gboolean*">
  10039. <type name="gboolean"/>
  10040. </array>
  10041. </return-value>
  10042. <parameters>
  10043. <instance-parameter name="key_file" transfer-ownership="none">
  10044. <doc xml:space="preserve">a #GKeyFile</doc>
  10045. <type name="KeyFile" c:type="GKeyFile*"/>
  10046. </instance-parameter>
  10047. <parameter name="group_name" transfer-ownership="none">
  10048. <doc xml:space="preserve">a group name</doc>
  10049. <type name="utf8" c:type="const gchar*"/>
  10050. </parameter>
  10051. <parameter name="key" transfer-ownership="none">
  10052. <doc xml:space="preserve">a key</doc>
  10053. <type name="utf8" c:type="const gchar*"/>
  10054. </parameter>
  10055. <parameter name="length"
  10056. direction="out"
  10057. caller-allocates="0"
  10058. transfer-ownership="full">
  10059. <doc xml:space="preserve">the number of booleans returned</doc>
  10060. <type name="gsize" c:type="gsize*"/>
  10061. </parameter>
  10062. </parameters>
  10063. </method>
  10064. <method name="get_comment"
  10065. c:identifier="g_key_file_get_comment"
  10066. version="2.6"
  10067. throws="1">
  10068. <doc xml:space="preserve">Retrieves a comment above @key from @group_name.
  10069. If @key is %NULL then @comment will be read from above
  10070. @group_name. If both @key and @group_name are %NULL, then
  10071. @comment will be read from above the first group in the file.
  10072. Note that the returned string includes the '#' comment markers.</doc>
  10073. <return-value transfer-ownership="full">
  10074. <doc xml:space="preserve">a comment that should be freed with g_free()</doc>
  10075. <type name="utf8" c:type="gchar*"/>
  10076. </return-value>
  10077. <parameters>
  10078. <instance-parameter name="key_file" transfer-ownership="none">
  10079. <doc xml:space="preserve">a #GKeyFile</doc>
  10080. <type name="KeyFile" c:type="GKeyFile*"/>
  10081. </instance-parameter>
  10082. <parameter name="group_name"
  10083. transfer-ownership="none"
  10084. nullable="1"
  10085. allow-none="1">
  10086. <doc xml:space="preserve">a group name, or %NULL</doc>
  10087. <type name="utf8" c:type="const gchar*"/>
  10088. </parameter>
  10089. <parameter name="key" transfer-ownership="none">
  10090. <doc xml:space="preserve">a key</doc>
  10091. <type name="utf8" c:type="const gchar*"/>
  10092. </parameter>
  10093. </parameters>
  10094. </method>
  10095. <method name="get_double"
  10096. c:identifier="g_key_file_get_double"
  10097. version="2.12"
  10098. throws="1">
  10099. <doc xml:space="preserve">Returns the value associated with @key under @group_name as a
  10100. double. If @group_name is %NULL, the start_group is used.
  10101. If @key cannot be found then 0.0 is returned and @error is set to
  10102. #G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the value associated
  10103. with @key cannot be interpreted as a double then 0.0 is returned
  10104. and @error is set to #G_KEY_FILE_ERROR_INVALID_VALUE.</doc>
  10105. <return-value transfer-ownership="none">
  10106. <doc xml:space="preserve">the value associated with the key as a double, or
  10107. 0.0 if the key was not found or could not be parsed.</doc>
  10108. <type name="gdouble" c:type="gdouble"/>
  10109. </return-value>
  10110. <parameters>
  10111. <instance-parameter name="key_file" transfer-ownership="none">
  10112. <doc xml:space="preserve">a #GKeyFile</doc>
  10113. <type name="KeyFile" c:type="GKeyFile*"/>
  10114. </instance-parameter>
  10115. <parameter name="group_name" transfer-ownership="none">
  10116. <doc xml:space="preserve">a group name</doc>
  10117. <type name="utf8" c:type="const gchar*"/>
  10118. </parameter>
  10119. <parameter name="key" transfer-ownership="none">
  10120. <doc xml:space="preserve">a key</doc>
  10121. <type name="utf8" c:type="const gchar*"/>
  10122. </parameter>
  10123. </parameters>
  10124. </method>
  10125. <method name="get_double_list"
  10126. c:identifier="g_key_file_get_double_list"
  10127. version="2.12"
  10128. throws="1">
  10129. <doc xml:space="preserve">Returns the values associated with @key under @group_name as
  10130. doubles.
  10131. If @key cannot be found then %NULL is returned and @error is set to
  10132. #G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the values associated
  10133. with @key cannot be interpreted as doubles then %NULL is returned
  10134. and @error is set to #G_KEY_FILE_ERROR_INVALID_VALUE.</doc>
  10135. <return-value transfer-ownership="container">
  10136. <doc xml:space="preserve">
  10137. the values associated with the key as a list of doubles, or %NULL if the
  10138. key was not found or could not be parsed. The returned list of doubles
  10139. should be freed with g_free() when no longer needed.</doc>
  10140. <array length="2" zero-terminated="0" c:type="gdouble*">
  10141. <type name="gdouble"/>
  10142. </array>
  10143. </return-value>
  10144. <parameters>
  10145. <instance-parameter name="key_file" transfer-ownership="none">
  10146. <doc xml:space="preserve">a #GKeyFile</doc>
  10147. <type name="KeyFile" c:type="GKeyFile*"/>
  10148. </instance-parameter>
  10149. <parameter name="group_name" transfer-ownership="none">
  10150. <doc xml:space="preserve">a group name</doc>
  10151. <type name="utf8" c:type="const gchar*"/>
  10152. </parameter>
  10153. <parameter name="key" transfer-ownership="none">
  10154. <doc xml:space="preserve">a key</doc>
  10155. <type name="utf8" c:type="const gchar*"/>
  10156. </parameter>
  10157. <parameter name="length"
  10158. direction="out"
  10159. caller-allocates="0"
  10160. transfer-ownership="full">
  10161. <doc xml:space="preserve">the number of doubles returned</doc>
  10162. <type name="gsize" c:type="gsize*"/>
  10163. </parameter>
  10164. </parameters>
  10165. </method>
  10166. <method name="get_groups"
  10167. c:identifier="g_key_file_get_groups"
  10168. version="2.6">
  10169. <doc xml:space="preserve">Returns all groups in the key file loaded with @key_file.
  10170. The array of returned groups will be %NULL-terminated, so
  10171. @length may optionally be %NULL.</doc>
  10172. <return-value transfer-ownership="full">
  10173. <doc xml:space="preserve">a newly-allocated %NULL-terminated array of strings.
  10174. Use g_strfreev() to free it.</doc>
  10175. <array c:type="gchar**">
  10176. <type name="utf8"/>
  10177. </array>
  10178. </return-value>
  10179. <parameters>
  10180. <instance-parameter name="key_file" transfer-ownership="none">
  10181. <doc xml:space="preserve">a #GKeyFile</doc>
  10182. <type name="KeyFile" c:type="GKeyFile*"/>
  10183. </instance-parameter>
  10184. <parameter name="length"
  10185. direction="out"
  10186. caller-allocates="0"
  10187. transfer-ownership="full"
  10188. optional="1"
  10189. allow-none="1">
  10190. <doc xml:space="preserve">return location for the number of returned groups, or %NULL</doc>
  10191. <type name="gsize" c:type="gsize*"/>
  10192. </parameter>
  10193. </parameters>
  10194. </method>
  10195. <method name="get_int64"
  10196. c:identifier="g_key_file_get_int64"
  10197. version="2.26"
  10198. throws="1">
  10199. <doc xml:space="preserve">Returns the value associated with @key under @group_name as a signed
  10200. 64-bit integer. This is similar to g_key_file_get_integer() but can return
  10201. 64-bit results without truncation.</doc>
  10202. <return-value transfer-ownership="none">
  10203. <doc xml:space="preserve">the value associated with the key as a signed 64-bit integer, or
  10204. 0 if the key was not found or could not be parsed.</doc>
  10205. <type name="gint64" c:type="gint64"/>
  10206. </return-value>
  10207. <parameters>
  10208. <instance-parameter name="key_file" transfer-ownership="none">
  10209. <doc xml:space="preserve">a non-%NULL #GKeyFile</doc>
  10210. <type name="KeyFile" c:type="GKeyFile*"/>
  10211. </instance-parameter>
  10212. <parameter name="group_name" transfer-ownership="none">
  10213. <doc xml:space="preserve">a non-%NULL group name</doc>
  10214. <type name="utf8" c:type="const gchar*"/>
  10215. </parameter>
  10216. <parameter name="key" transfer-ownership="none">
  10217. <doc xml:space="preserve">a non-%NULL key</doc>
  10218. <type name="utf8" c:type="const gchar*"/>
  10219. </parameter>
  10220. </parameters>
  10221. </method>
  10222. <method name="get_integer"
  10223. c:identifier="g_key_file_get_integer"
  10224. version="2.6"
  10225. throws="1">
  10226. <doc xml:space="preserve">Returns the value associated with @key under @group_name as an
  10227. integer.
  10228. If @key cannot be found then 0 is returned and @error is set to
  10229. #G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the value associated
  10230. with @key cannot be interpreted as an integer then 0 is returned
  10231. and @error is set to #G_KEY_FILE_ERROR_INVALID_VALUE.</doc>
  10232. <return-value transfer-ownership="none">
  10233. <doc xml:space="preserve">the value associated with the key as an integer, or
  10234. 0 if the key was not found or could not be parsed.</doc>
  10235. <type name="gint" c:type="gint"/>
  10236. </return-value>
  10237. <parameters>
  10238. <instance-parameter name="key_file" transfer-ownership="none">
  10239. <doc xml:space="preserve">a #GKeyFile</doc>
  10240. <type name="KeyFile" c:type="GKeyFile*"/>
  10241. </instance-parameter>
  10242. <parameter name="group_name" transfer-ownership="none">
  10243. <doc xml:space="preserve">a group name</doc>
  10244. <type name="utf8" c:type="const gchar*"/>
  10245. </parameter>
  10246. <parameter name="key" transfer-ownership="none">
  10247. <doc xml:space="preserve">a key</doc>
  10248. <type name="utf8" c:type="const gchar*"/>
  10249. </parameter>
  10250. </parameters>
  10251. </method>
  10252. <method name="get_integer_list"
  10253. c:identifier="g_key_file_get_integer_list"
  10254. version="2.6"
  10255. throws="1">
  10256. <doc xml:space="preserve">Returns the values associated with @key under @group_name as
  10257. integers.
  10258. If @key cannot be found then %NULL is returned and @error is set to
  10259. #G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the values associated
  10260. with @key cannot be interpreted as integers then %NULL is returned
  10261. and @error is set to #G_KEY_FILE_ERROR_INVALID_VALUE.</doc>
  10262. <return-value transfer-ownership="container">
  10263. <doc xml:space="preserve">
  10264. the values associated with the key as a list of integers, or %NULL if
  10265. the key was not found or could not be parsed. The returned list of
  10266. integers should be freed with g_free() when no longer needed.</doc>
  10267. <array length="2" zero-terminated="0" c:type="gint*">
  10268. <type name="gint"/>
  10269. </array>
  10270. </return-value>
  10271. <parameters>
  10272. <instance-parameter name="key_file" transfer-ownership="none">
  10273. <doc xml:space="preserve">a #GKeyFile</doc>
  10274. <type name="KeyFile" c:type="GKeyFile*"/>
  10275. </instance-parameter>
  10276. <parameter name="group_name" transfer-ownership="none">
  10277. <doc xml:space="preserve">a group name</doc>
  10278. <type name="utf8" c:type="const gchar*"/>
  10279. </parameter>
  10280. <parameter name="key" transfer-ownership="none">
  10281. <doc xml:space="preserve">a key</doc>
  10282. <type name="utf8" c:type="const gchar*"/>
  10283. </parameter>
  10284. <parameter name="length"
  10285. direction="out"
  10286. caller-allocates="0"
  10287. transfer-ownership="full">
  10288. <doc xml:space="preserve">the number of integers returned</doc>
  10289. <type name="gsize" c:type="gsize*"/>
  10290. </parameter>
  10291. </parameters>
  10292. </method>
  10293. <method name="get_keys"
  10294. c:identifier="g_key_file_get_keys"
  10295. version="2.6"
  10296. throws="1">
  10297. <doc xml:space="preserve">Returns all keys for the group name @group_name. The array of
  10298. returned keys will be %NULL-terminated, so @length may
  10299. optionally be %NULL. In the event that the @group_name cannot
  10300. be found, %NULL is returned and @error is set to
  10301. #G_KEY_FILE_ERROR_GROUP_NOT_FOUND.</doc>
  10302. <return-value transfer-ownership="full">
  10303. <doc xml:space="preserve">a newly-allocated %NULL-terminated array of strings.
  10304. Use g_strfreev() to free it.</doc>
  10305. <array c:type="gchar**">
  10306. <type name="utf8"/>
  10307. </array>
  10308. </return-value>
  10309. <parameters>
  10310. <instance-parameter name="key_file" transfer-ownership="none">
  10311. <doc xml:space="preserve">a #GKeyFile</doc>
  10312. <type name="KeyFile" c:type="GKeyFile*"/>
  10313. </instance-parameter>
  10314. <parameter name="group_name" transfer-ownership="none">
  10315. <doc xml:space="preserve">a group name</doc>
  10316. <type name="utf8" c:type="const gchar*"/>
  10317. </parameter>
  10318. <parameter name="length"
  10319. direction="out"
  10320. caller-allocates="0"
  10321. transfer-ownership="full"
  10322. optional="1"
  10323. allow-none="1">
  10324. <doc xml:space="preserve">return location for the number of keys returned, or %NULL</doc>
  10325. <type name="gsize" c:type="gsize*"/>
  10326. </parameter>
  10327. </parameters>
  10328. </method>
  10329. <method name="get_locale_string"
  10330. c:identifier="g_key_file_get_locale_string"
  10331. version="2.6"
  10332. throws="1">
  10333. <doc xml:space="preserve">Returns the value associated with @key under @group_name
  10334. translated in the given @locale if available. If @locale is
  10335. %NULL then the current locale is assumed.
  10336. If @key cannot be found then %NULL is returned and @error is set
  10337. to #G_KEY_FILE_ERROR_KEY_NOT_FOUND. If the value associated
  10338. with @key cannot be interpreted or no suitable translation can
  10339. be found then the untranslated value is returned.</doc>
  10340. <return-value transfer-ownership="full">
  10341. <doc xml:space="preserve">a newly allocated string or %NULL if the specified
  10342. key cannot be found.</doc>
  10343. <type name="utf8" c:type="gchar*"/>
  10344. </return-value>
  10345. <parameters>
  10346. <instance-parameter name="key_file" transfer-ownership="none">
  10347. <doc xml:space="preserve">a #GKeyFile</doc>
  10348. <type name="KeyFile" c:type="GKeyFile*"/>
  10349. </instance-parameter>
  10350. <parameter name="group_name" transfer-ownership="none">
  10351. <doc xml:space="preserve">a group name</doc>
  10352. <type name="utf8" c:type="const gchar*"/>
  10353. </parameter>
  10354. <parameter name="key" transfer-ownership="none">
  10355. <doc xml:space="preserve">a key</doc>
  10356. <type name="utf8" c:type="const gchar*"/>
  10357. </parameter>
  10358. <parameter name="locale"
  10359. transfer-ownership="none"
  10360. nullable="1"
  10361. allow-none="1">
  10362. <doc xml:space="preserve">a locale identifier or %NULL</doc>
  10363. <type name="utf8" c:type="const gchar*"/>
  10364. </parameter>
  10365. </parameters>
  10366. </method>
  10367. <method name="get_locale_string_list"
  10368. c:identifier="g_key_file_get_locale_string_list"
  10369. version="2.6"
  10370. throws="1">
  10371. <doc xml:space="preserve">Returns the values associated with @key under @group_name
  10372. translated in the given @locale if available. If @locale is
  10373. %NULL then the current locale is assumed.
  10374. If @key cannot be found then %NULL is returned and @error is set
  10375. to #G_KEY_FILE_ERROR_KEY_NOT_FOUND. If the values associated
  10376. with @key cannot be interpreted or no suitable translations
  10377. can be found then the untranslated values are returned. The
  10378. returned array is %NULL-terminated, so @length may optionally
  10379. be %NULL.</doc>
  10380. <return-value transfer-ownership="full">
  10381. <doc xml:space="preserve">a newly allocated %NULL-terminated string array
  10382. or %NULL if the key isn't found. The string array should be freed
  10383. with g_strfreev().</doc>
  10384. <array length="3" zero-terminated="1" c:type="gchar**">
  10385. <type name="utf8"/>
  10386. </array>
  10387. </return-value>
  10388. <parameters>
  10389. <instance-parameter name="key_file" transfer-ownership="none">
  10390. <doc xml:space="preserve">a #GKeyFile</doc>
  10391. <type name="KeyFile" c:type="GKeyFile*"/>
  10392. </instance-parameter>
  10393. <parameter name="group_name" transfer-ownership="none">
  10394. <doc xml:space="preserve">a group name</doc>
  10395. <type name="utf8" c:type="const gchar*"/>
  10396. </parameter>
  10397. <parameter name="key" transfer-ownership="none">
  10398. <doc xml:space="preserve">a key</doc>
  10399. <type name="utf8" c:type="const gchar*"/>
  10400. </parameter>
  10401. <parameter name="locale"
  10402. transfer-ownership="none"
  10403. nullable="1"
  10404. allow-none="1">
  10405. <doc xml:space="preserve">a locale identifier or %NULL</doc>
  10406. <type name="utf8" c:type="const gchar*"/>
  10407. </parameter>
  10408. <parameter name="length"
  10409. direction="out"
  10410. caller-allocates="0"
  10411. transfer-ownership="full"
  10412. optional="1"
  10413. allow-none="1">
  10414. <doc xml:space="preserve">return location for the number of returned strings or %NULL</doc>
  10415. <type name="gsize" c:type="gsize*"/>
  10416. </parameter>
  10417. </parameters>
  10418. </method>
  10419. <method name="get_start_group"
  10420. c:identifier="g_key_file_get_start_group"
  10421. version="2.6">
  10422. <doc xml:space="preserve">Returns the name of the start group of the file.</doc>
  10423. <return-value transfer-ownership="full">
  10424. <doc xml:space="preserve">The start group of the key file.</doc>
  10425. <type name="utf8" c:type="gchar*"/>
  10426. </return-value>
  10427. <parameters>
  10428. <instance-parameter name="key_file" transfer-ownership="none">
  10429. <doc xml:space="preserve">a #GKeyFile</doc>
  10430. <type name="KeyFile" c:type="GKeyFile*"/>
  10431. </instance-parameter>
  10432. </parameters>
  10433. </method>
  10434. <method name="get_string"
  10435. c:identifier="g_key_file_get_string"
  10436. version="2.6"
  10437. throws="1">
  10438. <doc xml:space="preserve">Returns the string value associated with @key under @group_name.
  10439. Unlike g_key_file_get_value(), this function handles escape sequences
  10440. like \s.
  10441. In the event the key cannot be found, %NULL is returned and
  10442. @error is set to #G_KEY_FILE_ERROR_KEY_NOT_FOUND. In the
  10443. event that the @group_name cannot be found, %NULL is returned
  10444. and @error is set to #G_KEY_FILE_ERROR_GROUP_NOT_FOUND.</doc>
  10445. <return-value transfer-ownership="full">
  10446. <doc xml:space="preserve">a newly allocated string or %NULL if the specified
  10447. key cannot be found.</doc>
  10448. <type name="utf8" c:type="gchar*"/>
  10449. </return-value>
  10450. <parameters>
  10451. <instance-parameter name="key_file" transfer-ownership="none">
  10452. <doc xml:space="preserve">a #GKeyFile</doc>
  10453. <type name="KeyFile" c:type="GKeyFile*"/>
  10454. </instance-parameter>
  10455. <parameter name="group_name" transfer-ownership="none">
  10456. <doc xml:space="preserve">a group name</doc>
  10457. <type name="utf8" c:type="const gchar*"/>
  10458. </parameter>
  10459. <parameter name="key" transfer-ownership="none">
  10460. <doc xml:space="preserve">a key</doc>
  10461. <type name="utf8" c:type="const gchar*"/>
  10462. </parameter>
  10463. </parameters>
  10464. </method>
  10465. <method name="get_string_list"
  10466. c:identifier="g_key_file_get_string_list"
  10467. version="2.6"
  10468. throws="1">
  10469. <doc xml:space="preserve">Returns the values associated with @key under @group_name.
  10470. In the event the key cannot be found, %NULL is returned and
  10471. @error is set to #G_KEY_FILE_ERROR_KEY_NOT_FOUND. In the
  10472. event that the @group_name cannot be found, %NULL is returned
  10473. and @error is set to #G_KEY_FILE_ERROR_GROUP_NOT_FOUND.</doc>
  10474. <return-value transfer-ownership="full">
  10475. <doc xml:space="preserve">
  10476. a %NULL-terminated string array or %NULL if the specified
  10477. key cannot be found. The array should be freed with g_strfreev().</doc>
  10478. <array length="2" zero-terminated="1" c:type="gchar**">
  10479. <type name="utf8"/>
  10480. </array>
  10481. </return-value>
  10482. <parameters>
  10483. <instance-parameter name="key_file" transfer-ownership="none">
  10484. <doc xml:space="preserve">a #GKeyFile</doc>
  10485. <type name="KeyFile" c:type="GKeyFile*"/>
  10486. </instance-parameter>
  10487. <parameter name="group_name" transfer-ownership="none">
  10488. <doc xml:space="preserve">a group name</doc>
  10489. <type name="utf8" c:type="const gchar*"/>
  10490. </parameter>
  10491. <parameter name="key" transfer-ownership="none">
  10492. <doc xml:space="preserve">a key</doc>
  10493. <type name="utf8" c:type="const gchar*"/>
  10494. </parameter>
  10495. <parameter name="length"
  10496. direction="out"
  10497. caller-allocates="0"
  10498. transfer-ownership="full"
  10499. optional="1"
  10500. allow-none="1">
  10501. <doc xml:space="preserve">return location for the number of returned strings, or %NULL</doc>
  10502. <type name="gsize" c:type="gsize*"/>
  10503. </parameter>
  10504. </parameters>
  10505. </method>
  10506. <method name="get_uint64"
  10507. c:identifier="g_key_file_get_uint64"
  10508. version="2.26"
  10509. throws="1">
  10510. <doc xml:space="preserve">Returns the value associated with @key under @group_name as an unsigned
  10511. 64-bit integer. This is similar to g_key_file_get_integer() but can return
  10512. large positive results without truncation.</doc>
  10513. <return-value transfer-ownership="none">
  10514. <doc xml:space="preserve">the value associated with the key as an unsigned 64-bit integer,
  10515. or 0 if the key was not found or could not be parsed.</doc>
  10516. <type name="guint64" c:type="guint64"/>
  10517. </return-value>
  10518. <parameters>
  10519. <instance-parameter name="key_file" transfer-ownership="none">
  10520. <doc xml:space="preserve">a non-%NULL #GKeyFile</doc>
  10521. <type name="KeyFile" c:type="GKeyFile*"/>
  10522. </instance-parameter>
  10523. <parameter name="group_name" transfer-ownership="none">
  10524. <doc xml:space="preserve">a non-%NULL group name</doc>
  10525. <type name="utf8" c:type="const gchar*"/>
  10526. </parameter>
  10527. <parameter name="key" transfer-ownership="none">
  10528. <doc xml:space="preserve">a non-%NULL key</doc>
  10529. <type name="utf8" c:type="const gchar*"/>
  10530. </parameter>
  10531. </parameters>
  10532. </method>
  10533. <method name="get_value"
  10534. c:identifier="g_key_file_get_value"
  10535. version="2.6"
  10536. throws="1">
  10537. <doc xml:space="preserve">Returns the raw value associated with @key under @group_name.
  10538. Use g_key_file_get_string() to retrieve an unescaped UTF-8 string.
  10539. In the event the key cannot be found, %NULL is returned and
  10540. @error is set to #G_KEY_FILE_ERROR_KEY_NOT_FOUND. In the
  10541. event that the @group_name cannot be found, %NULL is returned
  10542. and @error is set to #G_KEY_FILE_ERROR_GROUP_NOT_FOUND.</doc>
  10543. <return-value transfer-ownership="full">
  10544. <doc xml:space="preserve">a newly allocated string or %NULL if the specified
  10545. key cannot be found.</doc>
  10546. <type name="utf8" c:type="gchar*"/>
  10547. </return-value>
  10548. <parameters>
  10549. <instance-parameter name="key_file" transfer-ownership="none">
  10550. <doc xml:space="preserve">a #GKeyFile</doc>
  10551. <type name="KeyFile" c:type="GKeyFile*"/>
  10552. </instance-parameter>
  10553. <parameter name="group_name" transfer-ownership="none">
  10554. <doc xml:space="preserve">a group name</doc>
  10555. <type name="utf8" c:type="const gchar*"/>
  10556. </parameter>
  10557. <parameter name="key" transfer-ownership="none">
  10558. <doc xml:space="preserve">a key</doc>
  10559. <type name="utf8" c:type="const gchar*"/>
  10560. </parameter>
  10561. </parameters>
  10562. </method>
  10563. <method name="has_group"
  10564. c:identifier="g_key_file_has_group"
  10565. version="2.6">
  10566. <doc xml:space="preserve">Looks whether the key file has the group @group_name.</doc>
  10567. <return-value transfer-ownership="none">
  10568. <doc xml:space="preserve">%TRUE if @group_name is a part of @key_file, %FALSE
  10569. otherwise.</doc>
  10570. <type name="gboolean" c:type="gboolean"/>
  10571. </return-value>
  10572. <parameters>
  10573. <instance-parameter name="key_file" transfer-ownership="none">
  10574. <doc xml:space="preserve">a #GKeyFile</doc>
  10575. <type name="KeyFile" c:type="GKeyFile*"/>
  10576. </instance-parameter>
  10577. <parameter name="group_name" transfer-ownership="none">
  10578. <doc xml:space="preserve">a group name</doc>
  10579. <type name="utf8" c:type="const gchar*"/>
  10580. </parameter>
  10581. </parameters>
  10582. </method>
  10583. <method name="has_key"
  10584. c:identifier="g_key_file_has_key"
  10585. version="2.6"
  10586. introspectable="0"
  10587. throws="1">
  10588. <doc xml:space="preserve">Looks whether the key file has the key @key in the group
  10589. @group_name.
  10590. Note that this function does not follow the rules for #GError strictly;
  10591. the return value both carries meaning and signals an error. To use
  10592. this function, you must pass a #GError pointer in @error, and check
  10593. whether it is not %NULL to see if an error occurred.
  10594. Language bindings should use g_key_file_get_value() to test whether
  10595. or not a key exists.</doc>
  10596. <return-value transfer-ownership="none">
  10597. <doc xml:space="preserve">%TRUE if @key is a part of @group_name, %FALSE otherwise</doc>
  10598. <type name="gboolean" c:type="gboolean"/>
  10599. </return-value>
  10600. <parameters>
  10601. <instance-parameter name="key_file" transfer-ownership="none">
  10602. <doc xml:space="preserve">a #GKeyFile</doc>
  10603. <type name="KeyFile" c:type="GKeyFile*"/>
  10604. </instance-parameter>
  10605. <parameter name="group_name" transfer-ownership="none">
  10606. <doc xml:space="preserve">a group name</doc>
  10607. <type name="utf8" c:type="const gchar*"/>
  10608. </parameter>
  10609. <parameter name="key" transfer-ownership="none">
  10610. <doc xml:space="preserve">a key name</doc>
  10611. <type name="utf8" c:type="const gchar*"/>
  10612. </parameter>
  10613. </parameters>
  10614. </method>
  10615. <method name="load_from_data"
  10616. c:identifier="g_key_file_load_from_data"
  10617. version="2.6"
  10618. throws="1">
  10619. <doc xml:space="preserve">Loads a key file from memory into an empty #GKeyFile structure.
  10620. If the object cannot be created then %error is set to a #GKeyFileError.</doc>
  10621. <return-value transfer-ownership="none">
  10622. <doc xml:space="preserve">%TRUE if a key file could be loaded, %FALSE otherwise</doc>
  10623. <type name="gboolean" c:type="gboolean"/>
  10624. </return-value>
  10625. <parameters>
  10626. <instance-parameter name="key_file" transfer-ownership="none">
  10627. <doc xml:space="preserve">an empty #GKeyFile struct</doc>
  10628. <type name="KeyFile" c:type="GKeyFile*"/>
  10629. </instance-parameter>
  10630. <parameter name="data" transfer-ownership="none">
  10631. <doc xml:space="preserve">key file loaded in memory</doc>
  10632. <type name="utf8" c:type="const gchar*"/>
  10633. </parameter>
  10634. <parameter name="length" transfer-ownership="none">
  10635. <doc xml:space="preserve">the length of @data in bytes (or (gsize)-1 if data is nul-terminated)</doc>
  10636. <type name="gsize" c:type="gsize"/>
  10637. </parameter>
  10638. <parameter name="flags" transfer-ownership="none">
  10639. <doc xml:space="preserve">flags from #GKeyFileFlags</doc>
  10640. <type name="KeyFileFlags" c:type="GKeyFileFlags"/>
  10641. </parameter>
  10642. </parameters>
  10643. </method>
  10644. <method name="load_from_data_dirs"
  10645. c:identifier="g_key_file_load_from_data_dirs"
  10646. version="2.6"
  10647. throws="1">
  10648. <doc xml:space="preserve">This function looks for a key file named @file in the paths
  10649. returned from g_get_user_data_dir() and g_get_system_data_dirs(),
  10650. loads the file into @key_file and returns the file's full path in
  10651. @full_path. If the file could not be loaded then an %error is
  10652. set to either a #GFileError or #GKeyFileError.</doc>
  10653. <return-value transfer-ownership="none">
  10654. <doc xml:space="preserve">%TRUE if a key file could be loaded, %FALSE othewise</doc>
  10655. <type name="gboolean" c:type="gboolean"/>
  10656. </return-value>
  10657. <parameters>
  10658. <instance-parameter name="key_file" transfer-ownership="none">
  10659. <doc xml:space="preserve">an empty #GKeyFile struct</doc>
  10660. <type name="KeyFile" c:type="GKeyFile*"/>
  10661. </instance-parameter>
  10662. <parameter name="file" transfer-ownership="none">
  10663. <doc xml:space="preserve">a relative path to a filename to open and parse</doc>
  10664. <type name="filename" c:type="gchar*"/>
  10665. </parameter>
  10666. <parameter name="full_path"
  10667. direction="out"
  10668. caller-allocates="0"
  10669. transfer-ownership="full"
  10670. optional="1"
  10671. allow-none="1">
  10672. <doc xml:space="preserve">return location for a string containing the full path
  10673. of the file, or %NULL</doc>
  10674. <type name="filename" c:type="gchar**"/>
  10675. </parameter>
  10676. <parameter name="flags" transfer-ownership="none">
  10677. <doc xml:space="preserve">flags from #GKeyFileFlags</doc>
  10678. <type name="KeyFileFlags" c:type="GKeyFileFlags"/>
  10679. </parameter>
  10680. </parameters>
  10681. </method>
  10682. <method name="load_from_dirs"
  10683. c:identifier="g_key_file_load_from_dirs"
  10684. version="2.14"
  10685. throws="1">
  10686. <doc xml:space="preserve">This function looks for a key file named @file in the paths
  10687. specified in @search_dirs, loads the file into @key_file and
  10688. returns the file's full path in @full_path. If the file could not
  10689. be loaded then an %error is set to either a #GFileError or
  10690. #GKeyFileError.</doc>
  10691. <return-value transfer-ownership="none">
  10692. <doc xml:space="preserve">%TRUE if a key file could be loaded, %FALSE otherwise</doc>
  10693. <type name="gboolean" c:type="gboolean"/>
  10694. </return-value>
  10695. <parameters>
  10696. <instance-parameter name="key_file" transfer-ownership="none">
  10697. <doc xml:space="preserve">an empty #GKeyFile struct</doc>
  10698. <type name="KeyFile" c:type="GKeyFile*"/>
  10699. </instance-parameter>
  10700. <parameter name="file" transfer-ownership="none">
  10701. <doc xml:space="preserve">a relative path to a filename to open and parse</doc>
  10702. <type name="filename" c:type="gchar*"/>
  10703. </parameter>
  10704. <parameter name="search_dirs" transfer-ownership="none">
  10705. <doc xml:space="preserve">%NULL-terminated array of directories to search</doc>
  10706. <array c:type="gchar**">
  10707. <type name="filename"/>
  10708. </array>
  10709. </parameter>
  10710. <parameter name="full_path"
  10711. direction="out"
  10712. caller-allocates="0"
  10713. transfer-ownership="full"
  10714. optional="1"
  10715. allow-none="1">
  10716. <doc xml:space="preserve">return location for a string containing the full path
  10717. of the file, or %NULL</doc>
  10718. <type name="filename" c:type="gchar**"/>
  10719. </parameter>
  10720. <parameter name="flags" transfer-ownership="none">
  10721. <doc xml:space="preserve">flags from #GKeyFileFlags</doc>
  10722. <type name="KeyFileFlags" c:type="GKeyFileFlags"/>
  10723. </parameter>
  10724. </parameters>
  10725. </method>
  10726. <method name="load_from_file"
  10727. c:identifier="g_key_file_load_from_file"
  10728. version="2.6"
  10729. throws="1">
  10730. <doc xml:space="preserve">Loads a key file into an empty #GKeyFile structure.
  10731. If the file could not be loaded then @error is set to
  10732. either a #GFileError or #GKeyFileError.</doc>
  10733. <return-value transfer-ownership="none">
  10734. <doc xml:space="preserve">%TRUE if a key file could be loaded, %FALSE otherwise</doc>
  10735. <type name="gboolean" c:type="gboolean"/>
  10736. </return-value>
  10737. <parameters>
  10738. <instance-parameter name="key_file" transfer-ownership="none">
  10739. <doc xml:space="preserve">an empty #GKeyFile struct</doc>
  10740. <type name="KeyFile" c:type="GKeyFile*"/>
  10741. </instance-parameter>
  10742. <parameter name="file" transfer-ownership="none">
  10743. <doc xml:space="preserve">the path of a filename to load, in the GLib filename encoding</doc>
  10744. <type name="filename" c:type="gchar*"/>
  10745. </parameter>
  10746. <parameter name="flags" transfer-ownership="none">
  10747. <doc xml:space="preserve">flags from #GKeyFileFlags</doc>
  10748. <type name="KeyFileFlags" c:type="GKeyFileFlags"/>
  10749. </parameter>
  10750. </parameters>
  10751. </method>
  10752. <method name="ref"
  10753. c:identifier="g_key_file_ref"
  10754. version="2.32"
  10755. introspectable="0">
  10756. <doc xml:space="preserve">Increases the reference count of @key_file.</doc>
  10757. <return-value transfer-ownership="full">
  10758. <doc xml:space="preserve">the same @key_file.</doc>
  10759. <type name="KeyFile" c:type="GKeyFile*"/>
  10760. </return-value>
  10761. <parameters>
  10762. <instance-parameter name="key_file" transfer-ownership="none">
  10763. <doc xml:space="preserve">a #GKeyFile</doc>
  10764. <type name="KeyFile" c:type="GKeyFile*"/>
  10765. </instance-parameter>
  10766. </parameters>
  10767. </method>
  10768. <method name="remove_comment"
  10769. c:identifier="g_key_file_remove_comment"
  10770. version="2.6"
  10771. throws="1">
  10772. <doc xml:space="preserve">Removes a comment above @key from @group_name.
  10773. If @key is %NULL then @comment will be removed above @group_name.
  10774. If both @key and @group_name are %NULL, then @comment will
  10775. be removed above the first group in the file.</doc>
  10776. <return-value transfer-ownership="none">
  10777. <doc xml:space="preserve">%TRUE if the comment was removed, %FALSE otherwise</doc>
  10778. <type name="gboolean" c:type="gboolean"/>
  10779. </return-value>
  10780. <parameters>
  10781. <instance-parameter name="key_file" transfer-ownership="none">
  10782. <doc xml:space="preserve">a #GKeyFile</doc>
  10783. <type name="KeyFile" c:type="GKeyFile*"/>
  10784. </instance-parameter>
  10785. <parameter name="group_name"
  10786. transfer-ownership="none"
  10787. nullable="1"
  10788. allow-none="1">
  10789. <doc xml:space="preserve">a group name, or %NULL</doc>
  10790. <type name="utf8" c:type="const gchar*"/>
  10791. </parameter>
  10792. <parameter name="key"
  10793. transfer-ownership="none"
  10794. nullable="1"
  10795. allow-none="1">
  10796. <doc xml:space="preserve">a key</doc>
  10797. <type name="utf8" c:type="const gchar*"/>
  10798. </parameter>
  10799. </parameters>
  10800. </method>
  10801. <method name="remove_group"
  10802. c:identifier="g_key_file_remove_group"
  10803. version="2.6"
  10804. throws="1">
  10805. <doc xml:space="preserve">Removes the specified group, @group_name,
  10806. from the key file.</doc>
  10807. <return-value transfer-ownership="none">
  10808. <doc xml:space="preserve">%TRUE if the group was removed, %FALSE otherwise</doc>
  10809. <type name="gboolean" c:type="gboolean"/>
  10810. </return-value>
  10811. <parameters>
  10812. <instance-parameter name="key_file" transfer-ownership="none">
  10813. <doc xml:space="preserve">a #GKeyFile</doc>
  10814. <type name="KeyFile" c:type="GKeyFile*"/>
  10815. </instance-parameter>
  10816. <parameter name="group_name" transfer-ownership="none">
  10817. <doc xml:space="preserve">a group name</doc>
  10818. <type name="utf8" c:type="const gchar*"/>
  10819. </parameter>
  10820. </parameters>
  10821. </method>
  10822. <method name="remove_key"
  10823. c:identifier="g_key_file_remove_key"
  10824. version="2.6"
  10825. throws="1">
  10826. <doc xml:space="preserve">Removes @key in @group_name from the key file.</doc>
  10827. <return-value transfer-ownership="none">
  10828. <doc xml:space="preserve">%TRUE if the key was removed, %FALSE otherwise</doc>
  10829. <type name="gboolean" c:type="gboolean"/>
  10830. </return-value>
  10831. <parameters>
  10832. <instance-parameter name="key_file" transfer-ownership="none">
  10833. <doc xml:space="preserve">a #GKeyFile</doc>
  10834. <type name="KeyFile" c:type="GKeyFile*"/>
  10835. </instance-parameter>
  10836. <parameter name="group_name" transfer-ownership="none">
  10837. <doc xml:space="preserve">a group name</doc>
  10838. <type name="utf8" c:type="const gchar*"/>
  10839. </parameter>
  10840. <parameter name="key" transfer-ownership="none">
  10841. <doc xml:space="preserve">a key name to remove</doc>
  10842. <type name="utf8" c:type="const gchar*"/>
  10843. </parameter>
  10844. </parameters>
  10845. </method>
  10846. <method name="save_to_file"
  10847. c:identifier="g_key_file_save_to_file"
  10848. version="2.40"
  10849. throws="1">
  10850. <doc xml:space="preserve">Writes the contents of @key_file to @filename using
  10851. g_file_set_contents().
  10852. This function can fail for any of the reasons that
  10853. g_file_set_contents() may fail.</doc>
  10854. <return-value transfer-ownership="none">
  10855. <doc xml:space="preserve">%TRUE if successful, else %FALSE with @error set</doc>
  10856. <type name="gboolean" c:type="gboolean"/>
  10857. </return-value>
  10858. <parameters>
  10859. <instance-parameter name="key_file" transfer-ownership="none">
  10860. <doc xml:space="preserve">a #GKeyFile</doc>
  10861. <type name="KeyFile" c:type="GKeyFile*"/>
  10862. </instance-parameter>
  10863. <parameter name="filename" transfer-ownership="none">
  10864. <doc xml:space="preserve">the name of the file to write to</doc>
  10865. <type name="utf8" c:type="const gchar*"/>
  10866. </parameter>
  10867. </parameters>
  10868. </method>
  10869. <method name="set_boolean"
  10870. c:identifier="g_key_file_set_boolean"
  10871. version="2.6">
  10872. <doc xml:space="preserve">Associates a new boolean value with @key under @group_name.
  10873. If @key cannot be found then it is created.</doc>
  10874. <return-value transfer-ownership="none">
  10875. <type name="none" c:type="void"/>
  10876. </return-value>
  10877. <parameters>
  10878. <instance-parameter name="key_file" transfer-ownership="none">
  10879. <doc xml:space="preserve">a #GKeyFile</doc>
  10880. <type name="KeyFile" c:type="GKeyFile*"/>
  10881. </instance-parameter>
  10882. <parameter name="group_name" transfer-ownership="none">
  10883. <doc xml:space="preserve">a group name</doc>
  10884. <type name="utf8" c:type="const gchar*"/>
  10885. </parameter>
  10886. <parameter name="key" transfer-ownership="none">
  10887. <doc xml:space="preserve">a key</doc>
  10888. <type name="utf8" c:type="const gchar*"/>
  10889. </parameter>
  10890. <parameter name="value" transfer-ownership="none">
  10891. <doc xml:space="preserve">%TRUE or %FALSE</doc>
  10892. <type name="gboolean" c:type="gboolean"/>
  10893. </parameter>
  10894. </parameters>
  10895. </method>
  10896. <method name="set_boolean_list"
  10897. c:identifier="g_key_file_set_boolean_list"
  10898. version="2.6">
  10899. <doc xml:space="preserve">Associates a list of boolean values with @key under @group_name.
  10900. If @key cannot be found then it is created.
  10901. If @group_name is %NULL, the start_group is used.</doc>
  10902. <return-value transfer-ownership="none">
  10903. <type name="none" c:type="void"/>
  10904. </return-value>
  10905. <parameters>
  10906. <instance-parameter name="key_file" transfer-ownership="none">
  10907. <doc xml:space="preserve">a #GKeyFile</doc>
  10908. <type name="KeyFile" c:type="GKeyFile*"/>
  10909. </instance-parameter>
  10910. <parameter name="group_name" transfer-ownership="none">
  10911. <doc xml:space="preserve">a group name</doc>
  10912. <type name="utf8" c:type="const gchar*"/>
  10913. </parameter>
  10914. <parameter name="key" transfer-ownership="none">
  10915. <doc xml:space="preserve">a key</doc>
  10916. <type name="utf8" c:type="const gchar*"/>
  10917. </parameter>
  10918. <parameter name="list" transfer-ownership="none">
  10919. <doc xml:space="preserve">an array of boolean values</doc>
  10920. <array length="3" zero-terminated="0" c:type="gboolean">
  10921. <type name="gboolean" c:type="gboolean"/>
  10922. </array>
  10923. </parameter>
  10924. <parameter name="length" transfer-ownership="none">
  10925. <doc xml:space="preserve">length of @list</doc>
  10926. <type name="gsize" c:type="gsize"/>
  10927. </parameter>
  10928. </parameters>
  10929. </method>
  10930. <method name="set_comment"
  10931. c:identifier="g_key_file_set_comment"
  10932. version="2.6"
  10933. throws="1">
  10934. <doc xml:space="preserve">Places a comment above @key from @group_name.
  10935. If @key is %NULL then @comment will be written above @group_name.
  10936. If both @key and @group_name are %NULL, then @comment will be
  10937. written above the first group in the file.
  10938. Note that this function prepends a '#' comment marker to
  10939. each line of @comment.</doc>
  10940. <return-value transfer-ownership="none">
  10941. <doc xml:space="preserve">%TRUE if the comment was written, %FALSE otherwise</doc>
  10942. <type name="gboolean" c:type="gboolean"/>
  10943. </return-value>
  10944. <parameters>
  10945. <instance-parameter name="key_file" transfer-ownership="none">
  10946. <doc xml:space="preserve">a #GKeyFile</doc>
  10947. <type name="KeyFile" c:type="GKeyFile*"/>
  10948. </instance-parameter>
  10949. <parameter name="group_name"
  10950. transfer-ownership="none"
  10951. nullable="1"
  10952. allow-none="1">
  10953. <doc xml:space="preserve">a group name, or %NULL</doc>
  10954. <type name="utf8" c:type="const gchar*"/>
  10955. </parameter>
  10956. <parameter name="key"
  10957. transfer-ownership="none"
  10958. nullable="1"
  10959. allow-none="1">
  10960. <doc xml:space="preserve">a key</doc>
  10961. <type name="utf8" c:type="const gchar*"/>
  10962. </parameter>
  10963. <parameter name="comment" transfer-ownership="none">
  10964. <doc xml:space="preserve">a comment</doc>
  10965. <type name="utf8" c:type="const gchar*"/>
  10966. </parameter>
  10967. </parameters>
  10968. </method>
  10969. <method name="set_double"
  10970. c:identifier="g_key_file_set_double"
  10971. version="2.12">
  10972. <doc xml:space="preserve">Associates a new double value with @key under @group_name.
  10973. If @key cannot be found then it is created.</doc>
  10974. <return-value transfer-ownership="none">
  10975. <type name="none" c:type="void"/>
  10976. </return-value>
  10977. <parameters>
  10978. <instance-parameter name="key_file" transfer-ownership="none">
  10979. <doc xml:space="preserve">a #GKeyFile</doc>
  10980. <type name="KeyFile" c:type="GKeyFile*"/>
  10981. </instance-parameter>
  10982. <parameter name="group_name" transfer-ownership="none">
  10983. <doc xml:space="preserve">a group name</doc>
  10984. <type name="utf8" c:type="const gchar*"/>
  10985. </parameter>
  10986. <parameter name="key" transfer-ownership="none">
  10987. <doc xml:space="preserve">a key</doc>
  10988. <type name="utf8" c:type="const gchar*"/>
  10989. </parameter>
  10990. <parameter name="value" transfer-ownership="none">
  10991. <doc xml:space="preserve">an double value</doc>
  10992. <type name="gdouble" c:type="gdouble"/>
  10993. </parameter>
  10994. </parameters>
  10995. </method>
  10996. <method name="set_double_list"
  10997. c:identifier="g_key_file_set_double_list"
  10998. version="2.12">
  10999. <doc xml:space="preserve">Associates a list of double values with @key under
  11000. @group_name. If @key cannot be found then it is created.</doc>
  11001. <return-value transfer-ownership="none">
  11002. <type name="none" c:type="void"/>
  11003. </return-value>
  11004. <parameters>
  11005. <instance-parameter name="key_file" transfer-ownership="none">
  11006. <doc xml:space="preserve">a #GKeyFile</doc>
  11007. <type name="KeyFile" c:type="GKeyFile*"/>
  11008. </instance-parameter>
  11009. <parameter name="group_name" transfer-ownership="none">
  11010. <doc xml:space="preserve">a group name</doc>
  11011. <type name="utf8" c:type="const gchar*"/>
  11012. </parameter>
  11013. <parameter name="key" transfer-ownership="none">
  11014. <doc xml:space="preserve">a key</doc>
  11015. <type name="utf8" c:type="const gchar*"/>
  11016. </parameter>
  11017. <parameter name="list" transfer-ownership="none">
  11018. <doc xml:space="preserve">an array of double values</doc>
  11019. <array length="3" zero-terminated="0" c:type="gdouble">
  11020. <type name="gdouble" c:type="gdouble"/>
  11021. </array>
  11022. </parameter>
  11023. <parameter name="length" transfer-ownership="none">
  11024. <doc xml:space="preserve">number of double values in @list</doc>
  11025. <type name="gsize" c:type="gsize"/>
  11026. </parameter>
  11027. </parameters>
  11028. </method>
  11029. <method name="set_int64"
  11030. c:identifier="g_key_file_set_int64"
  11031. version="2.26">
  11032. <doc xml:space="preserve">Associates a new integer value with @key under @group_name.
  11033. If @key cannot be found then it is created.</doc>
  11034. <return-value transfer-ownership="none">
  11035. <type name="none" c:type="void"/>
  11036. </return-value>
  11037. <parameters>
  11038. <instance-parameter name="key_file" transfer-ownership="none">
  11039. <doc xml:space="preserve">a #GKeyFile</doc>
  11040. <type name="KeyFile" c:type="GKeyFile*"/>
  11041. </instance-parameter>
  11042. <parameter name="group_name" transfer-ownership="none">
  11043. <doc xml:space="preserve">a group name</doc>
  11044. <type name="utf8" c:type="const gchar*"/>
  11045. </parameter>
  11046. <parameter name="key" transfer-ownership="none">
  11047. <doc xml:space="preserve">a key</doc>
  11048. <type name="utf8" c:type="const gchar*"/>
  11049. </parameter>
  11050. <parameter name="value" transfer-ownership="none">
  11051. <doc xml:space="preserve">an integer value</doc>
  11052. <type name="gint64" c:type="gint64"/>
  11053. </parameter>
  11054. </parameters>
  11055. </method>
  11056. <method name="set_integer"
  11057. c:identifier="g_key_file_set_integer"
  11058. version="2.6">
  11059. <doc xml:space="preserve">Associates a new integer value with @key under @group_name.
  11060. If @key cannot be found then it is created.</doc>
  11061. <return-value transfer-ownership="none">
  11062. <type name="none" c:type="void"/>
  11063. </return-value>
  11064. <parameters>
  11065. <instance-parameter name="key_file" transfer-ownership="none">
  11066. <doc xml:space="preserve">a #GKeyFile</doc>
  11067. <type name="KeyFile" c:type="GKeyFile*"/>
  11068. </instance-parameter>
  11069. <parameter name="group_name" transfer-ownership="none">
  11070. <doc xml:space="preserve">a group name</doc>
  11071. <type name="utf8" c:type="const gchar*"/>
  11072. </parameter>
  11073. <parameter name="key" transfer-ownership="none">
  11074. <doc xml:space="preserve">a key</doc>
  11075. <type name="utf8" c:type="const gchar*"/>
  11076. </parameter>
  11077. <parameter name="value" transfer-ownership="none">
  11078. <doc xml:space="preserve">an integer value</doc>
  11079. <type name="gint" c:type="gint"/>
  11080. </parameter>
  11081. </parameters>
  11082. </method>
  11083. <method name="set_integer_list"
  11084. c:identifier="g_key_file_set_integer_list"
  11085. version="2.6">
  11086. <doc xml:space="preserve">Associates a list of integer values with @key under @group_name.
  11087. If @key cannot be found then it is created.</doc>
  11088. <return-value transfer-ownership="none">
  11089. <type name="none" c:type="void"/>
  11090. </return-value>
  11091. <parameters>
  11092. <instance-parameter name="key_file" transfer-ownership="none">
  11093. <doc xml:space="preserve">a #GKeyFile</doc>
  11094. <type name="KeyFile" c:type="GKeyFile*"/>
  11095. </instance-parameter>
  11096. <parameter name="group_name" transfer-ownership="none">
  11097. <doc xml:space="preserve">a group name</doc>
  11098. <type name="utf8" c:type="const gchar*"/>
  11099. </parameter>
  11100. <parameter name="key" transfer-ownership="none">
  11101. <doc xml:space="preserve">a key</doc>
  11102. <type name="utf8" c:type="const gchar*"/>
  11103. </parameter>
  11104. <parameter name="list" transfer-ownership="none">
  11105. <doc xml:space="preserve">an array of integer values</doc>
  11106. <array length="3" zero-terminated="0" c:type="gint">
  11107. <type name="gint" c:type="gint"/>
  11108. </array>
  11109. </parameter>
  11110. <parameter name="length" transfer-ownership="none">
  11111. <doc xml:space="preserve">number of integer values in @list</doc>
  11112. <type name="gsize" c:type="gsize"/>
  11113. </parameter>
  11114. </parameters>
  11115. </method>
  11116. <method name="set_list_separator"
  11117. c:identifier="g_key_file_set_list_separator"
  11118. version="2.6">
  11119. <doc xml:space="preserve">Sets the character which is used to separate
  11120. values in lists. Typically ';' or ',' are used
  11121. as separators. The default list separator is ';'.</doc>
  11122. <return-value transfer-ownership="none">
  11123. <type name="none" c:type="void"/>
  11124. </return-value>
  11125. <parameters>
  11126. <instance-parameter name="key_file" transfer-ownership="none">
  11127. <doc xml:space="preserve">a #GKeyFile</doc>
  11128. <type name="KeyFile" c:type="GKeyFile*"/>
  11129. </instance-parameter>
  11130. <parameter name="separator" transfer-ownership="none">
  11131. <doc xml:space="preserve">the separator</doc>
  11132. <type name="gchar" c:type="gchar"/>
  11133. </parameter>
  11134. </parameters>
  11135. </method>
  11136. <method name="set_locale_string"
  11137. c:identifier="g_key_file_set_locale_string"
  11138. version="2.6">
  11139. <doc xml:space="preserve">Associates a string value for @key and @locale under @group_name.
  11140. If the translation for @key cannot be found then it is created.</doc>
  11141. <return-value transfer-ownership="none">
  11142. <type name="none" c:type="void"/>
  11143. </return-value>
  11144. <parameters>
  11145. <instance-parameter name="key_file" transfer-ownership="none">
  11146. <doc xml:space="preserve">a #GKeyFile</doc>
  11147. <type name="KeyFile" c:type="GKeyFile*"/>
  11148. </instance-parameter>
  11149. <parameter name="group_name" transfer-ownership="none">
  11150. <doc xml:space="preserve">a group name</doc>
  11151. <type name="utf8" c:type="const gchar*"/>
  11152. </parameter>
  11153. <parameter name="key" transfer-ownership="none">
  11154. <doc xml:space="preserve">a key</doc>
  11155. <type name="utf8" c:type="const gchar*"/>
  11156. </parameter>
  11157. <parameter name="locale" transfer-ownership="none">
  11158. <doc xml:space="preserve">a locale identifier</doc>
  11159. <type name="utf8" c:type="const gchar*"/>
  11160. </parameter>
  11161. <parameter name="string" transfer-ownership="none">
  11162. <doc xml:space="preserve">a string</doc>
  11163. <type name="utf8" c:type="const gchar*"/>
  11164. </parameter>
  11165. </parameters>
  11166. </method>
  11167. <method name="set_locale_string_list"
  11168. c:identifier="g_key_file_set_locale_string_list"
  11169. version="2.6">
  11170. <doc xml:space="preserve">Associates a list of string values for @key and @locale under
  11171. @group_name. If the translation for @key cannot be found then
  11172. it is created.</doc>
  11173. <return-value transfer-ownership="none">
  11174. <type name="none" c:type="void"/>
  11175. </return-value>
  11176. <parameters>
  11177. <instance-parameter name="key_file" transfer-ownership="none">
  11178. <doc xml:space="preserve">a #GKeyFile</doc>
  11179. <type name="KeyFile" c:type="GKeyFile*"/>
  11180. </instance-parameter>
  11181. <parameter name="group_name" transfer-ownership="none">
  11182. <doc xml:space="preserve">a group name</doc>
  11183. <type name="utf8" c:type="const gchar*"/>
  11184. </parameter>
  11185. <parameter name="key" transfer-ownership="none">
  11186. <doc xml:space="preserve">a key</doc>
  11187. <type name="utf8" c:type="const gchar*"/>
  11188. </parameter>
  11189. <parameter name="locale" transfer-ownership="none">
  11190. <doc xml:space="preserve">a locale identifier</doc>
  11191. <type name="utf8" c:type="const gchar*"/>
  11192. </parameter>
  11193. <parameter name="list" transfer-ownership="none">
  11194. <doc xml:space="preserve">a %NULL-terminated array of locale string values</doc>
  11195. <array length="4" zero-terminated="1" c:type="gchar*">
  11196. <type name="utf8" c:type="gchar"/>
  11197. </array>
  11198. </parameter>
  11199. <parameter name="length" transfer-ownership="none">
  11200. <doc xml:space="preserve">the length of @list</doc>
  11201. <type name="gsize" c:type="gsize"/>
  11202. </parameter>
  11203. </parameters>
  11204. </method>
  11205. <method name="set_string"
  11206. c:identifier="g_key_file_set_string"
  11207. version="2.6">
  11208. <doc xml:space="preserve">Associates a new string value with @key under @group_name.
  11209. If @key cannot be found then it is created.
  11210. If @group_name cannot be found then it is created.
  11211. Unlike g_key_file_set_value(), this function handles characters
  11212. that need escaping, such as newlines.</doc>
  11213. <return-value transfer-ownership="none">
  11214. <type name="none" c:type="void"/>
  11215. </return-value>
  11216. <parameters>
  11217. <instance-parameter name="key_file" transfer-ownership="none">
  11218. <doc xml:space="preserve">a #GKeyFile</doc>
  11219. <type name="KeyFile" c:type="GKeyFile*"/>
  11220. </instance-parameter>
  11221. <parameter name="group_name" transfer-ownership="none">
  11222. <doc xml:space="preserve">a group name</doc>
  11223. <type name="utf8" c:type="const gchar*"/>
  11224. </parameter>
  11225. <parameter name="key" transfer-ownership="none">
  11226. <doc xml:space="preserve">a key</doc>
  11227. <type name="utf8" c:type="const gchar*"/>
  11228. </parameter>
  11229. <parameter name="string" transfer-ownership="none">
  11230. <doc xml:space="preserve">a string</doc>
  11231. <type name="utf8" c:type="const gchar*"/>
  11232. </parameter>
  11233. </parameters>
  11234. </method>
  11235. <method name="set_string_list"
  11236. c:identifier="g_key_file_set_string_list"
  11237. version="2.6">
  11238. <doc xml:space="preserve">Associates a list of string values for @key under @group_name.
  11239. If @key cannot be found then it is created.
  11240. If @group_name cannot be found then it is created.</doc>
  11241. <return-value transfer-ownership="none">
  11242. <type name="none" c:type="void"/>
  11243. </return-value>
  11244. <parameters>
  11245. <instance-parameter name="key_file" transfer-ownership="none">
  11246. <doc xml:space="preserve">a #GKeyFile</doc>
  11247. <type name="KeyFile" c:type="GKeyFile*"/>
  11248. </instance-parameter>
  11249. <parameter name="group_name" transfer-ownership="none">
  11250. <doc xml:space="preserve">a group name</doc>
  11251. <type name="utf8" c:type="const gchar*"/>
  11252. </parameter>
  11253. <parameter name="key" transfer-ownership="none">
  11254. <doc xml:space="preserve">a key</doc>
  11255. <type name="utf8" c:type="const gchar*"/>
  11256. </parameter>
  11257. <parameter name="list" transfer-ownership="none">
  11258. <doc xml:space="preserve">an array of string values</doc>
  11259. <array length="3" zero-terminated="1" c:type="gchar*">
  11260. <type name="utf8"/>
  11261. </array>
  11262. </parameter>
  11263. <parameter name="length" transfer-ownership="none">
  11264. <doc xml:space="preserve">number of string values in @list</doc>
  11265. <type name="gsize" c:type="gsize"/>
  11266. </parameter>
  11267. </parameters>
  11268. </method>
  11269. <method name="set_uint64"
  11270. c:identifier="g_key_file_set_uint64"
  11271. version="2.26">
  11272. <doc xml:space="preserve">Associates a new integer value with @key under @group_name.
  11273. If @key cannot be found then it is created.</doc>
  11274. <return-value transfer-ownership="none">
  11275. <type name="none" c:type="void"/>
  11276. </return-value>
  11277. <parameters>
  11278. <instance-parameter name="key_file" transfer-ownership="none">
  11279. <doc xml:space="preserve">a #GKeyFile</doc>
  11280. <type name="KeyFile" c:type="GKeyFile*"/>
  11281. </instance-parameter>
  11282. <parameter name="group_name" transfer-ownership="none">
  11283. <doc xml:space="preserve">a group name</doc>
  11284. <type name="utf8" c:type="const gchar*"/>
  11285. </parameter>
  11286. <parameter name="key" transfer-ownership="none">
  11287. <doc xml:space="preserve">a key</doc>
  11288. <type name="utf8" c:type="const gchar*"/>
  11289. </parameter>
  11290. <parameter name="value" transfer-ownership="none">
  11291. <doc xml:space="preserve">an integer value</doc>
  11292. <type name="guint64" c:type="guint64"/>
  11293. </parameter>
  11294. </parameters>
  11295. </method>
  11296. <method name="set_value"
  11297. c:identifier="g_key_file_set_value"
  11298. version="2.6">
  11299. <doc xml:space="preserve">Associates a new value with @key under @group_name.
  11300. If @key cannot be found then it is created. If @group_name cannot
  11301. be found then it is created. To set an UTF-8 string which may contain
  11302. characters that need escaping (such as newlines or spaces), use
  11303. g_key_file_set_string().</doc>
  11304. <return-value transfer-ownership="none">
  11305. <type name="none" c:type="void"/>
  11306. </return-value>
  11307. <parameters>
  11308. <instance-parameter name="key_file" transfer-ownership="none">
  11309. <doc xml:space="preserve">a #GKeyFile</doc>
  11310. <type name="KeyFile" c:type="GKeyFile*"/>
  11311. </instance-parameter>
  11312. <parameter name="group_name" transfer-ownership="none">
  11313. <doc xml:space="preserve">a group name</doc>
  11314. <type name="utf8" c:type="const gchar*"/>
  11315. </parameter>
  11316. <parameter name="key" transfer-ownership="none">
  11317. <doc xml:space="preserve">a key</doc>
  11318. <type name="utf8" c:type="const gchar*"/>
  11319. </parameter>
  11320. <parameter name="value" transfer-ownership="none">
  11321. <doc xml:space="preserve">a string</doc>
  11322. <type name="utf8" c:type="const gchar*"/>
  11323. </parameter>
  11324. </parameters>
  11325. </method>
  11326. <method name="to_data"
  11327. c:identifier="g_key_file_to_data"
  11328. version="2.6"
  11329. throws="1">
  11330. <doc xml:space="preserve">This function outputs @key_file as a string.
  11331. Note that this function never reports an error,
  11332. so it is safe to pass %NULL as @error.</doc>
  11333. <return-value transfer-ownership="full">
  11334. <doc xml:space="preserve">a newly allocated string holding
  11335. the contents of the #GKeyFile</doc>
  11336. <type name="utf8" c:type="gchar*"/>
  11337. </return-value>
  11338. <parameters>
  11339. <instance-parameter name="key_file" transfer-ownership="none">
  11340. <doc xml:space="preserve">a #GKeyFile</doc>
  11341. <type name="KeyFile" c:type="GKeyFile*"/>
  11342. </instance-parameter>
  11343. <parameter name="length"
  11344. direction="out"
  11345. caller-allocates="0"
  11346. transfer-ownership="full"
  11347. optional="1"
  11348. allow-none="1">
  11349. <doc xml:space="preserve">return location for the length of the
  11350. returned string, or %NULL</doc>
  11351. <type name="gsize" c:type="gsize*"/>
  11352. </parameter>
  11353. </parameters>
  11354. </method>
  11355. <method name="unref" c:identifier="g_key_file_unref" version="2.32">
  11356. <doc xml:space="preserve">Decreases the reference count of @key_file by 1. If the reference count
  11357. reaches zero, frees the key file and all its allocated memory.</doc>
  11358. <return-value transfer-ownership="none">
  11359. <type name="none" c:type="void"/>
  11360. </return-value>
  11361. <parameters>
  11362. <instance-parameter name="key_file" transfer-ownership="none">
  11363. <doc xml:space="preserve">a #GKeyFile</doc>
  11364. <type name="KeyFile" c:type="GKeyFile*"/>
  11365. </instance-parameter>
  11366. </parameters>
  11367. </method>
  11368. <function name="error_quark" c:identifier="g_key_file_error_quark">
  11369. <return-value transfer-ownership="none">
  11370. <type name="Quark" c:type="GQuark"/>
  11371. </return-value>
  11372. </function>
  11373. </record>
  11374. <enumeration name="KeyFileError"
  11375. c:type="GKeyFileError"
  11376. glib:error-domain="g-key-file-error-quark">
  11377. <doc xml:space="preserve">Error codes returned by key file parsing.</doc>
  11378. <member name="unknown_encoding"
  11379. value="0"
  11380. c:identifier="G_KEY_FILE_ERROR_UNKNOWN_ENCODING">
  11381. <doc xml:space="preserve">the text being parsed was in
  11382. an unknown encoding</doc>
  11383. </member>
  11384. <member name="parse" value="1" c:identifier="G_KEY_FILE_ERROR_PARSE">
  11385. <doc xml:space="preserve">document was ill-formed</doc>
  11386. </member>
  11387. <member name="not_found"
  11388. value="2"
  11389. c:identifier="G_KEY_FILE_ERROR_NOT_FOUND">
  11390. <doc xml:space="preserve">the file was not found</doc>
  11391. </member>
  11392. <member name="key_not_found"
  11393. value="3"
  11394. c:identifier="G_KEY_FILE_ERROR_KEY_NOT_FOUND">
  11395. <doc xml:space="preserve">a requested key was not found</doc>
  11396. </member>
  11397. <member name="group_not_found"
  11398. value="4"
  11399. c:identifier="G_KEY_FILE_ERROR_GROUP_NOT_FOUND">
  11400. <doc xml:space="preserve">a requested group was not found</doc>
  11401. </member>
  11402. <member name="invalid_value"
  11403. value="5"
  11404. c:identifier="G_KEY_FILE_ERROR_INVALID_VALUE">
  11405. <doc xml:space="preserve">a value could not be parsed</doc>
  11406. </member>
  11407. </enumeration>
  11408. <bitfield name="KeyFileFlags" c:type="GKeyFileFlags">
  11409. <doc xml:space="preserve">Flags which influence the parsing.</doc>
  11410. <member name="none" value="0" c:identifier="G_KEY_FILE_NONE">
  11411. <doc xml:space="preserve">No flags, default behaviour</doc>
  11412. </member>
  11413. <member name="keep_comments"
  11414. value="1"
  11415. c:identifier="G_KEY_FILE_KEEP_COMMENTS">
  11416. <doc xml:space="preserve">Use this flag if you plan to write the
  11417. (possibly modified) contents of the key file back to a file;
  11418. otherwise all comments will be lost when the key file is
  11419. written back.</doc>
  11420. </member>
  11421. <member name="keep_translations"
  11422. value="2"
  11423. c:identifier="G_KEY_FILE_KEEP_TRANSLATIONS">
  11424. <doc xml:space="preserve">Use this flag if you plan to write the
  11425. (possibly modified) contents of the key file back to a file;
  11426. otherwise only the translations for the current language will be
  11427. written back.</doc>
  11428. </member>
  11429. </bitfield>
  11430. <constant name="LITTLE_ENDIAN" value="1234" c:type="G_LITTLE_ENDIAN">
  11431. <doc xml:space="preserve">Specifies one of the possible types of byte order.
  11432. See #G_BYTE_ORDER.</doc>
  11433. <type name="gint" c:type="gint"/>
  11434. </constant>
  11435. <constant name="LN10" value="2.302585" c:type="G_LN10">
  11436. <doc xml:space="preserve">The natural logarithm of 10.</doc>
  11437. <type name="gdouble" c:type="gdouble"/>
  11438. </constant>
  11439. <constant name="LN2" value="0.693147" c:type="G_LN2">
  11440. <doc xml:space="preserve">The natural logarithm of 2.</doc>
  11441. <type name="gdouble" c:type="gdouble"/>
  11442. </constant>
  11443. <constant name="LOG_2_BASE_10" value="0.301030" c:type="G_LOG_2_BASE_10">
  11444. <doc xml:space="preserve">Multiplying the base 2 exponent by this number yields the base 10 exponent.</doc>
  11445. <type name="gdouble" c:type="gdouble"/>
  11446. </constant>
  11447. <constant name="LOG_DOMAIN" value="0" c:type="G_LOG_DOMAIN">
  11448. <doc xml:space="preserve">Defines the log domain.
  11449. For applications, this is typically left as the default %NULL
  11450. (or "") domain. Libraries should define this so that any messages
  11451. which they log can be differentiated from messages from other
  11452. libraries and application code. But be careful not to define
  11453. it in any public header files.
  11454. For example, GTK+ uses this in its Makefile.am:
  11455. |[
  11456. AM_CPPFLAGS = -DG_LOG_DOMAIN=\"Gtk\"
  11457. ]|</doc>
  11458. <type name="gchar" c:type="gchar"/>
  11459. </constant>
  11460. <constant name="LOG_FATAL_MASK" value="0" c:type="G_LOG_FATAL_MASK">
  11461. <doc xml:space="preserve">GLib log levels that are considered fatal by default.</doc>
  11462. <type name="gint" c:type="gint"/>
  11463. </constant>
  11464. <constant name="LOG_LEVEL_USER_SHIFT"
  11465. value="8"
  11466. c:type="G_LOG_LEVEL_USER_SHIFT">
  11467. <doc xml:space="preserve">Log levels below 1&lt;&lt;G_LOG_LEVEL_USER_SHIFT are used by GLib.
  11468. Higher bits can be used for user-defined log levels.</doc>
  11469. <type name="gint" c:type="gint"/>
  11470. </constant>
  11471. <record name="List" c:type="GList">
  11472. <doc xml:space="preserve">The #GList struct is used for each element in a doubly-linked list.</doc>
  11473. <field name="data" writable="1">
  11474. <doc xml:space="preserve">holds the element's data, which can be a pointer to any kind
  11475. of data, or any integer value using the
  11476. [Type Conversion Macros][glib-Type-Conversion-Macros]</doc>
  11477. <type name="gpointer" c:type="gpointer"/>
  11478. </field>
  11479. <field name="next" writable="1">
  11480. <doc xml:space="preserve">contains the link to the next element in the list</doc>
  11481. <type name="GLib.List" c:type="GList*">
  11482. <type name="gpointer" c:type="gpointer"/>
  11483. </type>
  11484. </field>
  11485. <field name="prev" writable="1">
  11486. <doc xml:space="preserve">contains the link to the previous element in the list</doc>
  11487. <type name="GLib.List" c:type="GList*">
  11488. <type name="gpointer" c:type="gpointer"/>
  11489. </type>
  11490. </field>
  11491. <function name="alloc" c:identifier="g_list_alloc" introspectable="0">
  11492. <doc xml:space="preserve">Allocates space for one #GList element. It is called by
  11493. g_list_append(), g_list_prepend(), g_list_insert() and
  11494. g_list_insert_sorted() and so is rarely used on its own.</doc>
  11495. <return-value>
  11496. <doc xml:space="preserve">a pointer to the newly-allocated #GList element</doc>
  11497. <type name="GLib.List" c:type="GList*">
  11498. <type name="gpointer" c:type="gpointer"/>
  11499. </type>
  11500. </return-value>
  11501. </function>
  11502. <function name="append" c:identifier="g_list_append" introspectable="0">
  11503. <doc xml:space="preserve">Adds a new element on to the end of the list.
  11504. Note that the return value is the new start of the list,
  11505. if @list was empty; make sure you store the new value.
  11506. g_list_append() has to traverse the entire list to find the end,
  11507. which is inefficient when adding multiple elements. A common idiom
  11508. to avoid the inefficiency is to use g_list_prepend() and reverse
  11509. the list with g_list_reverse() when all elements have been added.
  11510. |[&lt;!-- language="C" --&gt;
  11511. // Notice that these are initialized to the empty list.
  11512. GList *string_list = NULL, *number_list = NULL;
  11513. // This is a list of strings.
  11514. string_list = g_list_append (string_list, "first");
  11515. string_list = g_list_append (string_list, "second");
  11516. // This is a list of integers.
  11517. number_list = g_list_append (number_list, GINT_TO_POINTER (27));
  11518. number_list = g_list_append (number_list, GINT_TO_POINTER (14));
  11519. ]|</doc>
  11520. <return-value>
  11521. <doc xml:space="preserve">either @list or the new start of the #GList if @list was %NULL</doc>
  11522. <type name="GLib.List" c:type="GList*">
  11523. <type name="gpointer" c:type="gpointer"/>
  11524. </type>
  11525. </return-value>
  11526. <parameters>
  11527. <parameter name="list" transfer-ownership="none">
  11528. <doc xml:space="preserve">a pointer to a #GList</doc>
  11529. <type name="GLib.List" c:type="GList*">
  11530. <type name="gpointer" c:type="gpointer"/>
  11531. </type>
  11532. </parameter>
  11533. <parameter name="data"
  11534. transfer-ownership="none"
  11535. nullable="1"
  11536. allow-none="1">
  11537. <doc xml:space="preserve">the data for the new element</doc>
  11538. <type name="gpointer" c:type="gpointer"/>
  11539. </parameter>
  11540. </parameters>
  11541. </function>
  11542. <function name="concat" c:identifier="g_list_concat" introspectable="0">
  11543. <doc xml:space="preserve">Adds the second #GList onto the end of the first #GList.
  11544. Note that the elements of the second #GList are not copied.
  11545. They are used directly.
  11546. This function is for example used to move an element in the list.
  11547. The following example moves an element to the top of the list:
  11548. |[&lt;!-- language="C" --&gt;
  11549. list = g_list_remove_link (list, llink);
  11550. list = g_list_concat (llink, list);
  11551. ]|</doc>
  11552. <return-value>
  11553. <doc xml:space="preserve">the start of the new #GList, which equals @list1 if not %NULL</doc>
  11554. <type name="GLib.List" c:type="GList*">
  11555. <type name="gpointer" c:type="gpointer"/>
  11556. </type>
  11557. </return-value>
  11558. <parameters>
  11559. <parameter name="list1" transfer-ownership="none">
  11560. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  11561. <type name="GLib.List" c:type="GList*">
  11562. <type name="gpointer" c:type="gpointer"/>
  11563. </type>
  11564. </parameter>
  11565. <parameter name="list2" transfer-ownership="none">
  11566. <doc xml:space="preserve">the #GList to add to the end of the first #GList,
  11567. this must point to the top of the list</doc>
  11568. <type name="GLib.List" c:type="GList*">
  11569. <type name="gpointer" c:type="gpointer"/>
  11570. </type>
  11571. </parameter>
  11572. </parameters>
  11573. </function>
  11574. <function name="copy" c:identifier="g_list_copy" introspectable="0">
  11575. <doc xml:space="preserve">Copies a #GList.
  11576. Note that this is a "shallow" copy. If the list elements
  11577. consist of pointers to data, the pointers are copied but
  11578. the actual data is not. See g_list_copy_deep() if you need
  11579. to copy the data as well.</doc>
  11580. <return-value>
  11581. <doc xml:space="preserve">the start of the new list that holds the same data as @list</doc>
  11582. <type name="GLib.List" c:type="GList*">
  11583. <type name="gpointer" c:type="gpointer"/>
  11584. </type>
  11585. </return-value>
  11586. <parameters>
  11587. <parameter name="list" transfer-ownership="none">
  11588. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  11589. <type name="GLib.List" c:type="GList*">
  11590. <type name="gpointer" c:type="gpointer"/>
  11591. </type>
  11592. </parameter>
  11593. </parameters>
  11594. </function>
  11595. <function name="copy_deep"
  11596. c:identifier="g_list_copy_deep"
  11597. version="2.34"
  11598. introspectable="0">
  11599. <doc xml:space="preserve">Makes a full (deep) copy of a #GList.
  11600. In contrast with g_list_copy(), this function uses @func to make
  11601. a copy of each list element, in addition to copying the list
  11602. container itself.
  11603. @func, as a #GCopyFunc, takes two arguments, the data to be copied
  11604. and a @user_data pointer. It's safe to pass %NULL as user_data,
  11605. if the copy function takes only one argument.
  11606. For instance, if @list holds a list of GObjects, you can do:
  11607. |[&lt;!-- language="C" --&gt;
  11608. another_list = g_list_copy_deep (list, (GCopyFunc) g_object_ref, NULL);
  11609. ]|
  11610. And, to entirely free the new list, you could do:
  11611. |[&lt;!-- language="C" --&gt;
  11612. g_list_free_full (another_list, g_object_unref);
  11613. ]|</doc>
  11614. <return-value>
  11615. <doc xml:space="preserve">the start of the new list that holds a full copy of @list,
  11616. use g_list_free_full() to free it</doc>
  11617. <type name="GLib.List" c:type="GList*">
  11618. <type name="gpointer" c:type="gpointer"/>
  11619. </type>
  11620. </return-value>
  11621. <parameters>
  11622. <parameter name="list" transfer-ownership="none">
  11623. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  11624. <type name="GLib.List" c:type="GList*">
  11625. <type name="gpointer" c:type="gpointer"/>
  11626. </type>
  11627. </parameter>
  11628. <parameter name="func" transfer-ownership="none" closure="2">
  11629. <doc xml:space="preserve">a copy function used to copy every element in the list</doc>
  11630. <type name="CopyFunc" c:type="GCopyFunc"/>
  11631. </parameter>
  11632. <parameter name="user_data"
  11633. transfer-ownership="none"
  11634. nullable="1"
  11635. allow-none="1">
  11636. <doc xml:space="preserve">user data passed to the copy function @func, or %NULL</doc>
  11637. <type name="gpointer" c:type="gpointer"/>
  11638. </parameter>
  11639. </parameters>
  11640. </function>
  11641. <function name="delete_link"
  11642. c:identifier="g_list_delete_link"
  11643. introspectable="0">
  11644. <doc xml:space="preserve">Removes the node link_ from the list and frees it.
  11645. Compare this to g_list_remove_link() which removes the node
  11646. without freeing it.</doc>
  11647. <return-value>
  11648. <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
  11649. <type name="GLib.List" c:type="GList*">
  11650. <type name="gpointer" c:type="gpointer"/>
  11651. </type>
  11652. </return-value>
  11653. <parameters>
  11654. <parameter name="list" transfer-ownership="none">
  11655. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  11656. <type name="GLib.List" c:type="GList*">
  11657. <type name="gpointer" c:type="gpointer"/>
  11658. </type>
  11659. </parameter>
  11660. <parameter name="link_" transfer-ownership="none">
  11661. <doc xml:space="preserve">node to delete from @list</doc>
  11662. <type name="GLib.List" c:type="GList*">
  11663. <type name="gpointer" c:type="gpointer"/>
  11664. </type>
  11665. </parameter>
  11666. </parameters>
  11667. </function>
  11668. <function name="find" c:identifier="g_list_find" introspectable="0">
  11669. <doc xml:space="preserve">Finds the element in a #GList which contains the given data.</doc>
  11670. <return-value>
  11671. <doc xml:space="preserve">the found #GList element, or %NULL if it is not found</doc>
  11672. <type name="GLib.List" c:type="GList*">
  11673. <type name="gpointer" c:type="gpointer"/>
  11674. </type>
  11675. </return-value>
  11676. <parameters>
  11677. <parameter name="list" transfer-ownership="none">
  11678. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  11679. <type name="GLib.List" c:type="GList*">
  11680. <type name="gpointer" c:type="gpointer"/>
  11681. </type>
  11682. </parameter>
  11683. <parameter name="data"
  11684. transfer-ownership="none"
  11685. nullable="1"
  11686. allow-none="1">
  11687. <doc xml:space="preserve">the element data to find</doc>
  11688. <type name="gpointer" c:type="gconstpointer"/>
  11689. </parameter>
  11690. </parameters>
  11691. </function>
  11692. <function name="find_custom"
  11693. c:identifier="g_list_find_custom"
  11694. introspectable="0">
  11695. <doc xml:space="preserve">Finds an element in a #GList, using a supplied function to
  11696. find the desired element. It iterates over the list, calling
  11697. the given function which should return 0 when the desired
  11698. element is found. The function takes two #gconstpointer arguments,
  11699. the #GList element's data as the first argument and the
  11700. given user data.</doc>
  11701. <return-value>
  11702. <doc xml:space="preserve">the found #GList element, or %NULL if it is not found</doc>
  11703. <type name="GLib.List" c:type="GList*">
  11704. <type name="gpointer" c:type="gpointer"/>
  11705. </type>
  11706. </return-value>
  11707. <parameters>
  11708. <parameter name="list" transfer-ownership="none">
  11709. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  11710. <type name="GLib.List" c:type="GList*">
  11711. <type name="gpointer" c:type="gpointer"/>
  11712. </type>
  11713. </parameter>
  11714. <parameter name="data"
  11715. transfer-ownership="none"
  11716. nullable="1"
  11717. allow-none="1">
  11718. <doc xml:space="preserve">user data passed to the function</doc>
  11719. <type name="gpointer" c:type="gconstpointer"/>
  11720. </parameter>
  11721. <parameter name="func" transfer-ownership="none">
  11722. <doc xml:space="preserve">the function to call for each element.
  11723. It should return 0 when the desired element is found</doc>
  11724. <type name="CompareFunc" c:type="GCompareFunc"/>
  11725. </parameter>
  11726. </parameters>
  11727. </function>
  11728. <function name="first" c:identifier="g_list_first" introspectable="0">
  11729. <doc xml:space="preserve">Gets the first element in a #GList.</doc>
  11730. <return-value>
  11731. <doc xml:space="preserve">the first element in the #GList,
  11732. or %NULL if the #GList has no elements</doc>
  11733. <type name="GLib.List" c:type="GList*">
  11734. <type name="gpointer" c:type="gpointer"/>
  11735. </type>
  11736. </return-value>
  11737. <parameters>
  11738. <parameter name="list" transfer-ownership="none">
  11739. <doc xml:space="preserve">any #GList element</doc>
  11740. <type name="GLib.List" c:type="GList*">
  11741. <type name="gpointer" c:type="gpointer"/>
  11742. </type>
  11743. </parameter>
  11744. </parameters>
  11745. </function>
  11746. <function name="foreach"
  11747. c:identifier="g_list_foreach"
  11748. introspectable="0">
  11749. <doc xml:space="preserve">Calls a function for each element of a #GList.</doc>
  11750. <return-value transfer-ownership="none">
  11751. <type name="none" c:type="void"/>
  11752. </return-value>
  11753. <parameters>
  11754. <parameter name="list" transfer-ownership="none">
  11755. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  11756. <type name="GLib.List" c:type="GList*">
  11757. <type name="gpointer" c:type="gpointer"/>
  11758. </type>
  11759. </parameter>
  11760. <parameter name="func" transfer-ownership="none" closure="2">
  11761. <doc xml:space="preserve">the function to call with each element's data</doc>
  11762. <type name="Func" c:type="GFunc"/>
  11763. </parameter>
  11764. <parameter name="user_data"
  11765. transfer-ownership="none"
  11766. nullable="1"
  11767. allow-none="1">
  11768. <doc xml:space="preserve">user data to pass to the function</doc>
  11769. <type name="gpointer" c:type="gpointer"/>
  11770. </parameter>
  11771. </parameters>
  11772. </function>
  11773. <function name="free" c:identifier="g_list_free" introspectable="0">
  11774. <doc xml:space="preserve">Frees all of the memory used by a #GList.
  11775. The freed elements are returned to the slice allocator.
  11776. If list elements contain dynamically-allocated memory, you should
  11777. either use g_list_free_full() or free them manually first.</doc>
  11778. <return-value transfer-ownership="none">
  11779. <type name="none" c:type="void"/>
  11780. </return-value>
  11781. <parameters>
  11782. <parameter name="list" transfer-ownership="none">
  11783. <doc xml:space="preserve">a #GList</doc>
  11784. <type name="GLib.List" c:type="GList*">
  11785. <type name="gpointer" c:type="gpointer"/>
  11786. </type>
  11787. </parameter>
  11788. </parameters>
  11789. </function>
  11790. <function name="free_1" c:identifier="g_list_free_1" introspectable="0">
  11791. <doc xml:space="preserve">Frees one #GList element, but does not update links from the next and
  11792. previous elements in the list, so you should not call this function on an
  11793. element that is currently part of a list.
  11794. It is usually used after g_list_remove_link().</doc>
  11795. <return-value transfer-ownership="none">
  11796. <type name="none" c:type="void"/>
  11797. </return-value>
  11798. <parameters>
  11799. <parameter name="list" transfer-ownership="none">
  11800. <doc xml:space="preserve">a #GList element</doc>
  11801. <type name="GLib.List" c:type="GList*">
  11802. <type name="gpointer" c:type="gpointer"/>
  11803. </type>
  11804. </parameter>
  11805. </parameters>
  11806. </function>
  11807. <function name="free_full"
  11808. c:identifier="g_list_free_full"
  11809. version="2.28"
  11810. introspectable="0">
  11811. <doc xml:space="preserve">Convenience method, which frees all the memory used by a #GList,
  11812. and calls @free_func on every element's data.</doc>
  11813. <return-value transfer-ownership="none">
  11814. <type name="none" c:type="void"/>
  11815. </return-value>
  11816. <parameters>
  11817. <parameter name="list" transfer-ownership="none">
  11818. <doc xml:space="preserve">a pointer to a #GList</doc>
  11819. <type name="GLib.List" c:type="GList*">
  11820. <type name="gpointer" c:type="gpointer"/>
  11821. </type>
  11822. </parameter>
  11823. <parameter name="free_func" transfer-ownership="none" scope="async">
  11824. <doc xml:space="preserve">the function to be called to free each element's data</doc>
  11825. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  11826. </parameter>
  11827. </parameters>
  11828. </function>
  11829. <function name="index" c:identifier="g_list_index" introspectable="0">
  11830. <doc xml:space="preserve">Gets the position of the element containing
  11831. the given data (starting from 0).</doc>
  11832. <return-value transfer-ownership="none">
  11833. <doc xml:space="preserve">the index of the element containing the data,
  11834. or -1 if the data is not found</doc>
  11835. <type name="gint" c:type="gint"/>
  11836. </return-value>
  11837. <parameters>
  11838. <parameter name="list" transfer-ownership="none">
  11839. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  11840. <type name="GLib.List" c:type="GList*">
  11841. <type name="gpointer" c:type="gpointer"/>
  11842. </type>
  11843. </parameter>
  11844. <parameter name="data"
  11845. transfer-ownership="none"
  11846. nullable="1"
  11847. allow-none="1">
  11848. <doc xml:space="preserve">the data to find</doc>
  11849. <type name="gpointer" c:type="gconstpointer"/>
  11850. </parameter>
  11851. </parameters>
  11852. </function>
  11853. <function name="insert" c:identifier="g_list_insert" introspectable="0">
  11854. <doc xml:space="preserve">Inserts a new element into the list at the given position.</doc>
  11855. <return-value>
  11856. <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
  11857. <type name="GLib.List" c:type="GList*">
  11858. <type name="gpointer" c:type="gpointer"/>
  11859. </type>
  11860. </return-value>
  11861. <parameters>
  11862. <parameter name="list" transfer-ownership="none">
  11863. <doc xml:space="preserve">a pointer to a #GList, this must point to the top of the list</doc>
  11864. <type name="GLib.List" c:type="GList*">
  11865. <type name="gpointer" c:type="gpointer"/>
  11866. </type>
  11867. </parameter>
  11868. <parameter name="data"
  11869. transfer-ownership="none"
  11870. nullable="1"
  11871. allow-none="1">
  11872. <doc xml:space="preserve">the data for the new element</doc>
  11873. <type name="gpointer" c:type="gpointer"/>
  11874. </parameter>
  11875. <parameter name="position" transfer-ownership="none">
  11876. <doc xml:space="preserve">the position to insert the element. If this is
  11877. negative, or is larger than the number of elements in the
  11878. list, the new element is added on to the end of the list.</doc>
  11879. <type name="gint" c:type="gint"/>
  11880. </parameter>
  11881. </parameters>
  11882. </function>
  11883. <function name="insert_before"
  11884. c:identifier="g_list_insert_before"
  11885. introspectable="0">
  11886. <doc xml:space="preserve">Inserts a new element into the list before the given position.</doc>
  11887. <return-value>
  11888. <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
  11889. <type name="GLib.List" c:type="GList*">
  11890. <type name="gpointer" c:type="gpointer"/>
  11891. </type>
  11892. </return-value>
  11893. <parameters>
  11894. <parameter name="list" transfer-ownership="none">
  11895. <doc xml:space="preserve">a pointer to a #GList, this must point to the top of the list</doc>
  11896. <type name="GLib.List" c:type="GList*">
  11897. <type name="gpointer" c:type="gpointer"/>
  11898. </type>
  11899. </parameter>
  11900. <parameter name="sibling" transfer-ownership="none">
  11901. <doc xml:space="preserve">the list element before which the new element
  11902. is inserted or %NULL to insert at the end of the list</doc>
  11903. <type name="GLib.List" c:type="GList*">
  11904. <type name="gpointer" c:type="gpointer"/>
  11905. </type>
  11906. </parameter>
  11907. <parameter name="data"
  11908. transfer-ownership="none"
  11909. nullable="1"
  11910. allow-none="1">
  11911. <doc xml:space="preserve">the data for the new element</doc>
  11912. <type name="gpointer" c:type="gpointer"/>
  11913. </parameter>
  11914. </parameters>
  11915. </function>
  11916. <function name="insert_sorted"
  11917. c:identifier="g_list_insert_sorted"
  11918. introspectable="0">
  11919. <doc xml:space="preserve">Inserts a new element into the list, using the given comparison
  11920. function to determine its position.
  11921. If you are adding many new elements to a list, and the number of
  11922. new elements is much larger than the length of the list, use
  11923. g_list_prepend() to add the new items and sort the list afterwards
  11924. with g_list_sort().</doc>
  11925. <return-value>
  11926. <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
  11927. <type name="GLib.List" c:type="GList*">
  11928. <type name="gpointer" c:type="gpointer"/>
  11929. </type>
  11930. </return-value>
  11931. <parameters>
  11932. <parameter name="list" transfer-ownership="none">
  11933. <doc xml:space="preserve">a pointer to a #GList, this must point to the top of the
  11934. already sorted list</doc>
  11935. <type name="GLib.List" c:type="GList*">
  11936. <type name="gpointer" c:type="gpointer"/>
  11937. </type>
  11938. </parameter>
  11939. <parameter name="data"
  11940. transfer-ownership="none"
  11941. nullable="1"
  11942. allow-none="1">
  11943. <doc xml:space="preserve">the data for the new element</doc>
  11944. <type name="gpointer" c:type="gpointer"/>
  11945. </parameter>
  11946. <parameter name="func" transfer-ownership="none">
  11947. <doc xml:space="preserve">the function to compare elements in the list. It should
  11948. return a number &gt; 0 if the first parameter comes after the
  11949. second parameter in the sort order.</doc>
  11950. <type name="CompareFunc" c:type="GCompareFunc"/>
  11951. </parameter>
  11952. </parameters>
  11953. </function>
  11954. <function name="insert_sorted_with_data"
  11955. c:identifier="g_list_insert_sorted_with_data"
  11956. version="2.10"
  11957. introspectable="0">
  11958. <doc xml:space="preserve">Inserts a new element into the list, using the given comparison
  11959. function to determine its position.
  11960. If you are adding many new elements to a list, and the number of
  11961. new elements is much larger than the length of the list, use
  11962. g_list_prepend() to add the new items and sort the list afterwards
  11963. with g_list_sort().</doc>
  11964. <return-value>
  11965. <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
  11966. <type name="GLib.List" c:type="GList*">
  11967. <type name="gpointer" c:type="gpointer"/>
  11968. </type>
  11969. </return-value>
  11970. <parameters>
  11971. <parameter name="list" transfer-ownership="none">
  11972. <doc xml:space="preserve">a pointer to a #GList, this must point to the top of the
  11973. already sorted list</doc>
  11974. <type name="GLib.List" c:type="GList*">
  11975. <type name="gpointer" c:type="gpointer"/>
  11976. </type>
  11977. </parameter>
  11978. <parameter name="data"
  11979. transfer-ownership="none"
  11980. nullable="1"
  11981. allow-none="1">
  11982. <doc xml:space="preserve">the data for the new element</doc>
  11983. <type name="gpointer" c:type="gpointer"/>
  11984. </parameter>
  11985. <parameter name="func" transfer-ownership="none" closure="3">
  11986. <doc xml:space="preserve">the function to compare elements in the list. It should
  11987. return a number &gt; 0 if the first parameter comes after the
  11988. second parameter in the sort order.</doc>
  11989. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  11990. </parameter>
  11991. <parameter name="user_data"
  11992. transfer-ownership="none"
  11993. nullable="1"
  11994. allow-none="1">
  11995. <doc xml:space="preserve">user data to pass to comparison function</doc>
  11996. <type name="gpointer" c:type="gpointer"/>
  11997. </parameter>
  11998. </parameters>
  11999. </function>
  12000. <function name="last" c:identifier="g_list_last" introspectable="0">
  12001. <doc xml:space="preserve">Gets the last element in a #GList.</doc>
  12002. <return-value>
  12003. <doc xml:space="preserve">the last element in the #GList,
  12004. or %NULL if the #GList has no elements</doc>
  12005. <type name="GLib.List" c:type="GList*">
  12006. <type name="gpointer" c:type="gpointer"/>
  12007. </type>
  12008. </return-value>
  12009. <parameters>
  12010. <parameter name="list" transfer-ownership="none">
  12011. <doc xml:space="preserve">any #GList element</doc>
  12012. <type name="GLib.List" c:type="GList*">
  12013. <type name="gpointer" c:type="gpointer"/>
  12014. </type>
  12015. </parameter>
  12016. </parameters>
  12017. </function>
  12018. <function name="length" c:identifier="g_list_length" introspectable="0">
  12019. <doc xml:space="preserve">Gets the number of elements in a #GList.
  12020. This function iterates over the whole list to count its elements.
  12021. Use a #GQueue instead of a GList if you regularly need the number
  12022. of items. To check whether the list is non-empty, it is faster to check
  12023. @list against %NULL.</doc>
  12024. <return-value transfer-ownership="none">
  12025. <doc xml:space="preserve">the number of elements in the #GList</doc>
  12026. <type name="guint" c:type="guint"/>
  12027. </return-value>
  12028. <parameters>
  12029. <parameter name="list" transfer-ownership="none">
  12030. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  12031. <type name="GLib.List" c:type="GList*">
  12032. <type name="gpointer" c:type="gpointer"/>
  12033. </type>
  12034. </parameter>
  12035. </parameters>
  12036. </function>
  12037. <function name="nth" c:identifier="g_list_nth" introspectable="0">
  12038. <doc xml:space="preserve">Gets the element at the given position in a #GList.
  12039. This iterates over the list until it reaches the @n-th position. If you
  12040. intend to iterate over every element, it is better to use a for-loop as
  12041. described in the #GList introduction.</doc>
  12042. <return-value>
  12043. <doc xml:space="preserve">the element, or %NULL if the position is off
  12044. the end of the #GList</doc>
  12045. <type name="GLib.List" c:type="GList*">
  12046. <type name="gpointer" c:type="gpointer"/>
  12047. </type>
  12048. </return-value>
  12049. <parameters>
  12050. <parameter name="list" transfer-ownership="none">
  12051. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  12052. <type name="GLib.List" c:type="GList*">
  12053. <type name="gpointer" c:type="gpointer"/>
  12054. </type>
  12055. </parameter>
  12056. <parameter name="n" transfer-ownership="none">
  12057. <doc xml:space="preserve">the position of the element, counting from 0</doc>
  12058. <type name="guint" c:type="guint"/>
  12059. </parameter>
  12060. </parameters>
  12061. </function>
  12062. <function name="nth_data"
  12063. c:identifier="g_list_nth_data"
  12064. introspectable="0">
  12065. <doc xml:space="preserve">Gets the data of the element at the given position.
  12066. This iterates over the list until it reaches the @n-th position. If you
  12067. intend to iterate over every element, it is better to use a for-loop as
  12068. described in the #GList introduction.</doc>
  12069. <return-value transfer-ownership="none" nullable="1">
  12070. <doc xml:space="preserve">the element's data, or %NULL if the position
  12071. is off the end of the #GList</doc>
  12072. <type name="gpointer" c:type="gpointer"/>
  12073. </return-value>
  12074. <parameters>
  12075. <parameter name="list" transfer-ownership="none">
  12076. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  12077. <type name="GLib.List" c:type="GList*">
  12078. <type name="gpointer" c:type="gpointer"/>
  12079. </type>
  12080. </parameter>
  12081. <parameter name="n" transfer-ownership="none">
  12082. <doc xml:space="preserve">the position of the element</doc>
  12083. <type name="guint" c:type="guint"/>
  12084. </parameter>
  12085. </parameters>
  12086. </function>
  12087. <function name="nth_prev"
  12088. c:identifier="g_list_nth_prev"
  12089. introspectable="0">
  12090. <doc xml:space="preserve">Gets the element @n places before @list.</doc>
  12091. <return-value>
  12092. <doc xml:space="preserve">the element, or %NULL if the position is
  12093. off the end of the #GList</doc>
  12094. <type name="GLib.List" c:type="GList*">
  12095. <type name="gpointer" c:type="gpointer"/>
  12096. </type>
  12097. </return-value>
  12098. <parameters>
  12099. <parameter name="list" transfer-ownership="none">
  12100. <doc xml:space="preserve">a #GList</doc>
  12101. <type name="GLib.List" c:type="GList*">
  12102. <type name="gpointer" c:type="gpointer"/>
  12103. </type>
  12104. </parameter>
  12105. <parameter name="n" transfer-ownership="none">
  12106. <doc xml:space="preserve">the position of the element, counting from 0</doc>
  12107. <type name="guint" c:type="guint"/>
  12108. </parameter>
  12109. </parameters>
  12110. </function>
  12111. <function name="position"
  12112. c:identifier="g_list_position"
  12113. introspectable="0">
  12114. <doc xml:space="preserve">Gets the position of the given element
  12115. in the #GList (starting from 0).</doc>
  12116. <return-value transfer-ownership="none">
  12117. <doc xml:space="preserve">the position of the element in the #GList,
  12118. or -1 if the element is not found</doc>
  12119. <type name="gint" c:type="gint"/>
  12120. </return-value>
  12121. <parameters>
  12122. <parameter name="list" transfer-ownership="none">
  12123. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  12124. <type name="GLib.List" c:type="GList*">
  12125. <type name="gpointer" c:type="gpointer"/>
  12126. </type>
  12127. </parameter>
  12128. <parameter name="llink" transfer-ownership="none">
  12129. <doc xml:space="preserve">an element in the #GList</doc>
  12130. <type name="GLib.List" c:type="GList*">
  12131. <type name="gpointer" c:type="gpointer"/>
  12132. </type>
  12133. </parameter>
  12134. </parameters>
  12135. </function>
  12136. <function name="prepend"
  12137. c:identifier="g_list_prepend"
  12138. introspectable="0">
  12139. <doc xml:space="preserve">Prepends a new element on to the start of the list.
  12140. Note that the return value is the new start of the list,
  12141. which will have changed, so make sure you store the new value.
  12142. |[&lt;!-- language="C" --&gt;
  12143. // Notice that it is initialized to the empty list.
  12144. GList *list = NULL;
  12145. list = g_list_prepend (list, "last");
  12146. list = g_list_prepend (list, "first");
  12147. ]|
  12148. Do not use this function to prepend a new element to a different
  12149. element than the start of the list. Use g_list_insert_before() instead.</doc>
  12150. <return-value>
  12151. <doc xml:space="preserve">a pointer to the newly prepended element, which is the new
  12152. start of the #GList</doc>
  12153. <type name="GLib.List" c:type="GList*">
  12154. <type name="gpointer" c:type="gpointer"/>
  12155. </type>
  12156. </return-value>
  12157. <parameters>
  12158. <parameter name="list" transfer-ownership="none">
  12159. <doc xml:space="preserve">a pointer to a #GList, this must point to the top of the list</doc>
  12160. <type name="GLib.List" c:type="GList*">
  12161. <type name="gpointer" c:type="gpointer"/>
  12162. </type>
  12163. </parameter>
  12164. <parameter name="data"
  12165. transfer-ownership="none"
  12166. nullable="1"
  12167. allow-none="1">
  12168. <doc xml:space="preserve">the data for the new element</doc>
  12169. <type name="gpointer" c:type="gpointer"/>
  12170. </parameter>
  12171. </parameters>
  12172. </function>
  12173. <function name="remove" c:identifier="g_list_remove" introspectable="0">
  12174. <doc xml:space="preserve">Removes an element from a #GList.
  12175. If two elements contain the same data, only the first is removed.
  12176. If none of the elements contain the data, the #GList is unchanged.</doc>
  12177. <return-value>
  12178. <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
  12179. <type name="GLib.List" c:type="GList*">
  12180. <type name="gpointer" c:type="gpointer"/>
  12181. </type>
  12182. </return-value>
  12183. <parameters>
  12184. <parameter name="list" transfer-ownership="none">
  12185. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  12186. <type name="GLib.List" c:type="GList*">
  12187. <type name="gpointer" c:type="gpointer"/>
  12188. </type>
  12189. </parameter>
  12190. <parameter name="data"
  12191. transfer-ownership="none"
  12192. nullable="1"
  12193. allow-none="1">
  12194. <doc xml:space="preserve">the data of the element to remove</doc>
  12195. <type name="gpointer" c:type="gconstpointer"/>
  12196. </parameter>
  12197. </parameters>
  12198. </function>
  12199. <function name="remove_all"
  12200. c:identifier="g_list_remove_all"
  12201. introspectable="0">
  12202. <doc xml:space="preserve">Removes all list nodes with data equal to @data.
  12203. Returns the new head of the list. Contrast with
  12204. g_list_remove() which removes only the first node
  12205. matching the given data.</doc>
  12206. <return-value>
  12207. <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
  12208. <type name="GLib.List" c:type="GList*">
  12209. <type name="gpointer" c:type="gpointer"/>
  12210. </type>
  12211. </return-value>
  12212. <parameters>
  12213. <parameter name="list" transfer-ownership="none">
  12214. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  12215. <type name="GLib.List" c:type="GList*">
  12216. <type name="gpointer" c:type="gpointer"/>
  12217. </type>
  12218. </parameter>
  12219. <parameter name="data"
  12220. transfer-ownership="none"
  12221. nullable="1"
  12222. allow-none="1">
  12223. <doc xml:space="preserve">data to remove</doc>
  12224. <type name="gpointer" c:type="gconstpointer"/>
  12225. </parameter>
  12226. </parameters>
  12227. </function>
  12228. <function name="remove_link"
  12229. c:identifier="g_list_remove_link"
  12230. introspectable="0">
  12231. <doc xml:space="preserve">Removes an element from a #GList, without freeing the element.
  12232. The removed element's prev and next links are set to %NULL, so
  12233. that it becomes a self-contained list with one element.
  12234. This function is for example used to move an element in the list
  12235. (see the example for g_list_concat()) or to remove an element in
  12236. the list before freeing its data:
  12237. |[&lt;!-- language="C" --&gt;
  12238. list = g_list_remove_link (list, llink);
  12239. free_some_data_that_may_access_the_list_again (llink-&gt;data);
  12240. g_list_free (llink);
  12241. ]|</doc>
  12242. <return-value>
  12243. <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
  12244. <type name="GLib.List" c:type="GList*">
  12245. <type name="gpointer" c:type="gpointer"/>
  12246. </type>
  12247. </return-value>
  12248. <parameters>
  12249. <parameter name="list" transfer-ownership="none">
  12250. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  12251. <type name="GLib.List" c:type="GList*">
  12252. <type name="gpointer" c:type="gpointer"/>
  12253. </type>
  12254. </parameter>
  12255. <parameter name="llink" transfer-ownership="none">
  12256. <doc xml:space="preserve">an element in the #GList</doc>
  12257. <type name="GLib.List" c:type="GList*">
  12258. <type name="gpointer" c:type="gpointer"/>
  12259. </type>
  12260. </parameter>
  12261. </parameters>
  12262. </function>
  12263. <function name="reverse"
  12264. c:identifier="g_list_reverse"
  12265. introspectable="0">
  12266. <doc xml:space="preserve">Reverses a #GList.
  12267. It simply switches the next and prev pointers of each element.</doc>
  12268. <return-value>
  12269. <doc xml:space="preserve">the start of the reversed #GList</doc>
  12270. <type name="GLib.List" c:type="GList*">
  12271. <type name="gpointer" c:type="gpointer"/>
  12272. </type>
  12273. </return-value>
  12274. <parameters>
  12275. <parameter name="list" transfer-ownership="none">
  12276. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  12277. <type name="GLib.List" c:type="GList*">
  12278. <type name="gpointer" c:type="gpointer"/>
  12279. </type>
  12280. </parameter>
  12281. </parameters>
  12282. </function>
  12283. <function name="sort" c:identifier="g_list_sort" introspectable="0">
  12284. <doc xml:space="preserve">Sorts a #GList using the given comparison function. The algorithm
  12285. used is a stable sort.</doc>
  12286. <return-value>
  12287. <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
  12288. <type name="GLib.List" c:type="GList*">
  12289. <type name="gpointer" c:type="gpointer"/>
  12290. </type>
  12291. </return-value>
  12292. <parameters>
  12293. <parameter name="list" transfer-ownership="none">
  12294. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  12295. <type name="GLib.List" c:type="GList*">
  12296. <type name="gpointer" c:type="gpointer"/>
  12297. </type>
  12298. </parameter>
  12299. <parameter name="compare_func" transfer-ownership="none">
  12300. <doc xml:space="preserve">the comparison function used to sort the #GList.
  12301. This function is passed the data from 2 elements of the #GList
  12302. and should return 0 if they are equal, a negative value if the
  12303. first element comes before the second, or a positive value if
  12304. the first element comes after the second.</doc>
  12305. <type name="CompareFunc" c:type="GCompareFunc"/>
  12306. </parameter>
  12307. </parameters>
  12308. </function>
  12309. <function name="sort_with_data"
  12310. c:identifier="g_list_sort_with_data"
  12311. introspectable="0">
  12312. <doc xml:space="preserve">Like g_list_sort(), but the comparison function accepts
  12313. a user data argument.</doc>
  12314. <return-value>
  12315. <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
  12316. <type name="GLib.List" c:type="GList*">
  12317. <type name="gpointer" c:type="gpointer"/>
  12318. </type>
  12319. </return-value>
  12320. <parameters>
  12321. <parameter name="list" transfer-ownership="none">
  12322. <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
  12323. <type name="GLib.List" c:type="GList*">
  12324. <type name="gpointer" c:type="gpointer"/>
  12325. </type>
  12326. </parameter>
  12327. <parameter name="compare_func" transfer-ownership="none" closure="2">
  12328. <doc xml:space="preserve">comparison function</doc>
  12329. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  12330. </parameter>
  12331. <parameter name="user_data"
  12332. transfer-ownership="none"
  12333. nullable="1"
  12334. allow-none="1">
  12335. <doc xml:space="preserve">user data to pass to comparison function</doc>
  12336. <type name="gpointer" c:type="gpointer"/>
  12337. </parameter>
  12338. </parameters>
  12339. </function>
  12340. </record>
  12341. <callback name="LogFunc" c:type="GLogFunc">
  12342. <doc xml:space="preserve">Specifies the prototype of log handler functions.
  12343. The default log handler, g_log_default_handler(), automatically appends a
  12344. new-line character to @message when printing it. It is advised that any
  12345. custom log handler functions behave similarly, so that logging calls in user
  12346. code do not need modifying to add a new-line character to the message if the
  12347. log handler is changed.</doc>
  12348. <return-value transfer-ownership="none">
  12349. <type name="none" c:type="void"/>
  12350. </return-value>
  12351. <parameters>
  12352. <parameter name="log_domain" transfer-ownership="none">
  12353. <doc xml:space="preserve">the log domain of the message</doc>
  12354. <type name="utf8" c:type="const gchar*"/>
  12355. </parameter>
  12356. <parameter name="log_level" transfer-ownership="none">
  12357. <doc xml:space="preserve">the log level of the message (including the
  12358. fatal and recursion flags)</doc>
  12359. <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
  12360. </parameter>
  12361. <parameter name="message" transfer-ownership="none">
  12362. <doc xml:space="preserve">the message to process</doc>
  12363. <type name="utf8" c:type="const gchar*"/>
  12364. </parameter>
  12365. <parameter name="user_data"
  12366. transfer-ownership="none"
  12367. nullable="1"
  12368. allow-none="1"
  12369. closure="3">
  12370. <doc xml:space="preserve">user data, set in g_log_set_handler()</doc>
  12371. <type name="gpointer" c:type="gpointer"/>
  12372. </parameter>
  12373. </parameters>
  12374. </callback>
  12375. <bitfield name="LogLevelFlags" c:type="GLogLevelFlags">
  12376. <doc xml:space="preserve">Flags specifying the level of log messages.
  12377. It is possible to change how GLib treats messages of the various
  12378. levels using g_log_set_handler() and g_log_set_fatal_mask().</doc>
  12379. <member name="flag_recursion"
  12380. value="1"
  12381. c:identifier="G_LOG_FLAG_RECURSION">
  12382. <doc xml:space="preserve">internal flag</doc>
  12383. </member>
  12384. <member name="flag_fatal" value="2" c:identifier="G_LOG_FLAG_FATAL">
  12385. <doc xml:space="preserve">internal flag</doc>
  12386. </member>
  12387. <member name="level_error" value="4" c:identifier="G_LOG_LEVEL_ERROR">
  12388. <doc xml:space="preserve">log level for errors, see g_error().
  12389. This level is also used for messages produced by g_assert().</doc>
  12390. </member>
  12391. <member name="level_critical"
  12392. value="8"
  12393. c:identifier="G_LOG_LEVEL_CRITICAL">
  12394. <doc xml:space="preserve">log level for critical warning messages, see
  12395. g_critical().
  12396. This level is also used for messages produced by g_return_if_fail()
  12397. and g_return_val_if_fail().</doc>
  12398. </member>
  12399. <member name="level_warning"
  12400. value="16"
  12401. c:identifier="G_LOG_LEVEL_WARNING">
  12402. <doc xml:space="preserve">log level for warnings, see g_warning()</doc>
  12403. </member>
  12404. <member name="level_message"
  12405. value="32"
  12406. c:identifier="G_LOG_LEVEL_MESSAGE">
  12407. <doc xml:space="preserve">log level for messages, see g_message()</doc>
  12408. </member>
  12409. <member name="level_info" value="64" c:identifier="G_LOG_LEVEL_INFO">
  12410. <doc xml:space="preserve">log level for informational messages, see g_info()</doc>
  12411. </member>
  12412. <member name="level_debug" value="128" c:identifier="G_LOG_LEVEL_DEBUG">
  12413. <doc xml:space="preserve">log level for debug messages, see g_debug()</doc>
  12414. </member>
  12415. <member name="level_mask" value="-4" c:identifier="G_LOG_LEVEL_MASK">
  12416. <doc xml:space="preserve">a mask including all log levels</doc>
  12417. </member>
  12418. </bitfield>
  12419. <constant name="MAJOR_VERSION" value="2" c:type="GLIB_MAJOR_VERSION">
  12420. <doc xml:space="preserve">The major version number of the GLib library.
  12421. Like #glib_major_version, but from the headers used at
  12422. application compile time, rather than from the library
  12423. linked against at application run time.</doc>
  12424. <type name="gint" c:type="gint"/>
  12425. </constant>
  12426. <constant name="MAXINT16" value="32767" c:type="G_MAXINT16" version="2.4">
  12427. <doc xml:space="preserve">The maximum value which can be held in a #gint16.</doc>
  12428. <type name="gint16" c:type="gint16"/>
  12429. </constant>
  12430. <constant name="MAXINT32"
  12431. value="2147483647"
  12432. c:type="G_MAXINT32"
  12433. version="2.4">
  12434. <doc xml:space="preserve">The maximum value which can be held in a #gint32.</doc>
  12435. <type name="gint32" c:type="gint32"/>
  12436. </constant>
  12437. <constant name="MAXINT64" value="9223372036854775807" c:type="G_MAXINT64">
  12438. <doc xml:space="preserve">The maximum value which can be held in a #gint64.</doc>
  12439. <type name="gint64" c:type="gint64"/>
  12440. </constant>
  12441. <constant name="MAXINT8" value="127" c:type="G_MAXINT8" version="2.4">
  12442. <doc xml:space="preserve">The maximum value which can be held in a #gint8.</doc>
  12443. <type name="gint8" c:type="gint8"/>
  12444. </constant>
  12445. <constant name="MAXUINT16"
  12446. value="65535"
  12447. c:type="G_MAXUINT16"
  12448. version="2.4">
  12449. <doc xml:space="preserve">The maximum value which can be held in a #guint16.</doc>
  12450. <type name="guint16" c:type="guint16"/>
  12451. </constant>
  12452. <constant name="MAXUINT32"
  12453. value="4294967295"
  12454. c:type="G_MAXUINT32"
  12455. version="2.4">
  12456. <doc xml:space="preserve">The maximum value which can be held in a #guint32.</doc>
  12457. <type name="guint32" c:type="guint32"/>
  12458. </constant>
  12459. <constant name="MAXUINT64"
  12460. value="18446744073709551615"
  12461. c:type="G_MAXUINT64">
  12462. <doc xml:space="preserve">The maximum value which can be held in a #guint64.</doc>
  12463. <type name="guint64" c:type="guint64"/>
  12464. </constant>
  12465. <constant name="MAXUINT8" value="255" c:type="G_MAXUINT8" version="2.4">
  12466. <doc xml:space="preserve">The maximum value which can be held in a #guint8.</doc>
  12467. <type name="guint8" c:type="guint8"/>
  12468. </constant>
  12469. <constant name="MICRO_VERSION" value="2" c:type="GLIB_MICRO_VERSION">
  12470. <doc xml:space="preserve">The micro version number of the GLib library.
  12471. Like #gtk_micro_version, but from the headers used at
  12472. application compile time, rather than from the library
  12473. linked against at application run time.</doc>
  12474. <type name="gint" c:type="gint"/>
  12475. </constant>
  12476. <constant name="MININT16" value="-32768" c:type="G_MININT16" version="2.4">
  12477. <doc xml:space="preserve">The minimum value which can be held in a #gint16.</doc>
  12478. <type name="gint16" c:type="gint16"/>
  12479. </constant>
  12480. <constant name="MININT32"
  12481. value="-2147483648"
  12482. c:type="G_MININT32"
  12483. version="2.4">
  12484. <doc xml:space="preserve">The minimum value which can be held in a #gint32.</doc>
  12485. <type name="gint32" c:type="gint32"/>
  12486. </constant>
  12487. <constant name="MININT64" value="-9223372036854775808" c:type="G_MININT64">
  12488. <doc xml:space="preserve">The minimum value which can be held in a #gint64.</doc>
  12489. <type name="gint64" c:type="gint64"/>
  12490. </constant>
  12491. <constant name="MININT8" value="-128" c:type="G_MININT8" version="2.4">
  12492. <doc xml:space="preserve">The minimum value which can be held in a #gint8.</doc>
  12493. <type name="gint8" c:type="gint8"/>
  12494. </constant>
  12495. <constant name="MINOR_VERSION" value="48" c:type="GLIB_MINOR_VERSION">
  12496. <doc xml:space="preserve">The minor version number of the GLib library.
  12497. Like #gtk_minor_version, but from the headers used at
  12498. application compile time, rather than from the library
  12499. linked against at application run time.</doc>
  12500. <type name="gint" c:type="gint"/>
  12501. </constant>
  12502. <constant name="MODULE_SUFFIX" value="so" c:type="G_MODULE_SUFFIX">
  12503. <type name="utf8" c:type="gchar*"/>
  12504. </constant>
  12505. <record name="MainContext"
  12506. c:type="GMainContext"
  12507. glib:type-name="GMainContext"
  12508. glib:get-type="g_main_context_get_type"
  12509. c:symbol-prefix="main_context">
  12510. <doc xml:space="preserve">The `GMainContext` struct is an opaque data
  12511. type representing a set of sources to be handled in a main loop.</doc>
  12512. <constructor name="new" c:identifier="g_main_context_new">
  12513. <doc xml:space="preserve">Creates a new #GMainContext structure.</doc>
  12514. <return-value transfer-ownership="full">
  12515. <doc xml:space="preserve">the new #GMainContext</doc>
  12516. <type name="MainContext" c:type="GMainContext*"/>
  12517. </return-value>
  12518. </constructor>
  12519. <method name="acquire" c:identifier="g_main_context_acquire">
  12520. <doc xml:space="preserve">Tries to become the owner of the specified context.
  12521. If some other thread is the owner of the context,
  12522. returns %FALSE immediately. Ownership is properly
  12523. recursive: the owner can require ownership again
  12524. and will release ownership when g_main_context_release()
  12525. is called as many times as g_main_context_acquire().
  12526. You must be the owner of a context before you
  12527. can call g_main_context_prepare(), g_main_context_query(),
  12528. g_main_context_check(), g_main_context_dispatch().</doc>
  12529. <return-value transfer-ownership="none">
  12530. <doc xml:space="preserve">%TRUE if the operation succeeded, and
  12531. this thread is now the owner of @context.</doc>
  12532. <type name="gboolean" c:type="gboolean"/>
  12533. </return-value>
  12534. <parameters>
  12535. <instance-parameter name="context" transfer-ownership="none">
  12536. <doc xml:space="preserve">a #GMainContext</doc>
  12537. <type name="MainContext" c:type="GMainContext*"/>
  12538. </instance-parameter>
  12539. </parameters>
  12540. </method>
  12541. <method name="add_poll" c:identifier="g_main_context_add_poll">
  12542. <doc xml:space="preserve">Adds a file descriptor to the set of file descriptors polled for
  12543. this context. This will very seldom be used directly. Instead
  12544. a typical event source will use g_source_add_unix_fd() instead.</doc>
  12545. <return-value transfer-ownership="none">
  12546. <type name="none" c:type="void"/>
  12547. </return-value>
  12548. <parameters>
  12549. <instance-parameter name="context"
  12550. transfer-ownership="none"
  12551. nullable="1"
  12552. allow-none="1">
  12553. <doc xml:space="preserve">a #GMainContext (or %NULL for the default context)</doc>
  12554. <type name="MainContext" c:type="GMainContext*"/>
  12555. </instance-parameter>
  12556. <parameter name="fd" transfer-ownership="none">
  12557. <doc xml:space="preserve">a #GPollFD structure holding information about a file
  12558. descriptor to watch.</doc>
  12559. <type name="PollFD" c:type="GPollFD*"/>
  12560. </parameter>
  12561. <parameter name="priority" transfer-ownership="none">
  12562. <doc xml:space="preserve">the priority for this file descriptor which should be
  12563. the same as the priority used for g_source_attach() to ensure that the
  12564. file descriptor is polled whenever the results may be needed.</doc>
  12565. <type name="gint" c:type="gint"/>
  12566. </parameter>
  12567. </parameters>
  12568. </method>
  12569. <method name="check" c:identifier="g_main_context_check">
  12570. <doc xml:space="preserve">Passes the results of polling back to the main loop.
  12571. You must have successfully acquired the context with
  12572. g_main_context_acquire() before you may call this function.</doc>
  12573. <return-value transfer-ownership="none">
  12574. <doc xml:space="preserve">%TRUE if some sources are ready to be dispatched.</doc>
  12575. <type name="gint" c:type="gint"/>
  12576. </return-value>
  12577. <parameters>
  12578. <instance-parameter name="context" transfer-ownership="none">
  12579. <doc xml:space="preserve">a #GMainContext</doc>
  12580. <type name="MainContext" c:type="GMainContext*"/>
  12581. </instance-parameter>
  12582. <parameter name="max_priority" transfer-ownership="none">
  12583. <doc xml:space="preserve">the maximum numerical priority of sources to check</doc>
  12584. <type name="gint" c:type="gint"/>
  12585. </parameter>
  12586. <parameter name="fds" transfer-ownership="none">
  12587. <doc xml:space="preserve">array of #GPollFD's that was passed to
  12588. the last call to g_main_context_query()</doc>
  12589. <array length="2" zero-terminated="0" c:type="GPollFD*">
  12590. <type name="PollFD" c:type="GPollFD"/>
  12591. </array>
  12592. </parameter>
  12593. <parameter name="n_fds" transfer-ownership="none">
  12594. <doc xml:space="preserve">return value of g_main_context_query()</doc>
  12595. <type name="gint" c:type="gint"/>
  12596. </parameter>
  12597. </parameters>
  12598. </method>
  12599. <method name="dispatch" c:identifier="g_main_context_dispatch">
  12600. <doc xml:space="preserve">Dispatches all pending sources.
  12601. You must have successfully acquired the context with
  12602. g_main_context_acquire() before you may call this function.</doc>
  12603. <return-value transfer-ownership="none">
  12604. <type name="none" c:type="void"/>
  12605. </return-value>
  12606. <parameters>
  12607. <instance-parameter name="context" transfer-ownership="none">
  12608. <doc xml:space="preserve">a #GMainContext</doc>
  12609. <type name="MainContext" c:type="GMainContext*"/>
  12610. </instance-parameter>
  12611. </parameters>
  12612. </method>
  12613. <method name="find_source_by_funcs_user_data"
  12614. c:identifier="g_main_context_find_source_by_funcs_user_data">
  12615. <doc xml:space="preserve">Finds a source with the given source functions and user data. If
  12616. multiple sources exist with the same source function and user data,
  12617. the first one found will be returned.</doc>
  12618. <return-value transfer-ownership="none">
  12619. <doc xml:space="preserve">the source, if one was found, otherwise %NULL</doc>
  12620. <type name="Source" c:type="GSource*"/>
  12621. </return-value>
  12622. <parameters>
  12623. <instance-parameter name="context"
  12624. transfer-ownership="none"
  12625. nullable="1"
  12626. allow-none="1">
  12627. <doc xml:space="preserve">a #GMainContext (if %NULL, the default context will be used).</doc>
  12628. <type name="MainContext" c:type="GMainContext*"/>
  12629. </instance-parameter>
  12630. <parameter name="funcs" transfer-ownership="none">
  12631. <doc xml:space="preserve">the @source_funcs passed to g_source_new().</doc>
  12632. <type name="SourceFuncs" c:type="GSourceFuncs*"/>
  12633. </parameter>
  12634. <parameter name="user_data"
  12635. transfer-ownership="none"
  12636. nullable="1"
  12637. allow-none="1">
  12638. <doc xml:space="preserve">the user data from the callback.</doc>
  12639. <type name="gpointer" c:type="gpointer"/>
  12640. </parameter>
  12641. </parameters>
  12642. </method>
  12643. <method name="find_source_by_id"
  12644. c:identifier="g_main_context_find_source_by_id">
  12645. <doc xml:space="preserve">Finds a #GSource given a pair of context and ID.
  12646. It is a programmer error to attempt to lookup a non-existent source.
  12647. More specifically: source IDs can be reissued after a source has been
  12648. destroyed and therefore it is never valid to use this function with a
  12649. source ID which may have already been removed. An example is when
  12650. scheduling an idle to run in another thread with g_idle_add(): the
  12651. idle may already have run and been removed by the time this function
  12652. is called on its (now invalid) source ID. This source ID may have
  12653. been reissued, leading to the operation being performed against the
  12654. wrong source.</doc>
  12655. <return-value transfer-ownership="none">
  12656. <doc xml:space="preserve">the #GSource</doc>
  12657. <type name="Source" c:type="GSource*"/>
  12658. </return-value>
  12659. <parameters>
  12660. <instance-parameter name="context"
  12661. transfer-ownership="none"
  12662. nullable="1"
  12663. allow-none="1">
  12664. <doc xml:space="preserve">a #GMainContext (if %NULL, the default context will be used)</doc>
  12665. <type name="MainContext" c:type="GMainContext*"/>
  12666. </instance-parameter>
  12667. <parameter name="source_id" transfer-ownership="none">
  12668. <doc xml:space="preserve">the source ID, as returned by g_source_get_id().</doc>
  12669. <type name="guint" c:type="guint"/>
  12670. </parameter>
  12671. </parameters>
  12672. </method>
  12673. <method name="find_source_by_user_data"
  12674. c:identifier="g_main_context_find_source_by_user_data">
  12675. <doc xml:space="preserve">Finds a source with the given user data for the callback. If
  12676. multiple sources exist with the same user data, the first
  12677. one found will be returned.</doc>
  12678. <return-value transfer-ownership="none">
  12679. <doc xml:space="preserve">the source, if one was found, otherwise %NULL</doc>
  12680. <type name="Source" c:type="GSource*"/>
  12681. </return-value>
  12682. <parameters>
  12683. <instance-parameter name="context" transfer-ownership="none">
  12684. <doc xml:space="preserve">a #GMainContext</doc>
  12685. <type name="MainContext" c:type="GMainContext*"/>
  12686. </instance-parameter>
  12687. <parameter name="user_data"
  12688. transfer-ownership="none"
  12689. nullable="1"
  12690. allow-none="1">
  12691. <doc xml:space="preserve">the user_data for the callback.</doc>
  12692. <type name="gpointer" c:type="gpointer"/>
  12693. </parameter>
  12694. </parameters>
  12695. </method>
  12696. <method name="get_poll_func"
  12697. c:identifier="g_main_context_get_poll_func"
  12698. introspectable="0">
  12699. <doc xml:space="preserve">Gets the poll function set by g_main_context_set_poll_func().</doc>
  12700. <return-value>
  12701. <doc xml:space="preserve">the poll function</doc>
  12702. <type name="PollFunc" c:type="GPollFunc"/>
  12703. </return-value>
  12704. <parameters>
  12705. <instance-parameter name="context" transfer-ownership="none">
  12706. <doc xml:space="preserve">a #GMainContext</doc>
  12707. <type name="MainContext" c:type="GMainContext*"/>
  12708. </instance-parameter>
  12709. </parameters>
  12710. </method>
  12711. <method name="invoke"
  12712. c:identifier="g_main_context_invoke"
  12713. version="2.28"
  12714. introspectable="0">
  12715. <doc xml:space="preserve">Invokes a function in such a way that @context is owned during the
  12716. invocation of @function.
  12717. If @context is %NULL then the global default main context — as
  12718. returned by g_main_context_default() — is used.
  12719. If @context is owned by the current thread, @function is called
  12720. directly. Otherwise, if @context is the thread-default main context
  12721. of the current thread and g_main_context_acquire() succeeds, then
  12722. @function is called and g_main_context_release() is called
  12723. afterwards.
  12724. In any other case, an idle source is created to call @function and
  12725. that source is attached to @context (presumably to be run in another
  12726. thread). The idle source is attached with #G_PRIORITY_DEFAULT
  12727. priority. If you want a different priority, use
  12728. g_main_context_invoke_full().
  12729. Note that, as with normal idle functions, @function should probably
  12730. return %FALSE. If it returns %TRUE, it will be continuously run in a
  12731. loop (and may prevent this call from returning).</doc>
  12732. <return-value transfer-ownership="none">
  12733. <type name="none" c:type="void"/>
  12734. </return-value>
  12735. <parameters>
  12736. <instance-parameter name="context"
  12737. transfer-ownership="none"
  12738. nullable="1"
  12739. allow-none="1">
  12740. <doc xml:space="preserve">a #GMainContext, or %NULL</doc>
  12741. <type name="MainContext" c:type="GMainContext*"/>
  12742. </instance-parameter>
  12743. <parameter name="function" transfer-ownership="none" closure="1">
  12744. <doc xml:space="preserve">function to call</doc>
  12745. <type name="SourceFunc" c:type="GSourceFunc"/>
  12746. </parameter>
  12747. <parameter name="data"
  12748. transfer-ownership="none"
  12749. nullable="1"
  12750. allow-none="1">
  12751. <doc xml:space="preserve">data to pass to @function</doc>
  12752. <type name="gpointer" c:type="gpointer"/>
  12753. </parameter>
  12754. </parameters>
  12755. </method>
  12756. <method name="invoke_full"
  12757. c:identifier="g_main_context_invoke_full"
  12758. version="2.28">
  12759. <doc xml:space="preserve">Invokes a function in such a way that @context is owned during the
  12760. invocation of @function.
  12761. This function is the same as g_main_context_invoke() except that it
  12762. lets you specify the priority incase @function ends up being
  12763. scheduled as an idle and also lets you give a #GDestroyNotify for @data.
  12764. @notify should not assume that it is called from any particular
  12765. thread or with any particular context acquired.</doc>
  12766. <return-value transfer-ownership="none">
  12767. <type name="none" c:type="void"/>
  12768. </return-value>
  12769. <parameters>
  12770. <instance-parameter name="context"
  12771. transfer-ownership="none"
  12772. nullable="1"
  12773. allow-none="1">
  12774. <doc xml:space="preserve">a #GMainContext, or %NULL</doc>
  12775. <type name="MainContext" c:type="GMainContext*"/>
  12776. </instance-parameter>
  12777. <parameter name="priority" transfer-ownership="none">
  12778. <doc xml:space="preserve">the priority at which to run @function</doc>
  12779. <type name="gint" c:type="gint"/>
  12780. </parameter>
  12781. <parameter name="function"
  12782. transfer-ownership="none"
  12783. scope="notified"
  12784. closure="2"
  12785. destroy="3">
  12786. <doc xml:space="preserve">function to call</doc>
  12787. <type name="SourceFunc" c:type="GSourceFunc"/>
  12788. </parameter>
  12789. <parameter name="data"
  12790. transfer-ownership="none"
  12791. nullable="1"
  12792. allow-none="1">
  12793. <doc xml:space="preserve">data to pass to @function</doc>
  12794. <type name="gpointer" c:type="gpointer"/>
  12795. </parameter>
  12796. <parameter name="notify"
  12797. transfer-ownership="none"
  12798. nullable="1"
  12799. allow-none="1"
  12800. scope="async">
  12801. <doc xml:space="preserve">a function to call when @data is no longer in use, or %NULL.</doc>
  12802. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  12803. </parameter>
  12804. </parameters>
  12805. </method>
  12806. <method name="is_owner"
  12807. c:identifier="g_main_context_is_owner"
  12808. version="2.10">
  12809. <doc xml:space="preserve">Determines whether this thread holds the (recursive)
  12810. ownership of this #GMainContext. This is useful to
  12811. know before waiting on another thread that may be
  12812. blocking to get ownership of @context.</doc>
  12813. <return-value transfer-ownership="none">
  12814. <doc xml:space="preserve">%TRUE if current thread is owner of @context.</doc>
  12815. <type name="gboolean" c:type="gboolean"/>
  12816. </return-value>
  12817. <parameters>
  12818. <instance-parameter name="context" transfer-ownership="none">
  12819. <doc xml:space="preserve">a #GMainContext</doc>
  12820. <type name="MainContext" c:type="GMainContext*"/>
  12821. </instance-parameter>
  12822. </parameters>
  12823. </method>
  12824. <method name="iteration" c:identifier="g_main_context_iteration">
  12825. <doc xml:space="preserve">Runs a single iteration for the given main loop. This involves
  12826. checking to see if any event sources are ready to be processed,
  12827. then if no events sources are ready and @may_block is %TRUE, waiting
  12828. for a source to become ready, then dispatching the highest priority
  12829. events sources that are ready. Otherwise, if @may_block is %FALSE
  12830. sources are not waited to become ready, only those highest priority
  12831. events sources will be dispatched (if any), that are ready at this
  12832. given moment without further waiting.
  12833. Note that even when @may_block is %TRUE, it is still possible for
  12834. g_main_context_iteration() to return %FALSE, since the wait may
  12835. be interrupted for other reasons than an event source becoming ready.</doc>
  12836. <return-value transfer-ownership="none">
  12837. <doc xml:space="preserve">%TRUE if events were dispatched.</doc>
  12838. <type name="gboolean" c:type="gboolean"/>
  12839. </return-value>
  12840. <parameters>
  12841. <instance-parameter name="context"
  12842. transfer-ownership="none"
  12843. nullable="1"
  12844. allow-none="1">
  12845. <doc xml:space="preserve">a #GMainContext (if %NULL, the default context will be used)</doc>
  12846. <type name="MainContext" c:type="GMainContext*"/>
  12847. </instance-parameter>
  12848. <parameter name="may_block" transfer-ownership="none">
  12849. <doc xml:space="preserve">whether the call may block.</doc>
  12850. <type name="gboolean" c:type="gboolean"/>
  12851. </parameter>
  12852. </parameters>
  12853. </method>
  12854. <method name="pending" c:identifier="g_main_context_pending">
  12855. <doc xml:space="preserve">Checks if any sources have pending events for the given context.</doc>
  12856. <return-value transfer-ownership="none">
  12857. <doc xml:space="preserve">%TRUE if events are pending.</doc>
  12858. <type name="gboolean" c:type="gboolean"/>
  12859. </return-value>
  12860. <parameters>
  12861. <instance-parameter name="context"
  12862. transfer-ownership="none"
  12863. nullable="1"
  12864. allow-none="1">
  12865. <doc xml:space="preserve">a #GMainContext (if %NULL, the default context will be used)</doc>
  12866. <type name="MainContext" c:type="GMainContext*"/>
  12867. </instance-parameter>
  12868. </parameters>
  12869. </method>
  12870. <method name="pop_thread_default"
  12871. c:identifier="g_main_context_pop_thread_default"
  12872. version="2.22">
  12873. <doc xml:space="preserve">Pops @context off the thread-default context stack (verifying that
  12874. it was on the top of the stack).</doc>
  12875. <return-value transfer-ownership="none">
  12876. <type name="none" c:type="void"/>
  12877. </return-value>
  12878. <parameters>
  12879. <instance-parameter name="context"
  12880. transfer-ownership="none"
  12881. nullable="1"
  12882. allow-none="1">
  12883. <doc xml:space="preserve">a #GMainContext object, or %NULL</doc>
  12884. <type name="MainContext" c:type="GMainContext*"/>
  12885. </instance-parameter>
  12886. </parameters>
  12887. </method>
  12888. <method name="prepare" c:identifier="g_main_context_prepare">
  12889. <doc xml:space="preserve">Prepares to poll sources within a main loop. The resulting information
  12890. for polling is determined by calling g_main_context_query ().
  12891. You must have successfully acquired the context with
  12892. g_main_context_acquire() before you may call this function.</doc>
  12893. <return-value transfer-ownership="none">
  12894. <doc xml:space="preserve">%TRUE if some source is ready to be dispatched
  12895. prior to polling.</doc>
  12896. <type name="gboolean" c:type="gboolean"/>
  12897. </return-value>
  12898. <parameters>
  12899. <instance-parameter name="context" transfer-ownership="none">
  12900. <doc xml:space="preserve">a #GMainContext</doc>
  12901. <type name="MainContext" c:type="GMainContext*"/>
  12902. </instance-parameter>
  12903. <parameter name="priority" transfer-ownership="none">
  12904. <doc xml:space="preserve">location to store priority of highest priority
  12905. source already ready.</doc>
  12906. <type name="gint" c:type="gint*"/>
  12907. </parameter>
  12908. </parameters>
  12909. </method>
  12910. <method name="push_thread_default"
  12911. c:identifier="g_main_context_push_thread_default"
  12912. version="2.22">
  12913. <doc xml:space="preserve">Acquires @context and sets it as the thread-default context for the
  12914. current thread. This will cause certain asynchronous operations
  12915. (such as most [gio][gio]-based I/O) which are
  12916. started in this thread to run under @context and deliver their
  12917. results to its main loop, rather than running under the global
  12918. default context in the main thread. Note that calling this function
  12919. changes the context returned by g_main_context_get_thread_default(),
  12920. not the one returned by g_main_context_default(), so it does not affect
  12921. the context used by functions like g_idle_add().
  12922. Normally you would call this function shortly after creating a new
  12923. thread, passing it a #GMainContext which will be run by a
  12924. #GMainLoop in that thread, to set a new default context for all
  12925. async operations in that thread. (In this case, you don't need to
  12926. ever call g_main_context_pop_thread_default().) In some cases
  12927. however, you may want to schedule a single operation in a
  12928. non-default context, or temporarily use a non-default context in
  12929. the main thread. In that case, you can wrap the call to the
  12930. asynchronous operation inside a
  12931. g_main_context_push_thread_default() /
  12932. g_main_context_pop_thread_default() pair, but it is up to you to
  12933. ensure that no other asynchronous operations accidentally get
  12934. started while the non-default context is active.
  12935. Beware that libraries that predate this function may not correctly
  12936. handle being used from a thread with a thread-default context. Eg,
  12937. see g_file_supports_thread_contexts().</doc>
  12938. <return-value transfer-ownership="none">
  12939. <type name="none" c:type="void"/>
  12940. </return-value>
  12941. <parameters>
  12942. <instance-parameter name="context"
  12943. transfer-ownership="none"
  12944. nullable="1"
  12945. allow-none="1">
  12946. <doc xml:space="preserve">a #GMainContext, or %NULL for the global default context</doc>
  12947. <type name="MainContext" c:type="GMainContext*"/>
  12948. </instance-parameter>
  12949. </parameters>
  12950. </method>
  12951. <method name="query" c:identifier="g_main_context_query">
  12952. <doc xml:space="preserve">Determines information necessary to poll this main loop.
  12953. You must have successfully acquired the context with
  12954. g_main_context_acquire() before you may call this function.</doc>
  12955. <return-value transfer-ownership="none">
  12956. <doc xml:space="preserve">the number of records actually stored in @fds,
  12957. or, if more than @n_fds records need to be stored, the number
  12958. of records that need to be stored.</doc>
  12959. <type name="gint" c:type="gint"/>
  12960. </return-value>
  12961. <parameters>
  12962. <instance-parameter name="context" transfer-ownership="none">
  12963. <doc xml:space="preserve">a #GMainContext</doc>
  12964. <type name="MainContext" c:type="GMainContext*"/>
  12965. </instance-parameter>
  12966. <parameter name="max_priority" transfer-ownership="none">
  12967. <doc xml:space="preserve">maximum priority source to check</doc>
  12968. <type name="gint" c:type="gint"/>
  12969. </parameter>
  12970. <parameter name="timeout_"
  12971. direction="out"
  12972. caller-allocates="0"
  12973. transfer-ownership="full">
  12974. <doc xml:space="preserve">location to store timeout to be used in polling</doc>
  12975. <type name="gint" c:type="gint*"/>
  12976. </parameter>
  12977. <parameter name="fds"
  12978. direction="out"
  12979. caller-allocates="1"
  12980. transfer-ownership="none">
  12981. <doc xml:space="preserve">location to
  12982. store #GPollFD records that need to be polled.</doc>
  12983. <array length="3" zero-terminated="0" c:type="GPollFD*">
  12984. <type name="PollFD" c:type="GPollFD"/>
  12985. </array>
  12986. </parameter>
  12987. <parameter name="n_fds" transfer-ownership="none">
  12988. <doc xml:space="preserve">length of @fds.</doc>
  12989. <type name="gint" c:type="gint"/>
  12990. </parameter>
  12991. </parameters>
  12992. </method>
  12993. <method name="ref" c:identifier="g_main_context_ref">
  12994. <doc xml:space="preserve">Increases the reference count on a #GMainContext object by one.</doc>
  12995. <return-value transfer-ownership="full">
  12996. <doc xml:space="preserve">the @context that was passed in (since 2.6)</doc>
  12997. <type name="MainContext" c:type="GMainContext*"/>
  12998. </return-value>
  12999. <parameters>
  13000. <instance-parameter name="context" transfer-ownership="none">
  13001. <doc xml:space="preserve">a #GMainContext</doc>
  13002. <type name="MainContext" c:type="GMainContext*"/>
  13003. </instance-parameter>
  13004. </parameters>
  13005. </method>
  13006. <method name="release" c:identifier="g_main_context_release">
  13007. <doc xml:space="preserve">Releases ownership of a context previously acquired by this thread
  13008. with g_main_context_acquire(). If the context was acquired multiple
  13009. times, the ownership will be released only when g_main_context_release()
  13010. is called as many times as it was acquired.</doc>
  13011. <return-value transfer-ownership="none">
  13012. <type name="none" c:type="void"/>
  13013. </return-value>
  13014. <parameters>
  13015. <instance-parameter name="context" transfer-ownership="none">
  13016. <doc xml:space="preserve">a #GMainContext</doc>
  13017. <type name="MainContext" c:type="GMainContext*"/>
  13018. </instance-parameter>
  13019. </parameters>
  13020. </method>
  13021. <method name="remove_poll" c:identifier="g_main_context_remove_poll">
  13022. <doc xml:space="preserve">Removes file descriptor from the set of file descriptors to be
  13023. polled for a particular context.</doc>
  13024. <return-value transfer-ownership="none">
  13025. <type name="none" c:type="void"/>
  13026. </return-value>
  13027. <parameters>
  13028. <instance-parameter name="context" transfer-ownership="none">
  13029. <doc xml:space="preserve">a #GMainContext</doc>
  13030. <type name="MainContext" c:type="GMainContext*"/>
  13031. </instance-parameter>
  13032. <parameter name="fd" transfer-ownership="none">
  13033. <doc xml:space="preserve">a #GPollFD descriptor previously added with g_main_context_add_poll()</doc>
  13034. <type name="PollFD" c:type="GPollFD*"/>
  13035. </parameter>
  13036. </parameters>
  13037. </method>
  13038. <method name="set_poll_func"
  13039. c:identifier="g_main_context_set_poll_func"
  13040. introspectable="0">
  13041. <doc xml:space="preserve">Sets the function to use to handle polling of file descriptors. It
  13042. will be used instead of the poll() system call
  13043. (or GLib's replacement function, which is used where
  13044. poll() isn't available).
  13045. This function could possibly be used to integrate the GLib event
  13046. loop with an external event loop.</doc>
  13047. <return-value transfer-ownership="none">
  13048. <type name="none" c:type="void"/>
  13049. </return-value>
  13050. <parameters>
  13051. <instance-parameter name="context" transfer-ownership="none">
  13052. <doc xml:space="preserve">a #GMainContext</doc>
  13053. <type name="MainContext" c:type="GMainContext*"/>
  13054. </instance-parameter>
  13055. <parameter name="func" transfer-ownership="none">
  13056. <doc xml:space="preserve">the function to call to poll all file descriptors</doc>
  13057. <type name="PollFunc" c:type="GPollFunc"/>
  13058. </parameter>
  13059. </parameters>
  13060. </method>
  13061. <method name="unref" c:identifier="g_main_context_unref">
  13062. <doc xml:space="preserve">Decreases the reference count on a #GMainContext object by one. If
  13063. the result is zero, free the context and free all associated memory.</doc>
  13064. <return-value transfer-ownership="none">
  13065. <type name="none" c:type="void"/>
  13066. </return-value>
  13067. <parameters>
  13068. <instance-parameter name="context" transfer-ownership="none">
  13069. <doc xml:space="preserve">a #GMainContext</doc>
  13070. <type name="MainContext" c:type="GMainContext*"/>
  13071. </instance-parameter>
  13072. </parameters>
  13073. </method>
  13074. <method name="wait" c:identifier="g_main_context_wait">
  13075. <doc xml:space="preserve">Tries to become the owner of the specified context,
  13076. as with g_main_context_acquire(). But if another thread
  13077. is the owner, atomically drop @mutex and wait on @cond until
  13078. that owner releases ownership or until @cond is signaled, then
  13079. try again (once) to become the owner.</doc>
  13080. <return-value transfer-ownership="none">
  13081. <doc xml:space="preserve">%TRUE if the operation succeeded, and
  13082. this thread is now the owner of @context.</doc>
  13083. <type name="gboolean" c:type="gboolean"/>
  13084. </return-value>
  13085. <parameters>
  13086. <instance-parameter name="context" transfer-ownership="none">
  13087. <doc xml:space="preserve">a #GMainContext</doc>
  13088. <type name="MainContext" c:type="GMainContext*"/>
  13089. </instance-parameter>
  13090. <parameter name="cond" transfer-ownership="none">
  13091. <doc xml:space="preserve">a condition variable</doc>
  13092. <type name="Cond" c:type="GCond*"/>
  13093. </parameter>
  13094. <parameter name="mutex" transfer-ownership="none">
  13095. <doc xml:space="preserve">a mutex, currently held</doc>
  13096. <type name="Mutex" c:type="GMutex*"/>
  13097. </parameter>
  13098. </parameters>
  13099. </method>
  13100. <method name="wakeup" c:identifier="g_main_context_wakeup">
  13101. <doc xml:space="preserve">If @context is currently blocking in g_main_context_iteration()
  13102. waiting for a source to become ready, cause it to stop blocking
  13103. and return. Otherwise, cause the next invocation of
  13104. g_main_context_iteration() to return without blocking.
  13105. This API is useful for low-level control over #GMainContext; for
  13106. example, integrating it with main loop implementations such as
  13107. #GMainLoop.
  13108. Another related use for this function is when implementing a main
  13109. loop with a termination condition, computed from multiple threads:
  13110. |[&lt;!-- language="C" --&gt;
  13111. #define NUM_TASKS 10
  13112. static volatile gint tasks_remaining = NUM_TASKS;
  13113. ...
  13114. while (g_atomic_int_get (&amp;tasks_remaining) != 0)
  13115. g_main_context_iteration (NULL, TRUE);
  13116. ]|
  13117. Then in a thread:
  13118. |[&lt;!-- language="C" --&gt;
  13119. perform_work();
  13120. if (g_atomic_int_dec_and_test (&amp;tasks_remaining))
  13121. g_main_context_wakeup (NULL);
  13122. ]|</doc>
  13123. <return-value transfer-ownership="none">
  13124. <type name="none" c:type="void"/>
  13125. </return-value>
  13126. <parameters>
  13127. <instance-parameter name="context" transfer-ownership="none">
  13128. <doc xml:space="preserve">a #GMainContext</doc>
  13129. <type name="MainContext" c:type="GMainContext*"/>
  13130. </instance-parameter>
  13131. </parameters>
  13132. </method>
  13133. <function name="default" c:identifier="g_main_context_default">
  13134. <doc xml:space="preserve">Returns the global default main context. This is the main context
  13135. used for main loop functions when a main loop is not explicitly
  13136. specified, and corresponds to the "main" main loop. See also
  13137. g_main_context_get_thread_default().</doc>
  13138. <return-value transfer-ownership="none">
  13139. <doc xml:space="preserve">the global default main context.</doc>
  13140. <type name="MainContext" c:type="GMainContext*"/>
  13141. </return-value>
  13142. </function>
  13143. <function name="get_thread_default"
  13144. c:identifier="g_main_context_get_thread_default"
  13145. version="2.22">
  13146. <doc xml:space="preserve">Gets the thread-default #GMainContext for this thread. Asynchronous
  13147. operations that want to be able to be run in contexts other than
  13148. the default one should call this method or
  13149. g_main_context_ref_thread_default() to get a #GMainContext to add
  13150. their #GSources to. (Note that even in single-threaded
  13151. programs applications may sometimes want to temporarily push a
  13152. non-default context, so it is not safe to assume that this will
  13153. always return %NULL if you are running in the default thread.)
  13154. If you need to hold a reference on the context, use
  13155. g_main_context_ref_thread_default() instead.</doc>
  13156. <return-value transfer-ownership="none">
  13157. <doc xml:space="preserve">the thread-default #GMainContext, or
  13158. %NULL if the thread-default context is the global default context.</doc>
  13159. <type name="MainContext" c:type="GMainContext*"/>
  13160. </return-value>
  13161. </function>
  13162. <function name="ref_thread_default"
  13163. c:identifier="g_main_context_ref_thread_default"
  13164. version="2.32">
  13165. <doc xml:space="preserve">Gets the thread-default #GMainContext for this thread, as with
  13166. g_main_context_get_thread_default(), but also adds a reference to
  13167. it with g_main_context_ref(). In addition, unlike
  13168. g_main_context_get_thread_default(), if the thread-default context
  13169. is the global default context, this will return that #GMainContext
  13170. (with a ref added to it) rather than returning %NULL.</doc>
  13171. <return-value transfer-ownership="full">
  13172. <doc xml:space="preserve">the thread-default #GMainContext. Unref
  13173. with g_main_context_unref() when you are done with it.</doc>
  13174. <type name="MainContext" c:type="GMainContext*"/>
  13175. </return-value>
  13176. </function>
  13177. </record>
  13178. <record name="MainLoop"
  13179. c:type="GMainLoop"
  13180. glib:type-name="GMainLoop"
  13181. glib:get-type="g_main_loop_get_type"
  13182. c:symbol-prefix="main_loop">
  13183. <doc xml:space="preserve">The `GMainLoop` struct is an opaque data type
  13184. representing the main event loop of a GLib or GTK+ application.</doc>
  13185. <constructor name="new" c:identifier="g_main_loop_new">
  13186. <doc xml:space="preserve">Creates a new #GMainLoop structure.</doc>
  13187. <return-value transfer-ownership="full">
  13188. <doc xml:space="preserve">a new #GMainLoop.</doc>
  13189. <type name="MainLoop" c:type="GMainLoop*"/>
  13190. </return-value>
  13191. <parameters>
  13192. <parameter name="context"
  13193. transfer-ownership="none"
  13194. nullable="1"
  13195. allow-none="1">
  13196. <doc xml:space="preserve">a #GMainContext (if %NULL, the default context will be used).</doc>
  13197. <type name="MainContext" c:type="GMainContext*"/>
  13198. </parameter>
  13199. <parameter name="is_running" transfer-ownership="none">
  13200. <doc xml:space="preserve">set to %TRUE to indicate that the loop is running. This
  13201. is not very important since calling g_main_loop_run() will set this to
  13202. %TRUE anyway.</doc>
  13203. <type name="gboolean" c:type="gboolean"/>
  13204. </parameter>
  13205. </parameters>
  13206. </constructor>
  13207. <method name="get_context" c:identifier="g_main_loop_get_context">
  13208. <doc xml:space="preserve">Returns the #GMainContext of @loop.</doc>
  13209. <return-value transfer-ownership="none">
  13210. <doc xml:space="preserve">the #GMainContext of @loop</doc>
  13211. <type name="MainContext" c:type="GMainContext*"/>
  13212. </return-value>
  13213. <parameters>
  13214. <instance-parameter name="loop" transfer-ownership="none">
  13215. <doc xml:space="preserve">a #GMainLoop.</doc>
  13216. <type name="MainLoop" c:type="GMainLoop*"/>
  13217. </instance-parameter>
  13218. </parameters>
  13219. </method>
  13220. <method name="is_running" c:identifier="g_main_loop_is_running">
  13221. <doc xml:space="preserve">Checks to see if the main loop is currently being run via g_main_loop_run().</doc>
  13222. <return-value transfer-ownership="none">
  13223. <doc xml:space="preserve">%TRUE if the mainloop is currently being run.</doc>
  13224. <type name="gboolean" c:type="gboolean"/>
  13225. </return-value>
  13226. <parameters>
  13227. <instance-parameter name="loop" transfer-ownership="none">
  13228. <doc xml:space="preserve">a #GMainLoop.</doc>
  13229. <type name="MainLoop" c:type="GMainLoop*"/>
  13230. </instance-parameter>
  13231. </parameters>
  13232. </method>
  13233. <method name="quit" c:identifier="g_main_loop_quit">
  13234. <doc xml:space="preserve">Stops a #GMainLoop from running. Any calls to g_main_loop_run()
  13235. for the loop will return.
  13236. Note that sources that have already been dispatched when
  13237. g_main_loop_quit() is called will still be executed.</doc>
  13238. <return-value transfer-ownership="none">
  13239. <type name="none" c:type="void"/>
  13240. </return-value>
  13241. <parameters>
  13242. <instance-parameter name="loop" transfer-ownership="none">
  13243. <doc xml:space="preserve">a #GMainLoop</doc>
  13244. <type name="MainLoop" c:type="GMainLoop*"/>
  13245. </instance-parameter>
  13246. </parameters>
  13247. </method>
  13248. <method name="ref" c:identifier="g_main_loop_ref">
  13249. <doc xml:space="preserve">Increases the reference count on a #GMainLoop object by one.</doc>
  13250. <return-value transfer-ownership="full">
  13251. <doc xml:space="preserve">@loop</doc>
  13252. <type name="MainLoop" c:type="GMainLoop*"/>
  13253. </return-value>
  13254. <parameters>
  13255. <instance-parameter name="loop" transfer-ownership="none">
  13256. <doc xml:space="preserve">a #GMainLoop</doc>
  13257. <type name="MainLoop" c:type="GMainLoop*"/>
  13258. </instance-parameter>
  13259. </parameters>
  13260. </method>
  13261. <method name="run" c:identifier="g_main_loop_run">
  13262. <doc xml:space="preserve">Runs a main loop until g_main_loop_quit() is called on the loop.
  13263. If this is called for the thread of the loop's #GMainContext,
  13264. it will process events from the loop, otherwise it will
  13265. simply wait.</doc>
  13266. <return-value transfer-ownership="none">
  13267. <type name="none" c:type="void"/>
  13268. </return-value>
  13269. <parameters>
  13270. <instance-parameter name="loop" transfer-ownership="none">
  13271. <doc xml:space="preserve">a #GMainLoop</doc>
  13272. <type name="MainLoop" c:type="GMainLoop*"/>
  13273. </instance-parameter>
  13274. </parameters>
  13275. </method>
  13276. <method name="unref" c:identifier="g_main_loop_unref">
  13277. <doc xml:space="preserve">Decreases the reference count on a #GMainLoop object by one. If
  13278. the result is zero, free the loop and free all associated memory.</doc>
  13279. <return-value transfer-ownership="none">
  13280. <type name="none" c:type="void"/>
  13281. </return-value>
  13282. <parameters>
  13283. <instance-parameter name="loop" transfer-ownership="none">
  13284. <doc xml:space="preserve">a #GMainLoop</doc>
  13285. <type name="MainLoop" c:type="GMainLoop*"/>
  13286. </instance-parameter>
  13287. </parameters>
  13288. </method>
  13289. </record>
  13290. <record name="MappedFile"
  13291. c:type="GMappedFile"
  13292. glib:type-name="GMappedFile"
  13293. glib:get-type="g_mapped_file_get_type"
  13294. c:symbol-prefix="mapped_file">
  13295. <doc xml:space="preserve">The #GMappedFile represents a file mapping created with
  13296. g_mapped_file_new(). It has only private members and should
  13297. not be accessed directly.</doc>
  13298. <constructor name="new"
  13299. c:identifier="g_mapped_file_new"
  13300. version="2.8"
  13301. throws="1">
  13302. <doc xml:space="preserve">Maps a file into memory. On UNIX, this is using the mmap() function.
  13303. If @writable is %TRUE, the mapped buffer may be modified, otherwise
  13304. it is an error to modify the mapped buffer. Modifications to the buffer
  13305. are not visible to other processes mapping the same file, and are not
  13306. written back to the file.
  13307. Note that modifications of the underlying file might affect the contents
  13308. of the #GMappedFile. Therefore, mapping should only be used if the file
  13309. will not be modified, or if all modifications of the file are done
  13310. atomically (e.g. using g_file_set_contents()).
  13311. If @filename is the name of an empty, regular file, the function
  13312. will successfully return an empty #GMappedFile. In other cases of
  13313. size 0 (e.g. device files such as /dev/null), @error will be set
  13314. to the #GFileError value #G_FILE_ERROR_INVAL.</doc>
  13315. <return-value transfer-ownership="full">
  13316. <doc xml:space="preserve">a newly allocated #GMappedFile which must be unref'd
  13317. with g_mapped_file_unref(), or %NULL if the mapping failed.</doc>
  13318. <type name="MappedFile" c:type="GMappedFile*"/>
  13319. </return-value>
  13320. <parameters>
  13321. <parameter name="filename" transfer-ownership="none">
  13322. <doc xml:space="preserve">The path of the file to load, in the GLib filename encoding</doc>
  13323. <type name="utf8" c:type="const gchar*"/>
  13324. </parameter>
  13325. <parameter name="writable" transfer-ownership="none">
  13326. <doc xml:space="preserve">whether the mapping should be writable</doc>
  13327. <type name="gboolean" c:type="gboolean"/>
  13328. </parameter>
  13329. </parameters>
  13330. </constructor>
  13331. <constructor name="new_from_fd"
  13332. c:identifier="g_mapped_file_new_from_fd"
  13333. version="2.32"
  13334. throws="1">
  13335. <doc xml:space="preserve">Maps a file into memory. On UNIX, this is using the mmap() function.
  13336. If @writable is %TRUE, the mapped buffer may be modified, otherwise
  13337. it is an error to modify the mapped buffer. Modifications to the buffer
  13338. are not visible to other processes mapping the same file, and are not
  13339. written back to the file.
  13340. Note that modifications of the underlying file might affect the contents
  13341. of the #GMappedFile. Therefore, mapping should only be used if the file
  13342. will not be modified, or if all modifications of the file are done
  13343. atomically (e.g. using g_file_set_contents()).</doc>
  13344. <return-value transfer-ownership="full">
  13345. <doc xml:space="preserve">a newly allocated #GMappedFile which must be unref'd
  13346. with g_mapped_file_unref(), or %NULL if the mapping failed.</doc>
  13347. <type name="MappedFile" c:type="GMappedFile*"/>
  13348. </return-value>
  13349. <parameters>
  13350. <parameter name="fd" transfer-ownership="none">
  13351. <doc xml:space="preserve">The file descriptor of the file to load</doc>
  13352. <type name="gint" c:type="gint"/>
  13353. </parameter>
  13354. <parameter name="writable" transfer-ownership="none">
  13355. <doc xml:space="preserve">whether the mapping should be writable</doc>
  13356. <type name="gboolean" c:type="gboolean"/>
  13357. </parameter>
  13358. </parameters>
  13359. </constructor>
  13360. <method name="free"
  13361. c:identifier="g_mapped_file_free"
  13362. version="2.8"
  13363. deprecated="1"
  13364. deprecated-version="2.22">
  13365. <doc xml:space="preserve">This call existed before #GMappedFile had refcounting and is currently
  13366. exactly the same as g_mapped_file_unref().</doc>
  13367. <doc-deprecated xml:space="preserve">Use g_mapped_file_unref() instead.</doc-deprecated>
  13368. <return-value transfer-ownership="none">
  13369. <type name="none" c:type="void"/>
  13370. </return-value>
  13371. <parameters>
  13372. <instance-parameter name="file" transfer-ownership="none">
  13373. <doc xml:space="preserve">a #GMappedFile</doc>
  13374. <type name="MappedFile" c:type="GMappedFile*"/>
  13375. </instance-parameter>
  13376. </parameters>
  13377. </method>
  13378. <method name="get_bytes"
  13379. c:identifier="g_mapped_file_get_bytes"
  13380. version="2.34">
  13381. <doc xml:space="preserve">Creates a new #GBytes which references the data mapped from @file.
  13382. The mapped contents of the file must not be modified after creating this
  13383. bytes object, because a #GBytes should be immutable.</doc>
  13384. <return-value transfer-ownership="full">
  13385. <doc xml:space="preserve">A newly allocated #GBytes referencing data
  13386. from @file</doc>
  13387. <type name="Bytes" c:type="GBytes*"/>
  13388. </return-value>
  13389. <parameters>
  13390. <instance-parameter name="file" transfer-ownership="none">
  13391. <doc xml:space="preserve">a #GMappedFile</doc>
  13392. <type name="MappedFile" c:type="GMappedFile*"/>
  13393. </instance-parameter>
  13394. </parameters>
  13395. </method>
  13396. <method name="get_contents"
  13397. c:identifier="g_mapped_file_get_contents"
  13398. version="2.8">
  13399. <doc xml:space="preserve">Returns the contents of a #GMappedFile.
  13400. Note that the contents may not be zero-terminated,
  13401. even if the #GMappedFile is backed by a text file.
  13402. If the file is empty then %NULL is returned.</doc>
  13403. <return-value transfer-ownership="full">
  13404. <doc xml:space="preserve">the contents of @file, or %NULL.</doc>
  13405. <type name="utf8" c:type="gchar*"/>
  13406. </return-value>
  13407. <parameters>
  13408. <instance-parameter name="file" transfer-ownership="none">
  13409. <doc xml:space="preserve">a #GMappedFile</doc>
  13410. <type name="MappedFile" c:type="GMappedFile*"/>
  13411. </instance-parameter>
  13412. </parameters>
  13413. </method>
  13414. <method name="get_length"
  13415. c:identifier="g_mapped_file_get_length"
  13416. version="2.8">
  13417. <doc xml:space="preserve">Returns the length of the contents of a #GMappedFile.</doc>
  13418. <return-value transfer-ownership="none">
  13419. <doc xml:space="preserve">the length of the contents of @file.</doc>
  13420. <type name="gsize" c:type="gsize"/>
  13421. </return-value>
  13422. <parameters>
  13423. <instance-parameter name="file" transfer-ownership="none">
  13424. <doc xml:space="preserve">a #GMappedFile</doc>
  13425. <type name="MappedFile" c:type="GMappedFile*"/>
  13426. </instance-parameter>
  13427. </parameters>
  13428. </method>
  13429. <method name="ref" c:identifier="g_mapped_file_ref" version="2.22">
  13430. <doc xml:space="preserve">Increments the reference count of @file by one. It is safe to call
  13431. this function from any thread.</doc>
  13432. <return-value transfer-ownership="full">
  13433. <doc xml:space="preserve">the passed in #GMappedFile.</doc>
  13434. <type name="MappedFile" c:type="GMappedFile*"/>
  13435. </return-value>
  13436. <parameters>
  13437. <instance-parameter name="file" transfer-ownership="none">
  13438. <doc xml:space="preserve">a #GMappedFile</doc>
  13439. <type name="MappedFile" c:type="GMappedFile*"/>
  13440. </instance-parameter>
  13441. </parameters>
  13442. </method>
  13443. <method name="unref" c:identifier="g_mapped_file_unref">
  13444. <doc xml:space="preserve">Decrements the reference count of @file by one. If the reference count
  13445. drops to 0, unmaps the buffer of @file and frees it.
  13446. It is safe to call this function from any thread.
  13447. Since 2.22</doc>
  13448. <return-value transfer-ownership="none">
  13449. <type name="none" c:type="void"/>
  13450. </return-value>
  13451. <parameters>
  13452. <instance-parameter name="file" transfer-ownership="none">
  13453. <doc xml:space="preserve">a #GMappedFile</doc>
  13454. <type name="MappedFile" c:type="GMappedFile*"/>
  13455. </instance-parameter>
  13456. </parameters>
  13457. </method>
  13458. </record>
  13459. <bitfield name="MarkupCollectType" c:type="GMarkupCollectType">
  13460. <doc xml:space="preserve">A mixed enumerated type and flags field. You must specify one type
  13461. (string, strdup, boolean, tristate). Additionally, you may optionally
  13462. bitwise OR the type with the flag %G_MARKUP_COLLECT_OPTIONAL.
  13463. It is likely that this enum will be extended in the future to
  13464. support other types.</doc>
  13465. <member name="invalid" value="0" c:identifier="G_MARKUP_COLLECT_INVALID">
  13466. <doc xml:space="preserve">used to terminate the list of attributes
  13467. to collect</doc>
  13468. </member>
  13469. <member name="string" value="1" c:identifier="G_MARKUP_COLLECT_STRING">
  13470. <doc xml:space="preserve">collect the string pointer directly from
  13471. the attribute_values[] array. Expects a parameter of type (const
  13472. char **). If %G_MARKUP_COLLECT_OPTIONAL is specified and the
  13473. attribute isn't present then the pointer will be set to %NULL</doc>
  13474. </member>
  13475. <member name="strdup" value="2" c:identifier="G_MARKUP_COLLECT_STRDUP">
  13476. <doc xml:space="preserve">as with %G_MARKUP_COLLECT_STRING, but
  13477. expects a parameter of type (char **) and g_strdup()s the
  13478. returned pointer. The pointer must be freed with g_free()</doc>
  13479. </member>
  13480. <member name="boolean" value="3" c:identifier="G_MARKUP_COLLECT_BOOLEAN">
  13481. <doc xml:space="preserve">expects a parameter of type (gboolean *)
  13482. and parses the attribute value as a boolean. Sets %FALSE if the
  13483. attribute isn't present. Valid boolean values consist of
  13484. (case-insensitive) "false", "f", "no", "n", "0" and "true", "t",
  13485. "yes", "y", "1"</doc>
  13486. </member>
  13487. <member name="tristate"
  13488. value="4"
  13489. c:identifier="G_MARKUP_COLLECT_TRISTATE">
  13490. <doc xml:space="preserve">as with %G_MARKUP_COLLECT_BOOLEAN, but
  13491. in the case of a missing attribute a value is set that compares
  13492. equal to neither %FALSE nor %TRUE G_MARKUP_COLLECT_OPTIONAL is
  13493. implied</doc>
  13494. </member>
  13495. <member name="optional"
  13496. value="65536"
  13497. c:identifier="G_MARKUP_COLLECT_OPTIONAL">
  13498. <doc xml:space="preserve">can be bitwise ORed with the other fields.
  13499. If present, allows the attribute not to appear. A default value
  13500. is set depending on what value type is used</doc>
  13501. </member>
  13502. </bitfield>
  13503. <enumeration name="MarkupError"
  13504. c:type="GMarkupError"
  13505. glib:error-domain="g-markup-error-quark">
  13506. <doc xml:space="preserve">Error codes returned by markup parsing.</doc>
  13507. <member name="bad_utf8" value="0" c:identifier="G_MARKUP_ERROR_BAD_UTF8">
  13508. <doc xml:space="preserve">text being parsed was not valid UTF-8</doc>
  13509. </member>
  13510. <member name="empty" value="1" c:identifier="G_MARKUP_ERROR_EMPTY">
  13511. <doc xml:space="preserve">document contained nothing, or only whitespace</doc>
  13512. </member>
  13513. <member name="parse" value="2" c:identifier="G_MARKUP_ERROR_PARSE">
  13514. <doc xml:space="preserve">document was ill-formed</doc>
  13515. </member>
  13516. <member name="unknown_element"
  13517. value="3"
  13518. c:identifier="G_MARKUP_ERROR_UNKNOWN_ELEMENT">
  13519. <doc xml:space="preserve">error should be set by #GMarkupParser
  13520. functions; element wasn't known</doc>
  13521. </member>
  13522. <member name="unknown_attribute"
  13523. value="4"
  13524. c:identifier="G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE">
  13525. <doc xml:space="preserve">error should be set by #GMarkupParser
  13526. functions; attribute wasn't known</doc>
  13527. </member>
  13528. <member name="invalid_content"
  13529. value="5"
  13530. c:identifier="G_MARKUP_ERROR_INVALID_CONTENT">
  13531. <doc xml:space="preserve">error should be set by #GMarkupParser
  13532. functions; content was invalid</doc>
  13533. </member>
  13534. <member name="missing_attribute"
  13535. value="6"
  13536. c:identifier="G_MARKUP_ERROR_MISSING_ATTRIBUTE">
  13537. <doc xml:space="preserve">error should be set by #GMarkupParser
  13538. functions; a required attribute was missing</doc>
  13539. </member>
  13540. </enumeration>
  13541. <record name="MarkupParseContext"
  13542. c:type="GMarkupParseContext"
  13543. glib:type-name="GMarkupParseContext"
  13544. glib:get-type="g_markup_parse_context_get_type"
  13545. c:symbol-prefix="markup_parse_context">
  13546. <doc xml:space="preserve">A parse context is used to parse a stream of bytes that
  13547. you expect to contain marked-up text.
  13548. See g_markup_parse_context_new(), #GMarkupParser, and so
  13549. on for more details.</doc>
  13550. <constructor name="new" c:identifier="g_markup_parse_context_new">
  13551. <doc xml:space="preserve">Creates a new parse context. A parse context is used to parse
  13552. marked-up documents. You can feed any number of documents into
  13553. a context, as long as no errors occur; once an error occurs,
  13554. the parse context can't continue to parse text (you have to
  13555. free it and create a new parse context).</doc>
  13556. <return-value transfer-ownership="full">
  13557. <doc xml:space="preserve">a new #GMarkupParseContext</doc>
  13558. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13559. </return-value>
  13560. <parameters>
  13561. <parameter name="parser" transfer-ownership="none">
  13562. <doc xml:space="preserve">a #GMarkupParser</doc>
  13563. <type name="MarkupParser" c:type="const GMarkupParser*"/>
  13564. </parameter>
  13565. <parameter name="flags" transfer-ownership="none">
  13566. <doc xml:space="preserve">one or more #GMarkupParseFlags</doc>
  13567. <type name="MarkupParseFlags" c:type="GMarkupParseFlags"/>
  13568. </parameter>
  13569. <parameter name="user_data"
  13570. transfer-ownership="none"
  13571. nullable="1"
  13572. allow-none="1">
  13573. <doc xml:space="preserve">user data to pass to #GMarkupParser functions</doc>
  13574. <type name="gpointer" c:type="gpointer"/>
  13575. </parameter>
  13576. <parameter name="user_data_dnotify"
  13577. transfer-ownership="none"
  13578. scope="async">
  13579. <doc xml:space="preserve">user data destroy notifier called when
  13580. the parse context is freed</doc>
  13581. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  13582. </parameter>
  13583. </parameters>
  13584. </constructor>
  13585. <method name="end_parse"
  13586. c:identifier="g_markup_parse_context_end_parse"
  13587. throws="1">
  13588. <doc xml:space="preserve">Signals to the #GMarkupParseContext that all data has been
  13589. fed into the parse context with g_markup_parse_context_parse().
  13590. This function reports an error if the document isn't complete,
  13591. for example if elements are still open.</doc>
  13592. <return-value transfer-ownership="none">
  13593. <doc xml:space="preserve">%TRUE on success, %FALSE if an error was set</doc>
  13594. <type name="gboolean" c:type="gboolean"/>
  13595. </return-value>
  13596. <parameters>
  13597. <instance-parameter name="context" transfer-ownership="none">
  13598. <doc xml:space="preserve">a #GMarkupParseContext</doc>
  13599. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13600. </instance-parameter>
  13601. </parameters>
  13602. </method>
  13603. <method name="free" c:identifier="g_markup_parse_context_free">
  13604. <doc xml:space="preserve">Frees a #GMarkupParseContext.
  13605. This function can't be called from inside one of the
  13606. #GMarkupParser functions or while a subparser is pushed.</doc>
  13607. <return-value transfer-ownership="none">
  13608. <type name="none" c:type="void"/>
  13609. </return-value>
  13610. <parameters>
  13611. <instance-parameter name="context" transfer-ownership="none">
  13612. <doc xml:space="preserve">a #GMarkupParseContext</doc>
  13613. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13614. </instance-parameter>
  13615. </parameters>
  13616. </method>
  13617. <method name="get_element"
  13618. c:identifier="g_markup_parse_context_get_element"
  13619. version="2.2">
  13620. <doc xml:space="preserve">Retrieves the name of the currently open element.
  13621. If called from the start_element or end_element handlers this will
  13622. give the element_name as passed to those functions. For the parent
  13623. elements, see g_markup_parse_context_get_element_stack().</doc>
  13624. <return-value transfer-ownership="none">
  13625. <doc xml:space="preserve">the name of the currently open element, or %NULL</doc>
  13626. <type name="utf8" c:type="const gchar*"/>
  13627. </return-value>
  13628. <parameters>
  13629. <instance-parameter name="context" transfer-ownership="none">
  13630. <doc xml:space="preserve">a #GMarkupParseContext</doc>
  13631. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13632. </instance-parameter>
  13633. </parameters>
  13634. </method>
  13635. <method name="get_element_stack"
  13636. c:identifier="g_markup_parse_context_get_element_stack"
  13637. version="2.16"
  13638. introspectable="0">
  13639. <doc xml:space="preserve">Retrieves the element stack from the internal state of the parser.
  13640. The returned #GSList is a list of strings where the first item is
  13641. the currently open tag (as would be returned by
  13642. g_markup_parse_context_get_element()) and the next item is its
  13643. immediate parent.
  13644. This function is intended to be used in the start_element and
  13645. end_element handlers where g_markup_parse_context_get_element()
  13646. would merely return the name of the element that is being
  13647. processed.</doc>
  13648. <return-value transfer-ownership="none">
  13649. <doc xml:space="preserve">the element stack, which must not be modified</doc>
  13650. <type name="GLib.SList" c:type="const GSList*">
  13651. <type name="gpointer" c:type="gpointer"/>
  13652. </type>
  13653. </return-value>
  13654. <parameters>
  13655. <instance-parameter name="context" transfer-ownership="none">
  13656. <doc xml:space="preserve">a #GMarkupParseContext</doc>
  13657. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13658. </instance-parameter>
  13659. </parameters>
  13660. </method>
  13661. <method name="get_position"
  13662. c:identifier="g_markup_parse_context_get_position">
  13663. <doc xml:space="preserve">Retrieves the current line number and the number of the character on
  13664. that line. Intended for use in error messages; there are no strict
  13665. semantics for what constitutes the "current" line number other than
  13666. "the best number we could come up with for error messages."</doc>
  13667. <return-value transfer-ownership="none">
  13668. <type name="none" c:type="void"/>
  13669. </return-value>
  13670. <parameters>
  13671. <instance-parameter name="context" transfer-ownership="none">
  13672. <doc xml:space="preserve">a #GMarkupParseContext</doc>
  13673. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13674. </instance-parameter>
  13675. <parameter name="line_number"
  13676. transfer-ownership="none"
  13677. nullable="1"
  13678. allow-none="1">
  13679. <doc xml:space="preserve">return location for a line number, or %NULL</doc>
  13680. <type name="gint" c:type="gint*"/>
  13681. </parameter>
  13682. <parameter name="char_number"
  13683. transfer-ownership="none"
  13684. nullable="1"
  13685. allow-none="1">
  13686. <doc xml:space="preserve">return location for a char-on-line number, or %NULL</doc>
  13687. <type name="gint" c:type="gint*"/>
  13688. </parameter>
  13689. </parameters>
  13690. </method>
  13691. <method name="get_user_data"
  13692. c:identifier="g_markup_parse_context_get_user_data"
  13693. version="2.18">
  13694. <doc xml:space="preserve">Returns the user_data associated with @context.
  13695. This will either be the user_data that was provided to
  13696. g_markup_parse_context_new() or to the most recent call
  13697. of g_markup_parse_context_push().</doc>
  13698. <return-value transfer-ownership="none" nullable="1">
  13699. <doc xml:space="preserve">the provided user_data. The returned data belongs to
  13700. the markup context and will be freed when
  13701. g_markup_parse_context_free() is called.</doc>
  13702. <type name="gpointer" c:type="gpointer"/>
  13703. </return-value>
  13704. <parameters>
  13705. <instance-parameter name="context" transfer-ownership="none">
  13706. <doc xml:space="preserve">a #GMarkupParseContext</doc>
  13707. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13708. </instance-parameter>
  13709. </parameters>
  13710. </method>
  13711. <method name="parse"
  13712. c:identifier="g_markup_parse_context_parse"
  13713. throws="1">
  13714. <doc xml:space="preserve">Feed some data to the #GMarkupParseContext.
  13715. The data need not be valid UTF-8; an error will be signaled if
  13716. it's invalid. The data need not be an entire document; you can
  13717. feed a document into the parser incrementally, via multiple calls
  13718. to this function. Typically, as you receive data from a network
  13719. connection or file, you feed each received chunk of data into this
  13720. function, aborting the process if an error occurs. Once an error
  13721. is reported, no further data may be fed to the #GMarkupParseContext;
  13722. all errors are fatal.</doc>
  13723. <return-value transfer-ownership="none">
  13724. <doc xml:space="preserve">%FALSE if an error occurred, %TRUE on success</doc>
  13725. <type name="gboolean" c:type="gboolean"/>
  13726. </return-value>
  13727. <parameters>
  13728. <instance-parameter name="context" transfer-ownership="none">
  13729. <doc xml:space="preserve">a #GMarkupParseContext</doc>
  13730. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13731. </instance-parameter>
  13732. <parameter name="text" transfer-ownership="none">
  13733. <doc xml:space="preserve">chunk of text to parse</doc>
  13734. <type name="utf8" c:type="const gchar*"/>
  13735. </parameter>
  13736. <parameter name="text_len" transfer-ownership="none">
  13737. <doc xml:space="preserve">length of @text in bytes</doc>
  13738. <type name="gssize" c:type="gssize"/>
  13739. </parameter>
  13740. </parameters>
  13741. </method>
  13742. <method name="pop"
  13743. c:identifier="g_markup_parse_context_pop"
  13744. version="2.18">
  13745. <doc xml:space="preserve">Completes the process of a temporary sub-parser redirection.
  13746. This function exists to collect the user_data allocated by a
  13747. matching call to g_markup_parse_context_push(). It must be called
  13748. in the end_element handler corresponding to the start_element
  13749. handler during which g_markup_parse_context_push() was called.
  13750. You must not call this function from the error callback -- the
  13751. @user_data is provided directly to the callback in that case.
  13752. This function is not intended to be directly called by users
  13753. interested in invoking subparsers. Instead, it is intended to
  13754. be used by the subparsers themselves to implement a higher-level
  13755. interface.</doc>
  13756. <return-value transfer-ownership="none" nullable="1">
  13757. <doc xml:space="preserve">the user data passed to g_markup_parse_context_push()</doc>
  13758. <type name="gpointer" c:type="gpointer"/>
  13759. </return-value>
  13760. <parameters>
  13761. <instance-parameter name="context" transfer-ownership="none">
  13762. <doc xml:space="preserve">a #GMarkupParseContext</doc>
  13763. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13764. </instance-parameter>
  13765. </parameters>
  13766. </method>
  13767. <method name="push"
  13768. c:identifier="g_markup_parse_context_push"
  13769. version="2.18">
  13770. <doc xml:space="preserve">Temporarily redirects markup data to a sub-parser.
  13771. This function may only be called from the start_element handler of
  13772. a #GMarkupParser. It must be matched with a corresponding call to
  13773. g_markup_parse_context_pop() in the matching end_element handler
  13774. (except in the case that the parser aborts due to an error).
  13775. All tags, text and other data between the matching tags is
  13776. redirected to the subparser given by @parser. @user_data is used
  13777. as the user_data for that parser. @user_data is also passed to the
  13778. error callback in the event that an error occurs. This includes
  13779. errors that occur in subparsers of the subparser.
  13780. The end tag matching the start tag for which this call was made is
  13781. handled by the previous parser (which is given its own user_data)
  13782. which is why g_markup_parse_context_pop() is provided to allow "one
  13783. last access" to the @user_data provided to this function. In the
  13784. case of error, the @user_data provided here is passed directly to
  13785. the error callback of the subparser and g_markup_parse_context_pop()
  13786. should not be called. In either case, if @user_data was allocated
  13787. then it ought to be freed from both of these locations.
  13788. This function is not intended to be directly called by users
  13789. interested in invoking subparsers. Instead, it is intended to be
  13790. used by the subparsers themselves to implement a higher-level
  13791. interface.
  13792. As an example, see the following implementation of a simple
  13793. parser that counts the number of tags encountered.
  13794. |[&lt;!-- language="C" --&gt;
  13795. typedef struct
  13796. {
  13797. gint tag_count;
  13798. } CounterData;
  13799. static void
  13800. counter_start_element (GMarkupParseContext *context,
  13801. const gchar *element_name,
  13802. const gchar **attribute_names,
  13803. const gchar **attribute_values,
  13804. gpointer user_data,
  13805. GError **error)
  13806. {
  13807. CounterData *data = user_data;
  13808. data-&gt;tag_count++;
  13809. }
  13810. static void
  13811. counter_error (GMarkupParseContext *context,
  13812. GError *error,
  13813. gpointer user_data)
  13814. {
  13815. CounterData *data = user_data;
  13816. g_slice_free (CounterData, data);
  13817. }
  13818. static GMarkupParser counter_subparser =
  13819. {
  13820. counter_start_element,
  13821. NULL,
  13822. NULL,
  13823. NULL,
  13824. counter_error
  13825. };
  13826. ]|
  13827. In order to allow this parser to be easily used as a subparser, the
  13828. following interface is provided:
  13829. |[&lt;!-- language="C" --&gt;
  13830. void
  13831. start_counting (GMarkupParseContext *context)
  13832. {
  13833. CounterData *data = g_slice_new (CounterData);
  13834. data-&gt;tag_count = 0;
  13835. g_markup_parse_context_push (context, &amp;counter_subparser, data);
  13836. }
  13837. gint
  13838. end_counting (GMarkupParseContext *context)
  13839. {
  13840. CounterData *data = g_markup_parse_context_pop (context);
  13841. int result;
  13842. result = data-&gt;tag_count;
  13843. g_slice_free (CounterData, data);
  13844. return result;
  13845. }
  13846. ]|
  13847. The subparser would then be used as follows:
  13848. |[&lt;!-- language="C" --&gt;
  13849. static void start_element (context, element_name, ...)
  13850. {
  13851. if (strcmp (element_name, "count-these") == 0)
  13852. start_counting (context);
  13853. // else, handle other tags...
  13854. }
  13855. static void end_element (context, element_name, ...)
  13856. {
  13857. if (strcmp (element_name, "count-these") == 0)
  13858. g_print ("Counted %d tags\n", end_counting (context));
  13859. // else, handle other tags...
  13860. }
  13861. ]|</doc>
  13862. <return-value transfer-ownership="none">
  13863. <type name="none" c:type="void"/>
  13864. </return-value>
  13865. <parameters>
  13866. <instance-parameter name="context" transfer-ownership="none">
  13867. <doc xml:space="preserve">a #GMarkupParseContext</doc>
  13868. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13869. </instance-parameter>
  13870. <parameter name="parser" transfer-ownership="none">
  13871. <doc xml:space="preserve">a #GMarkupParser</doc>
  13872. <type name="MarkupParser" c:type="const GMarkupParser*"/>
  13873. </parameter>
  13874. <parameter name="user_data"
  13875. transfer-ownership="none"
  13876. nullable="1"
  13877. allow-none="1">
  13878. <doc xml:space="preserve">user data to pass to #GMarkupParser functions</doc>
  13879. <type name="gpointer" c:type="gpointer"/>
  13880. </parameter>
  13881. </parameters>
  13882. </method>
  13883. <method name="ref"
  13884. c:identifier="g_markup_parse_context_ref"
  13885. version="2.36">
  13886. <doc xml:space="preserve">Increases the reference count of @context.</doc>
  13887. <return-value transfer-ownership="full">
  13888. <doc xml:space="preserve">the same @context</doc>
  13889. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13890. </return-value>
  13891. <parameters>
  13892. <instance-parameter name="context" transfer-ownership="none">
  13893. <doc xml:space="preserve">a #GMarkupParseContext</doc>
  13894. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13895. </instance-parameter>
  13896. </parameters>
  13897. </method>
  13898. <method name="unref"
  13899. c:identifier="g_markup_parse_context_unref"
  13900. version="2.36">
  13901. <doc xml:space="preserve">Decreases the reference count of @context. When its reference count
  13902. drops to 0, it is freed.</doc>
  13903. <return-value transfer-ownership="none">
  13904. <type name="none" c:type="void"/>
  13905. </return-value>
  13906. <parameters>
  13907. <instance-parameter name="context" transfer-ownership="none">
  13908. <doc xml:space="preserve">a #GMarkupParseContext</doc>
  13909. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13910. </instance-parameter>
  13911. </parameters>
  13912. </method>
  13913. </record>
  13914. <bitfield name="MarkupParseFlags" c:type="GMarkupParseFlags">
  13915. <doc xml:space="preserve">Flags that affect the behaviour of the parser.</doc>
  13916. <member name="do_not_use_this_unsupported_flag"
  13917. value="1"
  13918. c:identifier="G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG">
  13919. <doc xml:space="preserve">flag you should not use</doc>
  13920. </member>
  13921. <member name="treat_cdata_as_text"
  13922. value="2"
  13923. c:identifier="G_MARKUP_TREAT_CDATA_AS_TEXT">
  13924. <doc xml:space="preserve">When this flag is set, CDATA marked
  13925. sections are not passed literally to the @passthrough function of
  13926. the parser. Instead, the content of the section (without the
  13927. `&lt;![CDATA[` and `]]&gt;`) is
  13928. passed to the @text function. This flag was added in GLib 2.12</doc>
  13929. </member>
  13930. <member name="prefix_error_position"
  13931. value="4"
  13932. c:identifier="G_MARKUP_PREFIX_ERROR_POSITION">
  13933. <doc xml:space="preserve">Normally errors caught by GMarkup
  13934. itself have line/column information prefixed to them to let the
  13935. caller know the location of the error. When this flag is set the
  13936. location information is also prefixed to errors generated by the
  13937. #GMarkupParser implementation functions</doc>
  13938. </member>
  13939. <member name="ignore_qualified"
  13940. value="8"
  13941. c:identifier="G_MARKUP_IGNORE_QUALIFIED">
  13942. <doc xml:space="preserve">Ignore (don't report) qualified
  13943. attributes and tags, along with their contents. A qualified
  13944. attribute or tag is one that contains ':' in its name (ie: is in
  13945. another namespace). Since: 2.40.</doc>
  13946. </member>
  13947. </bitfield>
  13948. <record name="MarkupParser" c:type="GMarkupParser">
  13949. <doc xml:space="preserve">Any of the fields in #GMarkupParser can be %NULL, in which case they
  13950. will be ignored. Except for the @error function, any of these callbacks
  13951. can set an error; in particular the %G_MARKUP_ERROR_UNKNOWN_ELEMENT,
  13952. %G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, and %G_MARKUP_ERROR_INVALID_CONTENT
  13953. errors are intended to be set from these callbacks. If you set an error
  13954. from a callback, g_markup_parse_context_parse() will report that error
  13955. back to its caller.</doc>
  13956. <field name="start_element">
  13957. <callback name="start_element" throws="1">
  13958. <return-value transfer-ownership="none">
  13959. <type name="none" c:type="void"/>
  13960. </return-value>
  13961. <parameters>
  13962. <parameter name="context" transfer-ownership="none">
  13963. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13964. </parameter>
  13965. <parameter name="element_name" transfer-ownership="none">
  13966. <type name="utf8" c:type="const gchar*"/>
  13967. </parameter>
  13968. <parameter name="attribute_names" transfer-ownership="none">
  13969. <type name="utf8" c:type="const gchar**"/>
  13970. </parameter>
  13971. <parameter name="attribute_values" transfer-ownership="none">
  13972. <type name="utf8" c:type="const gchar**"/>
  13973. </parameter>
  13974. <parameter name="user_data"
  13975. transfer-ownership="none"
  13976. nullable="1"
  13977. allow-none="1"
  13978. closure="4">
  13979. <type name="gpointer" c:type="gpointer"/>
  13980. </parameter>
  13981. </parameters>
  13982. </callback>
  13983. </field>
  13984. <field name="end_element">
  13985. <callback name="end_element" throws="1">
  13986. <return-value transfer-ownership="none">
  13987. <type name="none" c:type="void"/>
  13988. </return-value>
  13989. <parameters>
  13990. <parameter name="context" transfer-ownership="none">
  13991. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  13992. </parameter>
  13993. <parameter name="element_name" transfer-ownership="none">
  13994. <type name="utf8" c:type="const gchar*"/>
  13995. </parameter>
  13996. <parameter name="user_data"
  13997. transfer-ownership="none"
  13998. nullable="1"
  13999. allow-none="1"
  14000. closure="2">
  14001. <type name="gpointer" c:type="gpointer"/>
  14002. </parameter>
  14003. </parameters>
  14004. </callback>
  14005. </field>
  14006. <field name="text">
  14007. <callback name="text" throws="1">
  14008. <return-value transfer-ownership="none">
  14009. <type name="none" c:type="void"/>
  14010. </return-value>
  14011. <parameters>
  14012. <parameter name="context" transfer-ownership="none">
  14013. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  14014. </parameter>
  14015. <parameter name="text" transfer-ownership="none">
  14016. <type name="utf8" c:type="const gchar*"/>
  14017. </parameter>
  14018. <parameter name="text_len" transfer-ownership="none">
  14019. <type name="gsize" c:type="gsize"/>
  14020. </parameter>
  14021. <parameter name="user_data"
  14022. transfer-ownership="none"
  14023. nullable="1"
  14024. allow-none="1"
  14025. closure="3">
  14026. <type name="gpointer" c:type="gpointer"/>
  14027. </parameter>
  14028. </parameters>
  14029. </callback>
  14030. </field>
  14031. <field name="passthrough">
  14032. <callback name="passthrough" throws="1">
  14033. <return-value transfer-ownership="none">
  14034. <type name="none" c:type="void"/>
  14035. </return-value>
  14036. <parameters>
  14037. <parameter name="context" transfer-ownership="none">
  14038. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  14039. </parameter>
  14040. <parameter name="passthrough_text" transfer-ownership="none">
  14041. <type name="utf8" c:type="const gchar*"/>
  14042. </parameter>
  14043. <parameter name="text_len" transfer-ownership="none">
  14044. <type name="gsize" c:type="gsize"/>
  14045. </parameter>
  14046. <parameter name="user_data"
  14047. transfer-ownership="none"
  14048. nullable="1"
  14049. allow-none="1"
  14050. closure="3">
  14051. <type name="gpointer" c:type="gpointer"/>
  14052. </parameter>
  14053. </parameters>
  14054. </callback>
  14055. </field>
  14056. <field name="error">
  14057. <callback name="error">
  14058. <return-value transfer-ownership="none">
  14059. <type name="none" c:type="void"/>
  14060. </return-value>
  14061. <parameters>
  14062. <parameter name="context" transfer-ownership="none">
  14063. <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
  14064. </parameter>
  14065. <parameter name="error" transfer-ownership="none">
  14066. <type name="Error" c:type="GError*"/>
  14067. </parameter>
  14068. <parameter name="user_data"
  14069. transfer-ownership="none"
  14070. nullable="1"
  14071. allow-none="1"
  14072. closure="2">
  14073. <type name="gpointer" c:type="gpointer"/>
  14074. </parameter>
  14075. </parameters>
  14076. </callback>
  14077. </field>
  14078. </record>
  14079. <record name="MatchInfo"
  14080. c:type="GMatchInfo"
  14081. glib:type-name="GMatchInfo"
  14082. glib:get-type="g_match_info_get_type"
  14083. c:symbol-prefix="match_info">
  14084. <doc xml:space="preserve">A GMatchInfo is an opaque struct used to return information about
  14085. matches.</doc>
  14086. <method name="expand_references"
  14087. c:identifier="g_match_info_expand_references"
  14088. version="2.14"
  14089. throws="1">
  14090. <doc xml:space="preserve">Returns a new string containing the text in @string_to_expand with
  14091. references and escape sequences expanded. References refer to the last
  14092. match done with @string against @regex and have the same syntax used by
  14093. g_regex_replace().
  14094. The @string_to_expand must be UTF-8 encoded even if #G_REGEX_RAW was
  14095. passed to g_regex_new().
  14096. The backreferences are extracted from the string passed to the match
  14097. function, so you cannot call this function after freeing the string.
  14098. @match_info may be %NULL in which case @string_to_expand must not
  14099. contain references. For instance "foo\n" does not refer to an actual
  14100. pattern and '\n' merely will be replaced with \n character,
  14101. while to expand "\0" (whole match) one needs the result of a match.
  14102. Use g_regex_check_replacement() to find out whether @string_to_expand
  14103. contains references.</doc>
  14104. <return-value transfer-ownership="full" nullable="1">
  14105. <doc xml:space="preserve">the expanded string, or %NULL if an error occurred</doc>
  14106. <type name="utf8" c:type="gchar*"/>
  14107. </return-value>
  14108. <parameters>
  14109. <instance-parameter name="match_info"
  14110. transfer-ownership="none"
  14111. nullable="1"
  14112. allow-none="1">
  14113. <doc xml:space="preserve">a #GMatchInfo or %NULL</doc>
  14114. <type name="MatchInfo" c:type="const GMatchInfo*"/>
  14115. </instance-parameter>
  14116. <parameter name="string_to_expand" transfer-ownership="none">
  14117. <doc xml:space="preserve">the string to expand</doc>
  14118. <type name="utf8" c:type="const gchar*"/>
  14119. </parameter>
  14120. </parameters>
  14121. </method>
  14122. <method name="fetch" c:identifier="g_match_info_fetch" version="2.14">
  14123. <doc xml:space="preserve">Retrieves the text matching the @match_num'th capturing
  14124. parentheses. 0 is the full text of the match, 1 is the first paren
  14125. set, 2 the second, and so on.
  14126. If @match_num is a valid sub pattern but it didn't match anything
  14127. (e.g. sub pattern 1, matching "b" against "(a)?b") then an empty
  14128. string is returned.
  14129. If the match was obtained using the DFA algorithm, that is using
  14130. g_regex_match_all() or g_regex_match_all_full(), the retrieved
  14131. string is not that of a set of parentheses but that of a matched
  14132. substring. Substrings are matched in reverse order of length, so
  14133. 0 is the longest match.
  14134. The string is fetched from the string passed to the match function,
  14135. so you cannot call this function after freeing the string.</doc>
  14136. <return-value transfer-ownership="full" nullable="1">
  14137. <doc xml:space="preserve">The matched substring, or %NULL if an error
  14138. occurred. You have to free the string yourself</doc>
  14139. <type name="utf8" c:type="gchar*"/>
  14140. </return-value>
  14141. <parameters>
  14142. <instance-parameter name="match_info" transfer-ownership="none">
  14143. <doc xml:space="preserve">#GMatchInfo structure</doc>
  14144. <type name="MatchInfo" c:type="const GMatchInfo*"/>
  14145. </instance-parameter>
  14146. <parameter name="match_num" transfer-ownership="none">
  14147. <doc xml:space="preserve">number of the sub expression</doc>
  14148. <type name="gint" c:type="gint"/>
  14149. </parameter>
  14150. </parameters>
  14151. </method>
  14152. <method name="fetch_all"
  14153. c:identifier="g_match_info_fetch_all"
  14154. version="2.14">
  14155. <doc xml:space="preserve">Bundles up pointers to each of the matching substrings from a match
  14156. and stores them in an array of gchar pointers. The first element in
  14157. the returned array is the match number 0, i.e. the entire matched
  14158. text.
  14159. If a sub pattern didn't match anything (e.g. sub pattern 1, matching
  14160. "b" against "(a)?b") then an empty string is inserted.
  14161. If the last match was obtained using the DFA algorithm, that is using
  14162. g_regex_match_all() or g_regex_match_all_full(), the retrieved
  14163. strings are not that matched by sets of parentheses but that of the
  14164. matched substring. Substrings are matched in reverse order of length,
  14165. so the first one is the longest match.
  14166. The strings are fetched from the string passed to the match function,
  14167. so you cannot call this function after freeing the string.</doc>
  14168. <return-value transfer-ownership="full">
  14169. <doc xml:space="preserve">a %NULL-terminated array of gchar *
  14170. pointers. It must be freed using g_strfreev(). If the previous
  14171. match failed %NULL is returned</doc>
  14172. <array c:type="gchar**">
  14173. <type name="utf8"/>
  14174. </array>
  14175. </return-value>
  14176. <parameters>
  14177. <instance-parameter name="match_info" transfer-ownership="none">
  14178. <doc xml:space="preserve">a #GMatchInfo structure</doc>
  14179. <type name="MatchInfo" c:type="const GMatchInfo*"/>
  14180. </instance-parameter>
  14181. </parameters>
  14182. </method>
  14183. <method name="fetch_named"
  14184. c:identifier="g_match_info_fetch_named"
  14185. version="2.14">
  14186. <doc xml:space="preserve">Retrieves the text matching the capturing parentheses named @name.
  14187. If @name is a valid sub pattern name but it didn't match anything
  14188. (e.g. sub pattern "X", matching "b" against "(?P&lt;X&gt;a)?b")
  14189. then an empty string is returned.
  14190. The string is fetched from the string passed to the match function,
  14191. so you cannot call this function after freeing the string.</doc>
  14192. <return-value transfer-ownership="full" nullable="1">
  14193. <doc xml:space="preserve">The matched substring, or %NULL if an error
  14194. occurred. You have to free the string yourself</doc>
  14195. <type name="utf8" c:type="gchar*"/>
  14196. </return-value>
  14197. <parameters>
  14198. <instance-parameter name="match_info" transfer-ownership="none">
  14199. <doc xml:space="preserve">#GMatchInfo structure</doc>
  14200. <type name="MatchInfo" c:type="const GMatchInfo*"/>
  14201. </instance-parameter>
  14202. <parameter name="name" transfer-ownership="none">
  14203. <doc xml:space="preserve">name of the subexpression</doc>
  14204. <type name="utf8" c:type="const gchar*"/>
  14205. </parameter>
  14206. </parameters>
  14207. </method>
  14208. <method name="fetch_named_pos"
  14209. c:identifier="g_match_info_fetch_named_pos"
  14210. version="2.14">
  14211. <doc xml:space="preserve">Retrieves the position in bytes of the capturing parentheses named @name.
  14212. If @name is a valid sub pattern name but it didn't match anything
  14213. (e.g. sub pattern "X", matching "b" against "(?P&lt;X&gt;a)?b")
  14214. then @start_pos and @end_pos are set to -1 and %TRUE is returned.</doc>
  14215. <return-value transfer-ownership="none">
  14216. <doc xml:space="preserve">%TRUE if the position was fetched, %FALSE otherwise.
  14217. If the position cannot be fetched, @start_pos and @end_pos
  14218. are left unchanged.</doc>
  14219. <type name="gboolean" c:type="gboolean"/>
  14220. </return-value>
  14221. <parameters>
  14222. <instance-parameter name="match_info" transfer-ownership="none">
  14223. <doc xml:space="preserve">#GMatchInfo structure</doc>
  14224. <type name="MatchInfo" c:type="const GMatchInfo*"/>
  14225. </instance-parameter>
  14226. <parameter name="name" transfer-ownership="none">
  14227. <doc xml:space="preserve">name of the subexpression</doc>
  14228. <type name="utf8" c:type="const gchar*"/>
  14229. </parameter>
  14230. <parameter name="start_pos"
  14231. direction="out"
  14232. caller-allocates="0"
  14233. transfer-ownership="full"
  14234. optional="1"
  14235. allow-none="1">
  14236. <doc xml:space="preserve">pointer to location where to store
  14237. the start position, or %NULL</doc>
  14238. <type name="gint" c:type="gint*"/>
  14239. </parameter>
  14240. <parameter name="end_pos"
  14241. direction="out"
  14242. caller-allocates="0"
  14243. transfer-ownership="full"
  14244. optional="1"
  14245. allow-none="1">
  14246. <doc xml:space="preserve">pointer to location where to store
  14247. the end position, or %NULL</doc>
  14248. <type name="gint" c:type="gint*"/>
  14249. </parameter>
  14250. </parameters>
  14251. </method>
  14252. <method name="fetch_pos"
  14253. c:identifier="g_match_info_fetch_pos"
  14254. version="2.14">
  14255. <doc xml:space="preserve">Retrieves the position in bytes of the @match_num'th capturing
  14256. parentheses. 0 is the full text of the match, 1 is the first
  14257. paren set, 2 the second, and so on.
  14258. If @match_num is a valid sub pattern but it didn't match anything
  14259. (e.g. sub pattern 1, matching "b" against "(a)?b") then @start_pos
  14260. and @end_pos are set to -1 and %TRUE is returned.
  14261. If the match was obtained using the DFA algorithm, that is using
  14262. g_regex_match_all() or g_regex_match_all_full(), the retrieved
  14263. position is not that of a set of parentheses but that of a matched
  14264. substring. Substrings are matched in reverse order of length, so
  14265. 0 is the longest match.</doc>
  14266. <return-value transfer-ownership="none">
  14267. <doc xml:space="preserve">%TRUE if the position was fetched, %FALSE otherwise. If
  14268. the position cannot be fetched, @start_pos and @end_pos are left
  14269. unchanged</doc>
  14270. <type name="gboolean" c:type="gboolean"/>
  14271. </return-value>
  14272. <parameters>
  14273. <instance-parameter name="match_info" transfer-ownership="none">
  14274. <doc xml:space="preserve">#GMatchInfo structure</doc>
  14275. <type name="MatchInfo" c:type="const GMatchInfo*"/>
  14276. </instance-parameter>
  14277. <parameter name="match_num" transfer-ownership="none">
  14278. <doc xml:space="preserve">number of the sub expression</doc>
  14279. <type name="gint" c:type="gint"/>
  14280. </parameter>
  14281. <parameter name="start_pos"
  14282. direction="out"
  14283. caller-allocates="0"
  14284. transfer-ownership="full"
  14285. optional="1"
  14286. allow-none="1">
  14287. <doc xml:space="preserve">pointer to location where to store
  14288. the start position, or %NULL</doc>
  14289. <type name="gint" c:type="gint*"/>
  14290. </parameter>
  14291. <parameter name="end_pos"
  14292. direction="out"
  14293. caller-allocates="0"
  14294. transfer-ownership="full"
  14295. optional="1"
  14296. allow-none="1">
  14297. <doc xml:space="preserve">pointer to location where to store
  14298. the end position, or %NULL</doc>
  14299. <type name="gint" c:type="gint*"/>
  14300. </parameter>
  14301. </parameters>
  14302. </method>
  14303. <method name="free" c:identifier="g_match_info_free" version="2.14">
  14304. <doc xml:space="preserve">If @match_info is not %NULL, calls g_match_info_unref(); otherwise does
  14305. nothing.</doc>
  14306. <return-value transfer-ownership="none">
  14307. <type name="none" c:type="void"/>
  14308. </return-value>
  14309. <parameters>
  14310. <instance-parameter name="match_info"
  14311. transfer-ownership="none"
  14312. nullable="1"
  14313. allow-none="1">
  14314. <doc xml:space="preserve">a #GMatchInfo, or %NULL</doc>
  14315. <type name="MatchInfo" c:type="GMatchInfo*"/>
  14316. </instance-parameter>
  14317. </parameters>
  14318. </method>
  14319. <method name="get_match_count"
  14320. c:identifier="g_match_info_get_match_count"
  14321. version="2.14">
  14322. <doc xml:space="preserve">Retrieves the number of matched substrings (including substring 0,
  14323. that is the whole matched text), so 1 is returned if the pattern
  14324. has no substrings in it and 0 is returned if the match failed.
  14325. If the last match was obtained using the DFA algorithm, that is
  14326. using g_regex_match_all() or g_regex_match_all_full(), the retrieved
  14327. count is not that of the number of capturing parentheses but that of
  14328. the number of matched substrings.</doc>
  14329. <return-value transfer-ownership="none">
  14330. <doc xml:space="preserve">Number of matched substrings, or -1 if an error occurred</doc>
  14331. <type name="gint" c:type="gint"/>
  14332. </return-value>
  14333. <parameters>
  14334. <instance-parameter name="match_info" transfer-ownership="none">
  14335. <doc xml:space="preserve">a #GMatchInfo structure</doc>
  14336. <type name="MatchInfo" c:type="const GMatchInfo*"/>
  14337. </instance-parameter>
  14338. </parameters>
  14339. </method>
  14340. <method name="get_regex"
  14341. c:identifier="g_match_info_get_regex"
  14342. version="2.14">
  14343. <doc xml:space="preserve">Returns #GRegex object used in @match_info. It belongs to Glib
  14344. and must not be freed. Use g_regex_ref() if you need to keep it
  14345. after you free @match_info object.</doc>
  14346. <return-value transfer-ownership="full">
  14347. <doc xml:space="preserve">#GRegex object used in @match_info</doc>
  14348. <type name="Regex" c:type="GRegex*"/>
  14349. </return-value>
  14350. <parameters>
  14351. <instance-parameter name="match_info" transfer-ownership="none">
  14352. <doc xml:space="preserve">a #GMatchInfo</doc>
  14353. <type name="MatchInfo" c:type="const GMatchInfo*"/>
  14354. </instance-parameter>
  14355. </parameters>
  14356. </method>
  14357. <method name="get_string"
  14358. c:identifier="g_match_info_get_string"
  14359. version="2.14">
  14360. <doc xml:space="preserve">Returns the string searched with @match_info. This is the
  14361. string passed to g_regex_match() or g_regex_replace() so
  14362. you may not free it before calling this function.</doc>
  14363. <return-value transfer-ownership="none">
  14364. <doc xml:space="preserve">the string searched with @match_info</doc>
  14365. <type name="utf8" c:type="const gchar*"/>
  14366. </return-value>
  14367. <parameters>
  14368. <instance-parameter name="match_info" transfer-ownership="none">
  14369. <doc xml:space="preserve">a #GMatchInfo</doc>
  14370. <type name="MatchInfo" c:type="const GMatchInfo*"/>
  14371. </instance-parameter>
  14372. </parameters>
  14373. </method>
  14374. <method name="is_partial_match"
  14375. c:identifier="g_match_info_is_partial_match"
  14376. version="2.14">
  14377. <doc xml:space="preserve">Usually if the string passed to g_regex_match*() matches as far as
  14378. it goes, but is too short to match the entire pattern, %FALSE is
  14379. returned. There are circumstances where it might be helpful to
  14380. distinguish this case from other cases in which there is no match.
  14381. Consider, for example, an application where a human is required to
  14382. type in data for a field with specific formatting requirements. An
  14383. example might be a date in the form ddmmmyy, defined by the pattern
  14384. "^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$".
  14385. If the application sees the user’s keystrokes one by one, and can
  14386. check that what has been typed so far is potentially valid, it is
  14387. able to raise an error as soon as a mistake is made.
  14388. GRegex supports the concept of partial matching by means of the
  14389. #G_REGEX_MATCH_PARTIAL_SOFT and #G_REGEX_MATCH_PARTIAL_HARD flags.
  14390. When they are used, the return code for
  14391. g_regex_match() or g_regex_match_full() is, as usual, %TRUE
  14392. for a complete match, %FALSE otherwise. But, when these functions
  14393. return %FALSE, you can check if the match was partial calling
  14394. g_match_info_is_partial_match().
  14395. The difference between #G_REGEX_MATCH_PARTIAL_SOFT and
  14396. #G_REGEX_MATCH_PARTIAL_HARD is that when a partial match is encountered
  14397. with #G_REGEX_MATCH_PARTIAL_SOFT, matching continues to search for a
  14398. possible complete match, while with #G_REGEX_MATCH_PARTIAL_HARD matching
  14399. stops at the partial match.
  14400. When both #G_REGEX_MATCH_PARTIAL_SOFT and #G_REGEX_MATCH_PARTIAL_HARD
  14401. are set, the latter takes precedence.
  14402. There were formerly some restrictions on the pattern for partial matching.
  14403. The restrictions no longer apply.
  14404. See pcrepartial(3) for more information on partial matching.</doc>
  14405. <return-value transfer-ownership="none">
  14406. <doc xml:space="preserve">%TRUE if the match was partial, %FALSE otherwise</doc>
  14407. <type name="gboolean" c:type="gboolean"/>
  14408. </return-value>
  14409. <parameters>
  14410. <instance-parameter name="match_info" transfer-ownership="none">
  14411. <doc xml:space="preserve">a #GMatchInfo structure</doc>
  14412. <type name="MatchInfo" c:type="const GMatchInfo*"/>
  14413. </instance-parameter>
  14414. </parameters>
  14415. </method>
  14416. <method name="matches"
  14417. c:identifier="g_match_info_matches"
  14418. version="2.14">
  14419. <doc xml:space="preserve">Returns whether the previous match operation succeeded.</doc>
  14420. <return-value transfer-ownership="none">
  14421. <doc xml:space="preserve">%TRUE if the previous match operation succeeded,
  14422. %FALSE otherwise</doc>
  14423. <type name="gboolean" c:type="gboolean"/>
  14424. </return-value>
  14425. <parameters>
  14426. <instance-parameter name="match_info" transfer-ownership="none">
  14427. <doc xml:space="preserve">a #GMatchInfo structure</doc>
  14428. <type name="MatchInfo" c:type="const GMatchInfo*"/>
  14429. </instance-parameter>
  14430. </parameters>
  14431. </method>
  14432. <method name="next"
  14433. c:identifier="g_match_info_next"
  14434. version="2.14"
  14435. throws="1">
  14436. <doc xml:space="preserve">Scans for the next match using the same parameters of the previous
  14437. call to g_regex_match_full() or g_regex_match() that returned
  14438. @match_info.
  14439. The match is done on the string passed to the match function, so you
  14440. cannot free it before calling this function.</doc>
  14441. <return-value transfer-ownership="none">
  14442. <doc xml:space="preserve">%TRUE is the string matched, %FALSE otherwise</doc>
  14443. <type name="gboolean" c:type="gboolean"/>
  14444. </return-value>
  14445. <parameters>
  14446. <instance-parameter name="match_info" transfer-ownership="none">
  14447. <doc xml:space="preserve">a #GMatchInfo structure</doc>
  14448. <type name="MatchInfo" c:type="GMatchInfo*"/>
  14449. </instance-parameter>
  14450. </parameters>
  14451. </method>
  14452. <method name="ref" c:identifier="g_match_info_ref" version="2.30">
  14453. <doc xml:space="preserve">Increases reference count of @match_info by 1.</doc>
  14454. <return-value transfer-ownership="full">
  14455. <doc xml:space="preserve">@match_info</doc>
  14456. <type name="MatchInfo" c:type="GMatchInfo*"/>
  14457. </return-value>
  14458. <parameters>
  14459. <instance-parameter name="match_info" transfer-ownership="none">
  14460. <doc xml:space="preserve">a #GMatchInfo</doc>
  14461. <type name="MatchInfo" c:type="GMatchInfo*"/>
  14462. </instance-parameter>
  14463. </parameters>
  14464. </method>
  14465. <method name="unref" c:identifier="g_match_info_unref" version="2.30">
  14466. <doc xml:space="preserve">Decreases reference count of @match_info by 1. When reference count drops
  14467. to zero, it frees all the memory associated with the match_info structure.</doc>
  14468. <return-value transfer-ownership="none">
  14469. <type name="none" c:type="void"/>
  14470. </return-value>
  14471. <parameters>
  14472. <instance-parameter name="match_info" transfer-ownership="none">
  14473. <doc xml:space="preserve">a #GMatchInfo</doc>
  14474. <type name="MatchInfo" c:type="GMatchInfo*"/>
  14475. </instance-parameter>
  14476. </parameters>
  14477. </method>
  14478. </record>
  14479. <record name="MemVTable" c:type="GMemVTable">
  14480. <doc xml:space="preserve">A set of functions used to perform memory allocation. The same #GMemVTable must
  14481. be used for all allocations in the same program; a call to g_mem_set_vtable(),
  14482. if it exists, should be prior to any use of GLib.
  14483. This functions related to this has been deprecated in 2.46, and no longer work.</doc>
  14484. <field name="malloc">
  14485. <callback name="malloc">
  14486. <return-value transfer-ownership="none">
  14487. <type name="gpointer" c:type="gpointer"/>
  14488. </return-value>
  14489. <parameters>
  14490. <parameter name="n_bytes" transfer-ownership="none">
  14491. <type name="gsize" c:type="gsize"/>
  14492. </parameter>
  14493. </parameters>
  14494. </callback>
  14495. </field>
  14496. <field name="realloc">
  14497. <callback name="realloc">
  14498. <return-value transfer-ownership="none">
  14499. <type name="gpointer" c:type="gpointer"/>
  14500. </return-value>
  14501. <parameters>
  14502. <parameter name="mem" transfer-ownership="none">
  14503. <type name="gpointer" c:type="gpointer"/>
  14504. </parameter>
  14505. <parameter name="n_bytes" transfer-ownership="none">
  14506. <type name="gsize" c:type="gsize"/>
  14507. </parameter>
  14508. </parameters>
  14509. </callback>
  14510. </field>
  14511. <field name="free">
  14512. <callback name="free">
  14513. <return-value transfer-ownership="none">
  14514. <type name="none" c:type="void"/>
  14515. </return-value>
  14516. <parameters>
  14517. <parameter name="mem" transfer-ownership="none">
  14518. <type name="gpointer" c:type="gpointer"/>
  14519. </parameter>
  14520. </parameters>
  14521. </callback>
  14522. </field>
  14523. <field name="calloc">
  14524. <callback name="calloc">
  14525. <return-value transfer-ownership="none">
  14526. <type name="gpointer" c:type="gpointer"/>
  14527. </return-value>
  14528. <parameters>
  14529. <parameter name="n_blocks" transfer-ownership="none">
  14530. <type name="gsize" c:type="gsize"/>
  14531. </parameter>
  14532. <parameter name="n_block_bytes" transfer-ownership="none">
  14533. <type name="gsize" c:type="gsize"/>
  14534. </parameter>
  14535. </parameters>
  14536. </callback>
  14537. </field>
  14538. <field name="try_malloc">
  14539. <callback name="try_malloc">
  14540. <return-value transfer-ownership="none">
  14541. <type name="gpointer" c:type="gpointer"/>
  14542. </return-value>
  14543. <parameters>
  14544. <parameter name="n_bytes" transfer-ownership="none">
  14545. <type name="gsize" c:type="gsize"/>
  14546. </parameter>
  14547. </parameters>
  14548. </callback>
  14549. </field>
  14550. <field name="try_realloc">
  14551. <callback name="try_realloc">
  14552. <return-value transfer-ownership="none">
  14553. <type name="gpointer" c:type="gpointer"/>
  14554. </return-value>
  14555. <parameters>
  14556. <parameter name="mem" transfer-ownership="none">
  14557. <type name="gpointer" c:type="gpointer"/>
  14558. </parameter>
  14559. <parameter name="n_bytes" transfer-ownership="none">
  14560. <type name="gsize" c:type="gsize"/>
  14561. </parameter>
  14562. </parameters>
  14563. </callback>
  14564. </field>
  14565. </record>
  14566. <union name="Mutex" c:type="GMutex">
  14567. <doc xml:space="preserve">The #GMutex struct is an opaque data structure to represent a mutex
  14568. (mutual exclusion). It can be used to protect data against shared
  14569. access.
  14570. Take for example the following function:
  14571. |[&lt;!-- language="C" --&gt;
  14572. int
  14573. give_me_next_number (void)
  14574. {
  14575. static int current_number = 0;
  14576. // now do a very complicated calculation to calculate the new
  14577. // number, this might for example be a random number generator
  14578. current_number = calc_next_number (current_number);
  14579. return current_number;
  14580. }
  14581. ]|
  14582. It is easy to see that this won't work in a multi-threaded
  14583. application. There current_number must be protected against shared
  14584. access. A #GMutex can be used as a solution to this problem:
  14585. |[&lt;!-- language="C" --&gt;
  14586. int
  14587. give_me_next_number (void)
  14588. {
  14589. static GMutex mutex;
  14590. static int current_number = 0;
  14591. int ret_val;
  14592. g_mutex_lock (&amp;mutex);
  14593. ret_val = current_number = calc_next_number (current_number);
  14594. g_mutex_unlock (&amp;mutex);
  14595. return ret_val;
  14596. }
  14597. ]|
  14598. Notice that the #GMutex is not initialised to any particular value.
  14599. Its placement in static storage ensures that it will be initialised
  14600. to all-zeros, which is appropriate.
  14601. If a #GMutex is placed in other contexts (eg: embedded in a struct)
  14602. then it must be explicitly initialised using g_mutex_init().
  14603. A #GMutex should only be accessed via g_mutex_ functions.</doc>
  14604. <field name="p" readable="0" private="1">
  14605. <type name="gpointer" c:type="gpointer"/>
  14606. </field>
  14607. <field name="i" readable="0" private="1">
  14608. <array zero-terminated="0" c:type="guint" fixed-size="2">
  14609. <type name="guint" c:type="guint"/>
  14610. </array>
  14611. </field>
  14612. <method name="clear" c:identifier="g_mutex_clear">
  14613. <doc xml:space="preserve">Frees the resources allocated to a mutex with g_mutex_init().
  14614. This function should not be used with a #GMutex that has been
  14615. statically allocated.
  14616. Calling g_mutex_clear() on a locked mutex leads to undefined
  14617. behaviour.
  14618. Sine: 2.32</doc>
  14619. <return-value transfer-ownership="none">
  14620. <type name="none" c:type="void"/>
  14621. </return-value>
  14622. <parameters>
  14623. <instance-parameter name="mutex" transfer-ownership="none">
  14624. <doc xml:space="preserve">an initialized #GMutex</doc>
  14625. <type name="Mutex" c:type="GMutex*"/>
  14626. </instance-parameter>
  14627. </parameters>
  14628. </method>
  14629. <method name="init" c:identifier="g_mutex_init" version="2.32">
  14630. <doc xml:space="preserve">Initializes a #GMutex so that it can be used.
  14631. This function is useful to initialize a mutex that has been
  14632. allocated on the stack, or as part of a larger structure.
  14633. It is not necessary to initialize a mutex that has been
  14634. statically allocated.
  14635. |[&lt;!-- language="C" --&gt;
  14636. typedef struct {
  14637. GMutex m;
  14638. ...
  14639. } Blob;
  14640. Blob *b;
  14641. b = g_new (Blob, 1);
  14642. g_mutex_init (&amp;b-&gt;m);
  14643. ]|
  14644. To undo the effect of g_mutex_init() when a mutex is no longer
  14645. needed, use g_mutex_clear().
  14646. Calling g_mutex_init() on an already initialized #GMutex leads
  14647. to undefined behaviour.</doc>
  14648. <return-value transfer-ownership="none">
  14649. <type name="none" c:type="void"/>
  14650. </return-value>
  14651. <parameters>
  14652. <instance-parameter name="mutex" transfer-ownership="none">
  14653. <doc xml:space="preserve">an uninitialized #GMutex</doc>
  14654. <type name="Mutex" c:type="GMutex*"/>
  14655. </instance-parameter>
  14656. </parameters>
  14657. </method>
  14658. <method name="lock" c:identifier="g_mutex_lock">
  14659. <doc xml:space="preserve">Locks @mutex. If @mutex is already locked by another thread, the
  14660. current thread will block until @mutex is unlocked by the other
  14661. thread.
  14662. #GMutex is neither guaranteed to be recursive nor to be
  14663. non-recursive. As such, calling g_mutex_lock() on a #GMutex that has
  14664. already been locked by the same thread results in undefined behaviour
  14665. (including but not limited to deadlocks).</doc>
  14666. <return-value transfer-ownership="none">
  14667. <type name="none" c:type="void"/>
  14668. </return-value>
  14669. <parameters>
  14670. <instance-parameter name="mutex" transfer-ownership="none">
  14671. <doc xml:space="preserve">a #GMutex</doc>
  14672. <type name="Mutex" c:type="GMutex*"/>
  14673. </instance-parameter>
  14674. </parameters>
  14675. </method>
  14676. <method name="trylock" c:identifier="g_mutex_trylock">
  14677. <doc xml:space="preserve">Tries to lock @mutex. If @mutex is already locked by another thread,
  14678. it immediately returns %FALSE. Otherwise it locks @mutex and returns
  14679. %TRUE.
  14680. #GMutex is neither guaranteed to be recursive nor to be
  14681. non-recursive. As such, calling g_mutex_lock() on a #GMutex that has
  14682. already been locked by the same thread results in undefined behaviour
  14683. (including but not limited to deadlocks or arbitrary return values).</doc>
  14684. <return-value transfer-ownership="none">
  14685. <doc xml:space="preserve">%TRUE if @mutex could be locked</doc>
  14686. <type name="gboolean" c:type="gboolean"/>
  14687. </return-value>
  14688. <parameters>
  14689. <instance-parameter name="mutex" transfer-ownership="none">
  14690. <doc xml:space="preserve">a #GMutex</doc>
  14691. <type name="Mutex" c:type="GMutex*"/>
  14692. </instance-parameter>
  14693. </parameters>
  14694. </method>
  14695. <method name="unlock" c:identifier="g_mutex_unlock">
  14696. <doc xml:space="preserve">Unlocks @mutex. If another thread is blocked in a g_mutex_lock()
  14697. call for @mutex, it will become unblocked and can lock @mutex itself.
  14698. Calling g_mutex_unlock() on a mutex that is not locked by the
  14699. current thread leads to undefined behaviour.</doc>
  14700. <return-value transfer-ownership="none">
  14701. <type name="none" c:type="void"/>
  14702. </return-value>
  14703. <parameters>
  14704. <instance-parameter name="mutex" transfer-ownership="none">
  14705. <doc xml:space="preserve">a #GMutex</doc>
  14706. <type name="Mutex" c:type="GMutex*"/>
  14707. </instance-parameter>
  14708. </parameters>
  14709. </method>
  14710. </union>
  14711. <record name="Node" c:type="GNode">
  14712. <doc xml:space="preserve">The #GNode struct represents one node in a [n-ary tree][glib-N-ary-Trees].</doc>
  14713. <field name="data" writable="1">
  14714. <doc xml:space="preserve">contains the actual data of the node.</doc>
  14715. <type name="gpointer" c:type="gpointer"/>
  14716. </field>
  14717. <field name="next" writable="1">
  14718. <doc xml:space="preserve">points to the node's next sibling (a sibling is another
  14719. #GNode with the same parent).</doc>
  14720. <type name="Node" c:type="GNode*"/>
  14721. </field>
  14722. <field name="prev" writable="1">
  14723. <doc xml:space="preserve">points to the node's previous sibling.</doc>
  14724. <type name="Node" c:type="GNode*"/>
  14725. </field>
  14726. <field name="parent" writable="1">
  14727. <doc xml:space="preserve">points to the parent of the #GNode, or is %NULL if the
  14728. #GNode is the root of the tree.</doc>
  14729. <type name="Node" c:type="GNode*"/>
  14730. </field>
  14731. <field name="children" writable="1">
  14732. <doc xml:space="preserve">points to the first child of the #GNode. The other
  14733. children are accessed by using the @next pointer of each
  14734. child.</doc>
  14735. <type name="Node" c:type="GNode*"/>
  14736. </field>
  14737. <method name="child_index" c:identifier="g_node_child_index">
  14738. <doc xml:space="preserve">Gets the position of the first child of a #GNode
  14739. which contains the given data.</doc>
  14740. <return-value transfer-ownership="none">
  14741. <doc xml:space="preserve">the index of the child of @node which contains
  14742. @data, or -1 if the data is not found</doc>
  14743. <type name="gint" c:type="gint"/>
  14744. </return-value>
  14745. <parameters>
  14746. <instance-parameter name="node" transfer-ownership="none">
  14747. <doc xml:space="preserve">a #GNode</doc>
  14748. <type name="Node" c:type="GNode*"/>
  14749. </instance-parameter>
  14750. <parameter name="data"
  14751. transfer-ownership="none"
  14752. nullable="1"
  14753. allow-none="1">
  14754. <doc xml:space="preserve">the data to find</doc>
  14755. <type name="gpointer" c:type="gpointer"/>
  14756. </parameter>
  14757. </parameters>
  14758. </method>
  14759. <method name="child_position" c:identifier="g_node_child_position">
  14760. <doc xml:space="preserve">Gets the position of a #GNode with respect to its siblings.
  14761. @child must be a child of @node. The first child is numbered 0,
  14762. the second 1, and so on.</doc>
  14763. <return-value transfer-ownership="none">
  14764. <doc xml:space="preserve">the position of @child with respect to its siblings</doc>
  14765. <type name="gint" c:type="gint"/>
  14766. </return-value>
  14767. <parameters>
  14768. <instance-parameter name="node" transfer-ownership="none">
  14769. <doc xml:space="preserve">a #GNode</doc>
  14770. <type name="Node" c:type="GNode*"/>
  14771. </instance-parameter>
  14772. <parameter name="child" transfer-ownership="none">
  14773. <doc xml:space="preserve">a child of @node</doc>
  14774. <type name="Node" c:type="GNode*"/>
  14775. </parameter>
  14776. </parameters>
  14777. </method>
  14778. <method name="children_foreach"
  14779. c:identifier="g_node_children_foreach"
  14780. introspectable="0">
  14781. <doc xml:space="preserve">Calls a function for each of the children of a #GNode.
  14782. Note that it doesn't descend beneath the child nodes.</doc>
  14783. <return-value transfer-ownership="none">
  14784. <type name="none" c:type="void"/>
  14785. </return-value>
  14786. <parameters>
  14787. <instance-parameter name="node" transfer-ownership="none">
  14788. <doc xml:space="preserve">a #GNode</doc>
  14789. <type name="Node" c:type="GNode*"/>
  14790. </instance-parameter>
  14791. <parameter name="flags" transfer-ownership="none">
  14792. <doc xml:space="preserve">which types of children are to be visited, one of
  14793. %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES</doc>
  14794. <type name="TraverseFlags" c:type="GTraverseFlags"/>
  14795. </parameter>
  14796. <parameter name="func" transfer-ownership="none" closure="2">
  14797. <doc xml:space="preserve">the function to call for each visited node</doc>
  14798. <type name="NodeForeachFunc" c:type="GNodeForeachFunc"/>
  14799. </parameter>
  14800. <parameter name="data"
  14801. transfer-ownership="none"
  14802. nullable="1"
  14803. allow-none="1">
  14804. <doc xml:space="preserve">user data to pass to the function</doc>
  14805. <type name="gpointer" c:type="gpointer"/>
  14806. </parameter>
  14807. </parameters>
  14808. </method>
  14809. <method name="copy" c:identifier="g_node_copy" introspectable="0">
  14810. <doc xml:space="preserve">Recursively copies a #GNode (but does not deep-copy the data inside the
  14811. nodes, see g_node_copy_deep() if you need that).</doc>
  14812. <return-value>
  14813. <doc xml:space="preserve">a new #GNode containing the same data pointers</doc>
  14814. <type name="Node" c:type="GNode*"/>
  14815. </return-value>
  14816. <parameters>
  14817. <instance-parameter name="node" transfer-ownership="none">
  14818. <doc xml:space="preserve">a #GNode</doc>
  14819. <type name="Node" c:type="GNode*"/>
  14820. </instance-parameter>
  14821. </parameters>
  14822. </method>
  14823. <method name="copy_deep"
  14824. c:identifier="g_node_copy_deep"
  14825. version="2.4"
  14826. introspectable="0">
  14827. <doc xml:space="preserve">Recursively copies a #GNode and its data.</doc>
  14828. <return-value>
  14829. <doc xml:space="preserve">a new #GNode containing copies of the data in @node.</doc>
  14830. <type name="Node" c:type="GNode*"/>
  14831. </return-value>
  14832. <parameters>
  14833. <instance-parameter name="node" transfer-ownership="none">
  14834. <doc xml:space="preserve">a #GNode</doc>
  14835. <type name="Node" c:type="GNode*"/>
  14836. </instance-parameter>
  14837. <parameter name="copy_func" transfer-ownership="none" closure="1">
  14838. <doc xml:space="preserve">the function which is called to copy the data inside each node,
  14839. or %NULL to use the original data.</doc>
  14840. <type name="CopyFunc" c:type="GCopyFunc"/>
  14841. </parameter>
  14842. <parameter name="data"
  14843. transfer-ownership="none"
  14844. nullable="1"
  14845. allow-none="1">
  14846. <doc xml:space="preserve">data to pass to @copy_func</doc>
  14847. <type name="gpointer" c:type="gpointer"/>
  14848. </parameter>
  14849. </parameters>
  14850. </method>
  14851. <method name="depth" c:identifier="g_node_depth">
  14852. <doc xml:space="preserve">Gets the depth of a #GNode.
  14853. If @node is %NULL the depth is 0. The root node has a depth of 1.
  14854. For the children of the root node the depth is 2. And so on.</doc>
  14855. <return-value transfer-ownership="none">
  14856. <doc xml:space="preserve">the depth of the #GNode</doc>
  14857. <type name="guint" c:type="guint"/>
  14858. </return-value>
  14859. <parameters>
  14860. <instance-parameter name="node" transfer-ownership="none">
  14861. <doc xml:space="preserve">a #GNode</doc>
  14862. <type name="Node" c:type="GNode*"/>
  14863. </instance-parameter>
  14864. </parameters>
  14865. </method>
  14866. <method name="destroy" c:identifier="g_node_destroy">
  14867. <doc xml:space="preserve">Removes @root and its children from the tree, freeing any memory
  14868. allocated.</doc>
  14869. <return-value transfer-ownership="none">
  14870. <type name="none" c:type="void"/>
  14871. </return-value>
  14872. <parameters>
  14873. <instance-parameter name="root" transfer-ownership="none">
  14874. <doc xml:space="preserve">the root of the tree/subtree to destroy</doc>
  14875. <type name="Node" c:type="GNode*"/>
  14876. </instance-parameter>
  14877. </parameters>
  14878. </method>
  14879. <method name="find" c:identifier="g_node_find" introspectable="0">
  14880. <doc xml:space="preserve">Finds a #GNode in a tree.</doc>
  14881. <return-value>
  14882. <doc xml:space="preserve">the found #GNode, or %NULL if the data is not found</doc>
  14883. <type name="Node" c:type="GNode*"/>
  14884. </return-value>
  14885. <parameters>
  14886. <instance-parameter name="root" transfer-ownership="none">
  14887. <doc xml:space="preserve">the root #GNode of the tree to search</doc>
  14888. <type name="Node" c:type="GNode*"/>
  14889. </instance-parameter>
  14890. <parameter name="order" transfer-ownership="none">
  14891. <doc xml:space="preserve">the order in which nodes are visited - %G_IN_ORDER,
  14892. %G_PRE_ORDER, %G_POST_ORDER, or %G_LEVEL_ORDER</doc>
  14893. <type name="TraverseType" c:type="GTraverseType"/>
  14894. </parameter>
  14895. <parameter name="flags" transfer-ownership="none">
  14896. <doc xml:space="preserve">which types of children are to be searched, one of
  14897. %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES</doc>
  14898. <type name="TraverseFlags" c:type="GTraverseFlags"/>
  14899. </parameter>
  14900. <parameter name="data"
  14901. transfer-ownership="none"
  14902. nullable="1"
  14903. allow-none="1">
  14904. <doc xml:space="preserve">the data to find</doc>
  14905. <type name="gpointer" c:type="gpointer"/>
  14906. </parameter>
  14907. </parameters>
  14908. </method>
  14909. <method name="find_child"
  14910. c:identifier="g_node_find_child"
  14911. introspectable="0">
  14912. <doc xml:space="preserve">Finds the first child of a #GNode with the given data.</doc>
  14913. <return-value>
  14914. <doc xml:space="preserve">the found child #GNode, or %NULL if the data is not found</doc>
  14915. <type name="Node" c:type="GNode*"/>
  14916. </return-value>
  14917. <parameters>
  14918. <instance-parameter name="node" transfer-ownership="none">
  14919. <doc xml:space="preserve">a #GNode</doc>
  14920. <type name="Node" c:type="GNode*"/>
  14921. </instance-parameter>
  14922. <parameter name="flags" transfer-ownership="none">
  14923. <doc xml:space="preserve">which types of children are to be searched, one of
  14924. %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES</doc>
  14925. <type name="TraverseFlags" c:type="GTraverseFlags"/>
  14926. </parameter>
  14927. <parameter name="data"
  14928. transfer-ownership="none"
  14929. nullable="1"
  14930. allow-none="1">
  14931. <doc xml:space="preserve">the data to find</doc>
  14932. <type name="gpointer" c:type="gpointer"/>
  14933. </parameter>
  14934. </parameters>
  14935. </method>
  14936. <method name="first_sibling"
  14937. c:identifier="g_node_first_sibling"
  14938. introspectable="0">
  14939. <doc xml:space="preserve">Gets the first sibling of a #GNode.
  14940. This could possibly be the node itself.</doc>
  14941. <return-value>
  14942. <doc xml:space="preserve">the first sibling of @node</doc>
  14943. <type name="Node" c:type="GNode*"/>
  14944. </return-value>
  14945. <parameters>
  14946. <instance-parameter name="node" transfer-ownership="none">
  14947. <doc xml:space="preserve">a #GNode</doc>
  14948. <type name="Node" c:type="GNode*"/>
  14949. </instance-parameter>
  14950. </parameters>
  14951. </method>
  14952. <method name="get_root"
  14953. c:identifier="g_node_get_root"
  14954. introspectable="0">
  14955. <doc xml:space="preserve">Gets the root of a tree.</doc>
  14956. <return-value>
  14957. <doc xml:space="preserve">the root of the tree</doc>
  14958. <type name="Node" c:type="GNode*"/>
  14959. </return-value>
  14960. <parameters>
  14961. <instance-parameter name="node" transfer-ownership="none">
  14962. <doc xml:space="preserve">a #GNode</doc>
  14963. <type name="Node" c:type="GNode*"/>
  14964. </instance-parameter>
  14965. </parameters>
  14966. </method>
  14967. <method name="insert" c:identifier="g_node_insert" introspectable="0">
  14968. <doc xml:space="preserve">Inserts a #GNode beneath the parent at the given position.</doc>
  14969. <return-value>
  14970. <doc xml:space="preserve">the inserted #GNode</doc>
  14971. <type name="Node" c:type="GNode*"/>
  14972. </return-value>
  14973. <parameters>
  14974. <instance-parameter name="parent" transfer-ownership="none">
  14975. <doc xml:space="preserve">the #GNode to place @node under</doc>
  14976. <type name="Node" c:type="GNode*"/>
  14977. </instance-parameter>
  14978. <parameter name="position" transfer-ownership="none">
  14979. <doc xml:space="preserve">the position to place @node at, with respect to its siblings
  14980. If position is -1, @node is inserted as the last child of @parent</doc>
  14981. <type name="gint" c:type="gint"/>
  14982. </parameter>
  14983. <parameter name="node" transfer-ownership="none">
  14984. <doc xml:space="preserve">the #GNode to insert</doc>
  14985. <type name="Node" c:type="GNode*"/>
  14986. </parameter>
  14987. </parameters>
  14988. </method>
  14989. <method name="insert_after"
  14990. c:identifier="g_node_insert_after"
  14991. introspectable="0">
  14992. <doc xml:space="preserve">Inserts a #GNode beneath the parent after the given sibling.</doc>
  14993. <return-value>
  14994. <doc xml:space="preserve">the inserted #GNode</doc>
  14995. <type name="Node" c:type="GNode*"/>
  14996. </return-value>
  14997. <parameters>
  14998. <instance-parameter name="parent" transfer-ownership="none">
  14999. <doc xml:space="preserve">the #GNode to place @node under</doc>
  15000. <type name="Node" c:type="GNode*"/>
  15001. </instance-parameter>
  15002. <parameter name="sibling" transfer-ownership="none">
  15003. <doc xml:space="preserve">the sibling #GNode to place @node after.
  15004. If sibling is %NULL, the node is inserted as the first child of @parent.</doc>
  15005. <type name="Node" c:type="GNode*"/>
  15006. </parameter>
  15007. <parameter name="node" transfer-ownership="none">
  15008. <doc xml:space="preserve">the #GNode to insert</doc>
  15009. <type name="Node" c:type="GNode*"/>
  15010. </parameter>
  15011. </parameters>
  15012. </method>
  15013. <method name="insert_before"
  15014. c:identifier="g_node_insert_before"
  15015. introspectable="0">
  15016. <doc xml:space="preserve">Inserts a #GNode beneath the parent before the given sibling.</doc>
  15017. <return-value>
  15018. <doc xml:space="preserve">the inserted #GNode</doc>
  15019. <type name="Node" c:type="GNode*"/>
  15020. </return-value>
  15021. <parameters>
  15022. <instance-parameter name="parent" transfer-ownership="none">
  15023. <doc xml:space="preserve">the #GNode to place @node under</doc>
  15024. <type name="Node" c:type="GNode*"/>
  15025. </instance-parameter>
  15026. <parameter name="sibling" transfer-ownership="none">
  15027. <doc xml:space="preserve">the sibling #GNode to place @node before.
  15028. If sibling is %NULL, the node is inserted as the last child of @parent.</doc>
  15029. <type name="Node" c:type="GNode*"/>
  15030. </parameter>
  15031. <parameter name="node" transfer-ownership="none">
  15032. <doc xml:space="preserve">the #GNode to insert</doc>
  15033. <type name="Node" c:type="GNode*"/>
  15034. </parameter>
  15035. </parameters>
  15036. </method>
  15037. <method name="is_ancestor" c:identifier="g_node_is_ancestor">
  15038. <doc xml:space="preserve">Returns %TRUE if @node is an ancestor of @descendant.
  15039. This is true if node is the parent of @descendant,
  15040. or if node is the grandparent of @descendant etc.</doc>
  15041. <return-value transfer-ownership="none">
  15042. <doc xml:space="preserve">%TRUE if @node is an ancestor of @descendant</doc>
  15043. <type name="gboolean" c:type="gboolean"/>
  15044. </return-value>
  15045. <parameters>
  15046. <instance-parameter name="node" transfer-ownership="none">
  15047. <doc xml:space="preserve">a #GNode</doc>
  15048. <type name="Node" c:type="GNode*"/>
  15049. </instance-parameter>
  15050. <parameter name="descendant" transfer-ownership="none">
  15051. <doc xml:space="preserve">a #GNode</doc>
  15052. <type name="Node" c:type="GNode*"/>
  15053. </parameter>
  15054. </parameters>
  15055. </method>
  15056. <method name="last_child"
  15057. c:identifier="g_node_last_child"
  15058. introspectable="0">
  15059. <doc xml:space="preserve">Gets the last child of a #GNode.</doc>
  15060. <return-value>
  15061. <doc xml:space="preserve">the last child of @node, or %NULL if @node has no children</doc>
  15062. <type name="Node" c:type="GNode*"/>
  15063. </return-value>
  15064. <parameters>
  15065. <instance-parameter name="node" transfer-ownership="none">
  15066. <doc xml:space="preserve">a #GNode (must not be %NULL)</doc>
  15067. <type name="Node" c:type="GNode*"/>
  15068. </instance-parameter>
  15069. </parameters>
  15070. </method>
  15071. <method name="last_sibling"
  15072. c:identifier="g_node_last_sibling"
  15073. introspectable="0">
  15074. <doc xml:space="preserve">Gets the last sibling of a #GNode.
  15075. This could possibly be the node itself.</doc>
  15076. <return-value>
  15077. <doc xml:space="preserve">the last sibling of @node</doc>
  15078. <type name="Node" c:type="GNode*"/>
  15079. </return-value>
  15080. <parameters>
  15081. <instance-parameter name="node" transfer-ownership="none">
  15082. <doc xml:space="preserve">a #GNode</doc>
  15083. <type name="Node" c:type="GNode*"/>
  15084. </instance-parameter>
  15085. </parameters>
  15086. </method>
  15087. <method name="max_height" c:identifier="g_node_max_height">
  15088. <doc xml:space="preserve">Gets the maximum height of all branches beneath a #GNode.
  15089. This is the maximum distance from the #GNode to all leaf nodes.
  15090. If @root is %NULL, 0 is returned. If @root has no children,
  15091. 1 is returned. If @root has children, 2 is returned. And so on.</doc>
  15092. <return-value transfer-ownership="none">
  15093. <doc xml:space="preserve">the maximum height of the tree beneath @root</doc>
  15094. <type name="guint" c:type="guint"/>
  15095. </return-value>
  15096. <parameters>
  15097. <instance-parameter name="root" transfer-ownership="none">
  15098. <doc xml:space="preserve">a #GNode</doc>
  15099. <type name="Node" c:type="GNode*"/>
  15100. </instance-parameter>
  15101. </parameters>
  15102. </method>
  15103. <method name="n_children" c:identifier="g_node_n_children">
  15104. <doc xml:space="preserve">Gets the number of children of a #GNode.</doc>
  15105. <return-value transfer-ownership="none">
  15106. <doc xml:space="preserve">the number of children of @node</doc>
  15107. <type name="guint" c:type="guint"/>
  15108. </return-value>
  15109. <parameters>
  15110. <instance-parameter name="node" transfer-ownership="none">
  15111. <doc xml:space="preserve">a #GNode</doc>
  15112. <type name="Node" c:type="GNode*"/>
  15113. </instance-parameter>
  15114. </parameters>
  15115. </method>
  15116. <method name="n_nodes" c:identifier="g_node_n_nodes">
  15117. <doc xml:space="preserve">Gets the number of nodes in a tree.</doc>
  15118. <return-value transfer-ownership="none">
  15119. <doc xml:space="preserve">the number of nodes in the tree</doc>
  15120. <type name="guint" c:type="guint"/>
  15121. </return-value>
  15122. <parameters>
  15123. <instance-parameter name="root" transfer-ownership="none">
  15124. <doc xml:space="preserve">a #GNode</doc>
  15125. <type name="Node" c:type="GNode*"/>
  15126. </instance-parameter>
  15127. <parameter name="flags" transfer-ownership="none">
  15128. <doc xml:space="preserve">which types of children are to be counted, one of
  15129. %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES</doc>
  15130. <type name="TraverseFlags" c:type="GTraverseFlags"/>
  15131. </parameter>
  15132. </parameters>
  15133. </method>
  15134. <method name="nth_child"
  15135. c:identifier="g_node_nth_child"
  15136. introspectable="0">
  15137. <doc xml:space="preserve">Gets a child of a #GNode, using the given index.
  15138. The first child is at index 0. If the index is
  15139. too big, %NULL is returned.</doc>
  15140. <return-value>
  15141. <doc xml:space="preserve">the child of @node at index @n</doc>
  15142. <type name="Node" c:type="GNode*"/>
  15143. </return-value>
  15144. <parameters>
  15145. <instance-parameter name="node" transfer-ownership="none">
  15146. <doc xml:space="preserve">a #GNode</doc>
  15147. <type name="Node" c:type="GNode*"/>
  15148. </instance-parameter>
  15149. <parameter name="n" transfer-ownership="none">
  15150. <doc xml:space="preserve">the index of the desired child</doc>
  15151. <type name="guint" c:type="guint"/>
  15152. </parameter>
  15153. </parameters>
  15154. </method>
  15155. <method name="prepend" c:identifier="g_node_prepend" introspectable="0">
  15156. <doc xml:space="preserve">Inserts a #GNode as the first child of the given parent.</doc>
  15157. <return-value>
  15158. <doc xml:space="preserve">the inserted #GNode</doc>
  15159. <type name="Node" c:type="GNode*"/>
  15160. </return-value>
  15161. <parameters>
  15162. <instance-parameter name="parent" transfer-ownership="none">
  15163. <doc xml:space="preserve">the #GNode to place the new #GNode under</doc>
  15164. <type name="Node" c:type="GNode*"/>
  15165. </instance-parameter>
  15166. <parameter name="node" transfer-ownership="none">
  15167. <doc xml:space="preserve">the #GNode to insert</doc>
  15168. <type name="Node" c:type="GNode*"/>
  15169. </parameter>
  15170. </parameters>
  15171. </method>
  15172. <method name="reverse_children" c:identifier="g_node_reverse_children">
  15173. <doc xml:space="preserve">Reverses the order of the children of a #GNode.
  15174. (It doesn't change the order of the grandchildren.)</doc>
  15175. <return-value transfer-ownership="none">
  15176. <type name="none" c:type="void"/>
  15177. </return-value>
  15178. <parameters>
  15179. <instance-parameter name="node" transfer-ownership="none">
  15180. <doc xml:space="preserve">a #GNode.</doc>
  15181. <type name="Node" c:type="GNode*"/>
  15182. </instance-parameter>
  15183. </parameters>
  15184. </method>
  15185. <method name="traverse"
  15186. c:identifier="g_node_traverse"
  15187. introspectable="0">
  15188. <doc xml:space="preserve">Traverses a tree starting at the given root #GNode.
  15189. It calls the given function for each node visited.
  15190. The traversal can be halted at any point by returning %TRUE from @func.</doc>
  15191. <return-value transfer-ownership="none">
  15192. <type name="none" c:type="void"/>
  15193. </return-value>
  15194. <parameters>
  15195. <instance-parameter name="root" transfer-ownership="none">
  15196. <doc xml:space="preserve">the root #GNode of the tree to traverse</doc>
  15197. <type name="Node" c:type="GNode*"/>
  15198. </instance-parameter>
  15199. <parameter name="order" transfer-ownership="none">
  15200. <doc xml:space="preserve">the order in which nodes are visited - %G_IN_ORDER,
  15201. %G_PRE_ORDER, %G_POST_ORDER, or %G_LEVEL_ORDER.</doc>
  15202. <type name="TraverseType" c:type="GTraverseType"/>
  15203. </parameter>
  15204. <parameter name="flags" transfer-ownership="none">
  15205. <doc xml:space="preserve">which types of children are to be visited, one of
  15206. %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES</doc>
  15207. <type name="TraverseFlags" c:type="GTraverseFlags"/>
  15208. </parameter>
  15209. <parameter name="max_depth" transfer-ownership="none">
  15210. <doc xml:space="preserve">the maximum depth of the traversal. Nodes below this
  15211. depth will not be visited. If max_depth is -1 all nodes in
  15212. the tree are visited. If depth is 1, only the root is visited.
  15213. If depth is 2, the root and its children are visited. And so on.</doc>
  15214. <type name="gint" c:type="gint"/>
  15215. </parameter>
  15216. <parameter name="func" transfer-ownership="none" closure="4">
  15217. <doc xml:space="preserve">the function to call for each visited #GNode</doc>
  15218. <type name="NodeTraverseFunc" c:type="GNodeTraverseFunc"/>
  15219. </parameter>
  15220. <parameter name="data"
  15221. transfer-ownership="none"
  15222. nullable="1"
  15223. allow-none="1">
  15224. <doc xml:space="preserve">user data to pass to the function</doc>
  15225. <type name="gpointer" c:type="gpointer"/>
  15226. </parameter>
  15227. </parameters>
  15228. </method>
  15229. <method name="unlink" c:identifier="g_node_unlink">
  15230. <doc xml:space="preserve">Unlinks a #GNode from a tree, resulting in two separate trees.</doc>
  15231. <return-value transfer-ownership="none">
  15232. <type name="none" c:type="void"/>
  15233. </return-value>
  15234. <parameters>
  15235. <instance-parameter name="node" transfer-ownership="none">
  15236. <doc xml:space="preserve">the #GNode to unlink, which becomes the root of a new tree</doc>
  15237. <type name="Node" c:type="GNode*"/>
  15238. </instance-parameter>
  15239. </parameters>
  15240. </method>
  15241. <function name="new" c:identifier="g_node_new" introspectable="0">
  15242. <doc xml:space="preserve">Creates a new #GNode containing the given data.
  15243. Used to create the first node in a tree.</doc>
  15244. <return-value>
  15245. <doc xml:space="preserve">a new #GNode</doc>
  15246. <type name="Node" c:type="GNode*"/>
  15247. </return-value>
  15248. <parameters>
  15249. <parameter name="data"
  15250. transfer-ownership="none"
  15251. nullable="1"
  15252. allow-none="1">
  15253. <doc xml:space="preserve">the data of the new node</doc>
  15254. <type name="gpointer" c:type="gpointer"/>
  15255. </parameter>
  15256. </parameters>
  15257. </function>
  15258. </record>
  15259. <callback name="NodeForeachFunc" c:type="GNodeForeachFunc">
  15260. <doc xml:space="preserve">Specifies the type of function passed to g_node_children_foreach().
  15261. The function is called with each child node, together with the user
  15262. data passed to g_node_children_foreach().</doc>
  15263. <return-value transfer-ownership="none">
  15264. <type name="none" c:type="void"/>
  15265. </return-value>
  15266. <parameters>
  15267. <parameter name="node" transfer-ownership="none">
  15268. <doc xml:space="preserve">a #GNode.</doc>
  15269. <type name="Node" c:type="GNode*"/>
  15270. </parameter>
  15271. <parameter name="data"
  15272. transfer-ownership="none"
  15273. nullable="1"
  15274. allow-none="1">
  15275. <doc xml:space="preserve">user data passed to g_node_children_foreach().</doc>
  15276. <type name="gpointer" c:type="gpointer"/>
  15277. </parameter>
  15278. </parameters>
  15279. </callback>
  15280. <callback name="NodeTraverseFunc" c:type="GNodeTraverseFunc">
  15281. <doc xml:space="preserve">Specifies the type of function passed to g_node_traverse(). The
  15282. function is called with each of the nodes visited, together with the
  15283. user data passed to g_node_traverse(). If the function returns
  15284. %TRUE, then the traversal is stopped.</doc>
  15285. <return-value transfer-ownership="none">
  15286. <doc xml:space="preserve">%TRUE to stop the traversal.</doc>
  15287. <type name="gboolean" c:type="gboolean"/>
  15288. </return-value>
  15289. <parameters>
  15290. <parameter name="node" transfer-ownership="none">
  15291. <doc xml:space="preserve">a #GNode.</doc>
  15292. <type name="Node" c:type="GNode*"/>
  15293. </parameter>
  15294. <parameter name="data"
  15295. transfer-ownership="none"
  15296. nullable="1"
  15297. allow-none="1">
  15298. <doc xml:space="preserve">user data passed to g_node_traverse().</doc>
  15299. <type name="gpointer" c:type="gpointer"/>
  15300. </parameter>
  15301. </parameters>
  15302. </callback>
  15303. <enumeration name="NormalizeMode" c:type="GNormalizeMode">
  15304. <doc xml:space="preserve">Defines how a Unicode string is transformed in a canonical
  15305. form, standardizing such issues as whether a character with
  15306. an accent is represented as a base character and combining
  15307. accent or as a single precomposed character. Unicode strings
  15308. should generally be normalized before comparing them.</doc>
  15309. <member name="default" value="0" c:identifier="G_NORMALIZE_DEFAULT">
  15310. <doc xml:space="preserve">standardize differences that do not affect the
  15311. text content, such as the above-mentioned accent representation</doc>
  15312. </member>
  15313. <member name="nfd" value="0" c:identifier="G_NORMALIZE_NFD">
  15314. <doc xml:space="preserve">another name for %G_NORMALIZE_DEFAULT</doc>
  15315. </member>
  15316. <member name="default_compose"
  15317. value="1"
  15318. c:identifier="G_NORMALIZE_DEFAULT_COMPOSE">
  15319. <doc xml:space="preserve">like %G_NORMALIZE_DEFAULT, but with
  15320. composed forms rather than a maximally decomposed form</doc>
  15321. </member>
  15322. <member name="nfc" value="1" c:identifier="G_NORMALIZE_NFC">
  15323. <doc xml:space="preserve">another name for %G_NORMALIZE_DEFAULT_COMPOSE</doc>
  15324. </member>
  15325. <member name="all" value="2" c:identifier="G_NORMALIZE_ALL">
  15326. <doc xml:space="preserve">beyond %G_NORMALIZE_DEFAULT also standardize the
  15327. "compatibility" characters in Unicode, such as SUPERSCRIPT THREE
  15328. to the standard forms (in this case DIGIT THREE). Formatting
  15329. information may be lost but for most text operations such
  15330. characters should be considered the same</doc>
  15331. </member>
  15332. <member name="nfkd" value="2" c:identifier="G_NORMALIZE_NFKD">
  15333. <doc xml:space="preserve">another name for %G_NORMALIZE_ALL</doc>
  15334. </member>
  15335. <member name="all_compose"
  15336. value="3"
  15337. c:identifier="G_NORMALIZE_ALL_COMPOSE">
  15338. <doc xml:space="preserve">like %G_NORMALIZE_ALL, but with composed
  15339. forms rather than a maximally decomposed form</doc>
  15340. </member>
  15341. <member name="nfkc" value="3" c:identifier="G_NORMALIZE_NFKC">
  15342. <doc xml:space="preserve">another name for %G_NORMALIZE_ALL_COMPOSE</doc>
  15343. </member>
  15344. </enumeration>
  15345. <constant name="OPTION_REMAINING"
  15346. value=""
  15347. c:type="G_OPTION_REMAINING"
  15348. version="2.6">
  15349. <doc xml:space="preserve">If a long option in the main group has this name, it is not treated as a
  15350. regular option. Instead it collects all non-option arguments which would
  15351. otherwise be left in `argv`. The option must be of type
  15352. %G_OPTION_ARG_CALLBACK, %G_OPTION_ARG_STRING_ARRAY
  15353. or %G_OPTION_ARG_FILENAME_ARRAY.
  15354. Using #G_OPTION_REMAINING instead of simply scanning `argv`
  15355. for leftover arguments has the advantage that GOption takes care of
  15356. necessary encoding conversions for strings or filenames.</doc>
  15357. <type name="utf8" c:type="gchar*"/>
  15358. </constant>
  15359. <record name="Once" c:type="GOnce" version="2.4">
  15360. <doc xml:space="preserve">A #GOnce struct controls a one-time initialization function. Any
  15361. one-time initialization function must have its own unique #GOnce
  15362. struct.</doc>
  15363. <field name="status" writable="1">
  15364. <doc xml:space="preserve">the status of the #GOnce</doc>
  15365. <type name="OnceStatus" c:type="volatile GOnceStatus"/>
  15366. </field>
  15367. <field name="retval" writable="1">
  15368. <doc xml:space="preserve">the value returned by the call to the function, if @status
  15369. is %G_ONCE_STATUS_READY</doc>
  15370. <type name="gpointer" c:type="volatile gpointer"/>
  15371. </field>
  15372. <method name="impl" c:identifier="g_once_impl" introspectable="0">
  15373. <return-value transfer-ownership="none" nullable="1">
  15374. <type name="gpointer" c:type="gpointer"/>
  15375. </return-value>
  15376. <parameters>
  15377. <instance-parameter name="once" transfer-ownership="none">
  15378. <type name="Once" c:type="GOnce*"/>
  15379. </instance-parameter>
  15380. <parameter name="func" transfer-ownership="none">
  15381. <type name="ThreadFunc" c:type="GThreadFunc"/>
  15382. </parameter>
  15383. <parameter name="arg"
  15384. transfer-ownership="none"
  15385. nullable="1"
  15386. allow-none="1">
  15387. <type name="gpointer" c:type="gpointer"/>
  15388. </parameter>
  15389. </parameters>
  15390. </method>
  15391. <function name="init_enter"
  15392. c:identifier="g_once_init_enter"
  15393. version="2.14">
  15394. <doc xml:space="preserve">Function to be called when starting a critical initialization
  15395. section. The argument @location must point to a static
  15396. 0-initialized variable that will be set to a value other than 0 at
  15397. the end of the initialization section. In combination with
  15398. g_once_init_leave() and the unique address @value_location, it can
  15399. be ensured that an initialization section will be executed only once
  15400. during a program's life time, and that concurrent threads are
  15401. blocked until initialization completed. To be used in constructs
  15402. like this:
  15403. |[&lt;!-- language="C" --&gt;
  15404. static gsize initialization_value = 0;
  15405. if (g_once_init_enter (&amp;initialization_value))
  15406. {
  15407. gsize setup_value = 42; // initialization code here
  15408. g_once_init_leave (&amp;initialization_value, setup_value);
  15409. }
  15410. // use initialization_value here
  15411. ]|</doc>
  15412. <return-value transfer-ownership="none">
  15413. <doc xml:space="preserve">%TRUE if the initialization section should be entered,
  15414. %FALSE and blocks otherwise</doc>
  15415. <type name="gboolean" c:type="gboolean"/>
  15416. </return-value>
  15417. <parameters>
  15418. <parameter name="location" transfer-ownership="none">
  15419. <doc xml:space="preserve">location of a static initializable variable
  15420. containing 0</doc>
  15421. <type name="gpointer" c:type="void*"/>
  15422. </parameter>
  15423. </parameters>
  15424. </function>
  15425. <function name="init_leave"
  15426. c:identifier="g_once_init_leave"
  15427. version="2.14">
  15428. <doc xml:space="preserve">Counterpart to g_once_init_enter(). Expects a location of a static
  15429. 0-initialized initialization variable, and an initialization value
  15430. other than 0. Sets the variable to the initialization value, and
  15431. releases concurrent threads blocking in g_once_init_enter() on this
  15432. initialization variable.</doc>
  15433. <return-value transfer-ownership="none">
  15434. <type name="none" c:type="void"/>
  15435. </return-value>
  15436. <parameters>
  15437. <parameter name="location" transfer-ownership="none">
  15438. <doc xml:space="preserve">location of a static initializable variable
  15439. containing 0</doc>
  15440. <type name="gpointer" c:type="void*"/>
  15441. </parameter>
  15442. <parameter name="result" transfer-ownership="none">
  15443. <doc xml:space="preserve">new non-0 value for *@value_location</doc>
  15444. <type name="gsize" c:type="gsize"/>
  15445. </parameter>
  15446. </parameters>
  15447. </function>
  15448. </record>
  15449. <enumeration name="OnceStatus" version="2.4" c:type="GOnceStatus">
  15450. <doc xml:space="preserve">The possible statuses of a one-time initialization function
  15451. controlled by a #GOnce struct.</doc>
  15452. <member name="notcalled"
  15453. value="0"
  15454. c:identifier="G_ONCE_STATUS_NOTCALLED">
  15455. <doc xml:space="preserve">the function has not been called yet.</doc>
  15456. </member>
  15457. <member name="progress" value="1" c:identifier="G_ONCE_STATUS_PROGRESS">
  15458. <doc xml:space="preserve">the function call is currently in progress.</doc>
  15459. </member>
  15460. <member name="ready" value="2" c:identifier="G_ONCE_STATUS_READY">
  15461. <doc xml:space="preserve">the function has been called.</doc>
  15462. </member>
  15463. </enumeration>
  15464. <enumeration name="OptionArg" c:type="GOptionArg">
  15465. <doc xml:space="preserve">The #GOptionArg enum values determine which type of extra argument the
  15466. options expect to find. If an option expects an extra argument, it can
  15467. be specified in several ways; with a short option: `-x arg`, with a long
  15468. option: `--name arg` or combined in a single argument: `--name=arg`.</doc>
  15469. <member name="none" value="0" c:identifier="G_OPTION_ARG_NONE">
  15470. <doc xml:space="preserve">No extra argument. This is useful for simple flags.</doc>
  15471. </member>
  15472. <member name="string" value="1" c:identifier="G_OPTION_ARG_STRING">
  15473. <doc xml:space="preserve">The option takes a string argument.</doc>
  15474. </member>
  15475. <member name="int" value="2" c:identifier="G_OPTION_ARG_INT">
  15476. <doc xml:space="preserve">The option takes an integer argument.</doc>
  15477. </member>
  15478. <member name="callback" value="3" c:identifier="G_OPTION_ARG_CALLBACK">
  15479. <doc xml:space="preserve">The option provides a callback (of type
  15480. #GOptionArgFunc) to parse the extra argument.</doc>
  15481. </member>
  15482. <member name="filename" value="4" c:identifier="G_OPTION_ARG_FILENAME">
  15483. <doc xml:space="preserve">The option takes a filename as argument.</doc>
  15484. </member>
  15485. <member name="string_array"
  15486. value="5"
  15487. c:identifier="G_OPTION_ARG_STRING_ARRAY">
  15488. <doc xml:space="preserve">The option takes a string argument, multiple
  15489. uses of the option are collected into an array of strings.</doc>
  15490. </member>
  15491. <member name="filename_array"
  15492. value="6"
  15493. c:identifier="G_OPTION_ARG_FILENAME_ARRAY">
  15494. <doc xml:space="preserve">The option takes a filename as argument,
  15495. multiple uses of the option are collected into an array of strings.</doc>
  15496. </member>
  15497. <member name="double" value="7" c:identifier="G_OPTION_ARG_DOUBLE">
  15498. <doc xml:space="preserve">The option takes a double argument. The argument
  15499. can be formatted either for the user's locale or for the "C" locale.
  15500. Since 2.12</doc>
  15501. </member>
  15502. <member name="int64" value="8" c:identifier="G_OPTION_ARG_INT64">
  15503. <doc xml:space="preserve">The option takes a 64-bit integer. Like
  15504. %G_OPTION_ARG_INT but for larger numbers. The number can be in
  15505. decimal base, or in hexadecimal (when prefixed with `0x`, for
  15506. example, `0xffffffff`). Since 2.12</doc>
  15507. </member>
  15508. </enumeration>
  15509. <callback name="OptionArgFunc" c:type="GOptionArgFunc" throws="1">
  15510. <doc xml:space="preserve">The type of function to be passed as callback for %G_OPTION_ARG_CALLBACK
  15511. options.</doc>
  15512. <return-value transfer-ownership="none">
  15513. <doc xml:space="preserve">%TRUE if the option was successfully parsed, %FALSE if an error
  15514. occurred, in which case @error should be set with g_set_error()</doc>
  15515. <type name="gboolean" c:type="gboolean"/>
  15516. </return-value>
  15517. <parameters>
  15518. <parameter name="option_name" transfer-ownership="none">
  15519. <doc xml:space="preserve">The name of the option being parsed. This will be either a
  15520. single dash followed by a single letter (for a short name) or two dashes
  15521. followed by a long option name.</doc>
  15522. <type name="utf8" c:type="const gchar*"/>
  15523. </parameter>
  15524. <parameter name="value" transfer-ownership="none">
  15525. <doc xml:space="preserve">The value to be parsed.</doc>
  15526. <type name="utf8" c:type="const gchar*"/>
  15527. </parameter>
  15528. <parameter name="data"
  15529. transfer-ownership="none"
  15530. nullable="1"
  15531. allow-none="1">
  15532. <doc xml:space="preserve">User data added to the #GOptionGroup containing the option when it
  15533. was created with g_option_group_new()</doc>
  15534. <type name="gpointer" c:type="gpointer"/>
  15535. </parameter>
  15536. </parameters>
  15537. </callback>
  15538. <record name="OptionContext" c:type="GOptionContext" disguised="1">
  15539. <doc xml:space="preserve">A `GOptionContext` struct defines which options
  15540. are accepted by the commandline option parser. The struct has only private
  15541. fields and should not be directly accessed.</doc>
  15542. <method name="add_group"
  15543. c:identifier="g_option_context_add_group"
  15544. version="2.6">
  15545. <doc xml:space="preserve">Adds a #GOptionGroup to the @context, so that parsing with @context
  15546. will recognize the options in the group. Note that this will take
  15547. ownership of the @group and thus the @group should not be freed.</doc>
  15548. <return-value transfer-ownership="none">
  15549. <type name="none" c:type="void"/>
  15550. </return-value>
  15551. <parameters>
  15552. <instance-parameter name="context" transfer-ownership="none">
  15553. <doc xml:space="preserve">a #GOptionContext</doc>
  15554. <type name="OptionContext" c:type="GOptionContext*"/>
  15555. </instance-parameter>
  15556. <parameter name="group" transfer-ownership="full">
  15557. <doc xml:space="preserve">the group to add</doc>
  15558. <type name="OptionGroup" c:type="GOptionGroup*"/>
  15559. </parameter>
  15560. </parameters>
  15561. </method>
  15562. <method name="add_main_entries"
  15563. c:identifier="g_option_context_add_main_entries"
  15564. version="2.6">
  15565. <doc xml:space="preserve">A convenience function which creates a main group if it doesn't
  15566. exist, adds the @entries to it and sets the translation domain.</doc>
  15567. <return-value transfer-ownership="none">
  15568. <type name="none" c:type="void"/>
  15569. </return-value>
  15570. <parameters>
  15571. <instance-parameter name="context" transfer-ownership="none">
  15572. <doc xml:space="preserve">a #GOptionContext</doc>
  15573. <type name="OptionContext" c:type="GOptionContext*"/>
  15574. </instance-parameter>
  15575. <parameter name="entries" transfer-ownership="none">
  15576. <doc xml:space="preserve">a %NULL-terminated array of #GOptionEntrys</doc>
  15577. <type name="OptionEntry" c:type="const GOptionEntry*"/>
  15578. </parameter>
  15579. <parameter name="translation_domain"
  15580. transfer-ownership="none"
  15581. nullable="1"
  15582. allow-none="1">
  15583. <doc xml:space="preserve">a translation domain to use for translating
  15584. the `--help` output for the options in @entries
  15585. with gettext(), or %NULL</doc>
  15586. <type name="utf8" c:type="const gchar*"/>
  15587. </parameter>
  15588. </parameters>
  15589. </method>
  15590. <method name="free" c:identifier="g_option_context_free" version="2.6">
  15591. <doc xml:space="preserve">Frees context and all the groups which have been
  15592. added to it.
  15593. Please note that parsed arguments need to be freed separately (see
  15594. #GOptionEntry).</doc>
  15595. <return-value transfer-ownership="none">
  15596. <type name="none" c:type="void"/>
  15597. </return-value>
  15598. <parameters>
  15599. <instance-parameter name="context" transfer-ownership="none">
  15600. <doc xml:space="preserve">a #GOptionContext</doc>
  15601. <type name="OptionContext" c:type="GOptionContext*"/>
  15602. </instance-parameter>
  15603. </parameters>
  15604. </method>
  15605. <method name="get_description"
  15606. c:identifier="g_option_context_get_description"
  15607. version="2.12">
  15608. <doc xml:space="preserve">Returns the description. See g_option_context_set_description().</doc>
  15609. <return-value transfer-ownership="none">
  15610. <doc xml:space="preserve">the description</doc>
  15611. <type name="utf8" c:type="const gchar*"/>
  15612. </return-value>
  15613. <parameters>
  15614. <instance-parameter name="context" transfer-ownership="none">
  15615. <doc xml:space="preserve">a #GOptionContext</doc>
  15616. <type name="OptionContext" c:type="GOptionContext*"/>
  15617. </instance-parameter>
  15618. </parameters>
  15619. </method>
  15620. <method name="get_help"
  15621. c:identifier="g_option_context_get_help"
  15622. version="2.14">
  15623. <doc xml:space="preserve">Returns a formatted, translated help text for the given context.
  15624. To obtain the text produced by `--help`, call
  15625. `g_option_context_get_help (context, TRUE, NULL)`.
  15626. To obtain the text produced by `--help-all`, call
  15627. `g_option_context_get_help (context, FALSE, NULL)`.
  15628. To obtain the help text for an option group, call
  15629. `g_option_context_get_help (context, FALSE, group)`.</doc>
  15630. <return-value transfer-ownership="full">
  15631. <doc xml:space="preserve">A newly allocated string containing the help text</doc>
  15632. <type name="utf8" c:type="gchar*"/>
  15633. </return-value>
  15634. <parameters>
  15635. <instance-parameter name="context" transfer-ownership="none">
  15636. <doc xml:space="preserve">a #GOptionContext</doc>
  15637. <type name="OptionContext" c:type="GOptionContext*"/>
  15638. </instance-parameter>
  15639. <parameter name="main_help" transfer-ownership="none">
  15640. <doc xml:space="preserve">if %TRUE, only include the main group</doc>
  15641. <type name="gboolean" c:type="gboolean"/>
  15642. </parameter>
  15643. <parameter name="group"
  15644. transfer-ownership="none"
  15645. nullable="1"
  15646. allow-none="1">
  15647. <doc xml:space="preserve">the #GOptionGroup to create help for, or %NULL</doc>
  15648. <type name="OptionGroup" c:type="GOptionGroup*"/>
  15649. </parameter>
  15650. </parameters>
  15651. </method>
  15652. <method name="get_help_enabled"
  15653. c:identifier="g_option_context_get_help_enabled"
  15654. version="2.6">
  15655. <doc xml:space="preserve">Returns whether automatic `--help` generation
  15656. is turned on for @context. See g_option_context_set_help_enabled().</doc>
  15657. <return-value transfer-ownership="none">
  15658. <doc xml:space="preserve">%TRUE if automatic help generation is turned on.</doc>
  15659. <type name="gboolean" c:type="gboolean"/>
  15660. </return-value>
  15661. <parameters>
  15662. <instance-parameter name="context" transfer-ownership="none">
  15663. <doc xml:space="preserve">a #GOptionContext</doc>
  15664. <type name="OptionContext" c:type="GOptionContext*"/>
  15665. </instance-parameter>
  15666. </parameters>
  15667. </method>
  15668. <method name="get_ignore_unknown_options"
  15669. c:identifier="g_option_context_get_ignore_unknown_options"
  15670. version="2.6">
  15671. <doc xml:space="preserve">Returns whether unknown options are ignored or not. See
  15672. g_option_context_set_ignore_unknown_options().</doc>
  15673. <return-value transfer-ownership="none">
  15674. <doc xml:space="preserve">%TRUE if unknown options are ignored.</doc>
  15675. <type name="gboolean" c:type="gboolean"/>
  15676. </return-value>
  15677. <parameters>
  15678. <instance-parameter name="context" transfer-ownership="none">
  15679. <doc xml:space="preserve">a #GOptionContext</doc>
  15680. <type name="OptionContext" c:type="GOptionContext*"/>
  15681. </instance-parameter>
  15682. </parameters>
  15683. </method>
  15684. <method name="get_main_group"
  15685. c:identifier="g_option_context_get_main_group"
  15686. version="2.6">
  15687. <doc xml:space="preserve">Returns a pointer to the main group of @context.</doc>
  15688. <return-value transfer-ownership="none">
  15689. <doc xml:space="preserve">the main group of @context, or %NULL if
  15690. @context doesn't have a main group. Note that group belongs to
  15691. @context and should not be modified or freed.</doc>
  15692. <type name="OptionGroup" c:type="GOptionGroup*"/>
  15693. </return-value>
  15694. <parameters>
  15695. <instance-parameter name="context" transfer-ownership="none">
  15696. <doc xml:space="preserve">a #GOptionContext</doc>
  15697. <type name="OptionContext" c:type="GOptionContext*"/>
  15698. </instance-parameter>
  15699. </parameters>
  15700. </method>
  15701. <method name="get_strict_posix"
  15702. c:identifier="g_option_context_get_strict_posix"
  15703. version="2.44">
  15704. <doc xml:space="preserve">Returns whether strict POSIX code is enabled.
  15705. See g_option_context_set_strict_posix() for more information.</doc>
  15706. <return-value transfer-ownership="none">
  15707. <doc xml:space="preserve">%TRUE if strict POSIX is enabled, %FALSE otherwise.</doc>
  15708. <type name="gboolean" c:type="gboolean"/>
  15709. </return-value>
  15710. <parameters>
  15711. <instance-parameter name="context" transfer-ownership="none">
  15712. <doc xml:space="preserve">a #GoptionContext</doc>
  15713. <type name="OptionContext" c:type="GOptionContext*"/>
  15714. </instance-parameter>
  15715. </parameters>
  15716. </method>
  15717. <method name="get_summary"
  15718. c:identifier="g_option_context_get_summary"
  15719. version="2.12">
  15720. <doc xml:space="preserve">Returns the summary. See g_option_context_set_summary().</doc>
  15721. <return-value transfer-ownership="none">
  15722. <doc xml:space="preserve">the summary</doc>
  15723. <type name="utf8" c:type="const gchar*"/>
  15724. </return-value>
  15725. <parameters>
  15726. <instance-parameter name="context" transfer-ownership="none">
  15727. <doc xml:space="preserve">a #GOptionContext</doc>
  15728. <type name="OptionContext" c:type="GOptionContext*"/>
  15729. </instance-parameter>
  15730. </parameters>
  15731. </method>
  15732. <method name="parse"
  15733. c:identifier="g_option_context_parse"
  15734. version="2.6"
  15735. throws="1">
  15736. <doc xml:space="preserve">Parses the command line arguments, recognizing options
  15737. which have been added to @context. A side-effect of
  15738. calling this function is that g_set_prgname() will be
  15739. called.
  15740. If the parsing is successful, any parsed arguments are
  15741. removed from the array and @argc and @argv are updated
  15742. accordingly. A '--' option is stripped from @argv
  15743. unless there are unparsed options before and after it,
  15744. or some of the options after it start with '-'. In case
  15745. of an error, @argc and @argv are left unmodified.
  15746. If automatic `--help` support is enabled
  15747. (see g_option_context_set_help_enabled()), and the
  15748. @argv array contains one of the recognized help options,
  15749. this function will produce help output to stdout and
  15750. call `exit (0)`.
  15751. Note that function depends on the [current locale][setlocale] for
  15752. automatic character set conversion of string and filename
  15753. arguments.</doc>
  15754. <return-value transfer-ownership="none">
  15755. <doc xml:space="preserve">%TRUE if the parsing was successful,
  15756. %FALSE if an error occurred</doc>
  15757. <type name="gboolean" c:type="gboolean"/>
  15758. </return-value>
  15759. <parameters>
  15760. <instance-parameter name="context" transfer-ownership="none">
  15761. <doc xml:space="preserve">a #GOptionContext</doc>
  15762. <type name="OptionContext" c:type="GOptionContext*"/>
  15763. </instance-parameter>
  15764. <parameter name="argc"
  15765. direction="inout"
  15766. caller-allocates="0"
  15767. transfer-ownership="full"
  15768. nullable="1"
  15769. allow-none="1">
  15770. <doc xml:space="preserve">a pointer to the number of command line arguments</doc>
  15771. <type name="gint" c:type="gint*"/>
  15772. </parameter>
  15773. <parameter name="argv"
  15774. direction="inout"
  15775. caller-allocates="0"
  15776. transfer-ownership="full"
  15777. nullable="1"
  15778. allow-none="1">
  15779. <doc xml:space="preserve">a pointer to the array of command line arguments</doc>
  15780. <array length="0" zero-terminated="0" c:type="gchar***">
  15781. <type name="utf8" c:type="gchar**"/>
  15782. </array>
  15783. </parameter>
  15784. </parameters>
  15785. </method>
  15786. <method name="parse_strv"
  15787. c:identifier="g_option_context_parse_strv"
  15788. version="2.40"
  15789. throws="1">
  15790. <doc xml:space="preserve">Parses the command line arguments.
  15791. This function is similar to g_option_context_parse() except that it
  15792. respects the normal memory rules when dealing with a strv instead of
  15793. assuming that the passed-in array is the argv of the main function.
  15794. In particular, strings that are removed from the arguments list will
  15795. be freed using g_free().
  15796. On Windows, the strings are expected to be in UTF-8. This is in
  15797. contrast to g_option_context_parse() which expects them to be in the
  15798. system codepage, which is how they are passed as @argv to main().
  15799. See g_win32_get_command_line() for a solution.
  15800. This function is useful if you are trying to use #GOptionContext with
  15801. #GApplication.</doc>
  15802. <return-value transfer-ownership="none">
  15803. <doc xml:space="preserve">%TRUE if the parsing was successful,
  15804. %FALSE if an error occurred</doc>
  15805. <type name="gboolean" c:type="gboolean"/>
  15806. </return-value>
  15807. <parameters>
  15808. <instance-parameter name="context" transfer-ownership="none">
  15809. <doc xml:space="preserve">a #GOptionContext</doc>
  15810. <type name="OptionContext" c:type="GOptionContext*"/>
  15811. </instance-parameter>
  15812. <parameter name="arguments"
  15813. direction="inout"
  15814. caller-allocates="0"
  15815. transfer-ownership="full">
  15816. <doc xml:space="preserve">a pointer to the
  15817. command line arguments (which must be in UTF-8 on Windows)</doc>
  15818. <array zero-terminated="0" c:type="gchar***">
  15819. <type name="utf8" c:type="gchar**"/>
  15820. </array>
  15821. </parameter>
  15822. </parameters>
  15823. </method>
  15824. <method name="set_description"
  15825. c:identifier="g_option_context_set_description"
  15826. version="2.12">
  15827. <doc xml:space="preserve">Adds a string to be displayed in `--help` output after the list
  15828. of options. This text often includes a bug reporting address.
  15829. Note that the summary is translated (see
  15830. g_option_context_set_translate_func()).</doc>
  15831. <return-value transfer-ownership="none">
  15832. <type name="none" c:type="void"/>
  15833. </return-value>
  15834. <parameters>
  15835. <instance-parameter name="context" transfer-ownership="none">
  15836. <doc xml:space="preserve">a #GOptionContext</doc>
  15837. <type name="OptionContext" c:type="GOptionContext*"/>
  15838. </instance-parameter>
  15839. <parameter name="description"
  15840. transfer-ownership="none"
  15841. nullable="1"
  15842. allow-none="1">
  15843. <doc xml:space="preserve">a string to be shown in `--help` output
  15844. after the list of options, or %NULL</doc>
  15845. <type name="utf8" c:type="const gchar*"/>
  15846. </parameter>
  15847. </parameters>
  15848. </method>
  15849. <method name="set_help_enabled"
  15850. c:identifier="g_option_context_set_help_enabled"
  15851. version="2.6">
  15852. <doc xml:space="preserve">Enables or disables automatic generation of `--help` output.
  15853. By default, g_option_context_parse() recognizes `--help`, `-h`,
  15854. `-?`, `--help-all` and `--help-groupname` and creates suitable
  15855. output to stdout.</doc>
  15856. <return-value transfer-ownership="none">
  15857. <type name="none" c:type="void"/>
  15858. </return-value>
  15859. <parameters>
  15860. <instance-parameter name="context" transfer-ownership="none">
  15861. <doc xml:space="preserve">a #GOptionContext</doc>
  15862. <type name="OptionContext" c:type="GOptionContext*"/>
  15863. </instance-parameter>
  15864. <parameter name="help_enabled" transfer-ownership="none">
  15865. <doc xml:space="preserve">%TRUE to enable `--help`, %FALSE to disable it</doc>
  15866. <type name="gboolean" c:type="gboolean"/>
  15867. </parameter>
  15868. </parameters>
  15869. </method>
  15870. <method name="set_ignore_unknown_options"
  15871. c:identifier="g_option_context_set_ignore_unknown_options"
  15872. version="2.6">
  15873. <doc xml:space="preserve">Sets whether to ignore unknown options or not. If an argument is
  15874. ignored, it is left in the @argv array after parsing. By default,
  15875. g_option_context_parse() treats unknown options as error.
  15876. This setting does not affect non-option arguments (i.e. arguments
  15877. which don't start with a dash). But note that GOption cannot reliably
  15878. determine whether a non-option belongs to a preceding unknown option.</doc>
  15879. <return-value transfer-ownership="none">
  15880. <type name="none" c:type="void"/>
  15881. </return-value>
  15882. <parameters>
  15883. <instance-parameter name="context" transfer-ownership="none">
  15884. <doc xml:space="preserve">a #GOptionContext</doc>
  15885. <type name="OptionContext" c:type="GOptionContext*"/>
  15886. </instance-parameter>
  15887. <parameter name="ignore_unknown" transfer-ownership="none">
  15888. <doc xml:space="preserve">%TRUE to ignore unknown options, %FALSE to produce
  15889. an error when unknown options are met</doc>
  15890. <type name="gboolean" c:type="gboolean"/>
  15891. </parameter>
  15892. </parameters>
  15893. </method>
  15894. <method name="set_main_group"
  15895. c:identifier="g_option_context_set_main_group"
  15896. version="2.6">
  15897. <doc xml:space="preserve">Sets a #GOptionGroup as main group of the @context.
  15898. This has the same effect as calling g_option_context_add_group(),
  15899. the only difference is that the options in the main group are
  15900. treated differently when generating `--help` output.</doc>
  15901. <return-value transfer-ownership="none">
  15902. <type name="none" c:type="void"/>
  15903. </return-value>
  15904. <parameters>
  15905. <instance-parameter name="context" transfer-ownership="none">
  15906. <doc xml:space="preserve">a #GOptionContext</doc>
  15907. <type name="OptionContext" c:type="GOptionContext*"/>
  15908. </instance-parameter>
  15909. <parameter name="group" transfer-ownership="full">
  15910. <doc xml:space="preserve">the group to set as main group</doc>
  15911. <type name="OptionGroup" c:type="GOptionGroup*"/>
  15912. </parameter>
  15913. </parameters>
  15914. </method>
  15915. <method name="set_strict_posix"
  15916. c:identifier="g_option_context_set_strict_posix"
  15917. version="2.44">
  15918. <doc xml:space="preserve">Sets strict POSIX mode.
  15919. By default, this mode is disabled.
  15920. In strict POSIX mode, the first non-argument parameter encountered
  15921. (eg: filename) terminates argument processing. Remaining arguments
  15922. are treated as non-options and are not attempted to be parsed.
  15923. If strict POSIX mode is disabled then parsing is done in the GNU way
  15924. where option arguments can be freely mixed with non-options.
  15925. As an example, consider "ls foo -l". With GNU style parsing, this
  15926. will list "foo" in long mode. In strict POSIX style, this will list
  15927. the files named "foo" and "-l".
  15928. It may be useful to force strict POSIX mode when creating "verb
  15929. style" command line tools. For example, the "gsettings" command line
  15930. tool supports the global option "--schemadir" as well as many
  15931. subcommands ("get", "set", etc.) which each have their own set of
  15932. arguments. Using strict POSIX mode will allow parsing the global
  15933. options up to the verb name while leaving the remaining options to be
  15934. parsed by the relevant subcommand (which can be determined by
  15935. examining the verb name, which should be present in argv[1] after
  15936. parsing).</doc>
  15937. <return-value transfer-ownership="none">
  15938. <type name="none" c:type="void"/>
  15939. </return-value>
  15940. <parameters>
  15941. <instance-parameter name="context" transfer-ownership="none">
  15942. <doc xml:space="preserve">a #GoptionContext</doc>
  15943. <type name="OptionContext" c:type="GOptionContext*"/>
  15944. </instance-parameter>
  15945. <parameter name="strict_posix" transfer-ownership="none">
  15946. <doc xml:space="preserve">the new value</doc>
  15947. <type name="gboolean" c:type="gboolean"/>
  15948. </parameter>
  15949. </parameters>
  15950. </method>
  15951. <method name="set_summary"
  15952. c:identifier="g_option_context_set_summary"
  15953. version="2.12">
  15954. <doc xml:space="preserve">Adds a string to be displayed in `--help` output before the list
  15955. of options. This is typically a summary of the program functionality.
  15956. Note that the summary is translated (see
  15957. g_option_context_set_translate_func() and
  15958. g_option_context_set_translation_domain()).</doc>
  15959. <return-value transfer-ownership="none">
  15960. <type name="none" c:type="void"/>
  15961. </return-value>
  15962. <parameters>
  15963. <instance-parameter name="context" transfer-ownership="none">
  15964. <doc xml:space="preserve">a #GOptionContext</doc>
  15965. <type name="OptionContext" c:type="GOptionContext*"/>
  15966. </instance-parameter>
  15967. <parameter name="summary"
  15968. transfer-ownership="none"
  15969. nullable="1"
  15970. allow-none="1">
  15971. <doc xml:space="preserve">a string to be shown in `--help` output
  15972. before the list of options, or %NULL</doc>
  15973. <type name="utf8" c:type="const gchar*"/>
  15974. </parameter>
  15975. </parameters>
  15976. </method>
  15977. <method name="set_translate_func"
  15978. c:identifier="g_option_context_set_translate_func"
  15979. version="2.12">
  15980. <doc xml:space="preserve">Sets the function which is used to translate the contexts
  15981. user-visible strings, for `--help` output. If @func is %NULL,
  15982. strings are not translated.
  15983. Note that option groups have their own translation functions,
  15984. this function only affects the @parameter_string (see g_option_context_new()),
  15985. the summary (see g_option_context_set_summary()) and the description
  15986. (see g_option_context_set_description()).
  15987. If you are using gettext(), you only need to set the translation
  15988. domain, see g_option_context_set_translation_domain().</doc>
  15989. <return-value transfer-ownership="none">
  15990. <type name="none" c:type="void"/>
  15991. </return-value>
  15992. <parameters>
  15993. <instance-parameter name="context" transfer-ownership="none">
  15994. <doc xml:space="preserve">a #GOptionContext</doc>
  15995. <type name="OptionContext" c:type="GOptionContext*"/>
  15996. </instance-parameter>
  15997. <parameter name="func"
  15998. transfer-ownership="none"
  15999. nullable="1"
  16000. allow-none="1"
  16001. scope="notified"
  16002. closure="1"
  16003. destroy="2">
  16004. <doc xml:space="preserve">the #GTranslateFunc, or %NULL</doc>
  16005. <type name="TranslateFunc" c:type="GTranslateFunc"/>
  16006. </parameter>
  16007. <parameter name="data"
  16008. transfer-ownership="none"
  16009. nullable="1"
  16010. allow-none="1">
  16011. <doc xml:space="preserve">user data to pass to @func, or %NULL</doc>
  16012. <type name="gpointer" c:type="gpointer"/>
  16013. </parameter>
  16014. <parameter name="destroy_notify"
  16015. transfer-ownership="none"
  16016. nullable="1"
  16017. allow-none="1"
  16018. scope="async">
  16019. <doc xml:space="preserve">a function which gets called to free @data, or %NULL</doc>
  16020. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  16021. </parameter>
  16022. </parameters>
  16023. </method>
  16024. <method name="set_translation_domain"
  16025. c:identifier="g_option_context_set_translation_domain"
  16026. version="2.12">
  16027. <doc xml:space="preserve">A convenience function to use gettext() for translating
  16028. user-visible strings.</doc>
  16029. <return-value transfer-ownership="none">
  16030. <type name="none" c:type="void"/>
  16031. </return-value>
  16032. <parameters>
  16033. <instance-parameter name="context" transfer-ownership="none">
  16034. <doc xml:space="preserve">a #GOptionContext</doc>
  16035. <type name="OptionContext" c:type="GOptionContext*"/>
  16036. </instance-parameter>
  16037. <parameter name="domain" transfer-ownership="none">
  16038. <doc xml:space="preserve">the domain to use</doc>
  16039. <type name="utf8" c:type="const gchar*"/>
  16040. </parameter>
  16041. </parameters>
  16042. </method>
  16043. <function name="new"
  16044. c:identifier="g_option_context_new"
  16045. version="2.6"
  16046. introspectable="0">
  16047. <doc xml:space="preserve">Creates a new option context.
  16048. The @parameter_string can serve multiple purposes. It can be used
  16049. to add descriptions for "rest" arguments, which are not parsed by
  16050. the #GOptionContext, typically something like "FILES" or
  16051. "FILE1 FILE2...". If you are using #G_OPTION_REMAINING for
  16052. collecting "rest" arguments, GLib handles this automatically by
  16053. using the @arg_description of the corresponding #GOptionEntry in
  16054. the usage summary.
  16055. Another usage is to give a short summary of the program
  16056. functionality, like " - frob the strings", which will be displayed
  16057. in the same line as the usage. For a longer description of the
  16058. program functionality that should be displayed as a paragraph
  16059. below the usage line, use g_option_context_set_summary().
  16060. Note that the @parameter_string is translated using the
  16061. function set with g_option_context_set_translate_func(), so
  16062. it should normally be passed untranslated.</doc>
  16063. <return-value>
  16064. <doc xml:space="preserve">a newly created #GOptionContext, which must be
  16065. freed with g_option_context_free() after use.</doc>
  16066. <type name="OptionContext" c:type="GOptionContext*"/>
  16067. </return-value>
  16068. <parameters>
  16069. <parameter name="parameter_string"
  16070. transfer-ownership="none"
  16071. nullable="1"
  16072. allow-none="1">
  16073. <doc xml:space="preserve">a string which is displayed in
  16074. the first line of `--help` output, after the usage summary
  16075. `programname [OPTION...]`</doc>
  16076. <type name="utf8" c:type="const gchar*"/>
  16077. </parameter>
  16078. </parameters>
  16079. </function>
  16080. </record>
  16081. <record name="OptionEntry" c:type="GOptionEntry">
  16082. <doc xml:space="preserve">A GOptionEntry struct defines a single option. To have an effect, they
  16083. must be added to a #GOptionGroup with g_option_context_add_main_entries()
  16084. or g_option_group_add_entries().</doc>
  16085. <field name="long_name" writable="1">
  16086. <doc xml:space="preserve">The long name of an option can be used to specify it
  16087. in a commandline as `--long_name`. Every option must have a
  16088. long name. To resolve conflicts if multiple option groups contain
  16089. the same long name, it is also possible to specify the option as
  16090. `--groupname-long_name`.</doc>
  16091. <type name="utf8" c:type="const gchar*"/>
  16092. </field>
  16093. <field name="short_name" writable="1">
  16094. <doc xml:space="preserve">If an option has a short name, it can be specified
  16095. `-short_name` in a commandline. @short_name must be a printable
  16096. ASCII character different from '-', or zero if the option has no
  16097. short name.</doc>
  16098. <type name="gchar" c:type="gchar"/>
  16099. </field>
  16100. <field name="flags" writable="1">
  16101. <doc xml:space="preserve">Flags from #GOptionFlags</doc>
  16102. <type name="gint" c:type="gint"/>
  16103. </field>
  16104. <field name="arg" writable="1">
  16105. <doc xml:space="preserve">The type of the option, as a #GOptionArg</doc>
  16106. <type name="OptionArg" c:type="GOptionArg"/>
  16107. </field>
  16108. <field name="arg_data" writable="1">
  16109. <doc xml:space="preserve">If the @arg type is %G_OPTION_ARG_CALLBACK, then @arg_data
  16110. must point to a #GOptionArgFunc callback function, which will be
  16111. called to handle the extra argument. Otherwise, @arg_data is a
  16112. pointer to a location to store the value, the required type of
  16113. the location depends on the @arg type:
  16114. - %G_OPTION_ARG_NONE: %gboolean
  16115. - %G_OPTION_ARG_STRING: %gchar*
  16116. - %G_OPTION_ARG_INT: %gint
  16117. - %G_OPTION_ARG_FILENAME: %gchar*
  16118. - %G_OPTION_ARG_STRING_ARRAY: %gchar**
  16119. - %G_OPTION_ARG_FILENAME_ARRAY: %gchar**
  16120. - %G_OPTION_ARG_DOUBLE: %gdouble
  16121. If @arg type is %G_OPTION_ARG_STRING or %G_OPTION_ARG_FILENAME,
  16122. the location will contain a newly allocated string if the option
  16123. was given. That string needs to be freed by the callee using g_free().
  16124. Likewise if @arg type is %G_OPTION_ARG_STRING_ARRAY or
  16125. %G_OPTION_ARG_FILENAME_ARRAY, the data should be freed using g_strfreev().</doc>
  16126. <type name="gpointer" c:type="gpointer"/>
  16127. </field>
  16128. <field name="description" writable="1">
  16129. <doc xml:space="preserve">the description for the option in `--help`
  16130. output. The @description is translated using the @translate_func
  16131. of the group, see g_option_group_set_translation_domain().</doc>
  16132. <type name="utf8" c:type="const gchar*"/>
  16133. </field>
  16134. <field name="arg_description" writable="1">
  16135. <doc xml:space="preserve">The placeholder to use for the extra argument parsed
  16136. by the option in `--help` output. The @arg_description is translated
  16137. using the @translate_func of the group, see
  16138. g_option_group_set_translation_domain().</doc>
  16139. <type name="utf8" c:type="const gchar*"/>
  16140. </field>
  16141. </record>
  16142. <enumeration name="OptionError"
  16143. c:type="GOptionError"
  16144. glib:error-domain="g-option-context-error-quark">
  16145. <doc xml:space="preserve">Error codes returned by option parsing.</doc>
  16146. <member name="unknown_option"
  16147. value="0"
  16148. c:identifier="G_OPTION_ERROR_UNKNOWN_OPTION">
  16149. <doc xml:space="preserve">An option was not known to the parser.
  16150. This error will only be reported, if the parser hasn't been instructed
  16151. to ignore unknown options, see g_option_context_set_ignore_unknown_options().</doc>
  16152. </member>
  16153. <member name="bad_value"
  16154. value="1"
  16155. c:identifier="G_OPTION_ERROR_BAD_VALUE">
  16156. <doc xml:space="preserve">A value couldn't be parsed.</doc>
  16157. </member>
  16158. <member name="failed" value="2" c:identifier="G_OPTION_ERROR_FAILED">
  16159. <doc xml:space="preserve">A #GOptionArgFunc callback failed.</doc>
  16160. </member>
  16161. </enumeration>
  16162. <callback name="OptionErrorFunc" c:type="GOptionErrorFunc" throws="1">
  16163. <doc xml:space="preserve">The type of function to be used as callback when a parse error occurs.</doc>
  16164. <return-value transfer-ownership="none">
  16165. <type name="none" c:type="void"/>
  16166. </return-value>
  16167. <parameters>
  16168. <parameter name="context" transfer-ownership="none">
  16169. <doc xml:space="preserve">The active #GOptionContext</doc>
  16170. <type name="OptionContext" c:type="GOptionContext*"/>
  16171. </parameter>
  16172. <parameter name="group" transfer-ownership="none">
  16173. <doc xml:space="preserve">The group to which the function belongs</doc>
  16174. <type name="OptionGroup" c:type="GOptionGroup*"/>
  16175. </parameter>
  16176. <parameter name="data"
  16177. transfer-ownership="none"
  16178. nullable="1"
  16179. allow-none="1">
  16180. <doc xml:space="preserve">User data added to the #GOptionGroup containing the option when it
  16181. was created with g_option_group_new()</doc>
  16182. <type name="gpointer" c:type="gpointer"/>
  16183. </parameter>
  16184. </parameters>
  16185. </callback>
  16186. <bitfield name="OptionFlags" c:type="GOptionFlags">
  16187. <doc xml:space="preserve">Flags which modify individual options.</doc>
  16188. <member name="none" value="0" c:identifier="G_OPTION_FLAG_NONE">
  16189. <doc xml:space="preserve">No flags. Since: 2.42.</doc>
  16190. </member>
  16191. <member name="hidden" value="1" c:identifier="G_OPTION_FLAG_HIDDEN">
  16192. <doc xml:space="preserve">The option doesn't appear in `--help` output.</doc>
  16193. </member>
  16194. <member name="in_main" value="2" c:identifier="G_OPTION_FLAG_IN_MAIN">
  16195. <doc xml:space="preserve">The option appears in the main section of the
  16196. `--help` output, even if it is defined in a group.</doc>
  16197. </member>
  16198. <member name="reverse" value="4" c:identifier="G_OPTION_FLAG_REVERSE">
  16199. <doc xml:space="preserve">For options of the %G_OPTION_ARG_NONE kind, this
  16200. flag indicates that the sense of the option is reversed.</doc>
  16201. </member>
  16202. <member name="no_arg" value="8" c:identifier="G_OPTION_FLAG_NO_ARG">
  16203. <doc xml:space="preserve">For options of the %G_OPTION_ARG_CALLBACK kind,
  16204. this flag indicates that the callback does not take any argument
  16205. (like a %G_OPTION_ARG_NONE option). Since 2.8</doc>
  16206. </member>
  16207. <member name="filename" value="16" c:identifier="G_OPTION_FLAG_FILENAME">
  16208. <doc xml:space="preserve">For options of the %G_OPTION_ARG_CALLBACK
  16209. kind, this flag indicates that the argument should be passed to the
  16210. callback in the GLib filename encoding rather than UTF-8. Since 2.8</doc>
  16211. </member>
  16212. <member name="optional_arg"
  16213. value="32"
  16214. c:identifier="G_OPTION_FLAG_OPTIONAL_ARG">
  16215. <doc xml:space="preserve">For options of the %G_OPTION_ARG_CALLBACK
  16216. kind, this flag indicates that the argument supply is optional.
  16217. If no argument is given then data of %GOptionParseFunc will be
  16218. set to NULL. Since 2.8</doc>
  16219. </member>
  16220. <member name="noalias" value="64" c:identifier="G_OPTION_FLAG_NOALIAS">
  16221. <doc xml:space="preserve">This flag turns off the automatic conflict
  16222. resolution which prefixes long option names with `groupname-` if
  16223. there is a conflict. This option should only be used in situations
  16224. where aliasing is necessary to model some legacy commandline interface.
  16225. It is not safe to use this option, unless all option groups are under
  16226. your direct control. Since 2.8.</doc>
  16227. </member>
  16228. </bitfield>
  16229. <record name="OptionGroup"
  16230. c:type="GOptionGroup"
  16231. glib:type-name="GOptionGroup"
  16232. glib:get-type="g_option_group_get_type"
  16233. c:symbol-prefix="option_group">
  16234. <doc xml:space="preserve">A `GOptionGroup` struct defines the options in a single
  16235. group. The struct has only private fields and should not be directly accessed.
  16236. All options in a group share the same translation function. Libraries which
  16237. need to parse commandline options are expected to provide a function for
  16238. getting a `GOptionGroup` holding their options, which
  16239. the application can then add to its #GOptionContext.</doc>
  16240. <constructor name="new" c:identifier="g_option_group_new" version="2.6">
  16241. <doc xml:space="preserve">Creates a new #GOptionGroup.</doc>
  16242. <return-value transfer-ownership="full">
  16243. <doc xml:space="preserve">a newly created option group. It should be added
  16244. to a #GOptionContext or freed with g_option_group_unref().</doc>
  16245. <type name="OptionGroup" c:type="GOptionGroup*"/>
  16246. </return-value>
  16247. <parameters>
  16248. <parameter name="name" transfer-ownership="none">
  16249. <doc xml:space="preserve">the name for the option group, this is used to provide
  16250. help for the options in this group with `--help-`@name</doc>
  16251. <type name="utf8" c:type="const gchar*"/>
  16252. </parameter>
  16253. <parameter name="description" transfer-ownership="none">
  16254. <doc xml:space="preserve">a description for this group to be shown in
  16255. `--help`. This string is translated using the translation
  16256. domain or translation function of the group</doc>
  16257. <type name="utf8" c:type="const gchar*"/>
  16258. </parameter>
  16259. <parameter name="help_description" transfer-ownership="none">
  16260. <doc xml:space="preserve">a description for the `--help-`@name option.
  16261. This string is translated using the translation domain or translation function
  16262. of the group</doc>
  16263. <type name="utf8" c:type="const gchar*"/>
  16264. </parameter>
  16265. <parameter name="user_data"
  16266. transfer-ownership="none"
  16267. nullable="1"
  16268. allow-none="1">
  16269. <doc xml:space="preserve">user data that will be passed to the pre- and post-parse hooks,
  16270. the error hook and to callbacks of %G_OPTION_ARG_CALLBACK options, or %NULL</doc>
  16271. <type name="gpointer" c:type="gpointer"/>
  16272. </parameter>
  16273. <parameter name="destroy"
  16274. transfer-ownership="none"
  16275. nullable="1"
  16276. allow-none="1"
  16277. scope="async">
  16278. <doc xml:space="preserve">a function that will be called to free @user_data, or %NULL</doc>
  16279. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  16280. </parameter>
  16281. </parameters>
  16282. </constructor>
  16283. <method name="add_entries"
  16284. c:identifier="g_option_group_add_entries"
  16285. version="2.6">
  16286. <doc xml:space="preserve">Adds the options specified in @entries to @group.</doc>
  16287. <return-value transfer-ownership="none">
  16288. <type name="none" c:type="void"/>
  16289. </return-value>
  16290. <parameters>
  16291. <instance-parameter name="group" transfer-ownership="none">
  16292. <doc xml:space="preserve">a #GOptionGroup</doc>
  16293. <type name="OptionGroup" c:type="GOptionGroup*"/>
  16294. </instance-parameter>
  16295. <parameter name="entries" transfer-ownership="none">
  16296. <doc xml:space="preserve">a %NULL-terminated array of #GOptionEntrys</doc>
  16297. <type name="OptionEntry" c:type="const GOptionEntry*"/>
  16298. </parameter>
  16299. </parameters>
  16300. </method>
  16301. <method name="free"
  16302. c:identifier="g_option_group_free"
  16303. version="2.6"
  16304. deprecated="1"
  16305. deprecated-version="2.44">
  16306. <doc xml:space="preserve">Frees a #GOptionGroup. Note that you must not free groups
  16307. which have been added to a #GOptionContext.</doc>
  16308. <doc-deprecated xml:space="preserve">Use g_option_group_unref() instead.</doc-deprecated>
  16309. <return-value transfer-ownership="none">
  16310. <type name="none" c:type="void"/>
  16311. </return-value>
  16312. <parameters>
  16313. <instance-parameter name="group" transfer-ownership="none">
  16314. <doc xml:space="preserve">a #GOptionGroup</doc>
  16315. <type name="OptionGroup" c:type="GOptionGroup*"/>
  16316. </instance-parameter>
  16317. </parameters>
  16318. </method>
  16319. <method name="ref" c:identifier="g_option_group_ref" version="2.44">
  16320. <doc xml:space="preserve">Increments the reference count of @group by one.</doc>
  16321. <return-value transfer-ownership="full">
  16322. <doc xml:space="preserve">a #GoptionGroup</doc>
  16323. <type name="OptionGroup" c:type="GOptionGroup*"/>
  16324. </return-value>
  16325. <parameters>
  16326. <instance-parameter name="group" transfer-ownership="none">
  16327. <doc xml:space="preserve">a #GOptionGroup</doc>
  16328. <type name="OptionGroup" c:type="GOptionGroup*"/>
  16329. </instance-parameter>
  16330. </parameters>
  16331. </method>
  16332. <method name="set_error_hook"
  16333. c:identifier="g_option_group_set_error_hook"
  16334. version="2.6"
  16335. introspectable="0">
  16336. <doc xml:space="preserve">Associates a function with @group which will be called
  16337. from g_option_context_parse() when an error occurs.
  16338. Note that the user data to be passed to @error_func can be
  16339. specified when constructing the group with g_option_group_new().</doc>
  16340. <return-value transfer-ownership="none">
  16341. <type name="none" c:type="void"/>
  16342. </return-value>
  16343. <parameters>
  16344. <instance-parameter name="group" transfer-ownership="none">
  16345. <doc xml:space="preserve">a #GOptionGroup</doc>
  16346. <type name="OptionGroup" c:type="GOptionGroup*"/>
  16347. </instance-parameter>
  16348. <parameter name="error_func" transfer-ownership="none">
  16349. <doc xml:space="preserve">a function to call when an error occurs</doc>
  16350. <type name="OptionErrorFunc" c:type="GOptionErrorFunc"/>
  16351. </parameter>
  16352. </parameters>
  16353. </method>
  16354. <method name="set_parse_hooks"
  16355. c:identifier="g_option_group_set_parse_hooks"
  16356. version="2.6"
  16357. introspectable="0">
  16358. <doc xml:space="preserve">Associates two functions with @group which will be called
  16359. from g_option_context_parse() before the first option is parsed
  16360. and after the last option has been parsed, respectively.
  16361. Note that the user data to be passed to @pre_parse_func and
  16362. @post_parse_func can be specified when constructing the group
  16363. with g_option_group_new().</doc>
  16364. <return-value transfer-ownership="none">
  16365. <type name="none" c:type="void"/>
  16366. </return-value>
  16367. <parameters>
  16368. <instance-parameter name="group" transfer-ownership="none">
  16369. <doc xml:space="preserve">a #GOptionGroup</doc>
  16370. <type name="OptionGroup" c:type="GOptionGroup*"/>
  16371. </instance-parameter>
  16372. <parameter name="pre_parse_func"
  16373. transfer-ownership="none"
  16374. nullable="1"
  16375. allow-none="1">
  16376. <doc xml:space="preserve">a function to call before parsing, or %NULL</doc>
  16377. <type name="OptionParseFunc" c:type="GOptionParseFunc"/>
  16378. </parameter>
  16379. <parameter name="post_parse_func"
  16380. transfer-ownership="none"
  16381. nullable="1"
  16382. allow-none="1">
  16383. <doc xml:space="preserve">a function to call after parsing, or %NULL</doc>
  16384. <type name="OptionParseFunc" c:type="GOptionParseFunc"/>
  16385. </parameter>
  16386. </parameters>
  16387. </method>
  16388. <method name="set_translate_func"
  16389. c:identifier="g_option_group_set_translate_func"
  16390. version="2.6">
  16391. <doc xml:space="preserve">Sets the function which is used to translate user-visible strings,
  16392. for `--help` output. Different groups can use different
  16393. #GTranslateFuncs. If @func is %NULL, strings are not translated.
  16394. If you are using gettext(), you only need to set the translation
  16395. domain, see g_option_group_set_translation_domain().</doc>
  16396. <return-value transfer-ownership="none">
  16397. <type name="none" c:type="void"/>
  16398. </return-value>
  16399. <parameters>
  16400. <instance-parameter name="group" transfer-ownership="none">
  16401. <doc xml:space="preserve">a #GOptionGroup</doc>
  16402. <type name="OptionGroup" c:type="GOptionGroup*"/>
  16403. </instance-parameter>
  16404. <parameter name="func"
  16405. transfer-ownership="none"
  16406. nullable="1"
  16407. allow-none="1"
  16408. scope="notified"
  16409. closure="1"
  16410. destroy="2">
  16411. <doc xml:space="preserve">the #GTranslateFunc, or %NULL</doc>
  16412. <type name="TranslateFunc" c:type="GTranslateFunc"/>
  16413. </parameter>
  16414. <parameter name="data"
  16415. transfer-ownership="none"
  16416. nullable="1"
  16417. allow-none="1">
  16418. <doc xml:space="preserve">user data to pass to @func, or %NULL</doc>
  16419. <type name="gpointer" c:type="gpointer"/>
  16420. </parameter>
  16421. <parameter name="destroy_notify"
  16422. transfer-ownership="none"
  16423. nullable="1"
  16424. allow-none="1"
  16425. scope="async">
  16426. <doc xml:space="preserve">a function which gets called to free @data, or %NULL</doc>
  16427. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  16428. </parameter>
  16429. </parameters>
  16430. </method>
  16431. <method name="set_translation_domain"
  16432. c:identifier="g_option_group_set_translation_domain"
  16433. version="2.6">
  16434. <doc xml:space="preserve">A convenience function to use gettext() for translating
  16435. user-visible strings.</doc>
  16436. <return-value transfer-ownership="none">
  16437. <type name="none" c:type="void"/>
  16438. </return-value>
  16439. <parameters>
  16440. <instance-parameter name="group" transfer-ownership="none">
  16441. <doc xml:space="preserve">a #GOptionGroup</doc>
  16442. <type name="OptionGroup" c:type="GOptionGroup*"/>
  16443. </instance-parameter>
  16444. <parameter name="domain" transfer-ownership="none">
  16445. <doc xml:space="preserve">the domain to use</doc>
  16446. <type name="utf8" c:type="const gchar*"/>
  16447. </parameter>
  16448. </parameters>
  16449. </method>
  16450. <method name="unref" c:identifier="g_option_group_unref" version="2.44">
  16451. <doc xml:space="preserve">Decrements the reference count of @group by one.
  16452. If the reference count drops to 0, the @group will be freed.
  16453. and all memory allocated by the @group is released.</doc>
  16454. <return-value transfer-ownership="none">
  16455. <type name="none" c:type="void"/>
  16456. </return-value>
  16457. <parameters>
  16458. <instance-parameter name="group" transfer-ownership="none">
  16459. <doc xml:space="preserve">a #GOptionGroup</doc>
  16460. <type name="OptionGroup" c:type="GOptionGroup*"/>
  16461. </instance-parameter>
  16462. </parameters>
  16463. </method>
  16464. </record>
  16465. <callback name="OptionParseFunc" c:type="GOptionParseFunc" throws="1">
  16466. <doc xml:space="preserve">The type of function that can be called before and after parsing.</doc>
  16467. <return-value transfer-ownership="none">
  16468. <doc xml:space="preserve">%TRUE if the function completed successfully, %FALSE if an error
  16469. occurred, in which case @error should be set with g_set_error()</doc>
  16470. <type name="gboolean" c:type="gboolean"/>
  16471. </return-value>
  16472. <parameters>
  16473. <parameter name="context" transfer-ownership="none">
  16474. <doc xml:space="preserve">The active #GOptionContext</doc>
  16475. <type name="OptionContext" c:type="GOptionContext*"/>
  16476. </parameter>
  16477. <parameter name="group" transfer-ownership="none">
  16478. <doc xml:space="preserve">The group to which the function belongs</doc>
  16479. <type name="OptionGroup" c:type="GOptionGroup*"/>
  16480. </parameter>
  16481. <parameter name="data"
  16482. transfer-ownership="none"
  16483. nullable="1"
  16484. allow-none="1">
  16485. <doc xml:space="preserve">User data added to the #GOptionGroup containing the option when it
  16486. was created with g_option_group_new()</doc>
  16487. <type name="gpointer" c:type="gpointer"/>
  16488. </parameter>
  16489. </parameters>
  16490. </callback>
  16491. <constant name="PDP_ENDIAN" value="3412" c:type="G_PDP_ENDIAN">
  16492. <doc xml:space="preserve">Specifies one of the possible types of byte order
  16493. (currently unused). See #G_BYTE_ORDER.</doc>
  16494. <type name="gint" c:type="gint"/>
  16495. </constant>
  16496. <constant name="PI" value="3.141593" c:type="G_PI">
  16497. <doc xml:space="preserve">The value of pi (ratio of circle's circumference to its diameter).</doc>
  16498. <type name="gdouble" c:type="gdouble"/>
  16499. </constant>
  16500. <constant name="PI_2" value="1.570796" c:type="G_PI_2">
  16501. <doc xml:space="preserve">Pi divided by 2.</doc>
  16502. <type name="gdouble" c:type="gdouble"/>
  16503. </constant>
  16504. <constant name="PI_4" value="0.785398" c:type="G_PI_4">
  16505. <doc xml:space="preserve">Pi divided by 4.</doc>
  16506. <type name="gdouble" c:type="gdouble"/>
  16507. </constant>
  16508. <constant name="POLLFD_FORMAT" value="%d" c:type="G_POLLFD_FORMAT">
  16509. <doc xml:space="preserve">A format specifier that can be used in printf()-style format strings
  16510. when printing the @fd member of a #GPollFD.</doc>
  16511. <type name="utf8" c:type="gchar*"/>
  16512. </constant>
  16513. <constant name="PRIORITY_DEFAULT" value="0" c:type="G_PRIORITY_DEFAULT">
  16514. <doc xml:space="preserve">Use this for default priority event sources.
  16515. In GLib this priority is used when adding timeout functions
  16516. with g_timeout_add(). In GDK this priority is used for events
  16517. from the X server.</doc>
  16518. <type name="gint" c:type="gint"/>
  16519. </constant>
  16520. <constant name="PRIORITY_DEFAULT_IDLE"
  16521. value="200"
  16522. c:type="G_PRIORITY_DEFAULT_IDLE">
  16523. <doc xml:space="preserve">Use this for default priority idle functions.
  16524. In GLib this priority is used when adding idle functions with
  16525. g_idle_add().</doc>
  16526. <type name="gint" c:type="gint"/>
  16527. </constant>
  16528. <constant name="PRIORITY_HIGH" value="-100" c:type="G_PRIORITY_HIGH">
  16529. <doc xml:space="preserve">Use this for high priority event sources.
  16530. It is not used within GLib or GTK+.</doc>
  16531. <type name="gint" c:type="gint"/>
  16532. </constant>
  16533. <constant name="PRIORITY_HIGH_IDLE"
  16534. value="100"
  16535. c:type="G_PRIORITY_HIGH_IDLE">
  16536. <doc xml:space="preserve">Use this for high priority idle functions.
  16537. GTK+ uses #G_PRIORITY_HIGH_IDLE + 10 for resizing operations,
  16538. and #G_PRIORITY_HIGH_IDLE + 20 for redrawing operations. (This is
  16539. done to ensure that any pending resizes are processed before any
  16540. pending redraws, so that widgets are not redrawn twice unnecessarily.)</doc>
  16541. <type name="gint" c:type="gint"/>
  16542. </constant>
  16543. <constant name="PRIORITY_LOW" value="300" c:type="G_PRIORITY_LOW">
  16544. <doc xml:space="preserve">Use this for very low priority background tasks.
  16545. It is not used within GLib or GTK+.</doc>
  16546. <type name="gint" c:type="gint"/>
  16547. </constant>
  16548. <record name="PatternSpec" c:type="GPatternSpec" disguised="1">
  16549. <doc xml:space="preserve">A GPatternSpec struct is the 'compiled' form of a pattern. This
  16550. structure is opaque and its fields cannot be accessed directly.</doc>
  16551. <method name="equal" c:identifier="g_pattern_spec_equal">
  16552. <doc xml:space="preserve">Compares two compiled pattern specs and returns whether they will
  16553. match the same set of strings.</doc>
  16554. <return-value transfer-ownership="none">
  16555. <doc xml:space="preserve">Whether the compiled patterns are equal</doc>
  16556. <type name="gboolean" c:type="gboolean"/>
  16557. </return-value>
  16558. <parameters>
  16559. <instance-parameter name="pspec1" transfer-ownership="none">
  16560. <doc xml:space="preserve">a #GPatternSpec</doc>
  16561. <type name="PatternSpec" c:type="GPatternSpec*"/>
  16562. </instance-parameter>
  16563. <parameter name="pspec2" transfer-ownership="none">
  16564. <doc xml:space="preserve">another #GPatternSpec</doc>
  16565. <type name="PatternSpec" c:type="GPatternSpec*"/>
  16566. </parameter>
  16567. </parameters>
  16568. </method>
  16569. <method name="free" c:identifier="g_pattern_spec_free">
  16570. <doc xml:space="preserve">Frees the memory allocated for the #GPatternSpec.</doc>
  16571. <return-value transfer-ownership="none">
  16572. <type name="none" c:type="void"/>
  16573. </return-value>
  16574. <parameters>
  16575. <instance-parameter name="pspec" transfer-ownership="none">
  16576. <doc xml:space="preserve">a #GPatternSpec</doc>
  16577. <type name="PatternSpec" c:type="GPatternSpec*"/>
  16578. </instance-parameter>
  16579. </parameters>
  16580. </method>
  16581. <function name="new"
  16582. c:identifier="g_pattern_spec_new"
  16583. introspectable="0">
  16584. <doc xml:space="preserve">Compiles a pattern to a #GPatternSpec.</doc>
  16585. <return-value>
  16586. <doc xml:space="preserve">a newly-allocated #GPatternSpec</doc>
  16587. <type name="PatternSpec" c:type="GPatternSpec*"/>
  16588. </return-value>
  16589. <parameters>
  16590. <parameter name="pattern" transfer-ownership="none">
  16591. <doc xml:space="preserve">a zero-terminated UTF-8 encoded string</doc>
  16592. <type name="utf8" c:type="const gchar*"/>
  16593. </parameter>
  16594. </parameters>
  16595. </function>
  16596. </record>
  16597. <record name="PollFD"
  16598. c:type="GPollFD"
  16599. glib:type-name="GPollFD"
  16600. glib:get-type="g_pollfd_get_type"
  16601. c:symbol-prefix="pollfd">
  16602. <doc xml:space="preserve">Represents a file descriptor, which events to poll for, and which events
  16603. occurred.</doc>
  16604. <field name="fd" writable="1">
  16605. <doc xml:space="preserve">the file descriptor to poll (or a HANDLE on Win32)</doc>
  16606. <type name="gint" c:type="gint"/>
  16607. </field>
  16608. <field name="events" writable="1">
  16609. <doc xml:space="preserve">a bitwise combination from #GIOCondition, specifying which
  16610. events should be polled for. Typically for reading from a file
  16611. descriptor you would use %G_IO_IN | %G_IO_HUP | %G_IO_ERR, and
  16612. for writing you would use %G_IO_OUT | %G_IO_ERR.</doc>
  16613. <type name="gushort" c:type="gushort"/>
  16614. </field>
  16615. <field name="revents" writable="1">
  16616. <doc xml:space="preserve">a bitwise combination of flags from #GIOCondition, returned
  16617. from the poll() function to indicate which events occurred.</doc>
  16618. <type name="gushort" c:type="gushort"/>
  16619. </field>
  16620. </record>
  16621. <callback name="PollFunc" c:type="GPollFunc">
  16622. <doc xml:space="preserve">Specifies the type of function passed to g_main_context_set_poll_func().
  16623. The semantics of the function should match those of the poll() system call.</doc>
  16624. <return-value transfer-ownership="none">
  16625. <doc xml:space="preserve">the number of #GPollFD elements which have events or errors
  16626. reported, or -1 if an error occurred.</doc>
  16627. <type name="gint" c:type="gint"/>
  16628. </return-value>
  16629. <parameters>
  16630. <parameter name="ufds" transfer-ownership="none">
  16631. <doc xml:space="preserve">an array of #GPollFD elements</doc>
  16632. <type name="PollFD" c:type="GPollFD*"/>
  16633. </parameter>
  16634. <parameter name="nfsd" transfer-ownership="none">
  16635. <doc xml:space="preserve">the number of elements in @ufds</doc>
  16636. <type name="guint" c:type="guint"/>
  16637. </parameter>
  16638. <parameter name="timeout_" transfer-ownership="none">
  16639. <doc xml:space="preserve">the maximum time to wait for an event of the file descriptors.
  16640. A negative value indicates an infinite timeout.</doc>
  16641. <type name="gint" c:type="gint"/>
  16642. </parameter>
  16643. </parameters>
  16644. </callback>
  16645. <callback name="PrintFunc" c:type="GPrintFunc">
  16646. <doc xml:space="preserve">Specifies the type of the print handler functions.
  16647. These are called with the complete formatted string to output.</doc>
  16648. <return-value transfer-ownership="none">
  16649. <type name="none" c:type="void"/>
  16650. </return-value>
  16651. <parameters>
  16652. <parameter name="string" transfer-ownership="none">
  16653. <doc xml:space="preserve">the message to output</doc>
  16654. <type name="utf8" c:type="const gchar*"/>
  16655. </parameter>
  16656. </parameters>
  16657. </callback>
  16658. <record name="Private" c:type="GPrivate">
  16659. <doc xml:space="preserve">The #GPrivate struct is an opaque data structure to represent a
  16660. thread-local data key. It is approximately equivalent to the
  16661. pthread_setspecific()/pthread_getspecific() APIs on POSIX and to
  16662. TlsSetValue()/TlsGetValue() on Windows.
  16663. If you don't already know why you might want this functionality,
  16664. then you probably don't need it.
  16665. #GPrivate is a very limited resource (as far as 128 per program,
  16666. shared between all libraries). It is also not possible to destroy a
  16667. #GPrivate after it has been used. As such, it is only ever acceptable
  16668. to use #GPrivate in static scope, and even then sparingly so.
  16669. See G_PRIVATE_INIT() for a couple of examples.
  16670. The #GPrivate structure should be considered opaque. It should only
  16671. be accessed via the g_private_ functions.</doc>
  16672. <field name="p" readable="0" private="1">
  16673. <type name="gpointer" c:type="gpointer"/>
  16674. </field>
  16675. <field name="notify" readable="0" private="1">
  16676. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  16677. </field>
  16678. <field name="future" readable="0" private="1">
  16679. <array zero-terminated="0" c:type="gpointer" fixed-size="2">
  16680. <type name="gpointer" c:type="gpointer"/>
  16681. </array>
  16682. </field>
  16683. <method name="get" c:identifier="g_private_get">
  16684. <doc xml:space="preserve">Returns the current value of the thread local variable @key.
  16685. If the value has not yet been set in this thread, %NULL is returned.
  16686. Values are never copied between threads (when a new thread is
  16687. created, for example).</doc>
  16688. <return-value transfer-ownership="none" nullable="1">
  16689. <doc xml:space="preserve">the thread-local value</doc>
  16690. <type name="gpointer" c:type="gpointer"/>
  16691. </return-value>
  16692. <parameters>
  16693. <instance-parameter name="key" transfer-ownership="none">
  16694. <doc xml:space="preserve">a #GPrivate</doc>
  16695. <type name="Private" c:type="GPrivate*"/>
  16696. </instance-parameter>
  16697. </parameters>
  16698. </method>
  16699. <method name="replace" c:identifier="g_private_replace" version="2.32">
  16700. <doc xml:space="preserve">Sets the thread local variable @key to have the value @value in the
  16701. current thread.
  16702. This function differs from g_private_set() in the following way: if
  16703. the previous value was non-%NULL then the #GDestroyNotify handler for
  16704. @key is run on it.</doc>
  16705. <return-value transfer-ownership="none">
  16706. <type name="none" c:type="void"/>
  16707. </return-value>
  16708. <parameters>
  16709. <instance-parameter name="key" transfer-ownership="none">
  16710. <doc xml:space="preserve">a #GPrivate</doc>
  16711. <type name="Private" c:type="GPrivate*"/>
  16712. </instance-parameter>
  16713. <parameter name="value"
  16714. transfer-ownership="none"
  16715. nullable="1"
  16716. allow-none="1">
  16717. <doc xml:space="preserve">the new value</doc>
  16718. <type name="gpointer" c:type="gpointer"/>
  16719. </parameter>
  16720. </parameters>
  16721. </method>
  16722. <method name="set" c:identifier="g_private_set">
  16723. <doc xml:space="preserve">Sets the thread local variable @key to have the value @value in the
  16724. current thread.
  16725. This function differs from g_private_replace() in the following way:
  16726. the #GDestroyNotify for @key is not called on the old value.</doc>
  16727. <return-value transfer-ownership="none">
  16728. <type name="none" c:type="void"/>
  16729. </return-value>
  16730. <parameters>
  16731. <instance-parameter name="key" transfer-ownership="none">
  16732. <doc xml:space="preserve">a #GPrivate</doc>
  16733. <type name="Private" c:type="GPrivate*"/>
  16734. </instance-parameter>
  16735. <parameter name="value"
  16736. transfer-ownership="none"
  16737. nullable="1"
  16738. allow-none="1">
  16739. <doc xml:space="preserve">the new value</doc>
  16740. <type name="gpointer" c:type="gpointer"/>
  16741. </parameter>
  16742. </parameters>
  16743. </method>
  16744. </record>
  16745. <record name="PtrArray"
  16746. c:type="GPtrArray"
  16747. glib:type-name="GPtrArray"
  16748. glib:get-type="g_ptr_array_get_type"
  16749. c:symbol-prefix="ptr_array">
  16750. <doc xml:space="preserve">Contains the public fields of a pointer array.</doc>
  16751. <field name="pdata" writable="1">
  16752. <doc xml:space="preserve">points to the array of pointers, which may be moved when the
  16753. array grows</doc>
  16754. <type name="gpointer" c:type="gpointer*"/>
  16755. </field>
  16756. <field name="len" writable="1">
  16757. <doc xml:space="preserve">number of pointers in the array</doc>
  16758. <type name="guint" c:type="guint"/>
  16759. </field>
  16760. <function name="add" c:identifier="g_ptr_array_add" introspectable="0">
  16761. <doc xml:space="preserve">Adds a pointer to the end of the pointer array. The array will grow
  16762. in size automatically if necessary.</doc>
  16763. <return-value transfer-ownership="none">
  16764. <type name="none" c:type="void"/>
  16765. </return-value>
  16766. <parameters>
  16767. <parameter name="array" transfer-ownership="none">
  16768. <doc xml:space="preserve">a #GPtrArray</doc>
  16769. <array name="GLib.PtrArray" c:type="GPtrArray*">
  16770. <type name="gpointer" c:type="gpointer"/>
  16771. </array>
  16772. </parameter>
  16773. <parameter name="data"
  16774. transfer-ownership="none"
  16775. nullable="1"
  16776. allow-none="1">
  16777. <doc xml:space="preserve">the pointer to add</doc>
  16778. <type name="gpointer" c:type="gpointer"/>
  16779. </parameter>
  16780. </parameters>
  16781. </function>
  16782. <function name="foreach"
  16783. c:identifier="g_ptr_array_foreach"
  16784. version="2.4"
  16785. introspectable="0">
  16786. <doc xml:space="preserve">Calls a function for each element of a #GPtrArray.</doc>
  16787. <return-value transfer-ownership="none">
  16788. <type name="none" c:type="void"/>
  16789. </return-value>
  16790. <parameters>
  16791. <parameter name="array" transfer-ownership="none">
  16792. <doc xml:space="preserve">a #GPtrArray</doc>
  16793. <array name="GLib.PtrArray" c:type="GPtrArray*">
  16794. <type name="gpointer" c:type="gpointer"/>
  16795. </array>
  16796. </parameter>
  16797. <parameter name="func" transfer-ownership="none" closure="2">
  16798. <doc xml:space="preserve">the function to call for each array element</doc>
  16799. <type name="Func" c:type="GFunc"/>
  16800. </parameter>
  16801. <parameter name="user_data"
  16802. transfer-ownership="none"
  16803. nullable="1"
  16804. allow-none="1">
  16805. <doc xml:space="preserve">user data to pass to the function</doc>
  16806. <type name="gpointer" c:type="gpointer"/>
  16807. </parameter>
  16808. </parameters>
  16809. </function>
  16810. <function name="free" c:identifier="g_ptr_array_free" introspectable="0">
  16811. <doc xml:space="preserve">Frees the memory allocated for the #GPtrArray. If @free_seg is %TRUE
  16812. it frees the memory block holding the elements as well. Pass %FALSE
  16813. if you want to free the #GPtrArray wrapper but preserve the
  16814. underlying array for use elsewhere. If the reference count of @array
  16815. is greater than one, the #GPtrArray wrapper is preserved but the
  16816. size of @array will be set to zero.
  16817. If array contents point to dynamically-allocated memory, they should
  16818. be freed separately if @free_seg is %TRUE and no #GDestroyNotify
  16819. function has been set for @array.</doc>
  16820. <return-value transfer-ownership="none" nullable="1">
  16821. <doc xml:space="preserve">the pointer array if @free_seg is %FALSE, otherwise %NULL.
  16822. The pointer array should be freed using g_free().</doc>
  16823. <type name="gpointer" c:type="gpointer*"/>
  16824. </return-value>
  16825. <parameters>
  16826. <parameter name="array" transfer-ownership="none">
  16827. <doc xml:space="preserve">a #GPtrArray</doc>
  16828. <array name="GLib.PtrArray" c:type="GPtrArray*">
  16829. <type name="gpointer" c:type="gpointer"/>
  16830. </array>
  16831. </parameter>
  16832. <parameter name="free_seg" transfer-ownership="none">
  16833. <doc xml:space="preserve">if %TRUE the actual pointer array is freed as well</doc>
  16834. <type name="gboolean" c:type="gboolean"/>
  16835. </parameter>
  16836. </parameters>
  16837. </function>
  16838. <function name="insert"
  16839. c:identifier="g_ptr_array_insert"
  16840. version="2.40"
  16841. introspectable="0">
  16842. <doc xml:space="preserve">Inserts an element into the pointer array at the given index. The
  16843. array will grow in size automatically if necessary.</doc>
  16844. <return-value transfer-ownership="none">
  16845. <type name="none" c:type="void"/>
  16846. </return-value>
  16847. <parameters>
  16848. <parameter name="array" transfer-ownership="none">
  16849. <doc xml:space="preserve">a #GPtrArray</doc>
  16850. <array name="GLib.PtrArray" c:type="GPtrArray*">
  16851. <type name="gpointer" c:type="gpointer"/>
  16852. </array>
  16853. </parameter>
  16854. <parameter name="index_" transfer-ownership="none">
  16855. <doc xml:space="preserve">the index to place the new element at, or -1 to append</doc>
  16856. <type name="gint" c:type="gint"/>
  16857. </parameter>
  16858. <parameter name="data"
  16859. transfer-ownership="none"
  16860. nullable="1"
  16861. allow-none="1">
  16862. <doc xml:space="preserve">the pointer to add.</doc>
  16863. <type name="gpointer" c:type="gpointer"/>
  16864. </parameter>
  16865. </parameters>
  16866. </function>
  16867. <function name="new" c:identifier="g_ptr_array_new" introspectable="0">
  16868. <doc xml:space="preserve">Creates a new #GPtrArray with a reference count of 1.</doc>
  16869. <return-value>
  16870. <doc xml:space="preserve">the new #GPtrArray</doc>
  16871. <array name="GLib.PtrArray" c:type="GPtrArray*">
  16872. <type name="gpointer" c:type="gpointer"/>
  16873. </array>
  16874. </return-value>
  16875. </function>
  16876. <function name="new_full"
  16877. c:identifier="g_ptr_array_new_full"
  16878. version="2.30"
  16879. introspectable="0">
  16880. <doc xml:space="preserve">Creates a new #GPtrArray with @reserved_size pointers preallocated
  16881. and a reference count of 1. This avoids frequent reallocation, if
  16882. you are going to add many pointers to the array. Note however that
  16883. the size of the array is still 0. It also set @element_free_func
  16884. for freeing each element when the array is destroyed either via
  16885. g_ptr_array_unref(), when g_ptr_array_free() is called with
  16886. @free_segment set to %TRUE or when removing elements.</doc>
  16887. <return-value>
  16888. <doc xml:space="preserve">A new #GPtrArray</doc>
  16889. <array name="GLib.PtrArray" c:type="GPtrArray*">
  16890. <type name="gpointer" c:type="gpointer"/>
  16891. </array>
  16892. </return-value>
  16893. <parameters>
  16894. <parameter name="reserved_size" transfer-ownership="none">
  16895. <doc xml:space="preserve">number of pointers preallocated</doc>
  16896. <type name="guint" c:type="guint"/>
  16897. </parameter>
  16898. <parameter name="element_free_func"
  16899. transfer-ownership="none"
  16900. nullable="1"
  16901. allow-none="1"
  16902. scope="async">
  16903. <doc xml:space="preserve">A function to free elements with
  16904. destroy @array or %NULL</doc>
  16905. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  16906. </parameter>
  16907. </parameters>
  16908. </function>
  16909. <function name="new_with_free_func"
  16910. c:identifier="g_ptr_array_new_with_free_func"
  16911. version="2.22"
  16912. introspectable="0">
  16913. <doc xml:space="preserve">Creates a new #GPtrArray with a reference count of 1 and use
  16914. @element_free_func for freeing each element when the array is destroyed
  16915. either via g_ptr_array_unref(), when g_ptr_array_free() is called with
  16916. @free_segment set to %TRUE or when removing elements.</doc>
  16917. <return-value>
  16918. <doc xml:space="preserve">A new #GPtrArray</doc>
  16919. <array name="GLib.PtrArray" c:type="GPtrArray*">
  16920. <type name="gpointer" c:type="gpointer"/>
  16921. </array>
  16922. </return-value>
  16923. <parameters>
  16924. <parameter name="element_free_func"
  16925. transfer-ownership="none"
  16926. nullable="1"
  16927. allow-none="1"
  16928. scope="async">
  16929. <doc xml:space="preserve">A function to free elements with
  16930. destroy @array or %NULL</doc>
  16931. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  16932. </parameter>
  16933. </parameters>
  16934. </function>
  16935. <function name="ref"
  16936. c:identifier="g_ptr_array_ref"
  16937. version="2.22"
  16938. introspectable="0">
  16939. <doc xml:space="preserve">Atomically increments the reference count of @array by one.
  16940. This function is thread-safe and may be called from any thread.</doc>
  16941. <return-value>
  16942. <doc xml:space="preserve">The passed in #GPtrArray</doc>
  16943. <array name="GLib.PtrArray" c:type="GPtrArray*">
  16944. <type name="gpointer" c:type="gpointer"/>
  16945. </array>
  16946. </return-value>
  16947. <parameters>
  16948. <parameter name="array" transfer-ownership="none">
  16949. <doc xml:space="preserve">a #GPtrArray</doc>
  16950. <array name="GLib.PtrArray" c:type="GPtrArray*">
  16951. <type name="gpointer" c:type="gpointer"/>
  16952. </array>
  16953. </parameter>
  16954. </parameters>
  16955. </function>
  16956. <function name="remove"
  16957. c:identifier="g_ptr_array_remove"
  16958. introspectable="0">
  16959. <doc xml:space="preserve">Removes the first occurrence of the given pointer from the pointer
  16960. array. The following elements are moved down one place. If @array
  16961. has a non-%NULL #GDestroyNotify function it is called for the
  16962. removed element.
  16963. It returns %TRUE if the pointer was removed, or %FALSE if the
  16964. pointer was not found.</doc>
  16965. <return-value transfer-ownership="none">
  16966. <doc xml:space="preserve">%TRUE if the pointer is removed, %FALSE if the pointer
  16967. is not found in the array</doc>
  16968. <type name="gboolean" c:type="gboolean"/>
  16969. </return-value>
  16970. <parameters>
  16971. <parameter name="array" transfer-ownership="none">
  16972. <doc xml:space="preserve">a #GPtrArray</doc>
  16973. <array name="GLib.PtrArray" c:type="GPtrArray*">
  16974. <type name="gpointer" c:type="gpointer"/>
  16975. </array>
  16976. </parameter>
  16977. <parameter name="data"
  16978. transfer-ownership="none"
  16979. nullable="1"
  16980. allow-none="1">
  16981. <doc xml:space="preserve">the pointer to remove</doc>
  16982. <type name="gpointer" c:type="gpointer"/>
  16983. </parameter>
  16984. </parameters>
  16985. </function>
  16986. <function name="remove_fast"
  16987. c:identifier="g_ptr_array_remove_fast"
  16988. introspectable="0">
  16989. <doc xml:space="preserve">Removes the first occurrence of the given pointer from the pointer
  16990. array. The last element in the array is used to fill in the space,
  16991. so this function does not preserve the order of the array. But it
  16992. is faster than g_ptr_array_remove(). If @array has a non-%NULL
  16993. #GDestroyNotify function it is called for the removed element.
  16994. It returns %TRUE if the pointer was removed, or %FALSE if the
  16995. pointer was not found.</doc>
  16996. <return-value transfer-ownership="none">
  16997. <doc xml:space="preserve">%TRUE if the pointer was found in the array</doc>
  16998. <type name="gboolean" c:type="gboolean"/>
  16999. </return-value>
  17000. <parameters>
  17001. <parameter name="array" transfer-ownership="none">
  17002. <doc xml:space="preserve">a #GPtrArray</doc>
  17003. <array name="GLib.PtrArray" c:type="GPtrArray*">
  17004. <type name="gpointer" c:type="gpointer"/>
  17005. </array>
  17006. </parameter>
  17007. <parameter name="data"
  17008. transfer-ownership="none"
  17009. nullable="1"
  17010. allow-none="1">
  17011. <doc xml:space="preserve">the pointer to remove</doc>
  17012. <type name="gpointer" c:type="gpointer"/>
  17013. </parameter>
  17014. </parameters>
  17015. </function>
  17016. <function name="remove_index"
  17017. c:identifier="g_ptr_array_remove_index"
  17018. introspectable="0">
  17019. <doc xml:space="preserve">Removes the pointer at the given index from the pointer array.
  17020. The following elements are moved down one place. If @array has
  17021. a non-%NULL #GDestroyNotify function it is called for the removed
  17022. element.</doc>
  17023. <return-value transfer-ownership="none" nullable="1">
  17024. <doc xml:space="preserve">the pointer which was removed</doc>
  17025. <type name="gpointer" c:type="gpointer"/>
  17026. </return-value>
  17027. <parameters>
  17028. <parameter name="array" transfer-ownership="none">
  17029. <doc xml:space="preserve">a #GPtrArray</doc>
  17030. <array name="GLib.PtrArray" c:type="GPtrArray*">
  17031. <type name="gpointer" c:type="gpointer"/>
  17032. </array>
  17033. </parameter>
  17034. <parameter name="index_" transfer-ownership="none">
  17035. <doc xml:space="preserve">the index of the pointer to remove</doc>
  17036. <type name="guint" c:type="guint"/>
  17037. </parameter>
  17038. </parameters>
  17039. </function>
  17040. <function name="remove_index_fast"
  17041. c:identifier="g_ptr_array_remove_index_fast"
  17042. introspectable="0">
  17043. <doc xml:space="preserve">Removes the pointer at the given index from the pointer array.
  17044. The last element in the array is used to fill in the space, so
  17045. this function does not preserve the order of the array. But it
  17046. is faster than g_ptr_array_remove_index(). If @array has a non-%NULL
  17047. #GDestroyNotify function it is called for the removed element.</doc>
  17048. <return-value transfer-ownership="none" nullable="1">
  17049. <doc xml:space="preserve">the pointer which was removed</doc>
  17050. <type name="gpointer" c:type="gpointer"/>
  17051. </return-value>
  17052. <parameters>
  17053. <parameter name="array" transfer-ownership="none">
  17054. <doc xml:space="preserve">a #GPtrArray</doc>
  17055. <array name="GLib.PtrArray" c:type="GPtrArray*">
  17056. <type name="gpointer" c:type="gpointer"/>
  17057. </array>
  17058. </parameter>
  17059. <parameter name="index_" transfer-ownership="none">
  17060. <doc xml:space="preserve">the index of the pointer to remove</doc>
  17061. <type name="guint" c:type="guint"/>
  17062. </parameter>
  17063. </parameters>
  17064. </function>
  17065. <function name="remove_range"
  17066. c:identifier="g_ptr_array_remove_range"
  17067. version="2.4"
  17068. introspectable="0">
  17069. <doc xml:space="preserve">Removes the given number of pointers starting at the given index
  17070. from a #GPtrArray. The following elements are moved to close the
  17071. gap. If @array has a non-%NULL #GDestroyNotify function it is
  17072. called for the removed elements.</doc>
  17073. <return-value>
  17074. <doc xml:space="preserve">the @array</doc>
  17075. <array name="GLib.PtrArray" c:type="GPtrArray*">
  17076. <type name="gpointer" c:type="gpointer"/>
  17077. </array>
  17078. </return-value>
  17079. <parameters>
  17080. <parameter name="array" transfer-ownership="none">
  17081. <doc xml:space="preserve">a @GPtrArray</doc>
  17082. <array name="GLib.PtrArray" c:type="GPtrArray*">
  17083. <type name="gpointer" c:type="gpointer"/>
  17084. </array>
  17085. </parameter>
  17086. <parameter name="index_" transfer-ownership="none">
  17087. <doc xml:space="preserve">the index of the first pointer to remove</doc>
  17088. <type name="guint" c:type="guint"/>
  17089. </parameter>
  17090. <parameter name="length" transfer-ownership="none">
  17091. <doc xml:space="preserve">the number of pointers to remove</doc>
  17092. <type name="guint" c:type="guint"/>
  17093. </parameter>
  17094. </parameters>
  17095. </function>
  17096. <function name="set_free_func"
  17097. c:identifier="g_ptr_array_set_free_func"
  17098. version="2.22"
  17099. introspectable="0">
  17100. <doc xml:space="preserve">Sets a function for freeing each element when @array is destroyed
  17101. either via g_ptr_array_unref(), when g_ptr_array_free() is called
  17102. with @free_segment set to %TRUE or when removing elements.</doc>
  17103. <return-value transfer-ownership="none">
  17104. <type name="none" c:type="void"/>
  17105. </return-value>
  17106. <parameters>
  17107. <parameter name="array" transfer-ownership="none">
  17108. <doc xml:space="preserve">A #GPtrArray</doc>
  17109. <array name="GLib.PtrArray" c:type="GPtrArray*">
  17110. <type name="gpointer" c:type="gpointer"/>
  17111. </array>
  17112. </parameter>
  17113. <parameter name="element_free_func"
  17114. transfer-ownership="none"
  17115. nullable="1"
  17116. allow-none="1"
  17117. scope="async">
  17118. <doc xml:space="preserve">A function to free elements with
  17119. destroy @array or %NULL</doc>
  17120. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  17121. </parameter>
  17122. </parameters>
  17123. </function>
  17124. <function name="set_size"
  17125. c:identifier="g_ptr_array_set_size"
  17126. introspectable="0">
  17127. <doc xml:space="preserve">Sets the size of the array. When making the array larger,
  17128. newly-added elements will be set to %NULL. When making it smaller,
  17129. if @array has a non-%NULL #GDestroyNotify function then it will be
  17130. called for the removed elements.</doc>
  17131. <return-value transfer-ownership="none">
  17132. <type name="none" c:type="void"/>
  17133. </return-value>
  17134. <parameters>
  17135. <parameter name="array" transfer-ownership="none">
  17136. <doc xml:space="preserve">a #GPtrArray</doc>
  17137. <array name="GLib.PtrArray" c:type="GPtrArray*">
  17138. <type name="gpointer" c:type="gpointer"/>
  17139. </array>
  17140. </parameter>
  17141. <parameter name="length" transfer-ownership="none">
  17142. <doc xml:space="preserve">the new length of the pointer array</doc>
  17143. <type name="gint" c:type="gint"/>
  17144. </parameter>
  17145. </parameters>
  17146. </function>
  17147. <function name="sized_new"
  17148. c:identifier="g_ptr_array_sized_new"
  17149. introspectable="0">
  17150. <doc xml:space="preserve">Creates a new #GPtrArray with @reserved_size pointers preallocated
  17151. and a reference count of 1. This avoids frequent reallocation, if
  17152. you are going to add many pointers to the array. Note however that
  17153. the size of the array is still 0.</doc>
  17154. <return-value>
  17155. <doc xml:space="preserve">the new #GPtrArray</doc>
  17156. <array name="GLib.PtrArray" c:type="GPtrArray*">
  17157. <type name="gpointer" c:type="gpointer"/>
  17158. </array>
  17159. </return-value>
  17160. <parameters>
  17161. <parameter name="reserved_size" transfer-ownership="none">
  17162. <doc xml:space="preserve">number of pointers preallocated</doc>
  17163. <type name="guint" c:type="guint"/>
  17164. </parameter>
  17165. </parameters>
  17166. </function>
  17167. <function name="sort" c:identifier="g_ptr_array_sort" introspectable="0">
  17168. <doc xml:space="preserve">Sorts the array, using @compare_func which should be a qsort()-style
  17169. comparison function (returns less than zero for first arg is less
  17170. than second arg, zero for equal, greater than zero if irst arg is
  17171. greater than second arg).
  17172. Note that the comparison function for g_ptr_array_sort() doesn't
  17173. take the pointers from the array as arguments, it takes pointers to
  17174. the pointers in the array.
  17175. This is guaranteed to be a stable sort since version 2.32.</doc>
  17176. <return-value transfer-ownership="none">
  17177. <type name="none" c:type="void"/>
  17178. </return-value>
  17179. <parameters>
  17180. <parameter name="array" transfer-ownership="none">
  17181. <doc xml:space="preserve">a #GPtrArray</doc>
  17182. <array name="GLib.PtrArray" c:type="GPtrArray*">
  17183. <type name="gpointer" c:type="gpointer"/>
  17184. </array>
  17185. </parameter>
  17186. <parameter name="compare_func" transfer-ownership="none">
  17187. <doc xml:space="preserve">comparison function</doc>
  17188. <type name="CompareFunc" c:type="GCompareFunc"/>
  17189. </parameter>
  17190. </parameters>
  17191. </function>
  17192. <function name="sort_with_data"
  17193. c:identifier="g_ptr_array_sort_with_data"
  17194. introspectable="0">
  17195. <doc xml:space="preserve">Like g_ptr_array_sort(), but the comparison function has an extra
  17196. user data argument.
  17197. Note that the comparison function for g_ptr_array_sort_with_data()
  17198. doesn't take the pointers from the array as arguments, it takes
  17199. pointers to the pointers in the array.
  17200. This is guaranteed to be a stable sort since version 2.32.</doc>
  17201. <return-value transfer-ownership="none">
  17202. <type name="none" c:type="void"/>
  17203. </return-value>
  17204. <parameters>
  17205. <parameter name="array" transfer-ownership="none">
  17206. <doc xml:space="preserve">a #GPtrArray</doc>
  17207. <array name="GLib.PtrArray" c:type="GPtrArray*">
  17208. <type name="gpointer" c:type="gpointer"/>
  17209. </array>
  17210. </parameter>
  17211. <parameter name="compare_func" transfer-ownership="none" closure="2">
  17212. <doc xml:space="preserve">comparison function</doc>
  17213. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  17214. </parameter>
  17215. <parameter name="user_data"
  17216. transfer-ownership="none"
  17217. nullable="1"
  17218. allow-none="1">
  17219. <doc xml:space="preserve">data to pass to @compare_func</doc>
  17220. <type name="gpointer" c:type="gpointer"/>
  17221. </parameter>
  17222. </parameters>
  17223. </function>
  17224. <function name="unref"
  17225. c:identifier="g_ptr_array_unref"
  17226. version="2.22"
  17227. introspectable="0">
  17228. <doc xml:space="preserve">Atomically decrements the reference count of @array by one. If the
  17229. reference count drops to 0, the effect is the same as calling
  17230. g_ptr_array_free() with @free_segment set to %TRUE. This function
  17231. is MT-safe and may be called from any thread.</doc>
  17232. <return-value transfer-ownership="none">
  17233. <type name="none" c:type="void"/>
  17234. </return-value>
  17235. <parameters>
  17236. <parameter name="array" transfer-ownership="none">
  17237. <doc xml:space="preserve">A #GPtrArray</doc>
  17238. <array name="GLib.PtrArray" c:type="GPtrArray*">
  17239. <type name="gpointer" c:type="gpointer"/>
  17240. </array>
  17241. </parameter>
  17242. </parameters>
  17243. </function>
  17244. </record>
  17245. <record name="Queue" c:type="GQueue">
  17246. <doc xml:space="preserve">Contains the public fields of a
  17247. [Queue][glib-Double-ended-Queues].</doc>
  17248. <field name="head" writable="1">
  17249. <doc xml:space="preserve">a pointer to the first element of the queue</doc>
  17250. <type name="GLib.List" c:type="GList*">
  17251. <type name="gpointer" c:type="gpointer"/>
  17252. </type>
  17253. </field>
  17254. <field name="tail" writable="1">
  17255. <doc xml:space="preserve">a pointer to the last element of the queue</doc>
  17256. <type name="GLib.List" c:type="GList*">
  17257. <type name="gpointer" c:type="gpointer"/>
  17258. </type>
  17259. </field>
  17260. <field name="length" writable="1">
  17261. <doc xml:space="preserve">the number of elements in the queue</doc>
  17262. <type name="guint" c:type="guint"/>
  17263. </field>
  17264. <method name="clear" c:identifier="g_queue_clear" version="2.14">
  17265. <doc xml:space="preserve">Removes all the elements in @queue. If queue elements contain
  17266. dynamically-allocated memory, they should be freed first.</doc>
  17267. <return-value transfer-ownership="none">
  17268. <type name="none" c:type="void"/>
  17269. </return-value>
  17270. <parameters>
  17271. <instance-parameter name="queue" transfer-ownership="none">
  17272. <doc xml:space="preserve">a #GQueue</doc>
  17273. <type name="Queue" c:type="GQueue*"/>
  17274. </instance-parameter>
  17275. </parameters>
  17276. </method>
  17277. <method name="copy"
  17278. c:identifier="g_queue_copy"
  17279. version="2.4"
  17280. introspectable="0">
  17281. <doc xml:space="preserve">Copies a @queue. Note that is a shallow copy. If the elements in the
  17282. queue consist of pointers to data, the pointers are copied, but the
  17283. actual data is not.</doc>
  17284. <return-value>
  17285. <doc xml:space="preserve">a copy of @queue</doc>
  17286. <type name="Queue" c:type="GQueue*"/>
  17287. </return-value>
  17288. <parameters>
  17289. <instance-parameter name="queue" transfer-ownership="none">
  17290. <doc xml:space="preserve">a #GQueue</doc>
  17291. <type name="Queue" c:type="GQueue*"/>
  17292. </instance-parameter>
  17293. </parameters>
  17294. </method>
  17295. <method name="delete_link"
  17296. c:identifier="g_queue_delete_link"
  17297. version="2.4"
  17298. introspectable="0">
  17299. <doc xml:space="preserve">Removes @link_ from @queue and frees it.
  17300. @link_ must be part of @queue.</doc>
  17301. <return-value transfer-ownership="none">
  17302. <type name="none" c:type="void"/>
  17303. </return-value>
  17304. <parameters>
  17305. <instance-parameter name="queue" transfer-ownership="none">
  17306. <doc xml:space="preserve">a #GQueue</doc>
  17307. <type name="Queue" c:type="GQueue*"/>
  17308. </instance-parameter>
  17309. <parameter name="link_" transfer-ownership="none">
  17310. <doc xml:space="preserve">a #GList link that must be part of @queue</doc>
  17311. <type name="GLib.List" c:type="GList*">
  17312. <type name="gpointer" c:type="gpointer"/>
  17313. </type>
  17314. </parameter>
  17315. </parameters>
  17316. </method>
  17317. <method name="find"
  17318. c:identifier="g_queue_find"
  17319. version="2.4"
  17320. introspectable="0">
  17321. <doc xml:space="preserve">Finds the first link in @queue which contains @data.</doc>
  17322. <return-value>
  17323. <doc xml:space="preserve">the first link in @queue which contains @data</doc>
  17324. <type name="GLib.List" c:type="GList*">
  17325. <type name="gpointer" c:type="gpointer"/>
  17326. </type>
  17327. </return-value>
  17328. <parameters>
  17329. <instance-parameter name="queue" transfer-ownership="none">
  17330. <doc xml:space="preserve">a #GQueue</doc>
  17331. <type name="Queue" c:type="GQueue*"/>
  17332. </instance-parameter>
  17333. <parameter name="data"
  17334. transfer-ownership="none"
  17335. nullable="1"
  17336. allow-none="1">
  17337. <doc xml:space="preserve">data to find</doc>
  17338. <type name="gpointer" c:type="gconstpointer"/>
  17339. </parameter>
  17340. </parameters>
  17341. </method>
  17342. <method name="find_custom"
  17343. c:identifier="g_queue_find_custom"
  17344. version="2.4"
  17345. introspectable="0">
  17346. <doc xml:space="preserve">Finds an element in a #GQueue, using a supplied function to find the
  17347. desired element. It iterates over the queue, calling the given function
  17348. which should return 0 when the desired element is found. The function
  17349. takes two gconstpointer arguments, the #GQueue element's data as the
  17350. first argument and the given user data as the second argument.</doc>
  17351. <return-value>
  17352. <doc xml:space="preserve">the found link, or %NULL if it wasn't found</doc>
  17353. <type name="GLib.List" c:type="GList*">
  17354. <type name="gpointer" c:type="gpointer"/>
  17355. </type>
  17356. </return-value>
  17357. <parameters>
  17358. <instance-parameter name="queue" transfer-ownership="none">
  17359. <doc xml:space="preserve">a #GQueue</doc>
  17360. <type name="Queue" c:type="GQueue*"/>
  17361. </instance-parameter>
  17362. <parameter name="data"
  17363. transfer-ownership="none"
  17364. nullable="1"
  17365. allow-none="1">
  17366. <doc xml:space="preserve">user data passed to @func</doc>
  17367. <type name="gpointer" c:type="gconstpointer"/>
  17368. </parameter>
  17369. <parameter name="func" transfer-ownership="none">
  17370. <doc xml:space="preserve">a #GCompareFunc to call for each element. It should return 0
  17371. when the desired element is found</doc>
  17372. <type name="CompareFunc" c:type="GCompareFunc"/>
  17373. </parameter>
  17374. </parameters>
  17375. </method>
  17376. <method name="foreach"
  17377. c:identifier="g_queue_foreach"
  17378. version="2.4"
  17379. introspectable="0">
  17380. <doc xml:space="preserve">Calls @func for each element in the queue passing @user_data to the
  17381. function.</doc>
  17382. <return-value transfer-ownership="none">
  17383. <type name="none" c:type="void"/>
  17384. </return-value>
  17385. <parameters>
  17386. <instance-parameter name="queue" transfer-ownership="none">
  17387. <doc xml:space="preserve">a #GQueue</doc>
  17388. <type name="Queue" c:type="GQueue*"/>
  17389. </instance-parameter>
  17390. <parameter name="func" transfer-ownership="none" closure="1">
  17391. <doc xml:space="preserve">the function to call for each element's data</doc>
  17392. <type name="Func" c:type="GFunc"/>
  17393. </parameter>
  17394. <parameter name="user_data"
  17395. transfer-ownership="none"
  17396. nullable="1"
  17397. allow-none="1">
  17398. <doc xml:space="preserve">user data to pass to @func</doc>
  17399. <type name="gpointer" c:type="gpointer"/>
  17400. </parameter>
  17401. </parameters>
  17402. </method>
  17403. <method name="free" c:identifier="g_queue_free">
  17404. <doc xml:space="preserve">Frees the memory allocated for the #GQueue. Only call this function
  17405. if @queue was created with g_queue_new(). If queue elements contain
  17406. dynamically-allocated memory, they should be freed first.
  17407. If queue elements contain dynamically-allocated memory, you should
  17408. either use g_queue_free_full() or free them manually first.</doc>
  17409. <return-value transfer-ownership="none">
  17410. <type name="none" c:type="void"/>
  17411. </return-value>
  17412. <parameters>
  17413. <instance-parameter name="queue" transfer-ownership="none">
  17414. <doc xml:space="preserve">a #GQueue</doc>
  17415. <type name="Queue" c:type="GQueue*"/>
  17416. </instance-parameter>
  17417. </parameters>
  17418. </method>
  17419. <method name="free_full" c:identifier="g_queue_free_full" version="2.32">
  17420. <doc xml:space="preserve">Convenience method, which frees all the memory used by a #GQueue,
  17421. and calls the specified destroy function on every element's data.</doc>
  17422. <return-value transfer-ownership="none">
  17423. <type name="none" c:type="void"/>
  17424. </return-value>
  17425. <parameters>
  17426. <instance-parameter name="queue" transfer-ownership="none">
  17427. <doc xml:space="preserve">a pointer to a #GQueue</doc>
  17428. <type name="Queue" c:type="GQueue*"/>
  17429. </instance-parameter>
  17430. <parameter name="free_func" transfer-ownership="none" scope="async">
  17431. <doc xml:space="preserve">the function to be called to free each element's data</doc>
  17432. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  17433. </parameter>
  17434. </parameters>
  17435. </method>
  17436. <method name="get_length"
  17437. c:identifier="g_queue_get_length"
  17438. version="2.4">
  17439. <doc xml:space="preserve">Returns the number of items in @queue.</doc>
  17440. <return-value transfer-ownership="none">
  17441. <doc xml:space="preserve">the number of items in @queue</doc>
  17442. <type name="guint" c:type="guint"/>
  17443. </return-value>
  17444. <parameters>
  17445. <instance-parameter name="queue" transfer-ownership="none">
  17446. <doc xml:space="preserve">a #GQueue</doc>
  17447. <type name="Queue" c:type="GQueue*"/>
  17448. </instance-parameter>
  17449. </parameters>
  17450. </method>
  17451. <method name="index" c:identifier="g_queue_index" version="2.4">
  17452. <doc xml:space="preserve">Returns the position of the first element in @queue which contains @data.</doc>
  17453. <return-value transfer-ownership="none">
  17454. <doc xml:space="preserve">the position of the first element in @queue which
  17455. contains @data, or -1 if no element in @queue contains @data</doc>
  17456. <type name="gint" c:type="gint"/>
  17457. </return-value>
  17458. <parameters>
  17459. <instance-parameter name="queue" transfer-ownership="none">
  17460. <doc xml:space="preserve">a #GQueue</doc>
  17461. <type name="Queue" c:type="GQueue*"/>
  17462. </instance-parameter>
  17463. <parameter name="data"
  17464. transfer-ownership="none"
  17465. nullable="1"
  17466. allow-none="1">
  17467. <doc xml:space="preserve">the data to find</doc>
  17468. <type name="gpointer" c:type="gconstpointer"/>
  17469. </parameter>
  17470. </parameters>
  17471. </method>
  17472. <method name="init" c:identifier="g_queue_init" version="2.14">
  17473. <doc xml:space="preserve">A statically-allocated #GQueue must be initialized with this function
  17474. before it can be used. Alternatively you can initialize it with
  17475. #G_QUEUE_INIT. It is not necessary to initialize queues created with
  17476. g_queue_new().</doc>
  17477. <return-value transfer-ownership="none">
  17478. <type name="none" c:type="void"/>
  17479. </return-value>
  17480. <parameters>
  17481. <instance-parameter name="queue" transfer-ownership="none">
  17482. <doc xml:space="preserve">an uninitialized #GQueue</doc>
  17483. <type name="Queue" c:type="GQueue*"/>
  17484. </instance-parameter>
  17485. </parameters>
  17486. </method>
  17487. <method name="insert_after"
  17488. c:identifier="g_queue_insert_after"
  17489. version="2.4"
  17490. introspectable="0">
  17491. <doc xml:space="preserve">Inserts @data into @queue after @sibling.
  17492. @sibling must be part of @queue. Since GLib 2.44 a %NULL sibling pushes the
  17493. data at the head of the queue.</doc>
  17494. <return-value transfer-ownership="none">
  17495. <type name="none" c:type="void"/>
  17496. </return-value>
  17497. <parameters>
  17498. <instance-parameter name="queue" transfer-ownership="none">
  17499. <doc xml:space="preserve">a #GQueue</doc>
  17500. <type name="Queue" c:type="GQueue*"/>
  17501. </instance-parameter>
  17502. <parameter name="sibling"
  17503. transfer-ownership="none"
  17504. nullable="1"
  17505. allow-none="1">
  17506. <doc xml:space="preserve">a #GList link that must be part of @queue, or %NULL to
  17507. push at the head of the queue.</doc>
  17508. <type name="GLib.List" c:type="GList*">
  17509. <type name="gpointer" c:type="gpointer"/>
  17510. </type>
  17511. </parameter>
  17512. <parameter name="data"
  17513. transfer-ownership="none"
  17514. nullable="1"
  17515. allow-none="1">
  17516. <doc xml:space="preserve">the data to insert</doc>
  17517. <type name="gpointer" c:type="gpointer"/>
  17518. </parameter>
  17519. </parameters>
  17520. </method>
  17521. <method name="insert_before"
  17522. c:identifier="g_queue_insert_before"
  17523. version="2.4"
  17524. introspectable="0">
  17525. <doc xml:space="preserve">Inserts @data into @queue before @sibling.
  17526. @sibling must be part of @queue. Since GLib 2.44 a %NULL sibling pushes the
  17527. data at the tail of the queue.</doc>
  17528. <return-value transfer-ownership="none">
  17529. <type name="none" c:type="void"/>
  17530. </return-value>
  17531. <parameters>
  17532. <instance-parameter name="queue" transfer-ownership="none">
  17533. <doc xml:space="preserve">a #GQueue</doc>
  17534. <type name="Queue" c:type="GQueue*"/>
  17535. </instance-parameter>
  17536. <parameter name="sibling"
  17537. transfer-ownership="none"
  17538. nullable="1"
  17539. allow-none="1">
  17540. <doc xml:space="preserve">a #GList link that must be part of @queue, or %NULL to
  17541. push at the tail of the queue.</doc>
  17542. <type name="GLib.List" c:type="GList*">
  17543. <type name="gpointer" c:type="gpointer"/>
  17544. </type>
  17545. </parameter>
  17546. <parameter name="data"
  17547. transfer-ownership="none"
  17548. nullable="1"
  17549. allow-none="1">
  17550. <doc xml:space="preserve">the data to insert</doc>
  17551. <type name="gpointer" c:type="gpointer"/>
  17552. </parameter>
  17553. </parameters>
  17554. </method>
  17555. <method name="insert_sorted"
  17556. c:identifier="g_queue_insert_sorted"
  17557. version="2.4"
  17558. introspectable="0">
  17559. <doc xml:space="preserve">Inserts @data into @queue using @func to determine the new position.</doc>
  17560. <return-value transfer-ownership="none">
  17561. <type name="none" c:type="void"/>
  17562. </return-value>
  17563. <parameters>
  17564. <instance-parameter name="queue" transfer-ownership="none">
  17565. <doc xml:space="preserve">a #GQueue</doc>
  17566. <type name="Queue" c:type="GQueue*"/>
  17567. </instance-parameter>
  17568. <parameter name="data"
  17569. transfer-ownership="none"
  17570. nullable="1"
  17571. allow-none="1">
  17572. <doc xml:space="preserve">the data to insert</doc>
  17573. <type name="gpointer" c:type="gpointer"/>
  17574. </parameter>
  17575. <parameter name="func" transfer-ownership="none" closure="2">
  17576. <doc xml:space="preserve">the #GCompareDataFunc used to compare elements in the queue. It is
  17577. called with two elements of the @queue and @user_data. It should
  17578. return 0 if the elements are equal, a negative value if the first
  17579. element comes before the second, and a positive value if the second
  17580. element comes before the first.</doc>
  17581. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  17582. </parameter>
  17583. <parameter name="user_data"
  17584. transfer-ownership="none"
  17585. nullable="1"
  17586. allow-none="1">
  17587. <doc xml:space="preserve">user data passed to @func</doc>
  17588. <type name="gpointer" c:type="gpointer"/>
  17589. </parameter>
  17590. </parameters>
  17591. </method>
  17592. <method name="is_empty" c:identifier="g_queue_is_empty">
  17593. <doc xml:space="preserve">Returns %TRUE if the queue is empty.</doc>
  17594. <return-value transfer-ownership="none">
  17595. <doc xml:space="preserve">%TRUE if the queue is empty</doc>
  17596. <type name="gboolean" c:type="gboolean"/>
  17597. </return-value>
  17598. <parameters>
  17599. <instance-parameter name="queue" transfer-ownership="none">
  17600. <doc xml:space="preserve">a #GQueue.</doc>
  17601. <type name="Queue" c:type="GQueue*"/>
  17602. </instance-parameter>
  17603. </parameters>
  17604. </method>
  17605. <method name="link_index"
  17606. c:identifier="g_queue_link_index"
  17607. version="2.4"
  17608. introspectable="0">
  17609. <doc xml:space="preserve">Returns the position of @link_ in @queue.</doc>
  17610. <return-value transfer-ownership="none">
  17611. <doc xml:space="preserve">the position of @link_, or -1 if the link is
  17612. not part of @queue</doc>
  17613. <type name="gint" c:type="gint"/>
  17614. </return-value>
  17615. <parameters>
  17616. <instance-parameter name="queue" transfer-ownership="none">
  17617. <doc xml:space="preserve">a #GQueue</doc>
  17618. <type name="Queue" c:type="GQueue*"/>
  17619. </instance-parameter>
  17620. <parameter name="link_" transfer-ownership="none">
  17621. <doc xml:space="preserve">a #GList link</doc>
  17622. <type name="GLib.List" c:type="GList*">
  17623. <type name="gpointer" c:type="gpointer"/>
  17624. </type>
  17625. </parameter>
  17626. </parameters>
  17627. </method>
  17628. <method name="peek_head" c:identifier="g_queue_peek_head">
  17629. <doc xml:space="preserve">Returns the first element of the queue.</doc>
  17630. <return-value transfer-ownership="none" nullable="1">
  17631. <doc xml:space="preserve">the data of the first element in the queue, or %NULL
  17632. if the queue is empty</doc>
  17633. <type name="gpointer" c:type="gpointer"/>
  17634. </return-value>
  17635. <parameters>
  17636. <instance-parameter name="queue" transfer-ownership="none">
  17637. <doc xml:space="preserve">a #GQueue</doc>
  17638. <type name="Queue" c:type="GQueue*"/>
  17639. </instance-parameter>
  17640. </parameters>
  17641. </method>
  17642. <method name="peek_head_link"
  17643. c:identifier="g_queue_peek_head_link"
  17644. version="2.4"
  17645. introspectable="0">
  17646. <doc xml:space="preserve">Returns the first link in @queue.</doc>
  17647. <return-value>
  17648. <doc xml:space="preserve">the first link in @queue, or %NULL if @queue is empty</doc>
  17649. <type name="GLib.List" c:type="GList*">
  17650. <type name="gpointer" c:type="gpointer"/>
  17651. </type>
  17652. </return-value>
  17653. <parameters>
  17654. <instance-parameter name="queue" transfer-ownership="none">
  17655. <doc xml:space="preserve">a #GQueue</doc>
  17656. <type name="Queue" c:type="GQueue*"/>
  17657. </instance-parameter>
  17658. </parameters>
  17659. </method>
  17660. <method name="peek_nth" c:identifier="g_queue_peek_nth" version="2.4">
  17661. <doc xml:space="preserve">Returns the @n'th element of @queue.</doc>
  17662. <return-value transfer-ownership="none" nullable="1">
  17663. <doc xml:space="preserve">the data for the @n'th element of @queue,
  17664. or %NULL if @n is off the end of @queue</doc>
  17665. <type name="gpointer" c:type="gpointer"/>
  17666. </return-value>
  17667. <parameters>
  17668. <instance-parameter name="queue" transfer-ownership="none">
  17669. <doc xml:space="preserve">a #GQueue</doc>
  17670. <type name="Queue" c:type="GQueue*"/>
  17671. </instance-parameter>
  17672. <parameter name="n" transfer-ownership="none">
  17673. <doc xml:space="preserve">the position of the element</doc>
  17674. <type name="guint" c:type="guint"/>
  17675. </parameter>
  17676. </parameters>
  17677. </method>
  17678. <method name="peek_nth_link"
  17679. c:identifier="g_queue_peek_nth_link"
  17680. version="2.4"
  17681. introspectable="0">
  17682. <doc xml:space="preserve">Returns the link at the given position</doc>
  17683. <return-value>
  17684. <doc xml:space="preserve">the link at the @n'th position, or %NULL
  17685. if @n is off the end of the list</doc>
  17686. <type name="GLib.List" c:type="GList*">
  17687. <type name="gpointer" c:type="gpointer"/>
  17688. </type>
  17689. </return-value>
  17690. <parameters>
  17691. <instance-parameter name="queue" transfer-ownership="none">
  17692. <doc xml:space="preserve">a #GQueue</doc>
  17693. <type name="Queue" c:type="GQueue*"/>
  17694. </instance-parameter>
  17695. <parameter name="n" transfer-ownership="none">
  17696. <doc xml:space="preserve">the position of the link</doc>
  17697. <type name="guint" c:type="guint"/>
  17698. </parameter>
  17699. </parameters>
  17700. </method>
  17701. <method name="peek_tail" c:identifier="g_queue_peek_tail">
  17702. <doc xml:space="preserve">Returns the last element of the queue.</doc>
  17703. <return-value transfer-ownership="none" nullable="1">
  17704. <doc xml:space="preserve">the data of the last element in the queue, or %NULL
  17705. if the queue is empty</doc>
  17706. <type name="gpointer" c:type="gpointer"/>
  17707. </return-value>
  17708. <parameters>
  17709. <instance-parameter name="queue" transfer-ownership="none">
  17710. <doc xml:space="preserve">a #GQueue</doc>
  17711. <type name="Queue" c:type="GQueue*"/>
  17712. </instance-parameter>
  17713. </parameters>
  17714. </method>
  17715. <method name="peek_tail_link"
  17716. c:identifier="g_queue_peek_tail_link"
  17717. version="2.4"
  17718. introspectable="0">
  17719. <doc xml:space="preserve">Returns the last link in @queue.</doc>
  17720. <return-value>
  17721. <doc xml:space="preserve">the last link in @queue, or %NULL if @queue is empty</doc>
  17722. <type name="GLib.List" c:type="GList*">
  17723. <type name="gpointer" c:type="gpointer"/>
  17724. </type>
  17725. </return-value>
  17726. <parameters>
  17727. <instance-parameter name="queue" transfer-ownership="none">
  17728. <doc xml:space="preserve">a #GQueue</doc>
  17729. <type name="Queue" c:type="GQueue*"/>
  17730. </instance-parameter>
  17731. </parameters>
  17732. </method>
  17733. <method name="pop_head" c:identifier="g_queue_pop_head">
  17734. <doc xml:space="preserve">Removes the first element of the queue and returns its data.</doc>
  17735. <return-value transfer-ownership="none" nullable="1">
  17736. <doc xml:space="preserve">the data of the first element in the queue, or %NULL
  17737. if the queue is empty</doc>
  17738. <type name="gpointer" c:type="gpointer"/>
  17739. </return-value>
  17740. <parameters>
  17741. <instance-parameter name="queue" transfer-ownership="none">
  17742. <doc xml:space="preserve">a #GQueue</doc>
  17743. <type name="Queue" c:type="GQueue*"/>
  17744. </instance-parameter>
  17745. </parameters>
  17746. </method>
  17747. <method name="pop_head_link"
  17748. c:identifier="g_queue_pop_head_link"
  17749. introspectable="0">
  17750. <doc xml:space="preserve">Removes and returns the first element of the queue.</doc>
  17751. <return-value>
  17752. <doc xml:space="preserve">the #GList element at the head of the queue, or %NULL
  17753. if the queue is empty</doc>
  17754. <type name="GLib.List" c:type="GList*">
  17755. <type name="gpointer" c:type="gpointer"/>
  17756. </type>
  17757. </return-value>
  17758. <parameters>
  17759. <instance-parameter name="queue" transfer-ownership="none">
  17760. <doc xml:space="preserve">a #GQueue</doc>
  17761. <type name="Queue" c:type="GQueue*"/>
  17762. </instance-parameter>
  17763. </parameters>
  17764. </method>
  17765. <method name="pop_nth" c:identifier="g_queue_pop_nth" version="2.4">
  17766. <doc xml:space="preserve">Removes the @n'th element of @queue and returns its data.</doc>
  17767. <return-value transfer-ownership="none" nullable="1">
  17768. <doc xml:space="preserve">the element's data, or %NULL if @n is off the end of @queue</doc>
  17769. <type name="gpointer" c:type="gpointer"/>
  17770. </return-value>
  17771. <parameters>
  17772. <instance-parameter name="queue" transfer-ownership="none">
  17773. <doc xml:space="preserve">a #GQueue</doc>
  17774. <type name="Queue" c:type="GQueue*"/>
  17775. </instance-parameter>
  17776. <parameter name="n" transfer-ownership="none">
  17777. <doc xml:space="preserve">the position of the element</doc>
  17778. <type name="guint" c:type="guint"/>
  17779. </parameter>
  17780. </parameters>
  17781. </method>
  17782. <method name="pop_nth_link"
  17783. c:identifier="g_queue_pop_nth_link"
  17784. version="2.4"
  17785. introspectable="0">
  17786. <doc xml:space="preserve">Removes and returns the link at the given position.</doc>
  17787. <return-value>
  17788. <doc xml:space="preserve">the @n'th link, or %NULL if @n is off the end of @queue</doc>
  17789. <type name="GLib.List" c:type="GList*">
  17790. <type name="gpointer" c:type="gpointer"/>
  17791. </type>
  17792. </return-value>
  17793. <parameters>
  17794. <instance-parameter name="queue" transfer-ownership="none">
  17795. <doc xml:space="preserve">a #GQueue</doc>
  17796. <type name="Queue" c:type="GQueue*"/>
  17797. </instance-parameter>
  17798. <parameter name="n" transfer-ownership="none">
  17799. <doc xml:space="preserve">the link's position</doc>
  17800. <type name="guint" c:type="guint"/>
  17801. </parameter>
  17802. </parameters>
  17803. </method>
  17804. <method name="pop_tail" c:identifier="g_queue_pop_tail">
  17805. <doc xml:space="preserve">Removes the last element of the queue and returns its data.</doc>
  17806. <return-value transfer-ownership="none" nullable="1">
  17807. <doc xml:space="preserve">the data of the last element in the queue, or %NULL
  17808. if the queue is empty</doc>
  17809. <type name="gpointer" c:type="gpointer"/>
  17810. </return-value>
  17811. <parameters>
  17812. <instance-parameter name="queue" transfer-ownership="none">
  17813. <doc xml:space="preserve">a #GQueue</doc>
  17814. <type name="Queue" c:type="GQueue*"/>
  17815. </instance-parameter>
  17816. </parameters>
  17817. </method>
  17818. <method name="pop_tail_link"
  17819. c:identifier="g_queue_pop_tail_link"
  17820. introspectable="0">
  17821. <doc xml:space="preserve">Removes and returns the last element of the queue.</doc>
  17822. <return-value>
  17823. <doc xml:space="preserve">the #GList element at the tail of the queue, or %NULL
  17824. if the queue is empty</doc>
  17825. <type name="GLib.List" c:type="GList*">
  17826. <type name="gpointer" c:type="gpointer"/>
  17827. </type>
  17828. </return-value>
  17829. <parameters>
  17830. <instance-parameter name="queue" transfer-ownership="none">
  17831. <doc xml:space="preserve">a #GQueue</doc>
  17832. <type name="Queue" c:type="GQueue*"/>
  17833. </instance-parameter>
  17834. </parameters>
  17835. </method>
  17836. <method name="push_head" c:identifier="g_queue_push_head">
  17837. <doc xml:space="preserve">Adds a new element at the head of the queue.</doc>
  17838. <return-value transfer-ownership="none">
  17839. <type name="none" c:type="void"/>
  17840. </return-value>
  17841. <parameters>
  17842. <instance-parameter name="queue" transfer-ownership="none">
  17843. <doc xml:space="preserve">a #GQueue.</doc>
  17844. <type name="Queue" c:type="GQueue*"/>
  17845. </instance-parameter>
  17846. <parameter name="data"
  17847. transfer-ownership="none"
  17848. nullable="1"
  17849. allow-none="1">
  17850. <doc xml:space="preserve">the data for the new element.</doc>
  17851. <type name="gpointer" c:type="gpointer"/>
  17852. </parameter>
  17853. </parameters>
  17854. </method>
  17855. <method name="push_head_link"
  17856. c:identifier="g_queue_push_head_link"
  17857. introspectable="0">
  17858. <doc xml:space="preserve">Adds a new element at the head of the queue.</doc>
  17859. <return-value transfer-ownership="none">
  17860. <type name="none" c:type="void"/>
  17861. </return-value>
  17862. <parameters>
  17863. <instance-parameter name="queue" transfer-ownership="none">
  17864. <doc xml:space="preserve">a #GQueue</doc>
  17865. <type name="Queue" c:type="GQueue*"/>
  17866. </instance-parameter>
  17867. <parameter name="link_" transfer-ownership="none">
  17868. <doc xml:space="preserve">a single #GList element, not a list with more than one element</doc>
  17869. <type name="GLib.List" c:type="GList*">
  17870. <type name="gpointer" c:type="gpointer"/>
  17871. </type>
  17872. </parameter>
  17873. </parameters>
  17874. </method>
  17875. <method name="push_nth" c:identifier="g_queue_push_nth" version="2.4">
  17876. <doc xml:space="preserve">Inserts a new element into @queue at the given position.</doc>
  17877. <return-value transfer-ownership="none">
  17878. <type name="none" c:type="void"/>
  17879. </return-value>
  17880. <parameters>
  17881. <instance-parameter name="queue" transfer-ownership="none">
  17882. <doc xml:space="preserve">a #GQueue</doc>
  17883. <type name="Queue" c:type="GQueue*"/>
  17884. </instance-parameter>
  17885. <parameter name="data"
  17886. transfer-ownership="none"
  17887. nullable="1"
  17888. allow-none="1">
  17889. <doc xml:space="preserve">the data for the new element</doc>
  17890. <type name="gpointer" c:type="gpointer"/>
  17891. </parameter>
  17892. <parameter name="n" transfer-ownership="none">
  17893. <doc xml:space="preserve">the position to insert the new element. If @n is negative or
  17894. larger than the number of elements in the @queue, the element is
  17895. added to the end of the queue.</doc>
  17896. <type name="gint" c:type="gint"/>
  17897. </parameter>
  17898. </parameters>
  17899. </method>
  17900. <method name="push_nth_link"
  17901. c:identifier="g_queue_push_nth_link"
  17902. version="2.4"
  17903. introspectable="0">
  17904. <doc xml:space="preserve">Inserts @link into @queue at the given position.</doc>
  17905. <return-value transfer-ownership="none">
  17906. <type name="none" c:type="void"/>
  17907. </return-value>
  17908. <parameters>
  17909. <instance-parameter name="queue" transfer-ownership="none">
  17910. <doc xml:space="preserve">a #GQueue</doc>
  17911. <type name="Queue" c:type="GQueue*"/>
  17912. </instance-parameter>
  17913. <parameter name="n" transfer-ownership="none">
  17914. <doc xml:space="preserve">the position to insert the link. If this is negative or larger than
  17915. the number of elements in @queue, the link is added to the end of
  17916. @queue.</doc>
  17917. <type name="gint" c:type="gint"/>
  17918. </parameter>
  17919. <parameter name="link_" transfer-ownership="none">
  17920. <doc xml:space="preserve">the link to add to @queue</doc>
  17921. <type name="GLib.List" c:type="GList*">
  17922. <type name="gpointer" c:type="gpointer"/>
  17923. </type>
  17924. </parameter>
  17925. </parameters>
  17926. </method>
  17927. <method name="push_tail" c:identifier="g_queue_push_tail">
  17928. <doc xml:space="preserve">Adds a new element at the tail of the queue.</doc>
  17929. <return-value transfer-ownership="none">
  17930. <type name="none" c:type="void"/>
  17931. </return-value>
  17932. <parameters>
  17933. <instance-parameter name="queue" transfer-ownership="none">
  17934. <doc xml:space="preserve">a #GQueue</doc>
  17935. <type name="Queue" c:type="GQueue*"/>
  17936. </instance-parameter>
  17937. <parameter name="data"
  17938. transfer-ownership="none"
  17939. nullable="1"
  17940. allow-none="1">
  17941. <doc xml:space="preserve">the data for the new element</doc>
  17942. <type name="gpointer" c:type="gpointer"/>
  17943. </parameter>
  17944. </parameters>
  17945. </method>
  17946. <method name="push_tail_link"
  17947. c:identifier="g_queue_push_tail_link"
  17948. introspectable="0">
  17949. <doc xml:space="preserve">Adds a new element at the tail of the queue.</doc>
  17950. <return-value transfer-ownership="none">
  17951. <type name="none" c:type="void"/>
  17952. </return-value>
  17953. <parameters>
  17954. <instance-parameter name="queue" transfer-ownership="none">
  17955. <doc xml:space="preserve">a #GQueue</doc>
  17956. <type name="Queue" c:type="GQueue*"/>
  17957. </instance-parameter>
  17958. <parameter name="link_" transfer-ownership="none">
  17959. <doc xml:space="preserve">a single #GList element, not a list with more than one element</doc>
  17960. <type name="GLib.List" c:type="GList*">
  17961. <type name="gpointer" c:type="gpointer"/>
  17962. </type>
  17963. </parameter>
  17964. </parameters>
  17965. </method>
  17966. <method name="remove" c:identifier="g_queue_remove" version="2.4">
  17967. <doc xml:space="preserve">Removes the first element in @queue that contains @data.</doc>
  17968. <return-value transfer-ownership="none">
  17969. <doc xml:space="preserve">%TRUE if @data was found and removed from @queue</doc>
  17970. <type name="gboolean" c:type="gboolean"/>
  17971. </return-value>
  17972. <parameters>
  17973. <instance-parameter name="queue" transfer-ownership="none">
  17974. <doc xml:space="preserve">a #GQueue</doc>
  17975. <type name="Queue" c:type="GQueue*"/>
  17976. </instance-parameter>
  17977. <parameter name="data"
  17978. transfer-ownership="none"
  17979. nullable="1"
  17980. allow-none="1">
  17981. <doc xml:space="preserve">the data to remove</doc>
  17982. <type name="gpointer" c:type="gconstpointer"/>
  17983. </parameter>
  17984. </parameters>
  17985. </method>
  17986. <method name="remove_all"
  17987. c:identifier="g_queue_remove_all"
  17988. version="2.4">
  17989. <doc xml:space="preserve">Remove all elements whose data equals @data from @queue.</doc>
  17990. <return-value transfer-ownership="none">
  17991. <doc xml:space="preserve">the number of elements removed from @queue</doc>
  17992. <type name="guint" c:type="guint"/>
  17993. </return-value>
  17994. <parameters>
  17995. <instance-parameter name="queue" transfer-ownership="none">
  17996. <doc xml:space="preserve">a #GQueue</doc>
  17997. <type name="Queue" c:type="GQueue*"/>
  17998. </instance-parameter>
  17999. <parameter name="data"
  18000. transfer-ownership="none"
  18001. nullable="1"
  18002. allow-none="1">
  18003. <doc xml:space="preserve">the data to remove</doc>
  18004. <type name="gpointer" c:type="gconstpointer"/>
  18005. </parameter>
  18006. </parameters>
  18007. </method>
  18008. <method name="reverse" c:identifier="g_queue_reverse" version="2.4">
  18009. <doc xml:space="preserve">Reverses the order of the items in @queue.</doc>
  18010. <return-value transfer-ownership="none">
  18011. <type name="none" c:type="void"/>
  18012. </return-value>
  18013. <parameters>
  18014. <instance-parameter name="queue" transfer-ownership="none">
  18015. <doc xml:space="preserve">a #GQueue</doc>
  18016. <type name="Queue" c:type="GQueue*"/>
  18017. </instance-parameter>
  18018. </parameters>
  18019. </method>
  18020. <method name="sort"
  18021. c:identifier="g_queue_sort"
  18022. version="2.4"
  18023. introspectable="0">
  18024. <doc xml:space="preserve">Sorts @queue using @compare_func.</doc>
  18025. <return-value transfer-ownership="none">
  18026. <type name="none" c:type="void"/>
  18027. </return-value>
  18028. <parameters>
  18029. <instance-parameter name="queue" transfer-ownership="none">
  18030. <doc xml:space="preserve">a #GQueue</doc>
  18031. <type name="Queue" c:type="GQueue*"/>
  18032. </instance-parameter>
  18033. <parameter name="compare_func" transfer-ownership="none" closure="1">
  18034. <doc xml:space="preserve">the #GCompareDataFunc used to sort @queue. This function
  18035. is passed two elements of the queue and should return 0 if they are
  18036. equal, a negative value if the first comes before the second, and
  18037. a positive value if the second comes before the first.</doc>
  18038. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  18039. </parameter>
  18040. <parameter name="user_data"
  18041. transfer-ownership="none"
  18042. nullable="1"
  18043. allow-none="1">
  18044. <doc xml:space="preserve">user data passed to @compare_func</doc>
  18045. <type name="gpointer" c:type="gpointer"/>
  18046. </parameter>
  18047. </parameters>
  18048. </method>
  18049. <method name="unlink"
  18050. c:identifier="g_queue_unlink"
  18051. version="2.4"
  18052. introspectable="0">
  18053. <doc xml:space="preserve">Unlinks @link_ so that it will no longer be part of @queue.
  18054. The link is not freed.
  18055. @link_ must be part of @queue.</doc>
  18056. <return-value transfer-ownership="none">
  18057. <type name="none" c:type="void"/>
  18058. </return-value>
  18059. <parameters>
  18060. <instance-parameter name="queue" transfer-ownership="none">
  18061. <doc xml:space="preserve">a #GQueue</doc>
  18062. <type name="Queue" c:type="GQueue*"/>
  18063. </instance-parameter>
  18064. <parameter name="link_" transfer-ownership="none">
  18065. <doc xml:space="preserve">a #GList link that must be part of @queue</doc>
  18066. <type name="GLib.List" c:type="GList*">
  18067. <type name="gpointer" c:type="gpointer"/>
  18068. </type>
  18069. </parameter>
  18070. </parameters>
  18071. </method>
  18072. <function name="new" c:identifier="g_queue_new" introspectable="0">
  18073. <doc xml:space="preserve">Creates a new #GQueue.</doc>
  18074. <return-value>
  18075. <doc xml:space="preserve">a newly allocated #GQueue</doc>
  18076. <type name="Queue" c:type="GQueue*"/>
  18077. </return-value>
  18078. </function>
  18079. </record>
  18080. <record name="RWLock" c:type="GRWLock" version="2.32">
  18081. <doc xml:space="preserve">The GRWLock struct is an opaque data structure to represent a
  18082. reader-writer lock. It is similar to a #GMutex in that it allows
  18083. multiple threads to coordinate access to a shared resource.
  18084. The difference to a mutex is that a reader-writer lock discriminates
  18085. between read-only ('reader') and full ('writer') access. While only
  18086. one thread at a time is allowed write access (by holding the 'writer'
  18087. lock via g_rw_lock_writer_lock()), multiple threads can gain
  18088. simultaneous read-only access (by holding the 'reader' lock via
  18089. g_rw_lock_reader_lock()).
  18090. Here is an example for an array with access functions:
  18091. |[&lt;!-- language="C" --&gt;
  18092. GRWLock lock;
  18093. GPtrArray *array;
  18094. gpointer
  18095. my_array_get (guint index)
  18096. {
  18097. gpointer retval = NULL;
  18098. if (!array)
  18099. return NULL;
  18100. g_rw_lock_reader_lock (&amp;lock);
  18101. if (index &lt; array-&gt;len)
  18102. retval = g_ptr_array_index (array, index);
  18103. g_rw_lock_reader_unlock (&amp;lock);
  18104. return retval;
  18105. }
  18106. void
  18107. my_array_set (guint index, gpointer data)
  18108. {
  18109. g_rw_lock_writer_lock (&amp;lock);
  18110. if (!array)
  18111. array = g_ptr_array_new ();
  18112. if (index &gt;= array-&gt;len)
  18113. g_ptr_array_set_size (array, index+1);
  18114. g_ptr_array_index (array, index) = data;
  18115. g_rw_lock_writer_unlock (&amp;lock);
  18116. }
  18117. ]|
  18118. This example shows an array which can be accessed by many readers
  18119. (the my_array_get() function) simultaneously, whereas the writers
  18120. (the my_array_set() function) will only be allowed one at a time
  18121. and only if no readers currently access the array. This is because
  18122. of the potentially dangerous resizing of the array. Using these
  18123. functions is fully multi-thread safe now.
  18124. If a #GRWLock is allocated in static storage then it can be used
  18125. without initialisation. Otherwise, you should call
  18126. g_rw_lock_init() on it and g_rw_lock_clear() when done.
  18127. A GRWLock should only be accessed with the g_rw_lock_ functions.</doc>
  18128. <field name="p" readable="0" private="1">
  18129. <type name="gpointer" c:type="gpointer"/>
  18130. </field>
  18131. <field name="i" readable="0" private="1">
  18132. <array zero-terminated="0" c:type="guint" fixed-size="2">
  18133. <type name="guint" c:type="guint"/>
  18134. </array>
  18135. </field>
  18136. <method name="clear" c:identifier="g_rw_lock_clear">
  18137. <doc xml:space="preserve">Frees the resources allocated to a lock with g_rw_lock_init().
  18138. This function should not be used with a #GRWLock that has been
  18139. statically allocated.
  18140. Calling g_rw_lock_clear() when any thread holds the lock
  18141. leads to undefined behaviour.
  18142. Sine: 2.32</doc>
  18143. <return-value transfer-ownership="none">
  18144. <type name="none" c:type="void"/>
  18145. </return-value>
  18146. <parameters>
  18147. <instance-parameter name="rw_lock" transfer-ownership="none">
  18148. <doc xml:space="preserve">an initialized #GRWLock</doc>
  18149. <type name="RWLock" c:type="GRWLock*"/>
  18150. </instance-parameter>
  18151. </parameters>
  18152. </method>
  18153. <method name="init" c:identifier="g_rw_lock_init" version="2.32">
  18154. <doc xml:space="preserve">Initializes a #GRWLock so that it can be used.
  18155. This function is useful to initialize a lock that has been
  18156. allocated on the stack, or as part of a larger structure. It is not
  18157. necessary to initialise a reader-writer lock that has been statically
  18158. allocated.
  18159. |[&lt;!-- language="C" --&gt;
  18160. typedef struct {
  18161. GRWLock l;
  18162. ...
  18163. } Blob;
  18164. Blob *b;
  18165. b = g_new (Blob, 1);
  18166. g_rw_lock_init (&amp;b-&gt;l);
  18167. ]|
  18168. To undo the effect of g_rw_lock_init() when a lock is no longer
  18169. needed, use g_rw_lock_clear().
  18170. Calling g_rw_lock_init() on an already initialized #GRWLock leads
  18171. to undefined behaviour.</doc>
  18172. <return-value transfer-ownership="none">
  18173. <type name="none" c:type="void"/>
  18174. </return-value>
  18175. <parameters>
  18176. <instance-parameter name="rw_lock" transfer-ownership="none">
  18177. <doc xml:space="preserve">an uninitialized #GRWLock</doc>
  18178. <type name="RWLock" c:type="GRWLock*"/>
  18179. </instance-parameter>
  18180. </parameters>
  18181. </method>
  18182. <method name="reader_lock"
  18183. c:identifier="g_rw_lock_reader_lock"
  18184. version="2.32">
  18185. <doc xml:space="preserve">Obtain a read lock on @rw_lock. If another thread currently holds
  18186. the write lock on @rw_lock or blocks waiting for it, the current
  18187. thread will block. Read locks can be taken recursively.
  18188. It is implementation-defined how many threads are allowed to
  18189. hold read locks on the same lock simultaneously.</doc>
  18190. <return-value transfer-ownership="none">
  18191. <type name="none" c:type="void"/>
  18192. </return-value>
  18193. <parameters>
  18194. <instance-parameter name="rw_lock" transfer-ownership="none">
  18195. <doc xml:space="preserve">a #GRWLock</doc>
  18196. <type name="RWLock" c:type="GRWLock*"/>
  18197. </instance-parameter>
  18198. </parameters>
  18199. </method>
  18200. <method name="reader_trylock"
  18201. c:identifier="g_rw_lock_reader_trylock"
  18202. version="2.32">
  18203. <doc xml:space="preserve">Tries to obtain a read lock on @rw_lock and returns %TRUE if
  18204. the read lock was successfully obtained. Otherwise it
  18205. returns %FALSE.</doc>
  18206. <return-value transfer-ownership="none">
  18207. <doc xml:space="preserve">%TRUE if @rw_lock could be locked</doc>
  18208. <type name="gboolean" c:type="gboolean"/>
  18209. </return-value>
  18210. <parameters>
  18211. <instance-parameter name="rw_lock" transfer-ownership="none">
  18212. <doc xml:space="preserve">a #GRWLock</doc>
  18213. <type name="RWLock" c:type="GRWLock*"/>
  18214. </instance-parameter>
  18215. </parameters>
  18216. </method>
  18217. <method name="reader_unlock"
  18218. c:identifier="g_rw_lock_reader_unlock"
  18219. version="2.32">
  18220. <doc xml:space="preserve">Release a read lock on @rw_lock.
  18221. Calling g_rw_lock_reader_unlock() on a lock that is not held
  18222. by the current thread leads to undefined behaviour.</doc>
  18223. <return-value transfer-ownership="none">
  18224. <type name="none" c:type="void"/>
  18225. </return-value>
  18226. <parameters>
  18227. <instance-parameter name="rw_lock" transfer-ownership="none">
  18228. <doc xml:space="preserve">a #GRWLock</doc>
  18229. <type name="RWLock" c:type="GRWLock*"/>
  18230. </instance-parameter>
  18231. </parameters>
  18232. </method>
  18233. <method name="writer_lock"
  18234. c:identifier="g_rw_lock_writer_lock"
  18235. version="2.32">
  18236. <doc xml:space="preserve">Obtain a write lock on @rw_lock. If any thread already holds
  18237. a read or write lock on @rw_lock, the current thread will block
  18238. until all other threads have dropped their locks on @rw_lock.</doc>
  18239. <return-value transfer-ownership="none">
  18240. <type name="none" c:type="void"/>
  18241. </return-value>
  18242. <parameters>
  18243. <instance-parameter name="rw_lock" transfer-ownership="none">
  18244. <doc xml:space="preserve">a #GRWLock</doc>
  18245. <type name="RWLock" c:type="GRWLock*"/>
  18246. </instance-parameter>
  18247. </parameters>
  18248. </method>
  18249. <method name="writer_trylock"
  18250. c:identifier="g_rw_lock_writer_trylock"
  18251. version="2.32">
  18252. <doc xml:space="preserve">Tries to obtain a write lock on @rw_lock. If any other thread holds
  18253. a read or write lock on @rw_lock, it immediately returns %FALSE.
  18254. Otherwise it locks @rw_lock and returns %TRUE.</doc>
  18255. <return-value transfer-ownership="none">
  18256. <doc xml:space="preserve">%TRUE if @rw_lock could be locked</doc>
  18257. <type name="gboolean" c:type="gboolean"/>
  18258. </return-value>
  18259. <parameters>
  18260. <instance-parameter name="rw_lock" transfer-ownership="none">
  18261. <doc xml:space="preserve">a #GRWLock</doc>
  18262. <type name="RWLock" c:type="GRWLock*"/>
  18263. </instance-parameter>
  18264. </parameters>
  18265. </method>
  18266. <method name="writer_unlock"
  18267. c:identifier="g_rw_lock_writer_unlock"
  18268. version="2.32">
  18269. <doc xml:space="preserve">Release a write lock on @rw_lock.
  18270. Calling g_rw_lock_writer_unlock() on a lock that is not held
  18271. by the current thread leads to undefined behaviour.</doc>
  18272. <return-value transfer-ownership="none">
  18273. <type name="none" c:type="void"/>
  18274. </return-value>
  18275. <parameters>
  18276. <instance-parameter name="rw_lock" transfer-ownership="none">
  18277. <doc xml:space="preserve">a #GRWLock</doc>
  18278. <type name="RWLock" c:type="GRWLock*"/>
  18279. </instance-parameter>
  18280. </parameters>
  18281. </method>
  18282. </record>
  18283. <record name="Rand" c:type="GRand" disguised="1">
  18284. <doc xml:space="preserve">The GRand struct is an opaque data structure. It should only be
  18285. accessed through the g_rand_* functions.</doc>
  18286. <method name="copy"
  18287. c:identifier="g_rand_copy"
  18288. version="2.4"
  18289. introspectable="0">
  18290. <doc xml:space="preserve">Copies a #GRand into a new one with the same exact state as before.
  18291. This way you can take a snapshot of the random number generator for
  18292. replaying later.</doc>
  18293. <return-value>
  18294. <doc xml:space="preserve">the new #GRand</doc>
  18295. <type name="Rand" c:type="GRand*"/>
  18296. </return-value>
  18297. <parameters>
  18298. <instance-parameter name="rand_" transfer-ownership="none">
  18299. <doc xml:space="preserve">a #GRand</doc>
  18300. <type name="Rand" c:type="GRand*"/>
  18301. </instance-parameter>
  18302. </parameters>
  18303. </method>
  18304. <method name="double" c:identifier="g_rand_double">
  18305. <doc xml:space="preserve">Returns the next random #gdouble from @rand_ equally distributed over
  18306. the range [0..1).</doc>
  18307. <return-value transfer-ownership="none">
  18308. <doc xml:space="preserve">a random number</doc>
  18309. <type name="gdouble" c:type="gdouble"/>
  18310. </return-value>
  18311. <parameters>
  18312. <instance-parameter name="rand_" transfer-ownership="none">
  18313. <doc xml:space="preserve">a #GRand</doc>
  18314. <type name="Rand" c:type="GRand*"/>
  18315. </instance-parameter>
  18316. </parameters>
  18317. </method>
  18318. <method name="double_range" c:identifier="g_rand_double_range">
  18319. <doc xml:space="preserve">Returns the next random #gdouble from @rand_ equally distributed over
  18320. the range [@begin..@end).</doc>
  18321. <return-value transfer-ownership="none">
  18322. <doc xml:space="preserve">a random number</doc>
  18323. <type name="gdouble" c:type="gdouble"/>
  18324. </return-value>
  18325. <parameters>
  18326. <instance-parameter name="rand_" transfer-ownership="none">
  18327. <doc xml:space="preserve">a #GRand</doc>
  18328. <type name="Rand" c:type="GRand*"/>
  18329. </instance-parameter>
  18330. <parameter name="begin" transfer-ownership="none">
  18331. <doc xml:space="preserve">lower closed bound of the interval</doc>
  18332. <type name="gdouble" c:type="gdouble"/>
  18333. </parameter>
  18334. <parameter name="end" transfer-ownership="none">
  18335. <doc xml:space="preserve">upper open bound of the interval</doc>
  18336. <type name="gdouble" c:type="gdouble"/>
  18337. </parameter>
  18338. </parameters>
  18339. </method>
  18340. <method name="free" c:identifier="g_rand_free">
  18341. <doc xml:space="preserve">Frees the memory allocated for the #GRand.</doc>
  18342. <return-value transfer-ownership="none">
  18343. <type name="none" c:type="void"/>
  18344. </return-value>
  18345. <parameters>
  18346. <instance-parameter name="rand_" transfer-ownership="none">
  18347. <doc xml:space="preserve">a #GRand</doc>
  18348. <type name="Rand" c:type="GRand*"/>
  18349. </instance-parameter>
  18350. </parameters>
  18351. </method>
  18352. <method name="int" c:identifier="g_rand_int">
  18353. <doc xml:space="preserve">Returns the next random #guint32 from @rand_ equally distributed over
  18354. the range [0..2^32-1].</doc>
  18355. <return-value transfer-ownership="none">
  18356. <doc xml:space="preserve">a random number</doc>
  18357. <type name="guint32" c:type="guint32"/>
  18358. </return-value>
  18359. <parameters>
  18360. <instance-parameter name="rand_" transfer-ownership="none">
  18361. <doc xml:space="preserve">a #GRand</doc>
  18362. <type name="Rand" c:type="GRand*"/>
  18363. </instance-parameter>
  18364. </parameters>
  18365. </method>
  18366. <method name="int_range" c:identifier="g_rand_int_range">
  18367. <doc xml:space="preserve">Returns the next random #gint32 from @rand_ equally distributed over
  18368. the range [@begin..@end-1].</doc>
  18369. <return-value transfer-ownership="none">
  18370. <doc xml:space="preserve">a random number</doc>
  18371. <type name="gint32" c:type="gint32"/>
  18372. </return-value>
  18373. <parameters>
  18374. <instance-parameter name="rand_" transfer-ownership="none">
  18375. <doc xml:space="preserve">a #GRand</doc>
  18376. <type name="Rand" c:type="GRand*"/>
  18377. </instance-parameter>
  18378. <parameter name="begin" transfer-ownership="none">
  18379. <doc xml:space="preserve">lower closed bound of the interval</doc>
  18380. <type name="gint32" c:type="gint32"/>
  18381. </parameter>
  18382. <parameter name="end" transfer-ownership="none">
  18383. <doc xml:space="preserve">upper open bound of the interval</doc>
  18384. <type name="gint32" c:type="gint32"/>
  18385. </parameter>
  18386. </parameters>
  18387. </method>
  18388. <method name="set_seed" c:identifier="g_rand_set_seed">
  18389. <doc xml:space="preserve">Sets the seed for the random number generator #GRand to @seed.</doc>
  18390. <return-value transfer-ownership="none">
  18391. <type name="none" c:type="void"/>
  18392. </return-value>
  18393. <parameters>
  18394. <instance-parameter name="rand_" transfer-ownership="none">
  18395. <doc xml:space="preserve">a #GRand</doc>
  18396. <type name="Rand" c:type="GRand*"/>
  18397. </instance-parameter>
  18398. <parameter name="seed" transfer-ownership="none">
  18399. <doc xml:space="preserve">a value to reinitialize the random number generator</doc>
  18400. <type name="guint32" c:type="guint32"/>
  18401. </parameter>
  18402. </parameters>
  18403. </method>
  18404. <method name="set_seed_array"
  18405. c:identifier="g_rand_set_seed_array"
  18406. version="2.4">
  18407. <doc xml:space="preserve">Initializes the random number generator by an array of longs.
  18408. Array can be of arbitrary size, though only the first 624 values
  18409. are taken. This function is useful if you have many low entropy
  18410. seeds, or if you require more then 32 bits of actual entropy for
  18411. your application.</doc>
  18412. <return-value transfer-ownership="none">
  18413. <type name="none" c:type="void"/>
  18414. </return-value>
  18415. <parameters>
  18416. <instance-parameter name="rand_" transfer-ownership="none">
  18417. <doc xml:space="preserve">a #GRand</doc>
  18418. <type name="Rand" c:type="GRand*"/>
  18419. </instance-parameter>
  18420. <parameter name="seed" transfer-ownership="none">
  18421. <doc xml:space="preserve">array to initialize with</doc>
  18422. <type name="guint32" c:type="const guint32*"/>
  18423. </parameter>
  18424. <parameter name="seed_length" transfer-ownership="none">
  18425. <doc xml:space="preserve">length of array</doc>
  18426. <type name="guint" c:type="guint"/>
  18427. </parameter>
  18428. </parameters>
  18429. </method>
  18430. <function name="new" c:identifier="g_rand_new" introspectable="0">
  18431. <doc xml:space="preserve">Creates a new random number generator initialized with a seed taken
  18432. either from `/dev/urandom` (if existing) or from the current time
  18433. (as a fallback).
  18434. On Windows, the seed is taken from rand_s().</doc>
  18435. <return-value>
  18436. <doc xml:space="preserve">the new #GRand</doc>
  18437. <type name="Rand" c:type="GRand*"/>
  18438. </return-value>
  18439. </function>
  18440. <function name="new_with_seed"
  18441. c:identifier="g_rand_new_with_seed"
  18442. introspectable="0">
  18443. <doc xml:space="preserve">Creates a new random number generator initialized with @seed.</doc>
  18444. <return-value>
  18445. <doc xml:space="preserve">the new #GRand</doc>
  18446. <type name="Rand" c:type="GRand*"/>
  18447. </return-value>
  18448. <parameters>
  18449. <parameter name="seed" transfer-ownership="none">
  18450. <doc xml:space="preserve">a value to initialize the random number generator</doc>
  18451. <type name="guint32" c:type="guint32"/>
  18452. </parameter>
  18453. </parameters>
  18454. </function>
  18455. <function name="new_with_seed_array"
  18456. c:identifier="g_rand_new_with_seed_array"
  18457. version="2.4"
  18458. introspectable="0">
  18459. <doc xml:space="preserve">Creates a new random number generator initialized with @seed.</doc>
  18460. <return-value>
  18461. <doc xml:space="preserve">the new #GRand</doc>
  18462. <type name="Rand" c:type="GRand*"/>
  18463. </return-value>
  18464. <parameters>
  18465. <parameter name="seed" transfer-ownership="none">
  18466. <doc xml:space="preserve">an array of seeds to initialize the random number generator</doc>
  18467. <type name="guint32" c:type="const guint32*"/>
  18468. </parameter>
  18469. <parameter name="seed_length" transfer-ownership="none">
  18470. <doc xml:space="preserve">an array of seeds to initialize the random number
  18471. generator</doc>
  18472. <type name="guint" c:type="guint"/>
  18473. </parameter>
  18474. </parameters>
  18475. </function>
  18476. </record>
  18477. <record name="RecMutex" c:type="GRecMutex" version="2.32">
  18478. <doc xml:space="preserve">The GRecMutex struct is an opaque data structure to represent a
  18479. recursive mutex. It is similar to a #GMutex with the difference
  18480. that it is possible to lock a GRecMutex multiple times in the same
  18481. thread without deadlock. When doing so, care has to be taken to
  18482. unlock the recursive mutex as often as it has been locked.
  18483. If a #GRecMutex is allocated in static storage then it can be used
  18484. without initialisation. Otherwise, you should call
  18485. g_rec_mutex_init() on it and g_rec_mutex_clear() when done.
  18486. A GRecMutex should only be accessed with the
  18487. g_rec_mutex_ functions.</doc>
  18488. <field name="p" readable="0" private="1">
  18489. <type name="gpointer" c:type="gpointer"/>
  18490. </field>
  18491. <field name="i" readable="0" private="1">
  18492. <array zero-terminated="0" c:type="guint" fixed-size="2">
  18493. <type name="guint" c:type="guint"/>
  18494. </array>
  18495. </field>
  18496. <method name="clear" c:identifier="g_rec_mutex_clear">
  18497. <doc xml:space="preserve">Frees the resources allocated to a recursive mutex with
  18498. g_rec_mutex_init().
  18499. This function should not be used with a #GRecMutex that has been
  18500. statically allocated.
  18501. Calling g_rec_mutex_clear() on a locked recursive mutex leads
  18502. to undefined behaviour.
  18503. Sine: 2.32</doc>
  18504. <return-value transfer-ownership="none">
  18505. <type name="none" c:type="void"/>
  18506. </return-value>
  18507. <parameters>
  18508. <instance-parameter name="rec_mutex" transfer-ownership="none">
  18509. <doc xml:space="preserve">an initialized #GRecMutex</doc>
  18510. <type name="RecMutex" c:type="GRecMutex*"/>
  18511. </instance-parameter>
  18512. </parameters>
  18513. </method>
  18514. <method name="init" c:identifier="g_rec_mutex_init" version="2.32">
  18515. <doc xml:space="preserve">Initializes a #GRecMutex so that it can be used.
  18516. This function is useful to initialize a recursive mutex
  18517. that has been allocated on the stack, or as part of a larger
  18518. structure.
  18519. It is not necessary to initialise a recursive mutex that has been
  18520. statically allocated.
  18521. |[&lt;!-- language="C" --&gt;
  18522. typedef struct {
  18523. GRecMutex m;
  18524. ...
  18525. } Blob;
  18526. Blob *b;
  18527. b = g_new (Blob, 1);
  18528. g_rec_mutex_init (&amp;b-&gt;m);
  18529. ]|
  18530. Calling g_rec_mutex_init() on an already initialized #GRecMutex
  18531. leads to undefined behaviour.
  18532. To undo the effect of g_rec_mutex_init() when a recursive mutex
  18533. is no longer needed, use g_rec_mutex_clear().</doc>
  18534. <return-value transfer-ownership="none">
  18535. <type name="none" c:type="void"/>
  18536. </return-value>
  18537. <parameters>
  18538. <instance-parameter name="rec_mutex" transfer-ownership="none">
  18539. <doc xml:space="preserve">an uninitialized #GRecMutex</doc>
  18540. <type name="RecMutex" c:type="GRecMutex*"/>
  18541. </instance-parameter>
  18542. </parameters>
  18543. </method>
  18544. <method name="lock" c:identifier="g_rec_mutex_lock" version="2.32">
  18545. <doc xml:space="preserve">Locks @rec_mutex. If @rec_mutex is already locked by another
  18546. thread, the current thread will block until @rec_mutex is
  18547. unlocked by the other thread. If @rec_mutex is already locked
  18548. by the current thread, the 'lock count' of @rec_mutex is increased.
  18549. The mutex will only become available again when it is unlocked
  18550. as many times as it has been locked.</doc>
  18551. <return-value transfer-ownership="none">
  18552. <type name="none" c:type="void"/>
  18553. </return-value>
  18554. <parameters>
  18555. <instance-parameter name="rec_mutex" transfer-ownership="none">
  18556. <doc xml:space="preserve">a #GRecMutex</doc>
  18557. <type name="RecMutex" c:type="GRecMutex*"/>
  18558. </instance-parameter>
  18559. </parameters>
  18560. </method>
  18561. <method name="trylock" c:identifier="g_rec_mutex_trylock" version="2.32">
  18562. <doc xml:space="preserve">Tries to lock @rec_mutex. If @rec_mutex is already locked
  18563. by another thread, it immediately returns %FALSE. Otherwise
  18564. it locks @rec_mutex and returns %TRUE.</doc>
  18565. <return-value transfer-ownership="none">
  18566. <doc xml:space="preserve">%TRUE if @rec_mutex could be locked</doc>
  18567. <type name="gboolean" c:type="gboolean"/>
  18568. </return-value>
  18569. <parameters>
  18570. <instance-parameter name="rec_mutex" transfer-ownership="none">
  18571. <doc xml:space="preserve">a #GRecMutex</doc>
  18572. <type name="RecMutex" c:type="GRecMutex*"/>
  18573. </instance-parameter>
  18574. </parameters>
  18575. </method>
  18576. <method name="unlock" c:identifier="g_rec_mutex_unlock" version="2.32">
  18577. <doc xml:space="preserve">Unlocks @rec_mutex. If another thread is blocked in a
  18578. g_rec_mutex_lock() call for @rec_mutex, it will become unblocked
  18579. and can lock @rec_mutex itself.
  18580. Calling g_rec_mutex_unlock() on a recursive mutex that is not
  18581. locked by the current thread leads to undefined behaviour.</doc>
  18582. <return-value transfer-ownership="none">
  18583. <type name="none" c:type="void"/>
  18584. </return-value>
  18585. <parameters>
  18586. <instance-parameter name="rec_mutex" transfer-ownership="none">
  18587. <doc xml:space="preserve">a #GRecMutex</doc>
  18588. <type name="RecMutex" c:type="GRecMutex*"/>
  18589. </instance-parameter>
  18590. </parameters>
  18591. </method>
  18592. </record>
  18593. <record name="Regex"
  18594. c:type="GRegex"
  18595. version="2.14"
  18596. glib:type-name="GRegex"
  18597. glib:get-type="g_regex_get_type"
  18598. c:symbol-prefix="regex">
  18599. <doc xml:space="preserve">The g_regex_*() functions implement regular
  18600. expression pattern matching using syntax and semantics similar to
  18601. Perl regular expression.
  18602. Some functions accept a @start_position argument, setting it differs
  18603. from just passing over a shortened string and setting #G_REGEX_MATCH_NOTBOL
  18604. in the case of a pattern that begins with any kind of lookbehind assertion.
  18605. For example, consider the pattern "\Biss\B" which finds occurrences of "iss"
  18606. in the middle of words. ("\B" matches only if the current position in the
  18607. subject is not a word boundary.) When applied to the string "Mississipi"
  18608. from the fourth byte, namely "issipi", it does not match, because "\B" is
  18609. always false at the start of the subject, which is deemed to be a word
  18610. boundary. However, if the entire string is passed , but with
  18611. @start_position set to 4, it finds the second occurrence of "iss" because
  18612. it is able to look behind the starting point to discover that it is
  18613. preceded by a letter.
  18614. Note that, unless you set the #G_REGEX_RAW flag, all the strings passed
  18615. to these functions must be encoded in UTF-8. The lengths and the positions
  18616. inside the strings are in bytes and not in characters, so, for instance,
  18617. "\xc3\xa0" (i.e. "&amp;agrave;") is two bytes long but it is treated as a
  18618. single character. If you set #G_REGEX_RAW the strings can be non-valid
  18619. UTF-8 strings and a byte is treated as a character, so "\xc3\xa0" is two
  18620. bytes and two characters long.
  18621. When matching a pattern, "\n" matches only against a "\n" character in
  18622. the string, and "\r" matches only a "\r" character. To match any newline
  18623. sequence use "\R". This particular group matches either the two-character
  18624. sequence CR + LF ("\r\n"), or one of the single characters LF (linefeed,
  18625. U+000A, "\n"), VT vertical tab, U+000B, "\v"), FF (formfeed, U+000C, "\f"),
  18626. CR (carriage return, U+000D, "\r"), NEL (next line, U+0085), LS (line
  18627. separator, U+2028), or PS (paragraph separator, U+2029).
  18628. The behaviour of the dot, circumflex, and dollar metacharacters are
  18629. affected by newline characters, the default is to recognize any newline
  18630. character (the same characters recognized by "\R"). This can be changed
  18631. with #G_REGEX_NEWLINE_CR, #G_REGEX_NEWLINE_LF and #G_REGEX_NEWLINE_CRLF
  18632. compile options, and with #G_REGEX_MATCH_NEWLINE_ANY,
  18633. #G_REGEX_MATCH_NEWLINE_CR, #G_REGEX_MATCH_NEWLINE_LF and
  18634. #G_REGEX_MATCH_NEWLINE_CRLF match options. These settings are also
  18635. relevant when compiling a pattern if #G_REGEX_EXTENDED is set, and an
  18636. unescaped "#" outside a character class is encountered. This indicates
  18637. a comment that lasts until after the next newline.
  18638. When setting the %G_REGEX_JAVASCRIPT_COMPAT flag, pattern syntax and pattern
  18639. matching is changed to be compatible with the way that regular expressions
  18640. work in JavaScript. More precisely, a lonely ']' character in the pattern
  18641. is a syntax error; the '\x' escape only allows 0 to 2 hexadecimal digits, and
  18642. you must use the '\u' escape sequence with 4 hex digits to specify a unicode
  18643. codepoint instead of '\x' or 'x{....}'. If '\x' or '\u' are not followed by
  18644. the specified number of hex digits, they match 'x' and 'u' literally; also
  18645. '\U' always matches 'U' instead of being an error in the pattern. Finally,
  18646. pattern matching is modified so that back references to an unset subpattern
  18647. group produces a match with the empty string instead of an error. See
  18648. pcreapi(3) for more information.
  18649. Creating and manipulating the same #GRegex structure from different
  18650. threads is not a problem as #GRegex does not modify its internal
  18651. state between creation and destruction, on the other hand #GMatchInfo
  18652. is not threadsafe.
  18653. The regular expressions low-level functionalities are obtained through
  18654. the excellent
  18655. [PCRE](http://www.pcre.org/)
  18656. library written by Philip Hazel.</doc>
  18657. <constructor name="new"
  18658. c:identifier="g_regex_new"
  18659. version="2.14"
  18660. throws="1">
  18661. <doc xml:space="preserve">Compiles the regular expression to an internal form, and does
  18662. the initial setup of the #GRegex structure.</doc>
  18663. <return-value transfer-ownership="full" nullable="1">
  18664. <doc xml:space="preserve">a #GRegex structure or %NULL if an error occured. Call
  18665. g_regex_unref() when you are done with it</doc>
  18666. <type name="Regex" c:type="GRegex*"/>
  18667. </return-value>
  18668. <parameters>
  18669. <parameter name="pattern" transfer-ownership="none">
  18670. <doc xml:space="preserve">the regular expression</doc>
  18671. <type name="utf8" c:type="const gchar*"/>
  18672. </parameter>
  18673. <parameter name="compile_options" transfer-ownership="none">
  18674. <doc xml:space="preserve">compile options for the regular expression, or 0</doc>
  18675. <type name="RegexCompileFlags" c:type="GRegexCompileFlags"/>
  18676. </parameter>
  18677. <parameter name="match_options" transfer-ownership="none">
  18678. <doc xml:space="preserve">match options for the regular expression, or 0</doc>
  18679. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  18680. </parameter>
  18681. </parameters>
  18682. </constructor>
  18683. <method name="get_capture_count"
  18684. c:identifier="g_regex_get_capture_count"
  18685. version="2.14">
  18686. <doc xml:space="preserve">Returns the number of capturing subpatterns in the pattern.</doc>
  18687. <return-value transfer-ownership="none">
  18688. <doc xml:space="preserve">the number of capturing subpatterns</doc>
  18689. <type name="gint" c:type="gint"/>
  18690. </return-value>
  18691. <parameters>
  18692. <instance-parameter name="regex" transfer-ownership="none">
  18693. <doc xml:space="preserve">a #GRegex</doc>
  18694. <type name="Regex" c:type="const GRegex*"/>
  18695. </instance-parameter>
  18696. </parameters>
  18697. </method>
  18698. <method name="get_compile_flags"
  18699. c:identifier="g_regex_get_compile_flags"
  18700. version="2.26">
  18701. <doc xml:space="preserve">Returns the compile options that @regex was created with.</doc>
  18702. <return-value transfer-ownership="none">
  18703. <doc xml:space="preserve">flags from #GRegexCompileFlags</doc>
  18704. <type name="RegexCompileFlags" c:type="GRegexCompileFlags"/>
  18705. </return-value>
  18706. <parameters>
  18707. <instance-parameter name="regex" transfer-ownership="none">
  18708. <doc xml:space="preserve">a #GRegex</doc>
  18709. <type name="Regex" c:type="const GRegex*"/>
  18710. </instance-parameter>
  18711. </parameters>
  18712. </method>
  18713. <method name="get_has_cr_or_lf"
  18714. c:identifier="g_regex_get_has_cr_or_lf"
  18715. version="2.34">
  18716. <doc xml:space="preserve">Checks whether the pattern contains explicit CR or LF references.</doc>
  18717. <return-value transfer-ownership="none">
  18718. <doc xml:space="preserve">%TRUE if the pattern contains explicit CR or LF references</doc>
  18719. <type name="gboolean" c:type="gboolean"/>
  18720. </return-value>
  18721. <parameters>
  18722. <instance-parameter name="regex" transfer-ownership="none">
  18723. <doc xml:space="preserve">a #GRegex structure</doc>
  18724. <type name="Regex" c:type="const GRegex*"/>
  18725. </instance-parameter>
  18726. </parameters>
  18727. </method>
  18728. <method name="get_match_flags"
  18729. c:identifier="g_regex_get_match_flags"
  18730. version="2.26">
  18731. <doc xml:space="preserve">Returns the match options that @regex was created with.</doc>
  18732. <return-value transfer-ownership="none">
  18733. <doc xml:space="preserve">flags from #GRegexMatchFlags</doc>
  18734. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  18735. </return-value>
  18736. <parameters>
  18737. <instance-parameter name="regex" transfer-ownership="none">
  18738. <doc xml:space="preserve">a #GRegex</doc>
  18739. <type name="Regex" c:type="const GRegex*"/>
  18740. </instance-parameter>
  18741. </parameters>
  18742. </method>
  18743. <method name="get_max_backref"
  18744. c:identifier="g_regex_get_max_backref"
  18745. version="2.14">
  18746. <doc xml:space="preserve">Returns the number of the highest back reference
  18747. in the pattern, or 0 if the pattern does not contain
  18748. back references.</doc>
  18749. <return-value transfer-ownership="none">
  18750. <doc xml:space="preserve">the number of the highest back reference</doc>
  18751. <type name="gint" c:type="gint"/>
  18752. </return-value>
  18753. <parameters>
  18754. <instance-parameter name="regex" transfer-ownership="none">
  18755. <doc xml:space="preserve">a #GRegex</doc>
  18756. <type name="Regex" c:type="const GRegex*"/>
  18757. </instance-parameter>
  18758. </parameters>
  18759. </method>
  18760. <method name="get_max_lookbehind"
  18761. c:identifier="g_regex_get_max_lookbehind"
  18762. version="2.38">
  18763. <doc xml:space="preserve">Gets the number of characters in the longest lookbehind assertion in the
  18764. pattern. This information is useful when doing multi-segment matching using
  18765. the partial matching facilities.</doc>
  18766. <return-value transfer-ownership="none">
  18767. <doc xml:space="preserve">the number of characters in the longest lookbehind assertion.</doc>
  18768. <type name="gint" c:type="gint"/>
  18769. </return-value>
  18770. <parameters>
  18771. <instance-parameter name="regex" transfer-ownership="none">
  18772. <doc xml:space="preserve">a #GRegex structure</doc>
  18773. <type name="Regex" c:type="const GRegex*"/>
  18774. </instance-parameter>
  18775. </parameters>
  18776. </method>
  18777. <method name="get_pattern"
  18778. c:identifier="g_regex_get_pattern"
  18779. version="2.14">
  18780. <doc xml:space="preserve">Gets the pattern string associated with @regex, i.e. a copy of
  18781. the string passed to g_regex_new().</doc>
  18782. <return-value transfer-ownership="none">
  18783. <doc xml:space="preserve">the pattern of @regex</doc>
  18784. <type name="utf8" c:type="const gchar*"/>
  18785. </return-value>
  18786. <parameters>
  18787. <instance-parameter name="regex" transfer-ownership="none">
  18788. <doc xml:space="preserve">a #GRegex structure</doc>
  18789. <type name="Regex" c:type="const GRegex*"/>
  18790. </instance-parameter>
  18791. </parameters>
  18792. </method>
  18793. <method name="get_string_number"
  18794. c:identifier="g_regex_get_string_number"
  18795. version="2.14">
  18796. <doc xml:space="preserve">Retrieves the number of the subexpression named @name.</doc>
  18797. <return-value transfer-ownership="none">
  18798. <doc xml:space="preserve">The number of the subexpression or -1 if @name
  18799. does not exists</doc>
  18800. <type name="gint" c:type="gint"/>
  18801. </return-value>
  18802. <parameters>
  18803. <instance-parameter name="regex" transfer-ownership="none">
  18804. <doc xml:space="preserve">#GRegex structure</doc>
  18805. <type name="Regex" c:type="const GRegex*"/>
  18806. </instance-parameter>
  18807. <parameter name="name" transfer-ownership="none">
  18808. <doc xml:space="preserve">name of the subexpression</doc>
  18809. <type name="utf8" c:type="const gchar*"/>
  18810. </parameter>
  18811. </parameters>
  18812. </method>
  18813. <method name="match" c:identifier="g_regex_match" version="2.14">
  18814. <doc xml:space="preserve">Scans for a match in string for the pattern in @regex.
  18815. The @match_options are combined with the match options specified
  18816. when the @regex structure was created, letting you have more
  18817. flexibility in reusing #GRegex structures.
  18818. A #GMatchInfo structure, used to get information on the match,
  18819. is stored in @match_info if not %NULL. Note that if @match_info
  18820. is not %NULL then it is created even if the function returns %FALSE,
  18821. i.e. you must free it regardless if regular expression actually matched.
  18822. To retrieve all the non-overlapping matches of the pattern in
  18823. string you can use g_match_info_next().
  18824. |[&lt;!-- language="C" --&gt;
  18825. static void
  18826. print_uppercase_words (const gchar *string)
  18827. {
  18828. // Print all uppercase-only words.
  18829. GRegex *regex;
  18830. GMatchInfo *match_info;
  18831. regex = g_regex_new ("[A-Z]+", 0, 0, NULL);
  18832. g_regex_match (regex, string, 0, &amp;match_info);
  18833. while (g_match_info_matches (match_info))
  18834. {
  18835. gchar *word = g_match_info_fetch (match_info, 0);
  18836. g_print ("Found: %s\n", word);
  18837. g_free (word);
  18838. g_match_info_next (match_info, NULL);
  18839. }
  18840. g_match_info_free (match_info);
  18841. g_regex_unref (regex);
  18842. }
  18843. ]|
  18844. @string is not copied and is used in #GMatchInfo internally. If
  18845. you use any #GMatchInfo method (except g_match_info_free()) after
  18846. freeing or modifying @string then the behaviour is undefined.</doc>
  18847. <return-value transfer-ownership="none">
  18848. <doc xml:space="preserve">%TRUE is the string matched, %FALSE otherwise</doc>
  18849. <type name="gboolean" c:type="gboolean"/>
  18850. </return-value>
  18851. <parameters>
  18852. <instance-parameter name="regex" transfer-ownership="none">
  18853. <doc xml:space="preserve">a #GRegex structure from g_regex_new()</doc>
  18854. <type name="Regex" c:type="const GRegex*"/>
  18855. </instance-parameter>
  18856. <parameter name="string" transfer-ownership="none">
  18857. <doc xml:space="preserve">the string to scan for matches</doc>
  18858. <type name="utf8" c:type="const gchar*"/>
  18859. </parameter>
  18860. <parameter name="match_options" transfer-ownership="none">
  18861. <doc xml:space="preserve">match options</doc>
  18862. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  18863. </parameter>
  18864. <parameter name="match_info"
  18865. direction="out"
  18866. caller-allocates="0"
  18867. transfer-ownership="full"
  18868. optional="1"
  18869. allow-none="1">
  18870. <doc xml:space="preserve">pointer to location where to store
  18871. the #GMatchInfo, or %NULL if you do not need it</doc>
  18872. <type name="MatchInfo" c:type="GMatchInfo**"/>
  18873. </parameter>
  18874. </parameters>
  18875. </method>
  18876. <method name="match_all" c:identifier="g_regex_match_all" version="2.14">
  18877. <doc xml:space="preserve">Using the standard algorithm for regular expression matching only
  18878. the longest match in the string is retrieved. This function uses
  18879. a different algorithm so it can retrieve all the possible matches.
  18880. For more documentation see g_regex_match_all_full().
  18881. A #GMatchInfo structure, used to get information on the match, is
  18882. stored in @match_info if not %NULL. Note that if @match_info is
  18883. not %NULL then it is created even if the function returns %FALSE,
  18884. i.e. you must free it regardless if regular expression actually
  18885. matched.
  18886. @string is not copied and is used in #GMatchInfo internally. If
  18887. you use any #GMatchInfo method (except g_match_info_free()) after
  18888. freeing or modifying @string then the behaviour is undefined.</doc>
  18889. <return-value transfer-ownership="none">
  18890. <doc xml:space="preserve">%TRUE is the string matched, %FALSE otherwise</doc>
  18891. <type name="gboolean" c:type="gboolean"/>
  18892. </return-value>
  18893. <parameters>
  18894. <instance-parameter name="regex" transfer-ownership="none">
  18895. <doc xml:space="preserve">a #GRegex structure from g_regex_new()</doc>
  18896. <type name="Regex" c:type="const GRegex*"/>
  18897. </instance-parameter>
  18898. <parameter name="string" transfer-ownership="none">
  18899. <doc xml:space="preserve">the string to scan for matches</doc>
  18900. <type name="utf8" c:type="const gchar*"/>
  18901. </parameter>
  18902. <parameter name="match_options" transfer-ownership="none">
  18903. <doc xml:space="preserve">match options</doc>
  18904. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  18905. </parameter>
  18906. <parameter name="match_info"
  18907. direction="out"
  18908. caller-allocates="0"
  18909. transfer-ownership="full"
  18910. optional="1"
  18911. allow-none="1">
  18912. <doc xml:space="preserve">pointer to location where to store
  18913. the #GMatchInfo, or %NULL if you do not need it</doc>
  18914. <type name="MatchInfo" c:type="GMatchInfo**"/>
  18915. </parameter>
  18916. </parameters>
  18917. </method>
  18918. <method name="match_all_full"
  18919. c:identifier="g_regex_match_all_full"
  18920. version="2.14"
  18921. throws="1">
  18922. <doc xml:space="preserve">Using the standard algorithm for regular expression matching only
  18923. the longest match in the string is retrieved, it is not possible
  18924. to obtain all the available matches. For instance matching
  18925. "&lt;a&gt; &lt;b&gt; &lt;c&gt;" against the pattern "&lt;.*&gt;"
  18926. you get "&lt;a&gt; &lt;b&gt; &lt;c&gt;".
  18927. This function uses a different algorithm (called DFA, i.e. deterministic
  18928. finite automaton), so it can retrieve all the possible matches, all
  18929. starting at the same point in the string. For instance matching
  18930. "&lt;a&gt; &lt;b&gt; &lt;c&gt;" against the pattern "&lt;.*&gt;;"
  18931. you would obtain three matches: "&lt;a&gt; &lt;b&gt; &lt;c&gt;",
  18932. "&lt;a&gt; &lt;b&gt;" and "&lt;a&gt;".
  18933. The number of matched strings is retrieved using
  18934. g_match_info_get_match_count(). To obtain the matched strings and
  18935. their position you can use, respectively, g_match_info_fetch() and
  18936. g_match_info_fetch_pos(). Note that the strings are returned in
  18937. reverse order of length; that is, the longest matching string is
  18938. given first.
  18939. Note that the DFA algorithm is slower than the standard one and it
  18940. is not able to capture substrings, so backreferences do not work.
  18941. Setting @start_position differs from just passing over a shortened
  18942. string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern
  18943. that begins with any kind of lookbehind assertion, such as "\b".
  18944. A #GMatchInfo structure, used to get information on the match, is
  18945. stored in @match_info if not %NULL. Note that if @match_info is
  18946. not %NULL then it is created even if the function returns %FALSE,
  18947. i.e. you must free it regardless if regular expression actually
  18948. matched.
  18949. @string is not copied and is used in #GMatchInfo internally. If
  18950. you use any #GMatchInfo method (except g_match_info_free()) after
  18951. freeing or modifying @string then the behaviour is undefined.</doc>
  18952. <return-value transfer-ownership="none">
  18953. <doc xml:space="preserve">%TRUE is the string matched, %FALSE otherwise</doc>
  18954. <type name="gboolean" c:type="gboolean"/>
  18955. </return-value>
  18956. <parameters>
  18957. <instance-parameter name="regex" transfer-ownership="none">
  18958. <doc xml:space="preserve">a #GRegex structure from g_regex_new()</doc>
  18959. <type name="Regex" c:type="const GRegex*"/>
  18960. </instance-parameter>
  18961. <parameter name="string" transfer-ownership="none">
  18962. <doc xml:space="preserve">the string to scan for matches</doc>
  18963. <array length="1" zero-terminated="0" c:type="gchar*">
  18964. <type name="utf8" c:type="gchar"/>
  18965. </array>
  18966. </parameter>
  18967. <parameter name="string_len" transfer-ownership="none">
  18968. <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
  18969. <type name="gssize" c:type="gssize"/>
  18970. </parameter>
  18971. <parameter name="start_position" transfer-ownership="none">
  18972. <doc xml:space="preserve">starting index of the string to match, in bytes</doc>
  18973. <type name="gint" c:type="gint"/>
  18974. </parameter>
  18975. <parameter name="match_options" transfer-ownership="none">
  18976. <doc xml:space="preserve">match options</doc>
  18977. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  18978. </parameter>
  18979. <parameter name="match_info"
  18980. direction="out"
  18981. caller-allocates="0"
  18982. transfer-ownership="full"
  18983. optional="1"
  18984. allow-none="1">
  18985. <doc xml:space="preserve">pointer to location where to store
  18986. the #GMatchInfo, or %NULL if you do not need it</doc>
  18987. <type name="MatchInfo" c:type="GMatchInfo**"/>
  18988. </parameter>
  18989. </parameters>
  18990. </method>
  18991. <method name="match_full"
  18992. c:identifier="g_regex_match_full"
  18993. version="2.14"
  18994. throws="1">
  18995. <doc xml:space="preserve">Scans for a match in string for the pattern in @regex.
  18996. The @match_options are combined with the match options specified
  18997. when the @regex structure was created, letting you have more
  18998. flexibility in reusing #GRegex structures.
  18999. Setting @start_position differs from just passing over a shortened
  19000. string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern
  19001. that begins with any kind of lookbehind assertion, such as "\b".
  19002. A #GMatchInfo structure, used to get information on the match, is
  19003. stored in @match_info if not %NULL. Note that if @match_info is
  19004. not %NULL then it is created even if the function returns %FALSE,
  19005. i.e. you must free it regardless if regular expression actually
  19006. matched.
  19007. @string is not copied and is used in #GMatchInfo internally. If
  19008. you use any #GMatchInfo method (except g_match_info_free()) after
  19009. freeing or modifying @string then the behaviour is undefined.
  19010. To retrieve all the non-overlapping matches of the pattern in
  19011. string you can use g_match_info_next().
  19012. |[&lt;!-- language="C" --&gt;
  19013. static void
  19014. print_uppercase_words (const gchar *string)
  19015. {
  19016. // Print all uppercase-only words.
  19017. GRegex *regex;
  19018. GMatchInfo *match_info;
  19019. GError *error = NULL;
  19020. regex = g_regex_new ("[A-Z]+", 0, 0, NULL);
  19021. g_regex_match_full (regex, string, -1, 0, 0, &amp;match_info, &amp;error);
  19022. while (g_match_info_matches (match_info))
  19023. {
  19024. gchar *word = g_match_info_fetch (match_info, 0);
  19025. g_print ("Found: %s\n", word);
  19026. g_free (word);
  19027. g_match_info_next (match_info, &amp;error);
  19028. }
  19029. g_match_info_free (match_info);
  19030. g_regex_unref (regex);
  19031. if (error != NULL)
  19032. {
  19033. g_printerr ("Error while matching: %s\n", error-&gt;message);
  19034. g_error_free (error);
  19035. }
  19036. }
  19037. ]|</doc>
  19038. <return-value transfer-ownership="none">
  19039. <doc xml:space="preserve">%TRUE is the string matched, %FALSE otherwise</doc>
  19040. <type name="gboolean" c:type="gboolean"/>
  19041. </return-value>
  19042. <parameters>
  19043. <instance-parameter name="regex" transfer-ownership="none">
  19044. <doc xml:space="preserve">a #GRegex structure from g_regex_new()</doc>
  19045. <type name="Regex" c:type="const GRegex*"/>
  19046. </instance-parameter>
  19047. <parameter name="string" transfer-ownership="none">
  19048. <doc xml:space="preserve">the string to scan for matches</doc>
  19049. <array length="1" zero-terminated="0" c:type="gchar*">
  19050. <type name="utf8" c:type="gchar"/>
  19051. </array>
  19052. </parameter>
  19053. <parameter name="string_len" transfer-ownership="none">
  19054. <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
  19055. <type name="gssize" c:type="gssize"/>
  19056. </parameter>
  19057. <parameter name="start_position" transfer-ownership="none">
  19058. <doc xml:space="preserve">starting index of the string to match, in bytes</doc>
  19059. <type name="gint" c:type="gint"/>
  19060. </parameter>
  19061. <parameter name="match_options" transfer-ownership="none">
  19062. <doc xml:space="preserve">match options</doc>
  19063. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  19064. </parameter>
  19065. <parameter name="match_info"
  19066. direction="out"
  19067. caller-allocates="0"
  19068. transfer-ownership="full"
  19069. optional="1"
  19070. allow-none="1">
  19071. <doc xml:space="preserve">pointer to location where to store
  19072. the #GMatchInfo, or %NULL if you do not need it</doc>
  19073. <type name="MatchInfo" c:type="GMatchInfo**"/>
  19074. </parameter>
  19075. </parameters>
  19076. </method>
  19077. <method name="ref" c:identifier="g_regex_ref" version="2.14">
  19078. <doc xml:space="preserve">Increases reference count of @regex by 1.</doc>
  19079. <return-value transfer-ownership="full">
  19080. <doc xml:space="preserve">@regex</doc>
  19081. <type name="Regex" c:type="GRegex*"/>
  19082. </return-value>
  19083. <parameters>
  19084. <instance-parameter name="regex" transfer-ownership="none">
  19085. <doc xml:space="preserve">a #GRegex</doc>
  19086. <type name="Regex" c:type="GRegex*"/>
  19087. </instance-parameter>
  19088. </parameters>
  19089. </method>
  19090. <method name="replace"
  19091. c:identifier="g_regex_replace"
  19092. version="2.14"
  19093. throws="1">
  19094. <doc xml:space="preserve">Replaces all occurrences of the pattern in @regex with the
  19095. replacement text. Backreferences of the form '\number' or
  19096. '\g&lt;number&gt;' in the replacement text are interpolated by the
  19097. number-th captured subexpression of the match, '\g&lt;name&gt;' refers
  19098. to the captured subexpression with the given name. '\0' refers
  19099. to the complete match, but '\0' followed by a number is the octal
  19100. representation of a character. To include a literal '\' in the
  19101. replacement, write '\\'.
  19102. There are also escapes that changes the case of the following text:
  19103. - \l: Convert to lower case the next character
  19104. - \u: Convert to upper case the next character
  19105. - \L: Convert to lower case till \E
  19106. - \U: Convert to upper case till \E
  19107. - \E: End case modification
  19108. If you do not need to use backreferences use g_regex_replace_literal().
  19109. The @replacement string must be UTF-8 encoded even if #G_REGEX_RAW was
  19110. passed to g_regex_new(). If you want to use not UTF-8 encoded stings
  19111. you can use g_regex_replace_literal().
  19112. Setting @start_position differs from just passing over a shortened
  19113. string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern that
  19114. begins with any kind of lookbehind assertion, such as "\b".</doc>
  19115. <return-value transfer-ownership="full">
  19116. <doc xml:space="preserve">a newly allocated string containing the replacements</doc>
  19117. <type name="utf8" c:type="gchar*"/>
  19118. </return-value>
  19119. <parameters>
  19120. <instance-parameter name="regex" transfer-ownership="none">
  19121. <doc xml:space="preserve">a #GRegex structure</doc>
  19122. <type name="Regex" c:type="const GRegex*"/>
  19123. </instance-parameter>
  19124. <parameter name="string" transfer-ownership="none">
  19125. <doc xml:space="preserve">the string to perform matches against</doc>
  19126. <array length="1" zero-terminated="0" c:type="gchar*">
  19127. <type name="utf8" c:type="gchar"/>
  19128. </array>
  19129. </parameter>
  19130. <parameter name="string_len" transfer-ownership="none">
  19131. <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
  19132. <type name="gssize" c:type="gssize"/>
  19133. </parameter>
  19134. <parameter name="start_position" transfer-ownership="none">
  19135. <doc xml:space="preserve">starting index of the string to match, in bytes</doc>
  19136. <type name="gint" c:type="gint"/>
  19137. </parameter>
  19138. <parameter name="replacement" transfer-ownership="none">
  19139. <doc xml:space="preserve">text to replace each match with</doc>
  19140. <type name="utf8" c:type="const gchar*"/>
  19141. </parameter>
  19142. <parameter name="match_options" transfer-ownership="none">
  19143. <doc xml:space="preserve">options for the match</doc>
  19144. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  19145. </parameter>
  19146. </parameters>
  19147. </method>
  19148. <method name="replace_eval"
  19149. c:identifier="g_regex_replace_eval"
  19150. version="2.14"
  19151. introspectable="0"
  19152. throws="1">
  19153. <doc xml:space="preserve">Replaces occurrences of the pattern in regex with the output of
  19154. @eval for that occurrence.
  19155. Setting @start_position differs from just passing over a shortened
  19156. string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern
  19157. that begins with any kind of lookbehind assertion, such as "\b".
  19158. The following example uses g_regex_replace_eval() to replace multiple
  19159. strings at once:
  19160. |[&lt;!-- language="C" --&gt;
  19161. static gboolean
  19162. eval_cb (const GMatchInfo *info,
  19163. GString *res,
  19164. gpointer data)
  19165. {
  19166. gchar *match;
  19167. gchar *r;
  19168. match = g_match_info_fetch (info, 0);
  19169. r = g_hash_table_lookup ((GHashTable *)data, match);
  19170. g_string_append (res, r);
  19171. g_free (match);
  19172. return FALSE;
  19173. }
  19174. ...
  19175. GRegex *reg;
  19176. GHashTable *h;
  19177. gchar *res;
  19178. h = g_hash_table_new (g_str_hash, g_str_equal);
  19179. g_hash_table_insert (h, "1", "ONE");
  19180. g_hash_table_insert (h, "2", "TWO");
  19181. g_hash_table_insert (h, "3", "THREE");
  19182. g_hash_table_insert (h, "4", "FOUR");
  19183. reg = g_regex_new ("1|2|3|4", 0, 0, NULL);
  19184. res = g_regex_replace_eval (reg, text, -1, 0, 0, eval_cb, h, NULL);
  19185. g_hash_table_destroy (h);
  19186. ...
  19187. ]|</doc>
  19188. <return-value transfer-ownership="full">
  19189. <doc xml:space="preserve">a newly allocated string containing the replacements</doc>
  19190. <type name="utf8" c:type="gchar*"/>
  19191. </return-value>
  19192. <parameters>
  19193. <instance-parameter name="regex" transfer-ownership="none">
  19194. <doc xml:space="preserve">a #GRegex structure from g_regex_new()</doc>
  19195. <type name="Regex" c:type="const GRegex*"/>
  19196. </instance-parameter>
  19197. <parameter name="string" transfer-ownership="none">
  19198. <doc xml:space="preserve">string to perform matches against</doc>
  19199. <array length="1" zero-terminated="0" c:type="gchar*">
  19200. <type name="utf8" c:type="gchar"/>
  19201. </array>
  19202. </parameter>
  19203. <parameter name="string_len" transfer-ownership="none">
  19204. <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
  19205. <type name="gssize" c:type="gssize"/>
  19206. </parameter>
  19207. <parameter name="start_position" transfer-ownership="none">
  19208. <doc xml:space="preserve">starting index of the string to match, in bytes</doc>
  19209. <type name="gint" c:type="gint"/>
  19210. </parameter>
  19211. <parameter name="match_options" transfer-ownership="none">
  19212. <doc xml:space="preserve">options for the match</doc>
  19213. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  19214. </parameter>
  19215. <parameter name="eval" transfer-ownership="none" closure="5">
  19216. <doc xml:space="preserve">a function to call for each match</doc>
  19217. <type name="RegexEvalCallback" c:type="GRegexEvalCallback"/>
  19218. </parameter>
  19219. <parameter name="user_data"
  19220. transfer-ownership="none"
  19221. nullable="1"
  19222. allow-none="1">
  19223. <doc xml:space="preserve">user data to pass to the function</doc>
  19224. <type name="gpointer" c:type="gpointer"/>
  19225. </parameter>
  19226. </parameters>
  19227. </method>
  19228. <method name="replace_literal"
  19229. c:identifier="g_regex_replace_literal"
  19230. version="2.14"
  19231. throws="1">
  19232. <doc xml:space="preserve">Replaces all occurrences of the pattern in @regex with the
  19233. replacement text. @replacement is replaced literally, to
  19234. include backreferences use g_regex_replace().
  19235. Setting @start_position differs from just passing over a
  19236. shortened string and setting #G_REGEX_MATCH_NOTBOL in the
  19237. case of a pattern that begins with any kind of lookbehind
  19238. assertion, such as "\b".</doc>
  19239. <return-value transfer-ownership="full">
  19240. <doc xml:space="preserve">a newly allocated string containing the replacements</doc>
  19241. <type name="utf8" c:type="gchar*"/>
  19242. </return-value>
  19243. <parameters>
  19244. <instance-parameter name="regex" transfer-ownership="none">
  19245. <doc xml:space="preserve">a #GRegex structure</doc>
  19246. <type name="Regex" c:type="const GRegex*"/>
  19247. </instance-parameter>
  19248. <parameter name="string" transfer-ownership="none">
  19249. <doc xml:space="preserve">the string to perform matches against</doc>
  19250. <array length="1" zero-terminated="0" c:type="gchar*">
  19251. <type name="utf8" c:type="gchar"/>
  19252. </array>
  19253. </parameter>
  19254. <parameter name="string_len" transfer-ownership="none">
  19255. <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
  19256. <type name="gssize" c:type="gssize"/>
  19257. </parameter>
  19258. <parameter name="start_position" transfer-ownership="none">
  19259. <doc xml:space="preserve">starting index of the string to match, in bytes</doc>
  19260. <type name="gint" c:type="gint"/>
  19261. </parameter>
  19262. <parameter name="replacement" transfer-ownership="none">
  19263. <doc xml:space="preserve">text to replace each match with</doc>
  19264. <type name="utf8" c:type="const gchar*"/>
  19265. </parameter>
  19266. <parameter name="match_options" transfer-ownership="none">
  19267. <doc xml:space="preserve">options for the match</doc>
  19268. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  19269. </parameter>
  19270. </parameters>
  19271. </method>
  19272. <method name="split" c:identifier="g_regex_split" version="2.14">
  19273. <doc xml:space="preserve">Breaks the string on the pattern, and returns an array of the tokens.
  19274. If the pattern contains capturing parentheses, then the text for each
  19275. of the substrings will also be returned. If the pattern does not match
  19276. anywhere in the string, then the whole string is returned as the first
  19277. token.
  19278. As a special case, the result of splitting the empty string "" is an
  19279. empty vector, not a vector containing a single string. The reason for
  19280. this special case is that being able to represent a empty vector is
  19281. typically more useful than consistent handling of empty elements. If
  19282. you do need to represent empty elements, you'll need to check for the
  19283. empty string before calling this function.
  19284. A pattern that can match empty strings splits @string into separate
  19285. characters wherever it matches the empty string between characters.
  19286. For example splitting "ab c" using as a separator "\s*", you will get
  19287. "a", "b" and "c".</doc>
  19288. <return-value transfer-ownership="full">
  19289. <doc xml:space="preserve">a %NULL-terminated gchar ** array. Free
  19290. it using g_strfreev()</doc>
  19291. <array c:type="gchar**">
  19292. <type name="utf8"/>
  19293. </array>
  19294. </return-value>
  19295. <parameters>
  19296. <instance-parameter name="regex" transfer-ownership="none">
  19297. <doc xml:space="preserve">a #GRegex structure</doc>
  19298. <type name="Regex" c:type="const GRegex*"/>
  19299. </instance-parameter>
  19300. <parameter name="string" transfer-ownership="none">
  19301. <doc xml:space="preserve">the string to split with the pattern</doc>
  19302. <type name="utf8" c:type="const gchar*"/>
  19303. </parameter>
  19304. <parameter name="match_options" transfer-ownership="none">
  19305. <doc xml:space="preserve">match time option flags</doc>
  19306. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  19307. </parameter>
  19308. </parameters>
  19309. </method>
  19310. <method name="split_full"
  19311. c:identifier="g_regex_split_full"
  19312. version="2.14"
  19313. throws="1">
  19314. <doc xml:space="preserve">Breaks the string on the pattern, and returns an array of the tokens.
  19315. If the pattern contains capturing parentheses, then the text for each
  19316. of the substrings will also be returned. If the pattern does not match
  19317. anywhere in the string, then the whole string is returned as the first
  19318. token.
  19319. As a special case, the result of splitting the empty string "" is an
  19320. empty vector, not a vector containing a single string. The reason for
  19321. this special case is that being able to represent a empty vector is
  19322. typically more useful than consistent handling of empty elements. If
  19323. you do need to represent empty elements, you'll need to check for the
  19324. empty string before calling this function.
  19325. A pattern that can match empty strings splits @string into separate
  19326. characters wherever it matches the empty string between characters.
  19327. For example splitting "ab c" using as a separator "\s*", you will get
  19328. "a", "b" and "c".
  19329. Setting @start_position differs from just passing over a shortened
  19330. string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern
  19331. that begins with any kind of lookbehind assertion, such as "\b".</doc>
  19332. <return-value transfer-ownership="full">
  19333. <doc xml:space="preserve">a %NULL-terminated gchar ** array. Free
  19334. it using g_strfreev()</doc>
  19335. <array c:type="gchar**">
  19336. <type name="utf8"/>
  19337. </array>
  19338. </return-value>
  19339. <parameters>
  19340. <instance-parameter name="regex" transfer-ownership="none">
  19341. <doc xml:space="preserve">a #GRegex structure</doc>
  19342. <type name="Regex" c:type="const GRegex*"/>
  19343. </instance-parameter>
  19344. <parameter name="string" transfer-ownership="none">
  19345. <doc xml:space="preserve">the string to split with the pattern</doc>
  19346. <array length="1" zero-terminated="0" c:type="gchar*">
  19347. <type name="utf8" c:type="gchar"/>
  19348. </array>
  19349. </parameter>
  19350. <parameter name="string_len" transfer-ownership="none">
  19351. <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
  19352. <type name="gssize" c:type="gssize"/>
  19353. </parameter>
  19354. <parameter name="start_position" transfer-ownership="none">
  19355. <doc xml:space="preserve">starting index of the string to match, in bytes</doc>
  19356. <type name="gint" c:type="gint"/>
  19357. </parameter>
  19358. <parameter name="match_options" transfer-ownership="none">
  19359. <doc xml:space="preserve">match time option flags</doc>
  19360. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  19361. </parameter>
  19362. <parameter name="max_tokens" transfer-ownership="none">
  19363. <doc xml:space="preserve">the maximum number of tokens to split @string into.
  19364. If this is less than 1, the string is split completely</doc>
  19365. <type name="gint" c:type="gint"/>
  19366. </parameter>
  19367. </parameters>
  19368. </method>
  19369. <method name="unref" c:identifier="g_regex_unref" version="2.14">
  19370. <doc xml:space="preserve">Decreases reference count of @regex by 1. When reference count drops
  19371. to zero, it frees all the memory associated with the regex structure.</doc>
  19372. <return-value transfer-ownership="none">
  19373. <type name="none" c:type="void"/>
  19374. </return-value>
  19375. <parameters>
  19376. <instance-parameter name="regex" transfer-ownership="none">
  19377. <doc xml:space="preserve">a #GRegex</doc>
  19378. <type name="Regex" c:type="GRegex*"/>
  19379. </instance-parameter>
  19380. </parameters>
  19381. </method>
  19382. <function name="check_replacement"
  19383. c:identifier="g_regex_check_replacement"
  19384. version="2.14"
  19385. throws="1">
  19386. <doc xml:space="preserve">Checks whether @replacement is a valid replacement string
  19387. (see g_regex_replace()), i.e. that all escape sequences in
  19388. it are valid.
  19389. If @has_references is not %NULL then @replacement is checked
  19390. for pattern references. For instance, replacement text 'foo\n'
  19391. does not contain references and may be evaluated without information
  19392. about actual match, but '\0\1' (whole match followed by first
  19393. subpattern) requires valid #GMatchInfo object.</doc>
  19394. <return-value transfer-ownership="none">
  19395. <doc xml:space="preserve">whether @replacement is a valid replacement string</doc>
  19396. <type name="gboolean" c:type="gboolean"/>
  19397. </return-value>
  19398. <parameters>
  19399. <parameter name="replacement" transfer-ownership="none">
  19400. <doc xml:space="preserve">the replacement string</doc>
  19401. <type name="utf8" c:type="const gchar*"/>
  19402. </parameter>
  19403. <parameter name="has_references"
  19404. direction="out"
  19405. caller-allocates="0"
  19406. transfer-ownership="full"
  19407. optional="1"
  19408. allow-none="1">
  19409. <doc xml:space="preserve">location to store information about
  19410. references in @replacement or %NULL</doc>
  19411. <type name="gboolean" c:type="gboolean*"/>
  19412. </parameter>
  19413. </parameters>
  19414. </function>
  19415. <function name="error_quark" c:identifier="g_regex_error_quark">
  19416. <return-value transfer-ownership="none">
  19417. <type name="Quark" c:type="GQuark"/>
  19418. </return-value>
  19419. </function>
  19420. <function name="escape_nul"
  19421. c:identifier="g_regex_escape_nul"
  19422. version="2.30">
  19423. <doc xml:space="preserve">Escapes the nul characters in @string to "\x00". It can be used
  19424. to compile a regex with embedded nul characters.
  19425. For completeness, @length can be -1 for a nul-terminated string.
  19426. In this case the output string will be of course equal to @string.</doc>
  19427. <return-value transfer-ownership="full">
  19428. <doc xml:space="preserve">a newly-allocated escaped string</doc>
  19429. <type name="utf8" c:type="gchar*"/>
  19430. </return-value>
  19431. <parameters>
  19432. <parameter name="string" transfer-ownership="none">
  19433. <doc xml:space="preserve">the string to escape</doc>
  19434. <type name="utf8" c:type="const gchar*"/>
  19435. </parameter>
  19436. <parameter name="length" transfer-ownership="none">
  19437. <doc xml:space="preserve">the length of @string</doc>
  19438. <type name="gint" c:type="gint"/>
  19439. </parameter>
  19440. </parameters>
  19441. </function>
  19442. <function name="escape_string"
  19443. c:identifier="g_regex_escape_string"
  19444. version="2.14">
  19445. <doc xml:space="preserve">Escapes the special characters used for regular expressions
  19446. in @string, for instance "a.b*c" becomes "a\.b\*c". This
  19447. function is useful to dynamically generate regular expressions.
  19448. @string can contain nul characters that are replaced with "\0",
  19449. in this case remember to specify the correct length of @string
  19450. in @length.</doc>
  19451. <return-value transfer-ownership="full">
  19452. <doc xml:space="preserve">a newly-allocated escaped string</doc>
  19453. <type name="utf8" c:type="gchar*"/>
  19454. </return-value>
  19455. <parameters>
  19456. <parameter name="string" transfer-ownership="none">
  19457. <doc xml:space="preserve">the string to escape</doc>
  19458. <array length="1" zero-terminated="0" c:type="gchar*">
  19459. <type name="utf8" c:type="gchar"/>
  19460. </array>
  19461. </parameter>
  19462. <parameter name="length" transfer-ownership="none">
  19463. <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
  19464. <type name="gint" c:type="gint"/>
  19465. </parameter>
  19466. </parameters>
  19467. </function>
  19468. <function name="match_simple"
  19469. c:identifier="g_regex_match_simple"
  19470. version="2.14">
  19471. <doc xml:space="preserve">Scans for a match in @string for @pattern.
  19472. This function is equivalent to g_regex_match() but it does not
  19473. require to compile the pattern with g_regex_new(), avoiding some
  19474. lines of code when you need just to do a match without extracting
  19475. substrings, capture counts, and so on.
  19476. If this function is to be called on the same @pattern more than
  19477. once, it's more efficient to compile the pattern once with
  19478. g_regex_new() and then use g_regex_match().</doc>
  19479. <return-value transfer-ownership="none">
  19480. <doc xml:space="preserve">%TRUE if the string matched, %FALSE otherwise</doc>
  19481. <type name="gboolean" c:type="gboolean"/>
  19482. </return-value>
  19483. <parameters>
  19484. <parameter name="pattern" transfer-ownership="none">
  19485. <doc xml:space="preserve">the regular expression</doc>
  19486. <type name="utf8" c:type="const gchar*"/>
  19487. </parameter>
  19488. <parameter name="string" transfer-ownership="none">
  19489. <doc xml:space="preserve">the string to scan for matches</doc>
  19490. <type name="utf8" c:type="const gchar*"/>
  19491. </parameter>
  19492. <parameter name="compile_options" transfer-ownership="none">
  19493. <doc xml:space="preserve">compile options for the regular expression, or 0</doc>
  19494. <type name="RegexCompileFlags" c:type="GRegexCompileFlags"/>
  19495. </parameter>
  19496. <parameter name="match_options" transfer-ownership="none">
  19497. <doc xml:space="preserve">match options, or 0</doc>
  19498. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  19499. </parameter>
  19500. </parameters>
  19501. </function>
  19502. <function name="split_simple"
  19503. c:identifier="g_regex_split_simple"
  19504. version="2.14">
  19505. <doc xml:space="preserve">Breaks the string on the pattern, and returns an array of
  19506. the tokens. If the pattern contains capturing parentheses,
  19507. then the text for each of the substrings will also be returned.
  19508. If the pattern does not match anywhere in the string, then the
  19509. whole string is returned as the first token.
  19510. This function is equivalent to g_regex_split() but it does
  19511. not require to compile the pattern with g_regex_new(), avoiding
  19512. some lines of code when you need just to do a split without
  19513. extracting substrings, capture counts, and so on.
  19514. If this function is to be called on the same @pattern more than
  19515. once, it's more efficient to compile the pattern once with
  19516. g_regex_new() and then use g_regex_split().
  19517. As a special case, the result of splitting the empty string ""
  19518. is an empty vector, not a vector containing a single string.
  19519. The reason for this special case is that being able to represent
  19520. a empty vector is typically more useful than consistent handling
  19521. of empty elements. If you do need to represent empty elements,
  19522. you'll need to check for the empty string before calling this
  19523. function.
  19524. A pattern that can match empty strings splits @string into
  19525. separate characters wherever it matches the empty string between
  19526. characters. For example splitting "ab c" using as a separator
  19527. "\s*", you will get "a", "b" and "c".</doc>
  19528. <return-value transfer-ownership="full">
  19529. <doc xml:space="preserve">a %NULL-terminated array of strings. Free
  19530. it using g_strfreev()</doc>
  19531. <array c:type="gchar**">
  19532. <type name="utf8"/>
  19533. </array>
  19534. </return-value>
  19535. <parameters>
  19536. <parameter name="pattern" transfer-ownership="none">
  19537. <doc xml:space="preserve">the regular expression</doc>
  19538. <type name="utf8" c:type="const gchar*"/>
  19539. </parameter>
  19540. <parameter name="string" transfer-ownership="none">
  19541. <doc xml:space="preserve">the string to scan for matches</doc>
  19542. <type name="utf8" c:type="const gchar*"/>
  19543. </parameter>
  19544. <parameter name="compile_options" transfer-ownership="none">
  19545. <doc xml:space="preserve">compile options for the regular expression, or 0</doc>
  19546. <type name="RegexCompileFlags" c:type="GRegexCompileFlags"/>
  19547. </parameter>
  19548. <parameter name="match_options" transfer-ownership="none">
  19549. <doc xml:space="preserve">match options, or 0</doc>
  19550. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  19551. </parameter>
  19552. </parameters>
  19553. </function>
  19554. </record>
  19555. <bitfield name="RegexCompileFlags"
  19556. version="2.14"
  19557. c:type="GRegexCompileFlags">
  19558. <doc xml:space="preserve">Flags specifying compile-time options.</doc>
  19559. <member name="caseless" value="1" c:identifier="G_REGEX_CASELESS">
  19560. <doc xml:space="preserve">Letters in the pattern match both upper- and
  19561. lowercase letters. This option can be changed within a pattern
  19562. by a "(?i)" option setting.</doc>
  19563. </member>
  19564. <member name="multiline" value="2" c:identifier="G_REGEX_MULTILINE">
  19565. <doc xml:space="preserve">By default, GRegex treats the strings as consisting
  19566. of a single line of characters (even if it actually contains
  19567. newlines). The "start of line" metacharacter ("^") matches only
  19568. at the start of the string, while the "end of line" metacharacter
  19569. ("$") matches only at the end of the string, or before a terminating
  19570. newline (unless #G_REGEX_DOLLAR_ENDONLY is set). When
  19571. #G_REGEX_MULTILINE is set, the "start of line" and "end of line"
  19572. constructs match immediately following or immediately before any
  19573. newline in the string, respectively, as well as at the very start
  19574. and end. This can be changed within a pattern by a "(?m)" option
  19575. setting.</doc>
  19576. </member>
  19577. <member name="dotall" value="4" c:identifier="G_REGEX_DOTALL">
  19578. <doc xml:space="preserve">A dot metacharater (".") in the pattern matches all
  19579. characters, including newlines. Without it, newlines are excluded.
  19580. This option can be changed within a pattern by a ("?s") option setting.</doc>
  19581. </member>
  19582. <member name="extended" value="8" c:identifier="G_REGEX_EXTENDED">
  19583. <doc xml:space="preserve">Whitespace data characters in the pattern are
  19584. totally ignored except when escaped or inside a character class.
  19585. Whitespace does not include the VT character (code 11). In addition,
  19586. characters between an unescaped "#" outside a character class and
  19587. the next newline character, inclusive, are also ignored. This can
  19588. be changed within a pattern by a "(?x)" option setting.</doc>
  19589. </member>
  19590. <member name="anchored" value="16" c:identifier="G_REGEX_ANCHORED">
  19591. <doc xml:space="preserve">The pattern is forced to be "anchored", that is,
  19592. it is constrained to match only at the first matching point in the
  19593. string that is being searched. This effect can also be achieved by
  19594. appropriate constructs in the pattern itself such as the "^"
  19595. metacharater.</doc>
  19596. </member>
  19597. <member name="dollar_endonly"
  19598. value="32"
  19599. c:identifier="G_REGEX_DOLLAR_ENDONLY">
  19600. <doc xml:space="preserve">A dollar metacharacter ("$") in the pattern
  19601. matches only at the end of the string. Without this option, a
  19602. dollar also matches immediately before the final character if
  19603. it is a newline (but not before any other newlines). This option
  19604. is ignored if #G_REGEX_MULTILINE is set.</doc>
  19605. </member>
  19606. <member name="ungreedy" value="512" c:identifier="G_REGEX_UNGREEDY">
  19607. <doc xml:space="preserve">Inverts the "greediness" of the quantifiers so that
  19608. they are not greedy by default, but become greedy if followed by "?".
  19609. It can also be set by a "(?U)" option setting within the pattern.</doc>
  19610. </member>
  19611. <member name="raw" value="2048" c:identifier="G_REGEX_RAW">
  19612. <doc xml:space="preserve">Usually strings must be valid UTF-8 strings, using this
  19613. flag they are considered as a raw sequence of bytes.</doc>
  19614. </member>
  19615. <member name="no_auto_capture"
  19616. value="4096"
  19617. c:identifier="G_REGEX_NO_AUTO_CAPTURE">
  19618. <doc xml:space="preserve">Disables the use of numbered capturing
  19619. parentheses in the pattern. Any opening parenthesis that is not
  19620. followed by "?" behaves as if it were followed by "?:" but named
  19621. parentheses can still be used for capturing (and they acquire numbers
  19622. in the usual way).</doc>
  19623. </member>
  19624. <member name="optimize" value="8192" c:identifier="G_REGEX_OPTIMIZE">
  19625. <doc xml:space="preserve">Optimize the regular expression. If the pattern will
  19626. be used many times, then it may be worth the effort to optimize it
  19627. to improve the speed of matches.</doc>
  19628. </member>
  19629. <member name="firstline" value="262144" c:identifier="G_REGEX_FIRSTLINE">
  19630. <doc xml:space="preserve">Limits an unanchored pattern to match before (or at) the
  19631. first newline. Since: 2.34</doc>
  19632. </member>
  19633. <member name="dupnames" value="524288" c:identifier="G_REGEX_DUPNAMES">
  19634. <doc xml:space="preserve">Names used to identify capturing subpatterns need not
  19635. be unique. This can be helpful for certain types of pattern when it
  19636. is known that only one instance of the named subpattern can ever be
  19637. matched.</doc>
  19638. </member>
  19639. <member name="newline_cr"
  19640. value="1048576"
  19641. c:identifier="G_REGEX_NEWLINE_CR">
  19642. <doc xml:space="preserve">Usually any newline character or character sequence is
  19643. recognized. If this option is set, the only recognized newline character
  19644. is '\r'.</doc>
  19645. </member>
  19646. <member name="newline_lf"
  19647. value="2097152"
  19648. c:identifier="G_REGEX_NEWLINE_LF">
  19649. <doc xml:space="preserve">Usually any newline character or character sequence is
  19650. recognized. If this option is set, the only recognized newline character
  19651. is '\n'.</doc>
  19652. </member>
  19653. <member name="newline_crlf"
  19654. value="3145728"
  19655. c:identifier="G_REGEX_NEWLINE_CRLF">
  19656. <doc xml:space="preserve">Usually any newline character or character sequence is
  19657. recognized. If this option is set, the only recognized newline character
  19658. sequence is '\r\n'.</doc>
  19659. </member>
  19660. <member name="newline_anycrlf"
  19661. value="5242880"
  19662. c:identifier="G_REGEX_NEWLINE_ANYCRLF">
  19663. <doc xml:space="preserve">Usually any newline character or character sequence
  19664. is recognized. If this option is set, the only recognized newline character
  19665. sequences are '\r', '\n', and '\r\n'. Since: 2.34</doc>
  19666. </member>
  19667. <member name="bsr_anycrlf"
  19668. value="8388608"
  19669. c:identifier="G_REGEX_BSR_ANYCRLF">
  19670. <doc xml:space="preserve">Usually any newline character or character sequence
  19671. is recognised. If this option is set, then "\R" only recognizes the newline
  19672. characters '\r', '\n' and '\r\n'. Since: 2.34</doc>
  19673. </member>
  19674. <member name="javascript_compat"
  19675. value="33554432"
  19676. c:identifier="G_REGEX_JAVASCRIPT_COMPAT">
  19677. <doc xml:space="preserve">Changes behaviour so that it is compatible with
  19678. JavaScript rather than PCRE. Since: 2.34</doc>
  19679. </member>
  19680. </bitfield>
  19681. <enumeration name="RegexError"
  19682. version="2.14"
  19683. c:type="GRegexError"
  19684. glib:error-domain="g-regex-error-quark">
  19685. <doc xml:space="preserve">Error codes returned by regular expressions functions.</doc>
  19686. <member name="compile" value="0" c:identifier="G_REGEX_ERROR_COMPILE">
  19687. <doc xml:space="preserve">Compilation of the regular expression failed.</doc>
  19688. </member>
  19689. <member name="optimize" value="1" c:identifier="G_REGEX_ERROR_OPTIMIZE">
  19690. <doc xml:space="preserve">Optimization of the regular expression failed.</doc>
  19691. </member>
  19692. <member name="replace" value="2" c:identifier="G_REGEX_ERROR_REPLACE">
  19693. <doc xml:space="preserve">Replacement failed due to an ill-formed replacement
  19694. string.</doc>
  19695. </member>
  19696. <member name="match" value="3" c:identifier="G_REGEX_ERROR_MATCH">
  19697. <doc xml:space="preserve">The match process failed.</doc>
  19698. </member>
  19699. <member name="internal" value="4" c:identifier="G_REGEX_ERROR_INTERNAL">
  19700. <doc xml:space="preserve">Internal error of the regular expression engine.
  19701. Since 2.16</doc>
  19702. </member>
  19703. <member name="stray_backslash"
  19704. value="101"
  19705. c:identifier="G_REGEX_ERROR_STRAY_BACKSLASH">
  19706. <doc xml:space="preserve">"\\" at end of pattern. Since 2.16</doc>
  19707. </member>
  19708. <member name="missing_control_char"
  19709. value="102"
  19710. c:identifier="G_REGEX_ERROR_MISSING_CONTROL_CHAR">
  19711. <doc xml:space="preserve">"\\c" at end of pattern. Since 2.16</doc>
  19712. </member>
  19713. <member name="unrecognized_escape"
  19714. value="103"
  19715. c:identifier="G_REGEX_ERROR_UNRECOGNIZED_ESCAPE">
  19716. <doc xml:space="preserve">Unrecognized character follows "\\".
  19717. Since 2.16</doc>
  19718. </member>
  19719. <member name="quantifiers_out_of_order"
  19720. value="104"
  19721. c:identifier="G_REGEX_ERROR_QUANTIFIERS_OUT_OF_ORDER">
  19722. <doc xml:space="preserve">Numbers out of order in "{}"
  19723. quantifier. Since 2.16</doc>
  19724. </member>
  19725. <member name="quantifier_too_big"
  19726. value="105"
  19727. c:identifier="G_REGEX_ERROR_QUANTIFIER_TOO_BIG">
  19728. <doc xml:space="preserve">Number too big in "{}" quantifier.
  19729. Since 2.16</doc>
  19730. </member>
  19731. <member name="unterminated_character_class"
  19732. value="106"
  19733. c:identifier="G_REGEX_ERROR_UNTERMINATED_CHARACTER_CLASS">
  19734. <doc xml:space="preserve">Missing terminating "]" for
  19735. character class. Since 2.16</doc>
  19736. </member>
  19737. <member name="invalid_escape_in_character_class"
  19738. value="107"
  19739. c:identifier="G_REGEX_ERROR_INVALID_ESCAPE_IN_CHARACTER_CLASS">
  19740. <doc xml:space="preserve">Invalid escape sequence
  19741. in character class. Since 2.16</doc>
  19742. </member>
  19743. <member name="range_out_of_order"
  19744. value="108"
  19745. c:identifier="G_REGEX_ERROR_RANGE_OUT_OF_ORDER">
  19746. <doc xml:space="preserve">Range out of order in character class.
  19747. Since 2.16</doc>
  19748. </member>
  19749. <member name="nothing_to_repeat"
  19750. value="109"
  19751. c:identifier="G_REGEX_ERROR_NOTHING_TO_REPEAT">
  19752. <doc xml:space="preserve">Nothing to repeat. Since 2.16</doc>
  19753. </member>
  19754. <member name="unrecognized_character"
  19755. value="112"
  19756. c:identifier="G_REGEX_ERROR_UNRECOGNIZED_CHARACTER">
  19757. <doc xml:space="preserve">Unrecognized character after "(?",
  19758. "(?&lt;" or "(?P". Since 2.16</doc>
  19759. </member>
  19760. <member name="posix_named_class_outside_class"
  19761. value="113"
  19762. c:identifier="G_REGEX_ERROR_POSIX_NAMED_CLASS_OUTSIDE_CLASS">
  19763. <doc xml:space="preserve">POSIX named classes are
  19764. supported only within a class. Since 2.16</doc>
  19765. </member>
  19766. <member name="unmatched_parenthesis"
  19767. value="114"
  19768. c:identifier="G_REGEX_ERROR_UNMATCHED_PARENTHESIS">
  19769. <doc xml:space="preserve">Missing terminating ")" or ")"
  19770. without opening "(". Since 2.16</doc>
  19771. </member>
  19772. <member name="inexistent_subpattern_reference"
  19773. value="115"
  19774. c:identifier="G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE">
  19775. <doc xml:space="preserve">Reference to non-existent
  19776. subpattern. Since 2.16</doc>
  19777. </member>
  19778. <member name="unterminated_comment"
  19779. value="118"
  19780. c:identifier="G_REGEX_ERROR_UNTERMINATED_COMMENT">
  19781. <doc xml:space="preserve">Missing terminating ")" after comment.
  19782. Since 2.16</doc>
  19783. </member>
  19784. <member name="expression_too_large"
  19785. value="120"
  19786. c:identifier="G_REGEX_ERROR_EXPRESSION_TOO_LARGE">
  19787. <doc xml:space="preserve">Regular expression too large.
  19788. Since 2.16</doc>
  19789. </member>
  19790. <member name="memory_error"
  19791. value="121"
  19792. c:identifier="G_REGEX_ERROR_MEMORY_ERROR">
  19793. <doc xml:space="preserve">Failed to get memory. Since 2.16</doc>
  19794. </member>
  19795. <member name="variable_length_lookbehind"
  19796. value="125"
  19797. c:identifier="G_REGEX_ERROR_VARIABLE_LENGTH_LOOKBEHIND">
  19798. <doc xml:space="preserve">Lookbehind assertion is not
  19799. fixed length. Since 2.16</doc>
  19800. </member>
  19801. <member name="malformed_condition"
  19802. value="126"
  19803. c:identifier="G_REGEX_ERROR_MALFORMED_CONDITION">
  19804. <doc xml:space="preserve">Malformed number or name after "(?(".
  19805. Since 2.16</doc>
  19806. </member>
  19807. <member name="too_many_conditional_branches"
  19808. value="127"
  19809. c:identifier="G_REGEX_ERROR_TOO_MANY_CONDITIONAL_BRANCHES">
  19810. <doc xml:space="preserve">Conditional group contains
  19811. more than two branches. Since 2.16</doc>
  19812. </member>
  19813. <member name="assertion_expected"
  19814. value="128"
  19815. c:identifier="G_REGEX_ERROR_ASSERTION_EXPECTED">
  19816. <doc xml:space="preserve">Assertion expected after "(?(".
  19817. Since 2.16</doc>
  19818. </member>
  19819. <member name="unknown_posix_class_name"
  19820. value="130"
  19821. c:identifier="G_REGEX_ERROR_UNKNOWN_POSIX_CLASS_NAME">
  19822. <doc xml:space="preserve">Unknown POSIX class name.
  19823. Since 2.16</doc>
  19824. </member>
  19825. <member name="posix_collating_elements_not_supported"
  19826. value="131"
  19827. c:identifier="G_REGEX_ERROR_POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED">
  19828. <doc xml:space="preserve">POSIX collating
  19829. elements are not supported. Since 2.16</doc>
  19830. </member>
  19831. <member name="hex_code_too_large"
  19832. value="134"
  19833. c:identifier="G_REGEX_ERROR_HEX_CODE_TOO_LARGE">
  19834. <doc xml:space="preserve">Character value in "\\x{...}" sequence
  19835. is too large. Since 2.16</doc>
  19836. </member>
  19837. <member name="invalid_condition"
  19838. value="135"
  19839. c:identifier="G_REGEX_ERROR_INVALID_CONDITION">
  19840. <doc xml:space="preserve">Invalid condition "(?(0)". Since 2.16</doc>
  19841. </member>
  19842. <member name="single_byte_match_in_lookbehind"
  19843. value="136"
  19844. c:identifier="G_REGEX_ERROR_SINGLE_BYTE_MATCH_IN_LOOKBEHIND">
  19845. <doc xml:space="preserve">\\C not allowed in
  19846. lookbehind assertion. Since 2.16</doc>
  19847. </member>
  19848. <member name="infinite_loop"
  19849. value="140"
  19850. c:identifier="G_REGEX_ERROR_INFINITE_LOOP">
  19851. <doc xml:space="preserve">Recursive call could loop indefinitely.
  19852. Since 2.16</doc>
  19853. </member>
  19854. <member name="missing_subpattern_name_terminator"
  19855. value="142"
  19856. c:identifier="G_REGEX_ERROR_MISSING_SUBPATTERN_NAME_TERMINATOR">
  19857. <doc xml:space="preserve">Missing terminator
  19858. in subpattern name. Since 2.16</doc>
  19859. </member>
  19860. <member name="duplicate_subpattern_name"
  19861. value="143"
  19862. c:identifier="G_REGEX_ERROR_DUPLICATE_SUBPATTERN_NAME">
  19863. <doc xml:space="preserve">Two named subpatterns have
  19864. the same name. Since 2.16</doc>
  19865. </member>
  19866. <member name="malformed_property"
  19867. value="146"
  19868. c:identifier="G_REGEX_ERROR_MALFORMED_PROPERTY">
  19869. <doc xml:space="preserve">Malformed "\\P" or "\\p" sequence.
  19870. Since 2.16</doc>
  19871. </member>
  19872. <member name="unknown_property"
  19873. value="147"
  19874. c:identifier="G_REGEX_ERROR_UNKNOWN_PROPERTY">
  19875. <doc xml:space="preserve">Unknown property name after "\\P" or
  19876. "\\p". Since 2.16</doc>
  19877. </member>
  19878. <member name="subpattern_name_too_long"
  19879. value="148"
  19880. c:identifier="G_REGEX_ERROR_SUBPATTERN_NAME_TOO_LONG">
  19881. <doc xml:space="preserve">Subpattern name is too long
  19882. (maximum 32 characters). Since 2.16</doc>
  19883. </member>
  19884. <member name="too_many_subpatterns"
  19885. value="149"
  19886. c:identifier="G_REGEX_ERROR_TOO_MANY_SUBPATTERNS">
  19887. <doc xml:space="preserve">Too many named subpatterns (maximum
  19888. 10,000). Since 2.16</doc>
  19889. </member>
  19890. <member name="invalid_octal_value"
  19891. value="151"
  19892. c:identifier="G_REGEX_ERROR_INVALID_OCTAL_VALUE">
  19893. <doc xml:space="preserve">Octal value is greater than "\\377".
  19894. Since 2.16</doc>
  19895. </member>
  19896. <member name="too_many_branches_in_define"
  19897. value="154"
  19898. c:identifier="G_REGEX_ERROR_TOO_MANY_BRANCHES_IN_DEFINE">
  19899. <doc xml:space="preserve">"DEFINE" group contains more
  19900. than one branch. Since 2.16</doc>
  19901. </member>
  19902. <member name="define_repetion"
  19903. value="155"
  19904. c:identifier="G_REGEX_ERROR_DEFINE_REPETION">
  19905. <doc xml:space="preserve">Repeating a "DEFINE" group is not allowed.
  19906. This error is never raised. Since: 2.16 Deprecated: 2.34</doc>
  19907. </member>
  19908. <member name="inconsistent_newline_options"
  19909. value="156"
  19910. c:identifier="G_REGEX_ERROR_INCONSISTENT_NEWLINE_OPTIONS">
  19911. <doc xml:space="preserve">Inconsistent newline options.
  19912. Since 2.16</doc>
  19913. </member>
  19914. <member name="missing_back_reference"
  19915. value="157"
  19916. c:identifier="G_REGEX_ERROR_MISSING_BACK_REFERENCE">
  19917. <doc xml:space="preserve">"\\g" is not followed by a braced,
  19918. angle-bracketed, or quoted name or number, or by a plain number. Since: 2.16</doc>
  19919. </member>
  19920. <member name="invalid_relative_reference"
  19921. value="158"
  19922. c:identifier="G_REGEX_ERROR_INVALID_RELATIVE_REFERENCE">
  19923. <doc xml:space="preserve">relative reference must not be zero. Since: 2.34</doc>
  19924. </member>
  19925. <member name="backtracking_control_verb_argument_forbidden"
  19926. value="159"
  19927. c:identifier="G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_FORBIDDEN">
  19928. <doc xml:space="preserve">the backtracing
  19929. control verb used does not allow an argument. Since: 2.34</doc>
  19930. </member>
  19931. <member name="unknown_backtracking_control_verb"
  19932. value="160"
  19933. c:identifier="G_REGEX_ERROR_UNKNOWN_BACKTRACKING_CONTROL_VERB">
  19934. <doc xml:space="preserve">unknown backtracing
  19935. control verb. Since: 2.34</doc>
  19936. </member>
  19937. <member name="number_too_big"
  19938. value="161"
  19939. c:identifier="G_REGEX_ERROR_NUMBER_TOO_BIG">
  19940. <doc xml:space="preserve">number is too big in escape sequence. Since: 2.34</doc>
  19941. </member>
  19942. <member name="missing_subpattern_name"
  19943. value="162"
  19944. c:identifier="G_REGEX_ERROR_MISSING_SUBPATTERN_NAME">
  19945. <doc xml:space="preserve">Missing subpattern name. Since: 2.34</doc>
  19946. </member>
  19947. <member name="missing_digit"
  19948. value="163"
  19949. c:identifier="G_REGEX_ERROR_MISSING_DIGIT">
  19950. <doc xml:space="preserve">Missing digit. Since 2.34</doc>
  19951. </member>
  19952. <member name="invalid_data_character"
  19953. value="164"
  19954. c:identifier="G_REGEX_ERROR_INVALID_DATA_CHARACTER">
  19955. <doc xml:space="preserve">In JavaScript compatibility mode,
  19956. "[" is an invalid data character. Since: 2.34</doc>
  19957. </member>
  19958. <member name="extra_subpattern_name"
  19959. value="165"
  19960. c:identifier="G_REGEX_ERROR_EXTRA_SUBPATTERN_NAME">
  19961. <doc xml:space="preserve">different names for subpatterns of the
  19962. same number are not allowed. Since: 2.34</doc>
  19963. </member>
  19964. <member name="backtracking_control_verb_argument_required"
  19965. value="166"
  19966. c:identifier="G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_REQUIRED">
  19967. <doc xml:space="preserve">the backtracing control
  19968. verb requires an argument. Since: 2.34</doc>
  19969. </member>
  19970. <member name="invalid_control_char"
  19971. value="168"
  19972. c:identifier="G_REGEX_ERROR_INVALID_CONTROL_CHAR">
  19973. <doc xml:space="preserve">"\\c" must be followed by an ASCII
  19974. character. Since: 2.34</doc>
  19975. </member>
  19976. <member name="missing_name"
  19977. value="169"
  19978. c:identifier="G_REGEX_ERROR_MISSING_NAME">
  19979. <doc xml:space="preserve">"\\k" is not followed by a braced, angle-bracketed, or
  19980. quoted name. Since: 2.34</doc>
  19981. </member>
  19982. <member name="not_supported_in_class"
  19983. value="171"
  19984. c:identifier="G_REGEX_ERROR_NOT_SUPPORTED_IN_CLASS">
  19985. <doc xml:space="preserve">"\\N" is not supported in a class. Since: 2.34</doc>
  19986. </member>
  19987. <member name="too_many_forward_references"
  19988. value="172"
  19989. c:identifier="G_REGEX_ERROR_TOO_MANY_FORWARD_REFERENCES">
  19990. <doc xml:space="preserve">too many forward references. Since: 2.34</doc>
  19991. </member>
  19992. <member name="name_too_long"
  19993. value="175"
  19994. c:identifier="G_REGEX_ERROR_NAME_TOO_LONG">
  19995. <doc xml:space="preserve">the name is too long in "(*MARK)", "(*PRUNE)",
  19996. "(*SKIP)", or "(*THEN)". Since: 2.34</doc>
  19997. </member>
  19998. <member name="character_value_too_large"
  19999. value="176"
  20000. c:identifier="G_REGEX_ERROR_CHARACTER_VALUE_TOO_LARGE">
  20001. <doc xml:space="preserve">the character value in the \\u sequence is
  20002. too large. Since: 2.34</doc>
  20003. </member>
  20004. </enumeration>
  20005. <callback name="RegexEvalCallback"
  20006. c:type="GRegexEvalCallback"
  20007. version="2.14">
  20008. <doc xml:space="preserve">Specifies the type of the function passed to g_regex_replace_eval().
  20009. It is called for each occurrence of the pattern in the string passed
  20010. to g_regex_replace_eval(), and it should append the replacement to
  20011. @result.</doc>
  20012. <return-value transfer-ownership="none">
  20013. <doc xml:space="preserve">%FALSE to continue the replacement process, %TRUE to stop it</doc>
  20014. <type name="gboolean" c:type="gboolean"/>
  20015. </return-value>
  20016. <parameters>
  20017. <parameter name="match_info" transfer-ownership="none">
  20018. <doc xml:space="preserve">the #GMatchInfo generated by the match.
  20019. Use g_match_info_get_regex() and g_match_info_get_string() if you
  20020. need the #GRegex or the matched string.</doc>
  20021. <type name="MatchInfo" c:type="const GMatchInfo*"/>
  20022. </parameter>
  20023. <parameter name="result" transfer-ownership="none">
  20024. <doc xml:space="preserve">a #GString containing the new string</doc>
  20025. <type name="String" c:type="GString*"/>
  20026. </parameter>
  20027. <parameter name="user_data"
  20028. transfer-ownership="none"
  20029. nullable="1"
  20030. allow-none="1"
  20031. closure="2">
  20032. <doc xml:space="preserve">user data passed to g_regex_replace_eval()</doc>
  20033. <type name="gpointer" c:type="gpointer"/>
  20034. </parameter>
  20035. </parameters>
  20036. </callback>
  20037. <bitfield name="RegexMatchFlags" version="2.14" c:type="GRegexMatchFlags">
  20038. <doc xml:space="preserve">Flags specifying match-time options.</doc>
  20039. <member name="anchored" value="16" c:identifier="G_REGEX_MATCH_ANCHORED">
  20040. <doc xml:space="preserve">The pattern is forced to be "anchored", that is,
  20041. it is constrained to match only at the first matching point in the
  20042. string that is being searched. This effect can also be achieved by
  20043. appropriate constructs in the pattern itself such as the "^"
  20044. metacharater.</doc>
  20045. </member>
  20046. <member name="notbol" value="128" c:identifier="G_REGEX_MATCH_NOTBOL">
  20047. <doc xml:space="preserve">Specifies that first character of the string is
  20048. not the beginning of a line, so the circumflex metacharacter should
  20049. not match before it. Setting this without #G_REGEX_MULTILINE (at
  20050. compile time) causes circumflex never to match. This option affects
  20051. only the behaviour of the circumflex metacharacter, it does not
  20052. affect "\A".</doc>
  20053. </member>
  20054. <member name="noteol" value="256" c:identifier="G_REGEX_MATCH_NOTEOL">
  20055. <doc xml:space="preserve">Specifies that the end of the subject string is
  20056. not the end of a line, so the dollar metacharacter should not match
  20057. it nor (except in multiline mode) a newline immediately before it.
  20058. Setting this without #G_REGEX_MULTILINE (at compile time) causes
  20059. dollar never to match. This option affects only the behaviour of
  20060. the dollar metacharacter, it does not affect "\Z" or "\z".</doc>
  20061. </member>
  20062. <member name="notempty"
  20063. value="1024"
  20064. c:identifier="G_REGEX_MATCH_NOTEMPTY">
  20065. <doc xml:space="preserve">An empty string is not considered to be a valid
  20066. match if this option is set. If there are alternatives in the pattern,
  20067. they are tried. If all the alternatives match the empty string, the
  20068. entire match fails. For example, if the pattern "a?b?" is applied to
  20069. a string not beginning with "a" or "b", it matches the empty string
  20070. at the start of the string. With this flag set, this match is not
  20071. valid, so GRegex searches further into the string for occurrences
  20072. of "a" or "b".</doc>
  20073. </member>
  20074. <member name="partial"
  20075. value="32768"
  20076. c:identifier="G_REGEX_MATCH_PARTIAL">
  20077. <doc xml:space="preserve">Turns on the partial matching feature, for more
  20078. documentation on partial matching see g_match_info_is_partial_match().</doc>
  20079. </member>
  20080. <member name="newline_cr"
  20081. value="1048576"
  20082. c:identifier="G_REGEX_MATCH_NEWLINE_CR">
  20083. <doc xml:space="preserve">Overrides the newline definition set when
  20084. creating a new #GRegex, setting the '\r' character as line terminator.</doc>
  20085. </member>
  20086. <member name="newline_lf"
  20087. value="2097152"
  20088. c:identifier="G_REGEX_MATCH_NEWLINE_LF">
  20089. <doc xml:space="preserve">Overrides the newline definition set when
  20090. creating a new #GRegex, setting the '\n' character as line terminator.</doc>
  20091. </member>
  20092. <member name="newline_crlf"
  20093. value="3145728"
  20094. c:identifier="G_REGEX_MATCH_NEWLINE_CRLF">
  20095. <doc xml:space="preserve">Overrides the newline definition set when
  20096. creating a new #GRegex, setting the '\r\n' characters sequence as line terminator.</doc>
  20097. </member>
  20098. <member name="newline_any"
  20099. value="4194304"
  20100. c:identifier="G_REGEX_MATCH_NEWLINE_ANY">
  20101. <doc xml:space="preserve">Overrides the newline definition set when
  20102. creating a new #GRegex, any Unicode newline sequence
  20103. is recognised as a newline. These are '\r', '\n' and '\rn', and the
  20104. single characters U+000B LINE TABULATION, U+000C FORM FEED (FF),
  20105. U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and
  20106. U+2029 PARAGRAPH SEPARATOR.</doc>
  20107. </member>
  20108. <member name="newline_anycrlf"
  20109. value="5242880"
  20110. c:identifier="G_REGEX_MATCH_NEWLINE_ANYCRLF">
  20111. <doc xml:space="preserve">Overrides the newline definition set when
  20112. creating a new #GRegex; any '\r', '\n', or '\r\n' character sequence
  20113. is recognized as a newline. Since: 2.34</doc>
  20114. </member>
  20115. <member name="bsr_anycrlf"
  20116. value="8388608"
  20117. c:identifier="G_REGEX_MATCH_BSR_ANYCRLF">
  20118. <doc xml:space="preserve">Overrides the newline definition for "\R" set when
  20119. creating a new #GRegex; only '\r', '\n', or '\r\n' character sequences
  20120. are recognized as a newline by "\R". Since: 2.34</doc>
  20121. </member>
  20122. <member name="bsr_any"
  20123. value="16777216"
  20124. c:identifier="G_REGEX_MATCH_BSR_ANY">
  20125. <doc xml:space="preserve">Overrides the newline definition for "\R" set when
  20126. creating a new #GRegex; any Unicode newline character or character sequence
  20127. are recognized as a newline by "\R". These are '\r', '\n' and '\rn', and the
  20128. single characters U+000B LINE TABULATION, U+000C FORM FEED (FF),
  20129. U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and
  20130. U+2029 PARAGRAPH SEPARATOR. Since: 2.34</doc>
  20131. </member>
  20132. <member name="partial_soft"
  20133. value="32768"
  20134. c:identifier="G_REGEX_MATCH_PARTIAL_SOFT">
  20135. <doc xml:space="preserve">An alias for #G_REGEX_MATCH_PARTIAL. Since: 2.34</doc>
  20136. </member>
  20137. <member name="partial_hard"
  20138. value="134217728"
  20139. c:identifier="G_REGEX_MATCH_PARTIAL_HARD">
  20140. <doc xml:space="preserve">Turns on the partial matching feature. In contrast to
  20141. to #G_REGEX_MATCH_PARTIAL_SOFT, this stops matching as soon as a partial match
  20142. is found, without continuing to search for a possible complete match. See
  20143. g_match_info_is_partial_match() for more information. Since: 2.34</doc>
  20144. </member>
  20145. <member name="notempty_atstart"
  20146. value="268435456"
  20147. c:identifier="G_REGEX_MATCH_NOTEMPTY_ATSTART">
  20148. <doc xml:space="preserve">Like #G_REGEX_MATCH_NOTEMPTY, but only applied to
  20149. the start of the matched string. For anchored
  20150. patterns this can only happen for pattern containing "\K". Since: 2.34</doc>
  20151. </member>
  20152. </bitfield>
  20153. <constant name="SEARCHPATH_SEPARATOR"
  20154. value="59"
  20155. c:type="G_SEARCHPATH_SEPARATOR">
  20156. <doc xml:space="preserve">The search path separator character.
  20157. This is ':' on UNIX machines and ';' under Windows.</doc>
  20158. <type name="gint" c:type="gint"/>
  20159. </constant>
  20160. <constant name="SEARCHPATH_SEPARATOR_S"
  20161. value=";"
  20162. c:type="G_SEARCHPATH_SEPARATOR_S">
  20163. <doc xml:space="preserve">The search path separator as a string.
  20164. This is ":" on UNIX machines and ";" under Windows.</doc>
  20165. <type name="utf8" c:type="gchar*"/>
  20166. </constant>
  20167. <constant name="SIZEOF_LONG" value="4" c:type="GLIB_SIZEOF_LONG">
  20168. <type name="gint" c:type="gint"/>
  20169. </constant>
  20170. <constant name="SIZEOF_SIZE_T" value="4" c:type="GLIB_SIZEOF_SIZE_T">
  20171. <type name="gint" c:type="gint"/>
  20172. </constant>
  20173. <constant name="SIZEOF_SSIZE_T" value="4" c:type="GLIB_SIZEOF_SSIZE_T">
  20174. <type name="gint" c:type="gint"/>
  20175. </constant>
  20176. <constant name="SIZEOF_VOID_P" value="4" c:type="GLIB_SIZEOF_VOID_P">
  20177. <type name="gint" c:type="gint"/>
  20178. </constant>
  20179. <record name="SList" c:type="GSList">
  20180. <doc xml:space="preserve">The #GSList struct is used for each element in the singly-linked
  20181. list.</doc>
  20182. <field name="data" writable="1">
  20183. <doc xml:space="preserve">holds the element's data, which can be a pointer to any kind
  20184. of data, or any integer value using the
  20185. [Type Conversion Macros][glib-Type-Conversion-Macros]</doc>
  20186. <type name="gpointer" c:type="gpointer"/>
  20187. </field>
  20188. <field name="next" writable="1">
  20189. <doc xml:space="preserve">contains the link to the next element in the list.</doc>
  20190. <type name="GLib.SList" c:type="GSList*">
  20191. <type name="gpointer" c:type="gpointer"/>
  20192. </type>
  20193. </field>
  20194. <function name="alloc" c:identifier="g_slist_alloc" introspectable="0">
  20195. <doc xml:space="preserve">Allocates space for one #GSList element. It is called by the
  20196. g_slist_append(), g_slist_prepend(), g_slist_insert() and
  20197. g_slist_insert_sorted() functions and so is rarely used on its own.</doc>
  20198. <return-value>
  20199. <doc xml:space="preserve">a pointer to the newly-allocated #GSList element.</doc>
  20200. <type name="GLib.SList" c:type="GSList*">
  20201. <type name="gpointer" c:type="gpointer"/>
  20202. </type>
  20203. </return-value>
  20204. </function>
  20205. <function name="append" c:identifier="g_slist_append" introspectable="0">
  20206. <doc xml:space="preserve">Adds a new element on to the end of the list.
  20207. The return value is the new start of the list, which may
  20208. have changed, so make sure you store the new value.
  20209. Note that g_slist_append() has to traverse the entire list
  20210. to find the end, which is inefficient when adding multiple
  20211. elements. A common idiom to avoid the inefficiency is to prepend
  20212. the elements and reverse the list when all elements have been added.
  20213. |[&lt;!-- language="C" --&gt;
  20214. // Notice that these are initialized to the empty list.
  20215. GSList *list = NULL, *number_list = NULL;
  20216. // This is a list of strings.
  20217. list = g_slist_append (list, "first");
  20218. list = g_slist_append (list, "second");
  20219. // This is a list of integers.
  20220. number_list = g_slist_append (number_list, GINT_TO_POINTER (27));
  20221. number_list = g_slist_append (number_list, GINT_TO_POINTER (14));
  20222. ]|</doc>
  20223. <return-value>
  20224. <doc xml:space="preserve">the new start of the #GSList</doc>
  20225. <type name="GLib.SList" c:type="GSList*">
  20226. <type name="gpointer" c:type="gpointer"/>
  20227. </type>
  20228. </return-value>
  20229. <parameters>
  20230. <parameter name="list" transfer-ownership="none">
  20231. <doc xml:space="preserve">a #GSList</doc>
  20232. <type name="GLib.SList" c:type="GSList*">
  20233. <type name="gpointer" c:type="gpointer"/>
  20234. </type>
  20235. </parameter>
  20236. <parameter name="data"
  20237. transfer-ownership="none"
  20238. nullable="1"
  20239. allow-none="1">
  20240. <doc xml:space="preserve">the data for the new element</doc>
  20241. <type name="gpointer" c:type="gpointer"/>
  20242. </parameter>
  20243. </parameters>
  20244. </function>
  20245. <function name="concat" c:identifier="g_slist_concat" introspectable="0">
  20246. <doc xml:space="preserve">Adds the second #GSList onto the end of the first #GSList.
  20247. Note that the elements of the second #GSList are not copied.
  20248. They are used directly.</doc>
  20249. <return-value>
  20250. <doc xml:space="preserve">the start of the new #GSList</doc>
  20251. <type name="GLib.SList" c:type="GSList*">
  20252. <type name="gpointer" c:type="gpointer"/>
  20253. </type>
  20254. </return-value>
  20255. <parameters>
  20256. <parameter name="list1" transfer-ownership="none">
  20257. <doc xml:space="preserve">a #GSList</doc>
  20258. <type name="GLib.SList" c:type="GSList*">
  20259. <type name="gpointer" c:type="gpointer"/>
  20260. </type>
  20261. </parameter>
  20262. <parameter name="list2" transfer-ownership="none">
  20263. <doc xml:space="preserve">the #GSList to add to the end of the first #GSList</doc>
  20264. <type name="GLib.SList" c:type="GSList*">
  20265. <type name="gpointer" c:type="gpointer"/>
  20266. </type>
  20267. </parameter>
  20268. </parameters>
  20269. </function>
  20270. <function name="copy" c:identifier="g_slist_copy" introspectable="0">
  20271. <doc xml:space="preserve">Copies a #GSList.
  20272. Note that this is a "shallow" copy. If the list elements
  20273. consist of pointers to data, the pointers are copied but
  20274. the actual data isn't. See g_slist_copy_deep() if you need
  20275. to copy the data as well.</doc>
  20276. <return-value>
  20277. <doc xml:space="preserve">a copy of @list</doc>
  20278. <type name="GLib.SList" c:type="GSList*">
  20279. <type name="gpointer" c:type="gpointer"/>
  20280. </type>
  20281. </return-value>
  20282. <parameters>
  20283. <parameter name="list" transfer-ownership="none">
  20284. <doc xml:space="preserve">a #GSList</doc>
  20285. <type name="GLib.SList" c:type="GSList*">
  20286. <type name="gpointer" c:type="gpointer"/>
  20287. </type>
  20288. </parameter>
  20289. </parameters>
  20290. </function>
  20291. <function name="copy_deep"
  20292. c:identifier="g_slist_copy_deep"
  20293. version="2.34"
  20294. introspectable="0">
  20295. <doc xml:space="preserve">Makes a full (deep) copy of a #GSList.
  20296. In contrast with g_slist_copy(), this function uses @func to make a copy of
  20297. each list element, in addition to copying the list container itself.
  20298. @func, as a #GCopyFunc, takes two arguments, the data to be copied and a user
  20299. pointer. It's safe to pass #NULL as user_data, if the copy function takes only
  20300. one argument.
  20301. For instance, if @list holds a list of GObjects, you can do:
  20302. |[&lt;!-- language="C" --&gt;
  20303. another_list = g_slist_copy_deep (list, (GCopyFunc) g_object_ref, NULL);
  20304. ]|
  20305. And, to entirely free the new list, you could do:
  20306. |[&lt;!-- language="C" --&gt;
  20307. g_slist_free_full (another_list, g_object_unref);
  20308. ]|</doc>
  20309. <return-value>
  20310. <doc xml:space="preserve">a full copy of @list, use #g_slist_free_full to free it</doc>
  20311. <type name="GLib.SList" c:type="GSList*">
  20312. <type name="gpointer" c:type="gpointer"/>
  20313. </type>
  20314. </return-value>
  20315. <parameters>
  20316. <parameter name="list" transfer-ownership="none">
  20317. <doc xml:space="preserve">a #GSList</doc>
  20318. <type name="GLib.SList" c:type="GSList*">
  20319. <type name="gpointer" c:type="gpointer"/>
  20320. </type>
  20321. </parameter>
  20322. <parameter name="func" transfer-ownership="none" closure="2">
  20323. <doc xml:space="preserve">a copy function used to copy every element in the list</doc>
  20324. <type name="CopyFunc" c:type="GCopyFunc"/>
  20325. </parameter>
  20326. <parameter name="user_data"
  20327. transfer-ownership="none"
  20328. nullable="1"
  20329. allow-none="1">
  20330. <doc xml:space="preserve">user data passed to the copy function @func, or #NULL</doc>
  20331. <type name="gpointer" c:type="gpointer"/>
  20332. </parameter>
  20333. </parameters>
  20334. </function>
  20335. <function name="delete_link"
  20336. c:identifier="g_slist_delete_link"
  20337. introspectable="0">
  20338. <doc xml:space="preserve">Removes the node link_ from the list and frees it.
  20339. Compare this to g_slist_remove_link() which removes the node
  20340. without freeing it.
  20341. Removing arbitrary nodes from a singly-linked list requires time
  20342. that is proportional to the length of the list (ie. O(n)). If you
  20343. find yourself using g_slist_delete_link() frequently, you should
  20344. consider a different data structure, such as the doubly-linked
  20345. #GList.</doc>
  20346. <return-value>
  20347. <doc xml:space="preserve">the new head of @list</doc>
  20348. <type name="GLib.SList" c:type="GSList*">
  20349. <type name="gpointer" c:type="gpointer"/>
  20350. </type>
  20351. </return-value>
  20352. <parameters>
  20353. <parameter name="list" transfer-ownership="none">
  20354. <doc xml:space="preserve">a #GSList</doc>
  20355. <type name="GLib.SList" c:type="GSList*">
  20356. <type name="gpointer" c:type="gpointer"/>
  20357. </type>
  20358. </parameter>
  20359. <parameter name="link_" transfer-ownership="none">
  20360. <doc xml:space="preserve">node to delete</doc>
  20361. <type name="GLib.SList" c:type="GSList*">
  20362. <type name="gpointer" c:type="gpointer"/>
  20363. </type>
  20364. </parameter>
  20365. </parameters>
  20366. </function>
  20367. <function name="find" c:identifier="g_slist_find" introspectable="0">
  20368. <doc xml:space="preserve">Finds the element in a #GSList which
  20369. contains the given data.</doc>
  20370. <return-value>
  20371. <doc xml:space="preserve">the found #GSList element,
  20372. or %NULL if it is not found</doc>
  20373. <type name="GLib.SList" c:type="GSList*">
  20374. <type name="gpointer" c:type="gpointer"/>
  20375. </type>
  20376. </return-value>
  20377. <parameters>
  20378. <parameter name="list" transfer-ownership="none">
  20379. <doc xml:space="preserve">a #GSList</doc>
  20380. <type name="GLib.SList" c:type="GSList*">
  20381. <type name="gpointer" c:type="gpointer"/>
  20382. </type>
  20383. </parameter>
  20384. <parameter name="data"
  20385. transfer-ownership="none"
  20386. nullable="1"
  20387. allow-none="1">
  20388. <doc xml:space="preserve">the element data to find</doc>
  20389. <type name="gpointer" c:type="gconstpointer"/>
  20390. </parameter>
  20391. </parameters>
  20392. </function>
  20393. <function name="find_custom"
  20394. c:identifier="g_slist_find_custom"
  20395. introspectable="0">
  20396. <doc xml:space="preserve">Finds an element in a #GSList, using a supplied function to
  20397. find the desired element. It iterates over the list, calling
  20398. the given function which should return 0 when the desired
  20399. element is found. The function takes two #gconstpointer arguments,
  20400. the #GSList element's data as the first argument and the
  20401. given user data.</doc>
  20402. <return-value>
  20403. <doc xml:space="preserve">the found #GSList element, or %NULL if it is not found</doc>
  20404. <type name="GLib.SList" c:type="GSList*">
  20405. <type name="gpointer" c:type="gpointer"/>
  20406. </type>
  20407. </return-value>
  20408. <parameters>
  20409. <parameter name="list" transfer-ownership="none">
  20410. <doc xml:space="preserve">a #GSList</doc>
  20411. <type name="GLib.SList" c:type="GSList*">
  20412. <type name="gpointer" c:type="gpointer"/>
  20413. </type>
  20414. </parameter>
  20415. <parameter name="data"
  20416. transfer-ownership="none"
  20417. nullable="1"
  20418. allow-none="1">
  20419. <doc xml:space="preserve">user data passed to the function</doc>
  20420. <type name="gpointer" c:type="gconstpointer"/>
  20421. </parameter>
  20422. <parameter name="func" transfer-ownership="none">
  20423. <doc xml:space="preserve">the function to call for each element.
  20424. It should return 0 when the desired element is found</doc>
  20425. <type name="CompareFunc" c:type="GCompareFunc"/>
  20426. </parameter>
  20427. </parameters>
  20428. </function>
  20429. <function name="foreach"
  20430. c:identifier="g_slist_foreach"
  20431. introspectable="0">
  20432. <doc xml:space="preserve">Calls a function for each element of a #GSList.</doc>
  20433. <return-value transfer-ownership="none">
  20434. <type name="none" c:type="void"/>
  20435. </return-value>
  20436. <parameters>
  20437. <parameter name="list" transfer-ownership="none">
  20438. <doc xml:space="preserve">a #GSList</doc>
  20439. <type name="GLib.SList" c:type="GSList*">
  20440. <type name="gpointer" c:type="gpointer"/>
  20441. </type>
  20442. </parameter>
  20443. <parameter name="func" transfer-ownership="none" closure="2">
  20444. <doc xml:space="preserve">the function to call with each element's data</doc>
  20445. <type name="Func" c:type="GFunc"/>
  20446. </parameter>
  20447. <parameter name="user_data"
  20448. transfer-ownership="none"
  20449. nullable="1"
  20450. allow-none="1">
  20451. <doc xml:space="preserve">user data to pass to the function</doc>
  20452. <type name="gpointer" c:type="gpointer"/>
  20453. </parameter>
  20454. </parameters>
  20455. </function>
  20456. <function name="free" c:identifier="g_slist_free" introspectable="0">
  20457. <doc xml:space="preserve">Frees all of the memory used by a #GSList.
  20458. The freed elements are returned to the slice allocator.
  20459. If list elements contain dynamically-allocated memory,
  20460. you should either use g_slist_free_full() or free them manually
  20461. first.</doc>
  20462. <return-value transfer-ownership="none">
  20463. <type name="none" c:type="void"/>
  20464. </return-value>
  20465. <parameters>
  20466. <parameter name="list" transfer-ownership="none">
  20467. <doc xml:space="preserve">a #GSList</doc>
  20468. <type name="GLib.SList" c:type="GSList*">
  20469. <type name="gpointer" c:type="gpointer"/>
  20470. </type>
  20471. </parameter>
  20472. </parameters>
  20473. </function>
  20474. <function name="free_1" c:identifier="g_slist_free_1" introspectable="0">
  20475. <doc xml:space="preserve">Frees one #GSList element.
  20476. It is usually used after g_slist_remove_link().</doc>
  20477. <return-value transfer-ownership="none">
  20478. <type name="none" c:type="void"/>
  20479. </return-value>
  20480. <parameters>
  20481. <parameter name="list" transfer-ownership="none">
  20482. <doc xml:space="preserve">a #GSList element</doc>
  20483. <type name="GLib.SList" c:type="GSList*">
  20484. <type name="gpointer" c:type="gpointer"/>
  20485. </type>
  20486. </parameter>
  20487. </parameters>
  20488. </function>
  20489. <function name="free_full"
  20490. c:identifier="g_slist_free_full"
  20491. version="2.28"
  20492. introspectable="0">
  20493. <doc xml:space="preserve">Convenience method, which frees all the memory used by a #GSList, and
  20494. calls the specified destroy function on every element's data.</doc>
  20495. <return-value transfer-ownership="none">
  20496. <type name="none" c:type="void"/>
  20497. </return-value>
  20498. <parameters>
  20499. <parameter name="list" transfer-ownership="none">
  20500. <doc xml:space="preserve">a pointer to a #GSList</doc>
  20501. <type name="GLib.SList" c:type="GSList*">
  20502. <type name="gpointer" c:type="gpointer"/>
  20503. </type>
  20504. </parameter>
  20505. <parameter name="free_func" transfer-ownership="none" scope="async">
  20506. <doc xml:space="preserve">the function to be called to free each element's data</doc>
  20507. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  20508. </parameter>
  20509. </parameters>
  20510. </function>
  20511. <function name="index" c:identifier="g_slist_index" introspectable="0">
  20512. <doc xml:space="preserve">Gets the position of the element containing
  20513. the given data (starting from 0).</doc>
  20514. <return-value transfer-ownership="none">
  20515. <doc xml:space="preserve">the index of the element containing the data,
  20516. or -1 if the data is not found</doc>
  20517. <type name="gint" c:type="gint"/>
  20518. </return-value>
  20519. <parameters>
  20520. <parameter name="list" transfer-ownership="none">
  20521. <doc xml:space="preserve">a #GSList</doc>
  20522. <type name="GLib.SList" c:type="GSList*">
  20523. <type name="gpointer" c:type="gpointer"/>
  20524. </type>
  20525. </parameter>
  20526. <parameter name="data"
  20527. transfer-ownership="none"
  20528. nullable="1"
  20529. allow-none="1">
  20530. <doc xml:space="preserve">the data to find</doc>
  20531. <type name="gpointer" c:type="gconstpointer"/>
  20532. </parameter>
  20533. </parameters>
  20534. </function>
  20535. <function name="insert" c:identifier="g_slist_insert" introspectable="0">
  20536. <doc xml:space="preserve">Inserts a new element into the list at the given position.</doc>
  20537. <return-value>
  20538. <doc xml:space="preserve">the new start of the #GSList</doc>
  20539. <type name="GLib.SList" c:type="GSList*">
  20540. <type name="gpointer" c:type="gpointer"/>
  20541. </type>
  20542. </return-value>
  20543. <parameters>
  20544. <parameter name="list" transfer-ownership="none">
  20545. <doc xml:space="preserve">a #GSList</doc>
  20546. <type name="GLib.SList" c:type="GSList*">
  20547. <type name="gpointer" c:type="gpointer"/>
  20548. </type>
  20549. </parameter>
  20550. <parameter name="data"
  20551. transfer-ownership="none"
  20552. nullable="1"
  20553. allow-none="1">
  20554. <doc xml:space="preserve">the data for the new element</doc>
  20555. <type name="gpointer" c:type="gpointer"/>
  20556. </parameter>
  20557. <parameter name="position" transfer-ownership="none">
  20558. <doc xml:space="preserve">the position to insert the element.
  20559. If this is negative, or is larger than the number
  20560. of elements in the list, the new element is added on
  20561. to the end of the list.</doc>
  20562. <type name="gint" c:type="gint"/>
  20563. </parameter>
  20564. </parameters>
  20565. </function>
  20566. <function name="insert_before"
  20567. c:identifier="g_slist_insert_before"
  20568. introspectable="0">
  20569. <doc xml:space="preserve">Inserts a node before @sibling containing @data.</doc>
  20570. <return-value>
  20571. <doc xml:space="preserve">the new head of the list.</doc>
  20572. <type name="GLib.SList" c:type="GSList*">
  20573. <type name="gpointer" c:type="gpointer"/>
  20574. </type>
  20575. </return-value>
  20576. <parameters>
  20577. <parameter name="slist" transfer-ownership="none">
  20578. <doc xml:space="preserve">a #GSList</doc>
  20579. <type name="GLib.SList" c:type="GSList*">
  20580. <type name="gpointer" c:type="gpointer"/>
  20581. </type>
  20582. </parameter>
  20583. <parameter name="sibling" transfer-ownership="none">
  20584. <doc xml:space="preserve">node to insert @data before</doc>
  20585. <type name="GLib.SList" c:type="GSList*">
  20586. <type name="gpointer" c:type="gpointer"/>
  20587. </type>
  20588. </parameter>
  20589. <parameter name="data"
  20590. transfer-ownership="none"
  20591. nullable="1"
  20592. allow-none="1">
  20593. <doc xml:space="preserve">data to put in the newly-inserted node</doc>
  20594. <type name="gpointer" c:type="gpointer"/>
  20595. </parameter>
  20596. </parameters>
  20597. </function>
  20598. <function name="insert_sorted"
  20599. c:identifier="g_slist_insert_sorted"
  20600. introspectable="0">
  20601. <doc xml:space="preserve">Inserts a new element into the list, using the given
  20602. comparison function to determine its position.</doc>
  20603. <return-value>
  20604. <doc xml:space="preserve">the new start of the #GSList</doc>
  20605. <type name="GLib.SList" c:type="GSList*">
  20606. <type name="gpointer" c:type="gpointer"/>
  20607. </type>
  20608. </return-value>
  20609. <parameters>
  20610. <parameter name="list" transfer-ownership="none">
  20611. <doc xml:space="preserve">a #GSList</doc>
  20612. <type name="GLib.SList" c:type="GSList*">
  20613. <type name="gpointer" c:type="gpointer"/>
  20614. </type>
  20615. </parameter>
  20616. <parameter name="data"
  20617. transfer-ownership="none"
  20618. nullable="1"
  20619. allow-none="1">
  20620. <doc xml:space="preserve">the data for the new element</doc>
  20621. <type name="gpointer" c:type="gpointer"/>
  20622. </parameter>
  20623. <parameter name="func" transfer-ownership="none">
  20624. <doc xml:space="preserve">the function to compare elements in the list.
  20625. It should return a number &gt; 0 if the first parameter
  20626. comes after the second parameter in the sort order.</doc>
  20627. <type name="CompareFunc" c:type="GCompareFunc"/>
  20628. </parameter>
  20629. </parameters>
  20630. </function>
  20631. <function name="insert_sorted_with_data"
  20632. c:identifier="g_slist_insert_sorted_with_data"
  20633. version="2.10"
  20634. introspectable="0">
  20635. <doc xml:space="preserve">Inserts a new element into the list, using the given
  20636. comparison function to determine its position.</doc>
  20637. <return-value>
  20638. <doc xml:space="preserve">the new start of the #GSList</doc>
  20639. <type name="GLib.SList" c:type="GSList*">
  20640. <type name="gpointer" c:type="gpointer"/>
  20641. </type>
  20642. </return-value>
  20643. <parameters>
  20644. <parameter name="list" transfer-ownership="none">
  20645. <doc xml:space="preserve">a #GSList</doc>
  20646. <type name="GLib.SList" c:type="GSList*">
  20647. <type name="gpointer" c:type="gpointer"/>
  20648. </type>
  20649. </parameter>
  20650. <parameter name="data"
  20651. transfer-ownership="none"
  20652. nullable="1"
  20653. allow-none="1">
  20654. <doc xml:space="preserve">the data for the new element</doc>
  20655. <type name="gpointer" c:type="gpointer"/>
  20656. </parameter>
  20657. <parameter name="func" transfer-ownership="none" closure="3">
  20658. <doc xml:space="preserve">the function to compare elements in the list.
  20659. It should return a number &gt; 0 if the first parameter
  20660. comes after the second parameter in the sort order.</doc>
  20661. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  20662. </parameter>
  20663. <parameter name="user_data"
  20664. transfer-ownership="none"
  20665. nullable="1"
  20666. allow-none="1">
  20667. <doc xml:space="preserve">data to pass to comparison function</doc>
  20668. <type name="gpointer" c:type="gpointer"/>
  20669. </parameter>
  20670. </parameters>
  20671. </function>
  20672. <function name="last" c:identifier="g_slist_last" introspectable="0">
  20673. <doc xml:space="preserve">Gets the last element in a #GSList.
  20674. This function iterates over the whole list.</doc>
  20675. <return-value>
  20676. <doc xml:space="preserve">the last element in the #GSList,
  20677. or %NULL if the #GSList has no elements</doc>
  20678. <type name="GLib.SList" c:type="GSList*">
  20679. <type name="gpointer" c:type="gpointer"/>
  20680. </type>
  20681. </return-value>
  20682. <parameters>
  20683. <parameter name="list" transfer-ownership="none">
  20684. <doc xml:space="preserve">a #GSList</doc>
  20685. <type name="GLib.SList" c:type="GSList*">
  20686. <type name="gpointer" c:type="gpointer"/>
  20687. </type>
  20688. </parameter>
  20689. </parameters>
  20690. </function>
  20691. <function name="length" c:identifier="g_slist_length" introspectable="0">
  20692. <doc xml:space="preserve">Gets the number of elements in a #GSList.
  20693. This function iterates over the whole list to
  20694. count its elements. To check whether the list is non-empty, it is faster to
  20695. check @list against %NULL.</doc>
  20696. <return-value transfer-ownership="none">
  20697. <doc xml:space="preserve">the number of elements in the #GSList</doc>
  20698. <type name="guint" c:type="guint"/>
  20699. </return-value>
  20700. <parameters>
  20701. <parameter name="list" transfer-ownership="none">
  20702. <doc xml:space="preserve">a #GSList</doc>
  20703. <type name="GLib.SList" c:type="GSList*">
  20704. <type name="gpointer" c:type="gpointer"/>
  20705. </type>
  20706. </parameter>
  20707. </parameters>
  20708. </function>
  20709. <function name="nth" c:identifier="g_slist_nth" introspectable="0">
  20710. <doc xml:space="preserve">Gets the element at the given position in a #GSList.</doc>
  20711. <return-value>
  20712. <doc xml:space="preserve">the element, or %NULL if the position is off
  20713. the end of the #GSList</doc>
  20714. <type name="GLib.SList" c:type="GSList*">
  20715. <type name="gpointer" c:type="gpointer"/>
  20716. </type>
  20717. </return-value>
  20718. <parameters>
  20719. <parameter name="list" transfer-ownership="none">
  20720. <doc xml:space="preserve">a #GSList</doc>
  20721. <type name="GLib.SList" c:type="GSList*">
  20722. <type name="gpointer" c:type="gpointer"/>
  20723. </type>
  20724. </parameter>
  20725. <parameter name="n" transfer-ownership="none">
  20726. <doc xml:space="preserve">the position of the element, counting from 0</doc>
  20727. <type name="guint" c:type="guint"/>
  20728. </parameter>
  20729. </parameters>
  20730. </function>
  20731. <function name="nth_data"
  20732. c:identifier="g_slist_nth_data"
  20733. introspectable="0">
  20734. <doc xml:space="preserve">Gets the data of the element at the given position.</doc>
  20735. <return-value transfer-ownership="none" nullable="1">
  20736. <doc xml:space="preserve">the element's data, or %NULL if the position
  20737. is off the end of the #GSList</doc>
  20738. <type name="gpointer" c:type="gpointer"/>
  20739. </return-value>
  20740. <parameters>
  20741. <parameter name="list" transfer-ownership="none">
  20742. <doc xml:space="preserve">a #GSList</doc>
  20743. <type name="GLib.SList" c:type="GSList*">
  20744. <type name="gpointer" c:type="gpointer"/>
  20745. </type>
  20746. </parameter>
  20747. <parameter name="n" transfer-ownership="none">
  20748. <doc xml:space="preserve">the position of the element</doc>
  20749. <type name="guint" c:type="guint"/>
  20750. </parameter>
  20751. </parameters>
  20752. </function>
  20753. <function name="position"
  20754. c:identifier="g_slist_position"
  20755. introspectable="0">
  20756. <doc xml:space="preserve">Gets the position of the given element
  20757. in the #GSList (starting from 0).</doc>
  20758. <return-value transfer-ownership="none">
  20759. <doc xml:space="preserve">the position of the element in the #GSList,
  20760. or -1 if the element is not found</doc>
  20761. <type name="gint" c:type="gint"/>
  20762. </return-value>
  20763. <parameters>
  20764. <parameter name="list" transfer-ownership="none">
  20765. <doc xml:space="preserve">a #GSList</doc>
  20766. <type name="GLib.SList" c:type="GSList*">
  20767. <type name="gpointer" c:type="gpointer"/>
  20768. </type>
  20769. </parameter>
  20770. <parameter name="llink" transfer-ownership="none">
  20771. <doc xml:space="preserve">an element in the #GSList</doc>
  20772. <type name="GLib.SList" c:type="GSList*">
  20773. <type name="gpointer" c:type="gpointer"/>
  20774. </type>
  20775. </parameter>
  20776. </parameters>
  20777. </function>
  20778. <function name="prepend"
  20779. c:identifier="g_slist_prepend"
  20780. introspectable="0">
  20781. <doc xml:space="preserve">Adds a new element on to the start of the list.
  20782. The return value is the new start of the list, which
  20783. may have changed, so make sure you store the new value.
  20784. |[&lt;!-- language="C" --&gt;
  20785. // Notice that it is initialized to the empty list.
  20786. GSList *list = NULL;
  20787. list = g_slist_prepend (list, "last");
  20788. list = g_slist_prepend (list, "first");
  20789. ]|</doc>
  20790. <return-value>
  20791. <doc xml:space="preserve">the new start of the #GSList</doc>
  20792. <type name="GLib.SList" c:type="GSList*">
  20793. <type name="gpointer" c:type="gpointer"/>
  20794. </type>
  20795. </return-value>
  20796. <parameters>
  20797. <parameter name="list" transfer-ownership="none">
  20798. <doc xml:space="preserve">a #GSList</doc>
  20799. <type name="GLib.SList" c:type="GSList*">
  20800. <type name="gpointer" c:type="gpointer"/>
  20801. </type>
  20802. </parameter>
  20803. <parameter name="data"
  20804. transfer-ownership="none"
  20805. nullable="1"
  20806. allow-none="1">
  20807. <doc xml:space="preserve">the data for the new element</doc>
  20808. <type name="gpointer" c:type="gpointer"/>
  20809. </parameter>
  20810. </parameters>
  20811. </function>
  20812. <function name="remove" c:identifier="g_slist_remove" introspectable="0">
  20813. <doc xml:space="preserve">Removes an element from a #GSList.
  20814. If two elements contain the same data, only the first is removed.
  20815. If none of the elements contain the data, the #GSList is unchanged.</doc>
  20816. <return-value>
  20817. <doc xml:space="preserve">the new start of the #GSList</doc>
  20818. <type name="GLib.SList" c:type="GSList*">
  20819. <type name="gpointer" c:type="gpointer"/>
  20820. </type>
  20821. </return-value>
  20822. <parameters>
  20823. <parameter name="list" transfer-ownership="none">
  20824. <doc xml:space="preserve">a #GSList</doc>
  20825. <type name="GLib.SList" c:type="GSList*">
  20826. <type name="gpointer" c:type="gpointer"/>
  20827. </type>
  20828. </parameter>
  20829. <parameter name="data"
  20830. transfer-ownership="none"
  20831. nullable="1"
  20832. allow-none="1">
  20833. <doc xml:space="preserve">the data of the element to remove</doc>
  20834. <type name="gpointer" c:type="gconstpointer"/>
  20835. </parameter>
  20836. </parameters>
  20837. </function>
  20838. <function name="remove_all"
  20839. c:identifier="g_slist_remove_all"
  20840. introspectable="0">
  20841. <doc xml:space="preserve">Removes all list nodes with data equal to @data.
  20842. Returns the new head of the list. Contrast with
  20843. g_slist_remove() which removes only the first node
  20844. matching the given data.</doc>
  20845. <return-value>
  20846. <doc xml:space="preserve">new head of @list</doc>
  20847. <type name="GLib.SList" c:type="GSList*">
  20848. <type name="gpointer" c:type="gpointer"/>
  20849. </type>
  20850. </return-value>
  20851. <parameters>
  20852. <parameter name="list" transfer-ownership="none">
  20853. <doc xml:space="preserve">a #GSList</doc>
  20854. <type name="GLib.SList" c:type="GSList*">
  20855. <type name="gpointer" c:type="gpointer"/>
  20856. </type>
  20857. </parameter>
  20858. <parameter name="data"
  20859. transfer-ownership="none"
  20860. nullable="1"
  20861. allow-none="1">
  20862. <doc xml:space="preserve">data to remove</doc>
  20863. <type name="gpointer" c:type="gconstpointer"/>
  20864. </parameter>
  20865. </parameters>
  20866. </function>
  20867. <function name="remove_link"
  20868. c:identifier="g_slist_remove_link"
  20869. introspectable="0">
  20870. <doc xml:space="preserve">Removes an element from a #GSList, without
  20871. freeing the element. The removed element's next
  20872. link is set to %NULL, so that it becomes a
  20873. self-contained list with one element.
  20874. Removing arbitrary nodes from a singly-linked list
  20875. requires time that is proportional to the length of the list
  20876. (ie. O(n)). If you find yourself using g_slist_remove_link()
  20877. frequently, you should consider a different data structure,
  20878. such as the doubly-linked #GList.</doc>
  20879. <return-value>
  20880. <doc xml:space="preserve">the new start of the #GSList, without the element</doc>
  20881. <type name="GLib.SList" c:type="GSList*">
  20882. <type name="gpointer" c:type="gpointer"/>
  20883. </type>
  20884. </return-value>
  20885. <parameters>
  20886. <parameter name="list" transfer-ownership="none">
  20887. <doc xml:space="preserve">a #GSList</doc>
  20888. <type name="GLib.SList" c:type="GSList*">
  20889. <type name="gpointer" c:type="gpointer"/>
  20890. </type>
  20891. </parameter>
  20892. <parameter name="link_" transfer-ownership="none">
  20893. <doc xml:space="preserve">an element in the #GSList</doc>
  20894. <type name="GLib.SList" c:type="GSList*">
  20895. <type name="gpointer" c:type="gpointer"/>
  20896. </type>
  20897. </parameter>
  20898. </parameters>
  20899. </function>
  20900. <function name="reverse"
  20901. c:identifier="g_slist_reverse"
  20902. introspectable="0">
  20903. <doc xml:space="preserve">Reverses a #GSList.</doc>
  20904. <return-value>
  20905. <doc xml:space="preserve">the start of the reversed #GSList</doc>
  20906. <type name="GLib.SList" c:type="GSList*">
  20907. <type name="gpointer" c:type="gpointer"/>
  20908. </type>
  20909. </return-value>
  20910. <parameters>
  20911. <parameter name="list" transfer-ownership="none">
  20912. <doc xml:space="preserve">a #GSList</doc>
  20913. <type name="GLib.SList" c:type="GSList*">
  20914. <type name="gpointer" c:type="gpointer"/>
  20915. </type>
  20916. </parameter>
  20917. </parameters>
  20918. </function>
  20919. <function name="sort" c:identifier="g_slist_sort" introspectable="0">
  20920. <doc xml:space="preserve">Sorts a #GSList using the given comparison function.</doc>
  20921. <return-value>
  20922. <doc xml:space="preserve">the start of the sorted #GSList</doc>
  20923. <type name="GLib.SList" c:type="GSList*">
  20924. <type name="gpointer" c:type="gpointer"/>
  20925. </type>
  20926. </return-value>
  20927. <parameters>
  20928. <parameter name="list" transfer-ownership="none">
  20929. <doc xml:space="preserve">a #GSList</doc>
  20930. <type name="GLib.SList" c:type="GSList*">
  20931. <type name="gpointer" c:type="gpointer"/>
  20932. </type>
  20933. </parameter>
  20934. <parameter name="compare_func" transfer-ownership="none">
  20935. <doc xml:space="preserve">the comparison function used to sort the #GSList.
  20936. This function is passed the data from 2 elements of the #GSList
  20937. and should return 0 if they are equal, a negative value if the
  20938. first element comes before the second, or a positive value if
  20939. the first element comes after the second.</doc>
  20940. <type name="CompareFunc" c:type="GCompareFunc"/>
  20941. </parameter>
  20942. </parameters>
  20943. </function>
  20944. <function name="sort_with_data"
  20945. c:identifier="g_slist_sort_with_data"
  20946. introspectable="0">
  20947. <doc xml:space="preserve">Like g_slist_sort(), but the sort function accepts a user data argument.</doc>
  20948. <return-value>
  20949. <doc xml:space="preserve">new head of the list</doc>
  20950. <type name="GLib.SList" c:type="GSList*">
  20951. <type name="gpointer" c:type="gpointer"/>
  20952. </type>
  20953. </return-value>
  20954. <parameters>
  20955. <parameter name="list" transfer-ownership="none">
  20956. <doc xml:space="preserve">a #GSList</doc>
  20957. <type name="GLib.SList" c:type="GSList*">
  20958. <type name="gpointer" c:type="gpointer"/>
  20959. </type>
  20960. </parameter>
  20961. <parameter name="compare_func" transfer-ownership="none" closure="2">
  20962. <doc xml:space="preserve">comparison function</doc>
  20963. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  20964. </parameter>
  20965. <parameter name="user_data"
  20966. transfer-ownership="none"
  20967. nullable="1"
  20968. allow-none="1">
  20969. <doc xml:space="preserve">data to pass to comparison function</doc>
  20970. <type name="gpointer" c:type="gpointer"/>
  20971. </parameter>
  20972. </parameters>
  20973. </function>
  20974. </record>
  20975. <constant name="SOURCE_CONTINUE"
  20976. value="true"
  20977. c:type="G_SOURCE_CONTINUE"
  20978. version="2.32">
  20979. <doc xml:space="preserve">Use this macro as the return value of a #GSourceFunc to leave
  20980. the #GSource in the main loop.</doc>
  20981. <type name="gboolean" c:type="gboolean"/>
  20982. </constant>
  20983. <constant name="SOURCE_REMOVE"
  20984. value="false"
  20985. c:type="G_SOURCE_REMOVE"
  20986. version="2.32">
  20987. <doc xml:space="preserve">Use this macro as the return value of a #GSourceFunc to remove
  20988. the #GSource from the main loop.</doc>
  20989. <type name="gboolean" c:type="gboolean"/>
  20990. </constant>
  20991. <constant name="SQRT2" value="1.414214" c:type="G_SQRT2">
  20992. <doc xml:space="preserve">The square root of two.</doc>
  20993. <type name="gdouble" c:type="gdouble"/>
  20994. </constant>
  20995. <constant name="STR_DELIMITERS"
  20996. value="_-|&gt; &lt;."
  20997. c:type="G_STR_DELIMITERS">
  20998. <doc xml:space="preserve">The standard delimiters, used in g_strdelimit().</doc>
  20999. <type name="utf8" c:type="gchar*"/>
  21000. </constant>
  21001. <constant name="SYSDEF_AF_INET" value="2" c:type="GLIB_SYSDEF_AF_INET">
  21002. <type name="gint" c:type="gint"/>
  21003. </constant>
  21004. <constant name="SYSDEF_AF_INET6" value="10" c:type="GLIB_SYSDEF_AF_INET6">
  21005. <type name="gint" c:type="gint"/>
  21006. </constant>
  21007. <constant name="SYSDEF_AF_UNIX" value="1" c:type="GLIB_SYSDEF_AF_UNIX">
  21008. <type name="gint" c:type="gint"/>
  21009. </constant>
  21010. <constant name="SYSDEF_MSG_DONTROUTE"
  21011. value="4"
  21012. c:type="GLIB_SYSDEF_MSG_DONTROUTE">
  21013. <type name="gint" c:type="gint"/>
  21014. </constant>
  21015. <constant name="SYSDEF_MSG_OOB" value="1" c:type="GLIB_SYSDEF_MSG_OOB">
  21016. <type name="gint" c:type="gint"/>
  21017. </constant>
  21018. <constant name="SYSDEF_MSG_PEEK" value="2" c:type="GLIB_SYSDEF_MSG_PEEK">
  21019. <type name="gint" c:type="gint"/>
  21020. </constant>
  21021. <record name="Scanner" c:type="GScanner">
  21022. <doc xml:space="preserve">The data structure representing a lexical scanner.
  21023. You should set @input_name after creating the scanner, since
  21024. it is used by the default message handler when displaying
  21025. warnings and errors. If you are scanning a file, the filename
  21026. would be a good choice.
  21027. The @user_data and @max_parse_errors fields are not used.
  21028. If you need to associate extra data with the scanner you
  21029. can place them here.
  21030. If you want to use your own message handler you can set the
  21031. @msg_handler field. The type of the message handler function
  21032. is declared by #GScannerMsgFunc.</doc>
  21033. <field name="user_data" writable="1">
  21034. <doc xml:space="preserve">unused</doc>
  21035. <type name="gpointer" c:type="gpointer"/>
  21036. </field>
  21037. <field name="max_parse_errors" writable="1">
  21038. <doc xml:space="preserve">unused</doc>
  21039. <type name="guint" c:type="guint"/>
  21040. </field>
  21041. <field name="parse_errors" writable="1">
  21042. <doc xml:space="preserve">g_scanner_error() increments this field</doc>
  21043. <type name="guint" c:type="guint"/>
  21044. </field>
  21045. <field name="input_name" writable="1">
  21046. <doc xml:space="preserve">name of input stream, featured by the default message handler</doc>
  21047. <type name="utf8" c:type="const gchar*"/>
  21048. </field>
  21049. <field name="qdata" writable="1">
  21050. <doc xml:space="preserve">quarked data</doc>
  21051. <type name="Data" c:type="GData*"/>
  21052. </field>
  21053. <field name="config" writable="1">
  21054. <doc xml:space="preserve">link into the scanner configuration</doc>
  21055. <type name="ScannerConfig" c:type="GScannerConfig*"/>
  21056. </field>
  21057. <field name="token" writable="1">
  21058. <doc xml:space="preserve">token parsed by the last g_scanner_get_next_token()</doc>
  21059. <type name="TokenType" c:type="GTokenType"/>
  21060. </field>
  21061. <field name="value" writable="1">
  21062. <doc xml:space="preserve">value of the last token from g_scanner_get_next_token()</doc>
  21063. <type name="TokenValue" c:type="GTokenValue"/>
  21064. </field>
  21065. <field name="line" writable="1">
  21066. <doc xml:space="preserve">line number of the last token from g_scanner_get_next_token()</doc>
  21067. <type name="guint" c:type="guint"/>
  21068. </field>
  21069. <field name="position" writable="1">
  21070. <doc xml:space="preserve">char number of the last token from g_scanner_get_next_token()</doc>
  21071. <type name="guint" c:type="guint"/>
  21072. </field>
  21073. <field name="next_token" writable="1">
  21074. <doc xml:space="preserve">token parsed by the last g_scanner_peek_next_token()</doc>
  21075. <type name="TokenType" c:type="GTokenType"/>
  21076. </field>
  21077. <field name="next_value" writable="1">
  21078. <doc xml:space="preserve">value of the last token from g_scanner_peek_next_token()</doc>
  21079. <type name="TokenValue" c:type="GTokenValue"/>
  21080. </field>
  21081. <field name="next_line" writable="1">
  21082. <doc xml:space="preserve">line number of the last token from g_scanner_peek_next_token()</doc>
  21083. <type name="guint" c:type="guint"/>
  21084. </field>
  21085. <field name="next_position" writable="1">
  21086. <doc xml:space="preserve">char number of the last token from g_scanner_peek_next_token()</doc>
  21087. <type name="guint" c:type="guint"/>
  21088. </field>
  21089. <field name="symbol_table" readable="0" private="1">
  21090. <type name="GLib.HashTable" c:type="GHashTable*">
  21091. <type name="gpointer" c:type="gpointer"/>
  21092. <type name="gpointer" c:type="gpointer"/>
  21093. </type>
  21094. </field>
  21095. <field name="input_fd" readable="0" private="1">
  21096. <type name="gint" c:type="gint"/>
  21097. </field>
  21098. <field name="text" readable="0" private="1">
  21099. <type name="utf8" c:type="const gchar*"/>
  21100. </field>
  21101. <field name="text_end" readable="0" private="1">
  21102. <type name="utf8" c:type="const gchar*"/>
  21103. </field>
  21104. <field name="buffer" readable="0" private="1">
  21105. <type name="utf8" c:type="gchar*"/>
  21106. </field>
  21107. <field name="scope_id" readable="0" private="1">
  21108. <type name="guint" c:type="guint"/>
  21109. </field>
  21110. <field name="msg_handler" writable="1">
  21111. <doc xml:space="preserve">handler function for _warn and _error</doc>
  21112. <type name="ScannerMsgFunc" c:type="GScannerMsgFunc"/>
  21113. </field>
  21114. <method name="cur_line" c:identifier="g_scanner_cur_line">
  21115. <doc xml:space="preserve">Returns the current line in the input stream (counting
  21116. from 1). This is the line of the last token parsed via
  21117. g_scanner_get_next_token().</doc>
  21118. <return-value transfer-ownership="none">
  21119. <doc xml:space="preserve">the current line</doc>
  21120. <type name="guint" c:type="guint"/>
  21121. </return-value>
  21122. <parameters>
  21123. <instance-parameter name="scanner" transfer-ownership="none">
  21124. <doc xml:space="preserve">a #GScanner</doc>
  21125. <type name="Scanner" c:type="GScanner*"/>
  21126. </instance-parameter>
  21127. </parameters>
  21128. </method>
  21129. <method name="cur_position" c:identifier="g_scanner_cur_position">
  21130. <doc xml:space="preserve">Returns the current position in the current line (counting
  21131. from 0). This is the position of the last token parsed via
  21132. g_scanner_get_next_token().</doc>
  21133. <return-value transfer-ownership="none">
  21134. <doc xml:space="preserve">the current position on the line</doc>
  21135. <type name="guint" c:type="guint"/>
  21136. </return-value>
  21137. <parameters>
  21138. <instance-parameter name="scanner" transfer-ownership="none">
  21139. <doc xml:space="preserve">a #GScanner</doc>
  21140. <type name="Scanner" c:type="GScanner*"/>
  21141. </instance-parameter>
  21142. </parameters>
  21143. </method>
  21144. <method name="cur_token" c:identifier="g_scanner_cur_token">
  21145. <doc xml:space="preserve">Gets the current token type. This is simply the @token
  21146. field in the #GScanner structure.</doc>
  21147. <return-value transfer-ownership="none">
  21148. <doc xml:space="preserve">the current token type</doc>
  21149. <type name="TokenType" c:type="GTokenType"/>
  21150. </return-value>
  21151. <parameters>
  21152. <instance-parameter name="scanner" transfer-ownership="none">
  21153. <doc xml:space="preserve">a #GScanner</doc>
  21154. <type name="Scanner" c:type="GScanner*"/>
  21155. </instance-parameter>
  21156. </parameters>
  21157. </method>
  21158. <method name="cur_value"
  21159. c:identifier="g_scanner_cur_value"
  21160. introspectable="0">
  21161. <doc xml:space="preserve">Gets the current token value. This is simply the @value
  21162. field in the #GScanner structure.</doc>
  21163. <return-value>
  21164. <doc xml:space="preserve">the current token value</doc>
  21165. <type name="TokenValue" c:type="GTokenValue"/>
  21166. </return-value>
  21167. <parameters>
  21168. <instance-parameter name="scanner" transfer-ownership="none">
  21169. <doc xml:space="preserve">a #GScanner</doc>
  21170. <type name="Scanner" c:type="GScanner*"/>
  21171. </instance-parameter>
  21172. </parameters>
  21173. </method>
  21174. <method name="destroy" c:identifier="g_scanner_destroy">
  21175. <doc xml:space="preserve">Frees all memory used by the #GScanner.</doc>
  21176. <return-value transfer-ownership="none">
  21177. <type name="none" c:type="void"/>
  21178. </return-value>
  21179. <parameters>
  21180. <instance-parameter name="scanner" transfer-ownership="none">
  21181. <doc xml:space="preserve">a #GScanner</doc>
  21182. <type name="Scanner" c:type="GScanner*"/>
  21183. </instance-parameter>
  21184. </parameters>
  21185. </method>
  21186. <method name="eof" c:identifier="g_scanner_eof">
  21187. <doc xml:space="preserve">Returns %TRUE if the scanner has reached the end of
  21188. the file or text buffer.</doc>
  21189. <return-value transfer-ownership="none">
  21190. <doc xml:space="preserve">%TRUE if the scanner has reached the end of
  21191. the file or text buffer</doc>
  21192. <type name="gboolean" c:type="gboolean"/>
  21193. </return-value>
  21194. <parameters>
  21195. <instance-parameter name="scanner" transfer-ownership="none">
  21196. <doc xml:space="preserve">a #GScanner</doc>
  21197. <type name="Scanner" c:type="GScanner*"/>
  21198. </instance-parameter>
  21199. </parameters>
  21200. </method>
  21201. <method name="error" c:identifier="g_scanner_error" introspectable="0">
  21202. <doc xml:space="preserve">Outputs an error message, via the #GScanner message handler.</doc>
  21203. <return-value transfer-ownership="none">
  21204. <type name="none" c:type="void"/>
  21205. </return-value>
  21206. <parameters>
  21207. <instance-parameter name="scanner" transfer-ownership="none">
  21208. <doc xml:space="preserve">a #GScanner</doc>
  21209. <type name="Scanner" c:type="GScanner*"/>
  21210. </instance-parameter>
  21211. <parameter name="format" transfer-ownership="none">
  21212. <doc xml:space="preserve">the message format. See the printf() documentation</doc>
  21213. <type name="utf8" c:type="const gchar*"/>
  21214. </parameter>
  21215. <parameter name="..." transfer-ownership="none">
  21216. <doc xml:space="preserve">the parameters to insert into the format string</doc>
  21217. <varargs/>
  21218. </parameter>
  21219. </parameters>
  21220. </method>
  21221. <method name="get_next_token" c:identifier="g_scanner_get_next_token">
  21222. <doc xml:space="preserve">Parses the next token just like g_scanner_peek_next_token()
  21223. and also removes it from the input stream. The token data is
  21224. placed in the @token, @value, @line, and @position fields of
  21225. the #GScanner structure.</doc>
  21226. <return-value transfer-ownership="none">
  21227. <doc xml:space="preserve">the type of the token</doc>
  21228. <type name="TokenType" c:type="GTokenType"/>
  21229. </return-value>
  21230. <parameters>
  21231. <instance-parameter name="scanner" transfer-ownership="none">
  21232. <doc xml:space="preserve">a #GScanner</doc>
  21233. <type name="Scanner" c:type="GScanner*"/>
  21234. </instance-parameter>
  21235. </parameters>
  21236. </method>
  21237. <method name="input_file" c:identifier="g_scanner_input_file">
  21238. <doc xml:space="preserve">Prepares to scan a file.</doc>
  21239. <return-value transfer-ownership="none">
  21240. <type name="none" c:type="void"/>
  21241. </return-value>
  21242. <parameters>
  21243. <instance-parameter name="scanner" transfer-ownership="none">
  21244. <doc xml:space="preserve">a #GScanner</doc>
  21245. <type name="Scanner" c:type="GScanner*"/>
  21246. </instance-parameter>
  21247. <parameter name="input_fd" transfer-ownership="none">
  21248. <doc xml:space="preserve">a file descriptor</doc>
  21249. <type name="gint" c:type="gint"/>
  21250. </parameter>
  21251. </parameters>
  21252. </method>
  21253. <method name="input_text" c:identifier="g_scanner_input_text">
  21254. <doc xml:space="preserve">Prepares to scan a text buffer.</doc>
  21255. <return-value transfer-ownership="none">
  21256. <type name="none" c:type="void"/>
  21257. </return-value>
  21258. <parameters>
  21259. <instance-parameter name="scanner" transfer-ownership="none">
  21260. <doc xml:space="preserve">a #GScanner</doc>
  21261. <type name="Scanner" c:type="GScanner*"/>
  21262. </instance-parameter>
  21263. <parameter name="text" transfer-ownership="none">
  21264. <doc xml:space="preserve">the text buffer to scan</doc>
  21265. <type name="utf8" c:type="const gchar*"/>
  21266. </parameter>
  21267. <parameter name="text_len" transfer-ownership="none">
  21268. <doc xml:space="preserve">the length of the text buffer</doc>
  21269. <type name="guint" c:type="guint"/>
  21270. </parameter>
  21271. </parameters>
  21272. </method>
  21273. <method name="lookup_symbol" c:identifier="g_scanner_lookup_symbol">
  21274. <doc xml:space="preserve">Looks up a symbol in the current scope and return its value.
  21275. If the symbol is not bound in the current scope, %NULL is
  21276. returned.</doc>
  21277. <return-value transfer-ownership="none" nullable="1">
  21278. <doc xml:space="preserve">the value of @symbol in the current scope, or %NULL
  21279. if @symbol is not bound in the current scope</doc>
  21280. <type name="gpointer" c:type="gpointer"/>
  21281. </return-value>
  21282. <parameters>
  21283. <instance-parameter name="scanner" transfer-ownership="none">
  21284. <doc xml:space="preserve">a #GScanner</doc>
  21285. <type name="Scanner" c:type="GScanner*"/>
  21286. </instance-parameter>
  21287. <parameter name="symbol" transfer-ownership="none">
  21288. <doc xml:space="preserve">the symbol to look up</doc>
  21289. <type name="utf8" c:type="const gchar*"/>
  21290. </parameter>
  21291. </parameters>
  21292. </method>
  21293. <method name="peek_next_token" c:identifier="g_scanner_peek_next_token">
  21294. <doc xml:space="preserve">Parses the next token, without removing it from the input stream.
  21295. The token data is placed in the @next_token, @next_value, @next_line,
  21296. and @next_position fields of the #GScanner structure.
  21297. Note that, while the token is not removed from the input stream
  21298. (i.e. the next call to g_scanner_get_next_token() will return the
  21299. same token), it will not be reevaluated. This can lead to surprising
  21300. results when changing scope or the scanner configuration after peeking
  21301. the next token. Getting the next token after switching the scope or
  21302. configuration will return whatever was peeked before, regardless of
  21303. any symbols that may have been added or removed in the new scope.</doc>
  21304. <return-value transfer-ownership="none">
  21305. <doc xml:space="preserve">the type of the token</doc>
  21306. <type name="TokenType" c:type="GTokenType"/>
  21307. </return-value>
  21308. <parameters>
  21309. <instance-parameter name="scanner" transfer-ownership="none">
  21310. <doc xml:space="preserve">a #GScanner</doc>
  21311. <type name="Scanner" c:type="GScanner*"/>
  21312. </instance-parameter>
  21313. </parameters>
  21314. </method>
  21315. <method name="scope_add_symbol"
  21316. c:identifier="g_scanner_scope_add_symbol">
  21317. <doc xml:space="preserve">Adds a symbol to the given scope.</doc>
  21318. <return-value transfer-ownership="none">
  21319. <type name="none" c:type="void"/>
  21320. </return-value>
  21321. <parameters>
  21322. <instance-parameter name="scanner" transfer-ownership="none">
  21323. <doc xml:space="preserve">a #GScanner</doc>
  21324. <type name="Scanner" c:type="GScanner*"/>
  21325. </instance-parameter>
  21326. <parameter name="scope_id" transfer-ownership="none">
  21327. <doc xml:space="preserve">the scope id</doc>
  21328. <type name="guint" c:type="guint"/>
  21329. </parameter>
  21330. <parameter name="symbol" transfer-ownership="none">
  21331. <doc xml:space="preserve">the symbol to add</doc>
  21332. <type name="utf8" c:type="const gchar*"/>
  21333. </parameter>
  21334. <parameter name="value"
  21335. transfer-ownership="none"
  21336. nullable="1"
  21337. allow-none="1">
  21338. <doc xml:space="preserve">the value of the symbol</doc>
  21339. <type name="gpointer" c:type="gpointer"/>
  21340. </parameter>
  21341. </parameters>
  21342. </method>
  21343. <method name="scope_foreach_symbol"
  21344. c:identifier="g_scanner_scope_foreach_symbol"
  21345. introspectable="0">
  21346. <doc xml:space="preserve">Calls the given function for each of the symbol/value pairs
  21347. in the given scope of the #GScanner. The function is passed
  21348. the symbol and value of each pair, and the given @user_data
  21349. parameter.</doc>
  21350. <return-value transfer-ownership="none">
  21351. <type name="none" c:type="void"/>
  21352. </return-value>
  21353. <parameters>
  21354. <instance-parameter name="scanner" transfer-ownership="none">
  21355. <doc xml:space="preserve">a #GScanner</doc>
  21356. <type name="Scanner" c:type="GScanner*"/>
  21357. </instance-parameter>
  21358. <parameter name="scope_id" transfer-ownership="none">
  21359. <doc xml:space="preserve">the scope id</doc>
  21360. <type name="guint" c:type="guint"/>
  21361. </parameter>
  21362. <parameter name="func" transfer-ownership="none" closure="2">
  21363. <doc xml:space="preserve">the function to call for each symbol/value pair</doc>
  21364. <type name="HFunc" c:type="GHFunc"/>
  21365. </parameter>
  21366. <parameter name="user_data"
  21367. transfer-ownership="none"
  21368. nullable="1"
  21369. allow-none="1">
  21370. <doc xml:space="preserve">user data to pass to the function</doc>
  21371. <type name="gpointer" c:type="gpointer"/>
  21372. </parameter>
  21373. </parameters>
  21374. </method>
  21375. <method name="scope_lookup_symbol"
  21376. c:identifier="g_scanner_scope_lookup_symbol">
  21377. <doc xml:space="preserve">Looks up a symbol in a scope and return its value. If the
  21378. symbol is not bound in the scope, %NULL is returned.</doc>
  21379. <return-value transfer-ownership="none" nullable="1">
  21380. <doc xml:space="preserve">the value of @symbol in the given scope, or %NULL
  21381. if @symbol is not bound in the given scope.</doc>
  21382. <type name="gpointer" c:type="gpointer"/>
  21383. </return-value>
  21384. <parameters>
  21385. <instance-parameter name="scanner" transfer-ownership="none">
  21386. <doc xml:space="preserve">a #GScanner</doc>
  21387. <type name="Scanner" c:type="GScanner*"/>
  21388. </instance-parameter>
  21389. <parameter name="scope_id" transfer-ownership="none">
  21390. <doc xml:space="preserve">the scope id</doc>
  21391. <type name="guint" c:type="guint"/>
  21392. </parameter>
  21393. <parameter name="symbol" transfer-ownership="none">
  21394. <doc xml:space="preserve">the symbol to look up</doc>
  21395. <type name="utf8" c:type="const gchar*"/>
  21396. </parameter>
  21397. </parameters>
  21398. </method>
  21399. <method name="scope_remove_symbol"
  21400. c:identifier="g_scanner_scope_remove_symbol">
  21401. <doc xml:space="preserve">Removes a symbol from a scope.</doc>
  21402. <return-value transfer-ownership="none">
  21403. <type name="none" c:type="void"/>
  21404. </return-value>
  21405. <parameters>
  21406. <instance-parameter name="scanner" transfer-ownership="none">
  21407. <doc xml:space="preserve">a #GScanner</doc>
  21408. <type name="Scanner" c:type="GScanner*"/>
  21409. </instance-parameter>
  21410. <parameter name="scope_id" transfer-ownership="none">
  21411. <doc xml:space="preserve">the scope id</doc>
  21412. <type name="guint" c:type="guint"/>
  21413. </parameter>
  21414. <parameter name="symbol" transfer-ownership="none">
  21415. <doc xml:space="preserve">the symbol to remove</doc>
  21416. <type name="utf8" c:type="const gchar*"/>
  21417. </parameter>
  21418. </parameters>
  21419. </method>
  21420. <method name="set_scope" c:identifier="g_scanner_set_scope">
  21421. <doc xml:space="preserve">Sets the current scope.</doc>
  21422. <return-value transfer-ownership="none">
  21423. <doc xml:space="preserve">the old scope id</doc>
  21424. <type name="guint" c:type="guint"/>
  21425. </return-value>
  21426. <parameters>
  21427. <instance-parameter name="scanner" transfer-ownership="none">
  21428. <doc xml:space="preserve">a #GScanner</doc>
  21429. <type name="Scanner" c:type="GScanner*"/>
  21430. </instance-parameter>
  21431. <parameter name="scope_id" transfer-ownership="none">
  21432. <doc xml:space="preserve">the new scope id</doc>
  21433. <type name="guint" c:type="guint"/>
  21434. </parameter>
  21435. </parameters>
  21436. </method>
  21437. <method name="sync_file_offset"
  21438. c:identifier="g_scanner_sync_file_offset">
  21439. <doc xml:space="preserve">Rewinds the filedescriptor to the current buffer position
  21440. and blows the file read ahead buffer. This is useful for
  21441. third party uses of the scanners filedescriptor, which hooks
  21442. onto the current scanning position.</doc>
  21443. <return-value transfer-ownership="none">
  21444. <type name="none" c:type="void"/>
  21445. </return-value>
  21446. <parameters>
  21447. <instance-parameter name="scanner" transfer-ownership="none">
  21448. <doc xml:space="preserve">a #GScanner</doc>
  21449. <type name="Scanner" c:type="GScanner*"/>
  21450. </instance-parameter>
  21451. </parameters>
  21452. </method>
  21453. <method name="unexp_token" c:identifier="g_scanner_unexp_token">
  21454. <doc xml:space="preserve">Outputs a message through the scanner's msg_handler,
  21455. resulting from an unexpected token in the input stream.
  21456. Note that you should not call g_scanner_peek_next_token()
  21457. followed by g_scanner_unexp_token() without an intermediate
  21458. call to g_scanner_get_next_token(), as g_scanner_unexp_token()
  21459. evaluates the scanner's current token (not the peeked token)
  21460. to construct part of the message.</doc>
  21461. <return-value transfer-ownership="none">
  21462. <type name="none" c:type="void"/>
  21463. </return-value>
  21464. <parameters>
  21465. <instance-parameter name="scanner" transfer-ownership="none">
  21466. <doc xml:space="preserve">a #GScanner</doc>
  21467. <type name="Scanner" c:type="GScanner*"/>
  21468. </instance-parameter>
  21469. <parameter name="expected_token" transfer-ownership="none">
  21470. <doc xml:space="preserve">the expected token</doc>
  21471. <type name="TokenType" c:type="GTokenType"/>
  21472. </parameter>
  21473. <parameter name="identifier_spec" transfer-ownership="none">
  21474. <doc xml:space="preserve">a string describing how the scanner's user
  21475. refers to identifiers (%NULL defaults to "identifier").
  21476. This is used if @expected_token is %G_TOKEN_IDENTIFIER or
  21477. %G_TOKEN_IDENTIFIER_NULL.</doc>
  21478. <type name="utf8" c:type="const gchar*"/>
  21479. </parameter>
  21480. <parameter name="symbol_spec" transfer-ownership="none">
  21481. <doc xml:space="preserve">a string describing how the scanner's user refers
  21482. to symbols (%NULL defaults to "symbol"). This is used if
  21483. @expected_token is %G_TOKEN_SYMBOL or any token value greater
  21484. than %G_TOKEN_LAST.</doc>
  21485. <type name="utf8" c:type="const gchar*"/>
  21486. </parameter>
  21487. <parameter name="symbol_name" transfer-ownership="none">
  21488. <doc xml:space="preserve">the name of the symbol, if the scanner's current
  21489. token is a symbol.</doc>
  21490. <type name="utf8" c:type="const gchar*"/>
  21491. </parameter>
  21492. <parameter name="message" transfer-ownership="none">
  21493. <doc xml:space="preserve">a message string to output at the end of the
  21494. warning/error, or %NULL.</doc>
  21495. <type name="utf8" c:type="const gchar*"/>
  21496. </parameter>
  21497. <parameter name="is_error" transfer-ownership="none">
  21498. <doc xml:space="preserve">if %TRUE it is output as an error. If %FALSE it is
  21499. output as a warning.</doc>
  21500. <type name="gint" c:type="gint"/>
  21501. </parameter>
  21502. </parameters>
  21503. </method>
  21504. <method name="warn" c:identifier="g_scanner_warn" introspectable="0">
  21505. <doc xml:space="preserve">Outputs a warning message, via the #GScanner message handler.</doc>
  21506. <return-value transfer-ownership="none">
  21507. <type name="none" c:type="void"/>
  21508. </return-value>
  21509. <parameters>
  21510. <instance-parameter name="scanner" transfer-ownership="none">
  21511. <doc xml:space="preserve">a #GScanner</doc>
  21512. <type name="Scanner" c:type="GScanner*"/>
  21513. </instance-parameter>
  21514. <parameter name="format" transfer-ownership="none">
  21515. <doc xml:space="preserve">the message format. See the printf() documentation</doc>
  21516. <type name="utf8" c:type="const gchar*"/>
  21517. </parameter>
  21518. <parameter name="..." transfer-ownership="none">
  21519. <doc xml:space="preserve">the parameters to insert into the format string</doc>
  21520. <varargs/>
  21521. </parameter>
  21522. </parameters>
  21523. </method>
  21524. <function name="new" c:identifier="g_scanner_new" introspectable="0">
  21525. <doc xml:space="preserve">Creates a new #GScanner.
  21526. The @config_templ structure specifies the initial settings
  21527. of the scanner, which are copied into the #GScanner
  21528. @config field. If you pass %NULL then the default settings
  21529. are used.</doc>
  21530. <return-value>
  21531. <doc xml:space="preserve">the new #GScanner</doc>
  21532. <type name="Scanner" c:type="GScanner*"/>
  21533. </return-value>
  21534. <parameters>
  21535. <parameter name="config_templ" transfer-ownership="none">
  21536. <doc xml:space="preserve">the initial scanner settings</doc>
  21537. <type name="ScannerConfig" c:type="const GScannerConfig*"/>
  21538. </parameter>
  21539. </parameters>
  21540. </function>
  21541. </record>
  21542. <record name="ScannerConfig" c:type="GScannerConfig">
  21543. <doc xml:space="preserve">Specifies the #GScanner parser configuration. Most settings can
  21544. be changed during the parsing phase and will affect the lexical
  21545. parsing of the next unpeeked token.</doc>
  21546. <field name="cset_skip_characters" writable="1">
  21547. <doc xml:space="preserve">specifies which characters should be skipped
  21548. by the scanner (the default is the whitespace characters: space,
  21549. tab, carriage-return and line-feed).</doc>
  21550. <type name="utf8" c:type="gchar*"/>
  21551. </field>
  21552. <field name="cset_identifier_first" writable="1">
  21553. <doc xml:space="preserve">specifies the characters which can start
  21554. identifiers (the default is #G_CSET_a_2_z, "_", and #G_CSET_A_2_Z).</doc>
  21555. <type name="utf8" c:type="gchar*"/>
  21556. </field>
  21557. <field name="cset_identifier_nth" writable="1">
  21558. <doc xml:space="preserve">specifies the characters which can be used
  21559. in identifiers, after the first character (the default is
  21560. #G_CSET_a_2_z, "_0123456789", #G_CSET_A_2_Z, #G_CSET_LATINS,
  21561. #G_CSET_LATINC).</doc>
  21562. <type name="utf8" c:type="gchar*"/>
  21563. </field>
  21564. <field name="cpair_comment_single" writable="1">
  21565. <doc xml:space="preserve">specifies the characters at the start and
  21566. end of single-line comments. The default is "#\n" which means
  21567. that single-line comments start with a '#' and continue until
  21568. a '\n' (end of line).</doc>
  21569. <type name="utf8" c:type="gchar*"/>
  21570. </field>
  21571. <field name="case_sensitive" writable="1" bits="1">
  21572. <doc xml:space="preserve">specifies if symbols are case sensitive (the
  21573. default is %FALSE).</doc>
  21574. <type name="guint" c:type="guint"/>
  21575. </field>
  21576. <field name="skip_comment_multi" writable="1" bits="1">
  21577. <doc xml:space="preserve">specifies if multi-line comments are skipped
  21578. and not returned as tokens (the default is %TRUE).</doc>
  21579. <type name="guint" c:type="guint"/>
  21580. </field>
  21581. <field name="skip_comment_single" writable="1" bits="1">
  21582. <doc xml:space="preserve">specifies if single-line comments are skipped
  21583. and not returned as tokens (the default is %TRUE).</doc>
  21584. <type name="guint" c:type="guint"/>
  21585. </field>
  21586. <field name="scan_comment_multi" writable="1" bits="1">
  21587. <doc xml:space="preserve">specifies if multi-line comments are recognized
  21588. (the default is %TRUE).</doc>
  21589. <type name="guint" c:type="guint"/>
  21590. </field>
  21591. <field name="scan_identifier" writable="1" bits="1">
  21592. <doc xml:space="preserve">specifies if identifiers are recognized (the
  21593. default is %TRUE).</doc>
  21594. <type name="guint" c:type="guint"/>
  21595. </field>
  21596. <field name="scan_identifier_1char" writable="1" bits="1">
  21597. <doc xml:space="preserve">specifies if single-character
  21598. identifiers are recognized (the default is %FALSE).</doc>
  21599. <type name="guint" c:type="guint"/>
  21600. </field>
  21601. <field name="scan_identifier_NULL" writable="1" bits="1">
  21602. <doc xml:space="preserve">specifies if %NULL is reported as
  21603. %G_TOKEN_IDENTIFIER_NULL (the default is %FALSE).</doc>
  21604. <type name="guint" c:type="guint"/>
  21605. </field>
  21606. <field name="scan_symbols" writable="1" bits="1">
  21607. <doc xml:space="preserve">specifies if symbols are recognized (the default
  21608. is %TRUE).</doc>
  21609. <type name="guint" c:type="guint"/>
  21610. </field>
  21611. <field name="scan_binary" writable="1" bits="1">
  21612. <doc xml:space="preserve">specifies if binary numbers are recognized (the
  21613. default is %FALSE).</doc>
  21614. <type name="guint" c:type="guint"/>
  21615. </field>
  21616. <field name="scan_octal" writable="1" bits="1">
  21617. <doc xml:space="preserve">specifies if octal numbers are recognized (the
  21618. default is %TRUE).</doc>
  21619. <type name="guint" c:type="guint"/>
  21620. </field>
  21621. <field name="scan_float" writable="1" bits="1">
  21622. <doc xml:space="preserve">specifies if floating point numbers are recognized
  21623. (the default is %TRUE).</doc>
  21624. <type name="guint" c:type="guint"/>
  21625. </field>
  21626. <field name="scan_hex" writable="1" bits="1">
  21627. <doc xml:space="preserve">specifies if hexadecimal numbers are recognized (the
  21628. default is %TRUE).</doc>
  21629. <type name="guint" c:type="guint"/>
  21630. </field>
  21631. <field name="scan_hex_dollar" writable="1" bits="1">
  21632. <doc xml:space="preserve">specifies if '$' is recognized as a prefix for
  21633. hexadecimal numbers (the default is %FALSE).</doc>
  21634. <type name="guint" c:type="guint"/>
  21635. </field>
  21636. <field name="scan_string_sq" writable="1" bits="1">
  21637. <doc xml:space="preserve">specifies if strings can be enclosed in single
  21638. quotes (the default is %TRUE).</doc>
  21639. <type name="guint" c:type="guint"/>
  21640. </field>
  21641. <field name="scan_string_dq" writable="1" bits="1">
  21642. <doc xml:space="preserve">specifies if strings can be enclosed in double
  21643. quotes (the default is %TRUE).</doc>
  21644. <type name="guint" c:type="guint"/>
  21645. </field>
  21646. <field name="numbers_2_int" writable="1" bits="1">
  21647. <doc xml:space="preserve">specifies if binary, octal and hexadecimal numbers
  21648. are reported as #G_TOKEN_INT (the default is %TRUE).</doc>
  21649. <type name="guint" c:type="guint"/>
  21650. </field>
  21651. <field name="int_2_float" writable="1" bits="1">
  21652. <doc xml:space="preserve">specifies if all numbers are reported as %G_TOKEN_FLOAT
  21653. (the default is %FALSE).</doc>
  21654. <type name="guint" c:type="guint"/>
  21655. </field>
  21656. <field name="identifier_2_string" writable="1" bits="1">
  21657. <doc xml:space="preserve">specifies if identifiers are reported as strings
  21658. (the default is %FALSE).</doc>
  21659. <type name="guint" c:type="guint"/>
  21660. </field>
  21661. <field name="char_2_token" writable="1" bits="1">
  21662. <doc xml:space="preserve">specifies if characters are reported by setting
  21663. `token = ch` or as %G_TOKEN_CHAR (the default is %TRUE).</doc>
  21664. <type name="guint" c:type="guint"/>
  21665. </field>
  21666. <field name="symbol_2_token" writable="1" bits="1">
  21667. <doc xml:space="preserve">specifies if symbols are reported by setting
  21668. `token = v_symbol` or as %G_TOKEN_SYMBOL (the default is %FALSE).</doc>
  21669. <type name="guint" c:type="guint"/>
  21670. </field>
  21671. <field name="scope_0_fallback" writable="1" bits="1">
  21672. <doc xml:space="preserve">specifies if a symbol is searched for in the
  21673. default scope in addition to the current scope (the default is %FALSE).</doc>
  21674. <type name="guint" c:type="guint"/>
  21675. </field>
  21676. <field name="store_int64" writable="1" bits="1">
  21677. <doc xml:space="preserve">use value.v_int64 rather than v_int</doc>
  21678. <type name="guint" c:type="guint"/>
  21679. </field>
  21680. <field name="padding_dummy" readable="0" private="1">
  21681. <type name="guint" c:type="guint"/>
  21682. </field>
  21683. </record>
  21684. <callback name="ScannerMsgFunc" c:type="GScannerMsgFunc">
  21685. <doc xml:space="preserve">Specifies the type of the message handler function.</doc>
  21686. <return-value transfer-ownership="none">
  21687. <type name="none" c:type="void"/>
  21688. </return-value>
  21689. <parameters>
  21690. <parameter name="scanner" transfer-ownership="none">
  21691. <doc xml:space="preserve">a #GScanner</doc>
  21692. <type name="Scanner" c:type="GScanner*"/>
  21693. </parameter>
  21694. <parameter name="message" transfer-ownership="none">
  21695. <doc xml:space="preserve">the message</doc>
  21696. <type name="utf8" c:type="gchar*"/>
  21697. </parameter>
  21698. <parameter name="error" transfer-ownership="none">
  21699. <doc xml:space="preserve">%TRUE if the message signals an error,
  21700. %FALSE if it signals a warning.</doc>
  21701. <type name="gboolean" c:type="gboolean"/>
  21702. </parameter>
  21703. </parameters>
  21704. </callback>
  21705. <enumeration name="SeekType" c:type="GSeekType">
  21706. <doc xml:space="preserve">An enumeration specifying the base position for a
  21707. g_io_channel_seek_position() operation.</doc>
  21708. <member name="cur" value="0" c:identifier="G_SEEK_CUR">
  21709. <doc xml:space="preserve">the current position in the file.</doc>
  21710. </member>
  21711. <member name="set" value="1" c:identifier="G_SEEK_SET">
  21712. <doc xml:space="preserve">the start of the file.</doc>
  21713. </member>
  21714. <member name="end" value="2" c:identifier="G_SEEK_END">
  21715. <doc xml:space="preserve">the end of the file.</doc>
  21716. </member>
  21717. </enumeration>
  21718. <record name="Sequence" c:type="GSequence" disguised="1">
  21719. <doc xml:space="preserve">The #GSequence struct is an opaque data type representing a
  21720. [sequence][glib-Sequences] data type.</doc>
  21721. <method name="append"
  21722. c:identifier="g_sequence_append"
  21723. version="2.14"
  21724. introspectable="0">
  21725. <doc xml:space="preserve">Adds a new item to the end of @seq.</doc>
  21726. <return-value>
  21727. <doc xml:space="preserve">an iterator pointing to the new item</doc>
  21728. <type name="SequenceIter" c:type="GSequenceIter*"/>
  21729. </return-value>
  21730. <parameters>
  21731. <instance-parameter name="seq" transfer-ownership="none">
  21732. <doc xml:space="preserve">a #GSequence</doc>
  21733. <type name="Sequence" c:type="GSequence*"/>
  21734. </instance-parameter>
  21735. <parameter name="data"
  21736. transfer-ownership="none"
  21737. nullable="1"
  21738. allow-none="1">
  21739. <doc xml:space="preserve">the data for the new item</doc>
  21740. <type name="gpointer" c:type="gpointer"/>
  21741. </parameter>
  21742. </parameters>
  21743. </method>
  21744. <method name="foreach"
  21745. c:identifier="g_sequence_foreach"
  21746. version="2.14"
  21747. introspectable="0">
  21748. <doc xml:space="preserve">Calls @func for each item in the sequence passing @user_data
  21749. to the function.</doc>
  21750. <return-value transfer-ownership="none">
  21751. <type name="none" c:type="void"/>
  21752. </return-value>
  21753. <parameters>
  21754. <instance-parameter name="seq" transfer-ownership="none">
  21755. <doc xml:space="preserve">a #GSequence</doc>
  21756. <type name="Sequence" c:type="GSequence*"/>
  21757. </instance-parameter>
  21758. <parameter name="func" transfer-ownership="none" closure="1">
  21759. <doc xml:space="preserve">the function to call for each item in @seq</doc>
  21760. <type name="Func" c:type="GFunc"/>
  21761. </parameter>
  21762. <parameter name="user_data"
  21763. transfer-ownership="none"
  21764. nullable="1"
  21765. allow-none="1">
  21766. <doc xml:space="preserve">user data passed to @func</doc>
  21767. <type name="gpointer" c:type="gpointer"/>
  21768. </parameter>
  21769. </parameters>
  21770. </method>
  21771. <method name="free" c:identifier="g_sequence_free" version="2.14">
  21772. <doc xml:space="preserve">Frees the memory allocated for @seq. If @seq has a data destroy
  21773. function associated with it, that function is called on all items
  21774. in @seq.</doc>
  21775. <return-value transfer-ownership="none">
  21776. <type name="none" c:type="void"/>
  21777. </return-value>
  21778. <parameters>
  21779. <instance-parameter name="seq" transfer-ownership="none">
  21780. <doc xml:space="preserve">a #GSequence</doc>
  21781. <type name="Sequence" c:type="GSequence*"/>
  21782. </instance-parameter>
  21783. </parameters>
  21784. </method>
  21785. <method name="get_begin_iter"
  21786. c:identifier="g_sequence_get_begin_iter"
  21787. version="2.14"
  21788. introspectable="0">
  21789. <doc xml:space="preserve">Returns the begin iterator for @seq.</doc>
  21790. <return-value>
  21791. <doc xml:space="preserve">the begin iterator for @seq.</doc>
  21792. <type name="SequenceIter" c:type="GSequenceIter*"/>
  21793. </return-value>
  21794. <parameters>
  21795. <instance-parameter name="seq" transfer-ownership="none">
  21796. <doc xml:space="preserve">a #GSequence</doc>
  21797. <type name="Sequence" c:type="GSequence*"/>
  21798. </instance-parameter>
  21799. </parameters>
  21800. </method>
  21801. <method name="get_end_iter"
  21802. c:identifier="g_sequence_get_end_iter"
  21803. version="2.14"
  21804. introspectable="0">
  21805. <doc xml:space="preserve">Returns the end iterator for @seg</doc>
  21806. <return-value>
  21807. <doc xml:space="preserve">the end iterator for @seq</doc>
  21808. <type name="SequenceIter" c:type="GSequenceIter*"/>
  21809. </return-value>
  21810. <parameters>
  21811. <instance-parameter name="seq" transfer-ownership="none">
  21812. <doc xml:space="preserve">a #GSequence</doc>
  21813. <type name="Sequence" c:type="GSequence*"/>
  21814. </instance-parameter>
  21815. </parameters>
  21816. </method>
  21817. <method name="get_iter_at_pos"
  21818. c:identifier="g_sequence_get_iter_at_pos"
  21819. version="2.14"
  21820. introspectable="0">
  21821. <doc xml:space="preserve">Returns the iterator at position @pos. If @pos is negative or larger
  21822. than the number of items in @seq, the end iterator is returned.</doc>
  21823. <return-value>
  21824. <doc xml:space="preserve">The #GSequenceIter at position @pos</doc>
  21825. <type name="SequenceIter" c:type="GSequenceIter*"/>
  21826. </return-value>
  21827. <parameters>
  21828. <instance-parameter name="seq" transfer-ownership="none">
  21829. <doc xml:space="preserve">a #GSequence</doc>
  21830. <type name="Sequence" c:type="GSequence*"/>
  21831. </instance-parameter>
  21832. <parameter name="pos" transfer-ownership="none">
  21833. <doc xml:space="preserve">a position in @seq, or -1 for the end</doc>
  21834. <type name="gint" c:type="gint"/>
  21835. </parameter>
  21836. </parameters>
  21837. </method>
  21838. <method name="get_length"
  21839. c:identifier="g_sequence_get_length"
  21840. version="2.14">
  21841. <doc xml:space="preserve">Returns the length of @seq. Note that this method is O(h) where `h' is the
  21842. height of the tree. It is thus more efficient to use g_sequence_is_empty()
  21843. when comparing the length to zero.</doc>
  21844. <return-value transfer-ownership="none">
  21845. <doc xml:space="preserve">the length of @seq</doc>
  21846. <type name="gint" c:type="gint"/>
  21847. </return-value>
  21848. <parameters>
  21849. <instance-parameter name="seq" transfer-ownership="none">
  21850. <doc xml:space="preserve">a #GSequence</doc>
  21851. <type name="Sequence" c:type="GSequence*"/>
  21852. </instance-parameter>
  21853. </parameters>
  21854. </method>
  21855. <method name="insert_sorted"
  21856. c:identifier="g_sequence_insert_sorted"
  21857. version="2.14"
  21858. introspectable="0">
  21859. <doc xml:space="preserve">Inserts @data into @sequence using @func to determine the new
  21860. position. The sequence must already be sorted according to @cmp_func;
  21861. otherwise the new position of @data is undefined.
  21862. @cmp_func is called with two items of the @seq and @user_data.
  21863. It should return 0 if the items are equal, a negative value
  21864. if the first item comes before the second, and a positive value
  21865. if the second item comes before the first.</doc>
  21866. <return-value>
  21867. <doc xml:space="preserve">a #GSequenceIter pointing to the new item.</doc>
  21868. <type name="SequenceIter" c:type="GSequenceIter*"/>
  21869. </return-value>
  21870. <parameters>
  21871. <instance-parameter name="seq" transfer-ownership="none">
  21872. <doc xml:space="preserve">a #GSequence</doc>
  21873. <type name="Sequence" c:type="GSequence*"/>
  21874. </instance-parameter>
  21875. <parameter name="data"
  21876. transfer-ownership="none"
  21877. nullable="1"
  21878. allow-none="1">
  21879. <doc xml:space="preserve">the data to insert</doc>
  21880. <type name="gpointer" c:type="gpointer"/>
  21881. </parameter>
  21882. <parameter name="cmp_func" transfer-ownership="none" closure="2">
  21883. <doc xml:space="preserve">the function used to compare items in the sequence</doc>
  21884. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  21885. </parameter>
  21886. <parameter name="cmp_data"
  21887. transfer-ownership="none"
  21888. nullable="1"
  21889. allow-none="1">
  21890. <doc xml:space="preserve">user data passed to @cmp_func.</doc>
  21891. <type name="gpointer" c:type="gpointer"/>
  21892. </parameter>
  21893. </parameters>
  21894. </method>
  21895. <method name="insert_sorted_iter"
  21896. c:identifier="g_sequence_insert_sorted_iter"
  21897. version="2.14"
  21898. introspectable="0">
  21899. <doc xml:space="preserve">Like g_sequence_insert_sorted(), but uses
  21900. a #GSequenceIterCompareFunc instead of a #GCompareDataFunc as
  21901. the compare function.
  21902. @iter_cmp is called with two iterators pointing into @seq.
  21903. It should return 0 if the iterators are equal, a negative
  21904. value if the first iterator comes before the second, and a
  21905. positive value if the second iterator comes before the first.
  21906. It is called with two iterators pointing into @seq. It should
  21907. return 0 if the iterators are equal, a negative value if the
  21908. first iterator comes before the second, and a positive value
  21909. if the second iterator comes before the first.</doc>
  21910. <return-value>
  21911. <doc xml:space="preserve">a #GSequenceIter pointing to the new item</doc>
  21912. <type name="SequenceIter" c:type="GSequenceIter*"/>
  21913. </return-value>
  21914. <parameters>
  21915. <instance-parameter name="seq" transfer-ownership="none">
  21916. <doc xml:space="preserve">a #GSequence</doc>
  21917. <type name="Sequence" c:type="GSequence*"/>
  21918. </instance-parameter>
  21919. <parameter name="data"
  21920. transfer-ownership="none"
  21921. nullable="1"
  21922. allow-none="1">
  21923. <doc xml:space="preserve">data for the new item</doc>
  21924. <type name="gpointer" c:type="gpointer"/>
  21925. </parameter>
  21926. <parameter name="iter_cmp" transfer-ownership="none" closure="2">
  21927. <doc xml:space="preserve">the function used to compare iterators in the sequence</doc>
  21928. <type name="SequenceIterCompareFunc"
  21929. c:type="GSequenceIterCompareFunc"/>
  21930. </parameter>
  21931. <parameter name="cmp_data"
  21932. transfer-ownership="none"
  21933. nullable="1"
  21934. allow-none="1">
  21935. <doc xml:space="preserve">user data passed to @cmp_func</doc>
  21936. <type name="gpointer" c:type="gpointer"/>
  21937. </parameter>
  21938. </parameters>
  21939. </method>
  21940. <method name="is_empty"
  21941. c:identifier="g_sequence_is_empty"
  21942. version="2.48">
  21943. <doc xml:space="preserve">Returns %TRUE if the sequence contains zero items.
  21944. This function is functionally identical to checking the result of
  21945. g_sequence_get_length() being equal to zero. However this function is
  21946. implemented in O(1) running time.</doc>
  21947. <return-value transfer-ownership="none">
  21948. <doc xml:space="preserve">%TRUE if the sequence is empty, otherwise %FALSE.</doc>
  21949. <type name="gboolean" c:type="gboolean"/>
  21950. </return-value>
  21951. <parameters>
  21952. <instance-parameter name="seq" transfer-ownership="none">
  21953. <doc xml:space="preserve">a #GSequence</doc>
  21954. <type name="Sequence" c:type="GSequence*"/>
  21955. </instance-parameter>
  21956. </parameters>
  21957. </method>
  21958. <method name="lookup"
  21959. c:identifier="g_sequence_lookup"
  21960. version="2.28"
  21961. introspectable="0">
  21962. <doc xml:space="preserve">Returns an iterator pointing to the position of the first item found
  21963. equal to @data according to @cmp_func and @cmp_data. If more than one
  21964. item is equal, it is not guaranteed that it is the first which is
  21965. returned. In that case, you can use g_sequence_iter_next() and
  21966. g_sequence_iter_prev() to get others.
  21967. @cmp_func is called with two items of the @seq and @user_data.
  21968. It should return 0 if the items are equal, a negative value if
  21969. the first item comes before the second, and a positive value if
  21970. the second item comes before the first.
  21971. This function will fail if the data contained in the sequence is
  21972. unsorted. Use g_sequence_insert_sorted() or
  21973. g_sequence_insert_sorted_iter() to add data to your sequence or, if
  21974. you want to add a large amount of data, call g_sequence_sort() after
  21975. doing unsorted insertions.</doc>
  21976. <return-value>
  21977. <doc xml:space="preserve">an #GSequenceIter pointing to the position of the
  21978. first item found equal to @data according to @cmp_func and
  21979. @cmp_data, or %NULL if no such item exists</doc>
  21980. <type name="SequenceIter" c:type="GSequenceIter*"/>
  21981. </return-value>
  21982. <parameters>
  21983. <instance-parameter name="seq" transfer-ownership="none">
  21984. <doc xml:space="preserve">a #GSequence</doc>
  21985. <type name="Sequence" c:type="GSequence*"/>
  21986. </instance-parameter>
  21987. <parameter name="data"
  21988. transfer-ownership="none"
  21989. nullable="1"
  21990. allow-none="1">
  21991. <doc xml:space="preserve">data to lookup</doc>
  21992. <type name="gpointer" c:type="gpointer"/>
  21993. </parameter>
  21994. <parameter name="cmp_func" transfer-ownership="none" closure="2">
  21995. <doc xml:space="preserve">the function used to compare items in the sequence</doc>
  21996. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  21997. </parameter>
  21998. <parameter name="cmp_data"
  21999. transfer-ownership="none"
  22000. nullable="1"
  22001. allow-none="1">
  22002. <doc xml:space="preserve">user data passed to @cmp_func</doc>
  22003. <type name="gpointer" c:type="gpointer"/>
  22004. </parameter>
  22005. </parameters>
  22006. </method>
  22007. <method name="lookup_iter"
  22008. c:identifier="g_sequence_lookup_iter"
  22009. version="2.28"
  22010. introspectable="0">
  22011. <doc xml:space="preserve">Like g_sequence_lookup(), but uses a #GSequenceIterCompareFunc
  22012. instead of a #GCompareDataFunc as the compare function.
  22013. @iter_cmp is called with two iterators pointing into @seq.
  22014. It should return 0 if the iterators are equal, a negative value
  22015. if the first iterator comes before the second, and a positive
  22016. value if the second iterator comes before the first.
  22017. This function will fail if the data contained in the sequence is
  22018. unsorted. Use g_sequence_insert_sorted() or
  22019. g_sequence_insert_sorted_iter() to add data to your sequence or, if
  22020. you want to add a large amount of data, call g_sequence_sort() after
  22021. doing unsorted insertions.</doc>
  22022. <return-value>
  22023. <doc xml:space="preserve">an #GSequenceIter pointing to the position of
  22024. the first item found equal to @data according to @cmp_func
  22025. and @cmp_data, or %NULL if no such item exists</doc>
  22026. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22027. </return-value>
  22028. <parameters>
  22029. <instance-parameter name="seq" transfer-ownership="none">
  22030. <doc xml:space="preserve">a #GSequence</doc>
  22031. <type name="Sequence" c:type="GSequence*"/>
  22032. </instance-parameter>
  22033. <parameter name="data"
  22034. transfer-ownership="none"
  22035. nullable="1"
  22036. allow-none="1">
  22037. <doc xml:space="preserve">data to lookup</doc>
  22038. <type name="gpointer" c:type="gpointer"/>
  22039. </parameter>
  22040. <parameter name="iter_cmp" transfer-ownership="none" closure="2">
  22041. <doc xml:space="preserve">the function used to compare iterators in the sequence</doc>
  22042. <type name="SequenceIterCompareFunc"
  22043. c:type="GSequenceIterCompareFunc"/>
  22044. </parameter>
  22045. <parameter name="cmp_data"
  22046. transfer-ownership="none"
  22047. nullable="1"
  22048. allow-none="1">
  22049. <doc xml:space="preserve">user data passed to @iter_cmp</doc>
  22050. <type name="gpointer" c:type="gpointer"/>
  22051. </parameter>
  22052. </parameters>
  22053. </method>
  22054. <method name="prepend"
  22055. c:identifier="g_sequence_prepend"
  22056. version="2.14"
  22057. introspectable="0">
  22058. <doc xml:space="preserve">Adds a new item to the front of @seq</doc>
  22059. <return-value>
  22060. <doc xml:space="preserve">an iterator pointing to the new item</doc>
  22061. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22062. </return-value>
  22063. <parameters>
  22064. <instance-parameter name="seq" transfer-ownership="none">
  22065. <doc xml:space="preserve">a #GSequence</doc>
  22066. <type name="Sequence" c:type="GSequence*"/>
  22067. </instance-parameter>
  22068. <parameter name="data"
  22069. transfer-ownership="none"
  22070. nullable="1"
  22071. allow-none="1">
  22072. <doc xml:space="preserve">the data for the new item</doc>
  22073. <type name="gpointer" c:type="gpointer"/>
  22074. </parameter>
  22075. </parameters>
  22076. </method>
  22077. <method name="search"
  22078. c:identifier="g_sequence_search"
  22079. version="2.14"
  22080. introspectable="0">
  22081. <doc xml:space="preserve">Returns an iterator pointing to the position where @data would
  22082. be inserted according to @cmp_func and @cmp_data.
  22083. @cmp_func is called with two items of the @seq and @user_data.
  22084. It should return 0 if the items are equal, a negative value if
  22085. the first item comes before the second, and a positive value if
  22086. the second item comes before the first.
  22087. If you are simply searching for an existing element of the sequence,
  22088. consider using g_sequence_lookup().
  22089. This function will fail if the data contained in the sequence is
  22090. unsorted. Use g_sequence_insert_sorted() or
  22091. g_sequence_insert_sorted_iter() to add data to your sequence or, if
  22092. you want to add a large amount of data, call g_sequence_sort() after
  22093. doing unsorted insertions.</doc>
  22094. <return-value>
  22095. <doc xml:space="preserve">an #GSequenceIter pointing to the position where @data
  22096. would have been inserted according to @cmp_func and @cmp_data</doc>
  22097. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22098. </return-value>
  22099. <parameters>
  22100. <instance-parameter name="seq" transfer-ownership="none">
  22101. <doc xml:space="preserve">a #GSequence</doc>
  22102. <type name="Sequence" c:type="GSequence*"/>
  22103. </instance-parameter>
  22104. <parameter name="data"
  22105. transfer-ownership="none"
  22106. nullable="1"
  22107. allow-none="1">
  22108. <doc xml:space="preserve">data for the new item</doc>
  22109. <type name="gpointer" c:type="gpointer"/>
  22110. </parameter>
  22111. <parameter name="cmp_func" transfer-ownership="none" closure="2">
  22112. <doc xml:space="preserve">the function used to compare items in the sequence</doc>
  22113. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  22114. </parameter>
  22115. <parameter name="cmp_data"
  22116. transfer-ownership="none"
  22117. nullable="1"
  22118. allow-none="1">
  22119. <doc xml:space="preserve">user data passed to @cmp_func</doc>
  22120. <type name="gpointer" c:type="gpointer"/>
  22121. </parameter>
  22122. </parameters>
  22123. </method>
  22124. <method name="search_iter"
  22125. c:identifier="g_sequence_search_iter"
  22126. version="2.14"
  22127. introspectable="0">
  22128. <doc xml:space="preserve">Like g_sequence_search(), but uses a #GSequenceIterCompareFunc
  22129. instead of a #GCompareDataFunc as the compare function.
  22130. @iter_cmp is called with two iterators pointing into @seq.
  22131. It should return 0 if the iterators are equal, a negative value
  22132. if the first iterator comes before the second, and a positive
  22133. value if the second iterator comes before the first.
  22134. If you are simply searching for an existing element of the sequence,
  22135. consider using g_sequence_lookup_iter().
  22136. This function will fail if the data contained in the sequence is
  22137. unsorted. Use g_sequence_insert_sorted() or
  22138. g_sequence_insert_sorted_iter() to add data to your sequence or, if
  22139. you want to add a large amount of data, call g_sequence_sort() after
  22140. doing unsorted insertions.</doc>
  22141. <return-value>
  22142. <doc xml:space="preserve">a #GSequenceIter pointing to the position in @seq
  22143. where @data would have been inserted according to @iter_cmp
  22144. and @cmp_data</doc>
  22145. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22146. </return-value>
  22147. <parameters>
  22148. <instance-parameter name="seq" transfer-ownership="none">
  22149. <doc xml:space="preserve">a #GSequence</doc>
  22150. <type name="Sequence" c:type="GSequence*"/>
  22151. </instance-parameter>
  22152. <parameter name="data"
  22153. transfer-ownership="none"
  22154. nullable="1"
  22155. allow-none="1">
  22156. <doc xml:space="preserve">data for the new item</doc>
  22157. <type name="gpointer" c:type="gpointer"/>
  22158. </parameter>
  22159. <parameter name="iter_cmp" transfer-ownership="none" closure="2">
  22160. <doc xml:space="preserve">the function used to compare iterators in the sequence</doc>
  22161. <type name="SequenceIterCompareFunc"
  22162. c:type="GSequenceIterCompareFunc"/>
  22163. </parameter>
  22164. <parameter name="cmp_data"
  22165. transfer-ownership="none"
  22166. nullable="1"
  22167. allow-none="1">
  22168. <doc xml:space="preserve">user data passed to @iter_cmp</doc>
  22169. <type name="gpointer" c:type="gpointer"/>
  22170. </parameter>
  22171. </parameters>
  22172. </method>
  22173. <method name="sort"
  22174. c:identifier="g_sequence_sort"
  22175. version="2.14"
  22176. introspectable="0">
  22177. <doc xml:space="preserve">Sorts @seq using @cmp_func.
  22178. @cmp_func is passed two items of @seq and should
  22179. return 0 if they are equal, a negative value if the
  22180. first comes before the second, and a positive value
  22181. if the second comes before the first.</doc>
  22182. <return-value transfer-ownership="none">
  22183. <type name="none" c:type="void"/>
  22184. </return-value>
  22185. <parameters>
  22186. <instance-parameter name="seq" transfer-ownership="none">
  22187. <doc xml:space="preserve">a #GSequence</doc>
  22188. <type name="Sequence" c:type="GSequence*"/>
  22189. </instance-parameter>
  22190. <parameter name="cmp_func" transfer-ownership="none" closure="1">
  22191. <doc xml:space="preserve">the function used to sort the sequence</doc>
  22192. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  22193. </parameter>
  22194. <parameter name="cmp_data"
  22195. transfer-ownership="none"
  22196. nullable="1"
  22197. allow-none="1">
  22198. <doc xml:space="preserve">user data passed to @cmp_func</doc>
  22199. <type name="gpointer" c:type="gpointer"/>
  22200. </parameter>
  22201. </parameters>
  22202. </method>
  22203. <method name="sort_iter"
  22204. c:identifier="g_sequence_sort_iter"
  22205. version="2.14"
  22206. introspectable="0">
  22207. <doc xml:space="preserve">Like g_sequence_sort(), but uses a #GSequenceIterCompareFunc instead
  22208. of a GCompareDataFunc as the compare function
  22209. @cmp_func is called with two iterators pointing into @seq. It should
  22210. return 0 if the iterators are equal, a negative value if the first
  22211. iterator comes before the second, and a positive value if the second
  22212. iterator comes before the first.</doc>
  22213. <return-value transfer-ownership="none">
  22214. <type name="none" c:type="void"/>
  22215. </return-value>
  22216. <parameters>
  22217. <instance-parameter name="seq" transfer-ownership="none">
  22218. <doc xml:space="preserve">a #GSequence</doc>
  22219. <type name="Sequence" c:type="GSequence*"/>
  22220. </instance-parameter>
  22221. <parameter name="cmp_func" transfer-ownership="none" closure="1">
  22222. <doc xml:space="preserve">the function used to compare iterators in the sequence</doc>
  22223. <type name="SequenceIterCompareFunc"
  22224. c:type="GSequenceIterCompareFunc"/>
  22225. </parameter>
  22226. <parameter name="cmp_data"
  22227. transfer-ownership="none"
  22228. nullable="1"
  22229. allow-none="1">
  22230. <doc xml:space="preserve">user data passed to @cmp_func</doc>
  22231. <type name="gpointer" c:type="gpointer"/>
  22232. </parameter>
  22233. </parameters>
  22234. </method>
  22235. <function name="foreach_range"
  22236. c:identifier="g_sequence_foreach_range"
  22237. version="2.14"
  22238. introspectable="0">
  22239. <doc xml:space="preserve">Calls @func for each item in the range (@begin, @end) passing
  22240. @user_data to the function.</doc>
  22241. <return-value transfer-ownership="none">
  22242. <type name="none" c:type="void"/>
  22243. </return-value>
  22244. <parameters>
  22245. <parameter name="begin" transfer-ownership="none">
  22246. <doc xml:space="preserve">a #GSequenceIter</doc>
  22247. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22248. </parameter>
  22249. <parameter name="end" transfer-ownership="none">
  22250. <doc xml:space="preserve">a #GSequenceIter</doc>
  22251. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22252. </parameter>
  22253. <parameter name="func" transfer-ownership="none" closure="3">
  22254. <doc xml:space="preserve">a #GFunc</doc>
  22255. <type name="Func" c:type="GFunc"/>
  22256. </parameter>
  22257. <parameter name="user_data"
  22258. transfer-ownership="none"
  22259. nullable="1"
  22260. allow-none="1">
  22261. <doc xml:space="preserve">user data passed to @func</doc>
  22262. <type name="gpointer" c:type="gpointer"/>
  22263. </parameter>
  22264. </parameters>
  22265. </function>
  22266. <function name="get" c:identifier="g_sequence_get" version="2.14">
  22267. <doc xml:space="preserve">Returns the data that @iter points to.</doc>
  22268. <return-value transfer-ownership="none" nullable="1">
  22269. <doc xml:space="preserve">the data that @iter points to</doc>
  22270. <type name="gpointer" c:type="gpointer"/>
  22271. </return-value>
  22272. <parameters>
  22273. <parameter name="iter" transfer-ownership="none">
  22274. <doc xml:space="preserve">a #GSequenceIter</doc>
  22275. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22276. </parameter>
  22277. </parameters>
  22278. </function>
  22279. <function name="insert_before"
  22280. c:identifier="g_sequence_insert_before"
  22281. version="2.14"
  22282. introspectable="0">
  22283. <doc xml:space="preserve">Inserts a new item just before the item pointed to by @iter.</doc>
  22284. <return-value>
  22285. <doc xml:space="preserve">an iterator pointing to the new item</doc>
  22286. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22287. </return-value>
  22288. <parameters>
  22289. <parameter name="iter" transfer-ownership="none">
  22290. <doc xml:space="preserve">a #GSequenceIter</doc>
  22291. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22292. </parameter>
  22293. <parameter name="data"
  22294. transfer-ownership="none"
  22295. nullable="1"
  22296. allow-none="1">
  22297. <doc xml:space="preserve">the data for the new item</doc>
  22298. <type name="gpointer" c:type="gpointer"/>
  22299. </parameter>
  22300. </parameters>
  22301. </function>
  22302. <function name="move" c:identifier="g_sequence_move" version="2.14">
  22303. <doc xml:space="preserve">Moves the item pointed to by @src to the position indicated by @dest.
  22304. After calling this function @dest will point to the position immediately
  22305. after @src. It is allowed for @src and @dest to point into different
  22306. sequences.</doc>
  22307. <return-value transfer-ownership="none">
  22308. <type name="none" c:type="void"/>
  22309. </return-value>
  22310. <parameters>
  22311. <parameter name="src" transfer-ownership="none">
  22312. <doc xml:space="preserve">a #GSequenceIter pointing to the item to move</doc>
  22313. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22314. </parameter>
  22315. <parameter name="dest" transfer-ownership="none">
  22316. <doc xml:space="preserve">a #GSequenceIter pointing to the position to which
  22317. the item is moved</doc>
  22318. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22319. </parameter>
  22320. </parameters>
  22321. </function>
  22322. <function name="move_range"
  22323. c:identifier="g_sequence_move_range"
  22324. version="2.14">
  22325. <doc xml:space="preserve">Inserts the (@begin, @end) range at the destination pointed to by ptr.
  22326. The @begin and @end iters must point into the same sequence. It is
  22327. allowed for @dest to point to a different sequence than the one pointed
  22328. into by @begin and @end.
  22329. If @dest is NULL, the range indicated by @begin and @end is
  22330. removed from the sequence. If @dest iter points to a place within
  22331. the (@begin, @end) range, the range does not move.</doc>
  22332. <return-value transfer-ownership="none">
  22333. <type name="none" c:type="void"/>
  22334. </return-value>
  22335. <parameters>
  22336. <parameter name="dest" transfer-ownership="none">
  22337. <doc xml:space="preserve">a #GSequenceIter</doc>
  22338. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22339. </parameter>
  22340. <parameter name="begin" transfer-ownership="none">
  22341. <doc xml:space="preserve">a #GSequenceIter</doc>
  22342. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22343. </parameter>
  22344. <parameter name="end" transfer-ownership="none">
  22345. <doc xml:space="preserve">a #GSequenceIter</doc>
  22346. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22347. </parameter>
  22348. </parameters>
  22349. </function>
  22350. <function name="new"
  22351. c:identifier="g_sequence_new"
  22352. version="2.14"
  22353. introspectable="0">
  22354. <doc xml:space="preserve">Creates a new GSequence. The @data_destroy function, if non-%NULL will
  22355. be called on all items when the sequence is destroyed and on items that
  22356. are removed from the sequence.</doc>
  22357. <return-value>
  22358. <doc xml:space="preserve">a new #GSequence</doc>
  22359. <type name="Sequence" c:type="GSequence*"/>
  22360. </return-value>
  22361. <parameters>
  22362. <parameter name="data_destroy"
  22363. transfer-ownership="none"
  22364. nullable="1"
  22365. allow-none="1"
  22366. scope="async">
  22367. <doc xml:space="preserve">a #GDestroyNotify function, or %NULL</doc>
  22368. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  22369. </parameter>
  22370. </parameters>
  22371. </function>
  22372. <function name="range_get_midpoint"
  22373. c:identifier="g_sequence_range_get_midpoint"
  22374. version="2.14"
  22375. introspectable="0">
  22376. <doc xml:space="preserve">Finds an iterator somewhere in the range (@begin, @end). This
  22377. iterator will be close to the middle of the range, but is not
  22378. guaranteed to be exactly in the middle.
  22379. The @begin and @end iterators must both point to the same sequence
  22380. and @begin must come before or be equal to @end in the sequence.</doc>
  22381. <return-value>
  22382. <doc xml:space="preserve">a #GSequenceIter pointing somewhere in the
  22383. (@begin, @end) range</doc>
  22384. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22385. </return-value>
  22386. <parameters>
  22387. <parameter name="begin" transfer-ownership="none">
  22388. <doc xml:space="preserve">a #GSequenceIter</doc>
  22389. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22390. </parameter>
  22391. <parameter name="end" transfer-ownership="none">
  22392. <doc xml:space="preserve">a #GSequenceIter</doc>
  22393. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22394. </parameter>
  22395. </parameters>
  22396. </function>
  22397. <function name="remove" c:identifier="g_sequence_remove" version="2.14">
  22398. <doc xml:space="preserve">Removes the item pointed to by @iter. It is an error to pass the
  22399. end iterator to this function.
  22400. If the sequence has a data destroy function associated with it, this
  22401. function is called on the data for the removed item.</doc>
  22402. <return-value transfer-ownership="none">
  22403. <type name="none" c:type="void"/>
  22404. </return-value>
  22405. <parameters>
  22406. <parameter name="iter" transfer-ownership="none">
  22407. <doc xml:space="preserve">a #GSequenceIter</doc>
  22408. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22409. </parameter>
  22410. </parameters>
  22411. </function>
  22412. <function name="remove_range"
  22413. c:identifier="g_sequence_remove_range"
  22414. version="2.14">
  22415. <doc xml:space="preserve">Removes all items in the (@begin, @end) range.
  22416. If the sequence has a data destroy function associated with it, this
  22417. function is called on the data for the removed items.</doc>
  22418. <return-value transfer-ownership="none">
  22419. <type name="none" c:type="void"/>
  22420. </return-value>
  22421. <parameters>
  22422. <parameter name="begin" transfer-ownership="none">
  22423. <doc xml:space="preserve">a #GSequenceIter</doc>
  22424. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22425. </parameter>
  22426. <parameter name="end" transfer-ownership="none">
  22427. <doc xml:space="preserve">a #GSequenceIter</doc>
  22428. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22429. </parameter>
  22430. </parameters>
  22431. </function>
  22432. <function name="set" c:identifier="g_sequence_set" version="2.14">
  22433. <doc xml:space="preserve">Changes the data for the item pointed to by @iter to be @data. If
  22434. the sequence has a data destroy function associated with it, that
  22435. function is called on the existing data that @iter pointed to.</doc>
  22436. <return-value transfer-ownership="none">
  22437. <type name="none" c:type="void"/>
  22438. </return-value>
  22439. <parameters>
  22440. <parameter name="iter" transfer-ownership="none">
  22441. <doc xml:space="preserve">a #GSequenceIter</doc>
  22442. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22443. </parameter>
  22444. <parameter name="data"
  22445. transfer-ownership="none"
  22446. nullable="1"
  22447. allow-none="1">
  22448. <doc xml:space="preserve">new data for the item</doc>
  22449. <type name="gpointer" c:type="gpointer"/>
  22450. </parameter>
  22451. </parameters>
  22452. </function>
  22453. <function name="sort_changed"
  22454. c:identifier="g_sequence_sort_changed"
  22455. version="2.14"
  22456. introspectable="0">
  22457. <doc xml:space="preserve">Moves the data pointed to a new position as indicated by @cmp_func. This
  22458. function should be called for items in a sequence already sorted according
  22459. to @cmp_func whenever some aspect of an item changes so that @cmp_func
  22460. may return different values for that item.
  22461. @cmp_func is called with two items of the @seq and @user_data.
  22462. It should return 0 if the items are equal, a negative value if
  22463. the first item comes before the second, and a positive value if
  22464. the second item comes before the first.</doc>
  22465. <return-value transfer-ownership="none">
  22466. <type name="none" c:type="void"/>
  22467. </return-value>
  22468. <parameters>
  22469. <parameter name="iter" transfer-ownership="none">
  22470. <doc xml:space="preserve">A #GSequenceIter</doc>
  22471. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22472. </parameter>
  22473. <parameter name="cmp_func" transfer-ownership="none" closure="2">
  22474. <doc xml:space="preserve">the function used to compare items in the sequence</doc>
  22475. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  22476. </parameter>
  22477. <parameter name="cmp_data"
  22478. transfer-ownership="none"
  22479. nullable="1"
  22480. allow-none="1">
  22481. <doc xml:space="preserve">user data passed to @cmp_func.</doc>
  22482. <type name="gpointer" c:type="gpointer"/>
  22483. </parameter>
  22484. </parameters>
  22485. </function>
  22486. <function name="sort_changed_iter"
  22487. c:identifier="g_sequence_sort_changed_iter"
  22488. version="2.14"
  22489. introspectable="0">
  22490. <doc xml:space="preserve">Like g_sequence_sort_changed(), but uses
  22491. a #GSequenceIterCompareFunc instead of a #GCompareDataFunc as
  22492. the compare function.
  22493. @iter_cmp is called with two iterators pointing into @seq. It should
  22494. return 0 if the iterators are equal, a negative value if the first
  22495. iterator comes before the second, and a positive value if the second
  22496. iterator comes before the first.</doc>
  22497. <return-value transfer-ownership="none">
  22498. <type name="none" c:type="void"/>
  22499. </return-value>
  22500. <parameters>
  22501. <parameter name="iter" transfer-ownership="none">
  22502. <doc xml:space="preserve">a #GSequenceIter</doc>
  22503. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22504. </parameter>
  22505. <parameter name="iter_cmp" transfer-ownership="none" closure="2">
  22506. <doc xml:space="preserve">the function used to compare iterators in the sequence</doc>
  22507. <type name="SequenceIterCompareFunc"
  22508. c:type="GSequenceIterCompareFunc"/>
  22509. </parameter>
  22510. <parameter name="cmp_data"
  22511. transfer-ownership="none"
  22512. nullable="1"
  22513. allow-none="1">
  22514. <doc xml:space="preserve">user data passed to @cmp_func</doc>
  22515. <type name="gpointer" c:type="gpointer"/>
  22516. </parameter>
  22517. </parameters>
  22518. </function>
  22519. <function name="swap" c:identifier="g_sequence_swap" version="2.14">
  22520. <doc xml:space="preserve">Swaps the items pointed to by @a and @b. It is allowed for @a and @b
  22521. to point into difference sequences.</doc>
  22522. <return-value transfer-ownership="none">
  22523. <type name="none" c:type="void"/>
  22524. </return-value>
  22525. <parameters>
  22526. <parameter name="a" transfer-ownership="none">
  22527. <doc xml:space="preserve">a #GSequenceIter</doc>
  22528. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22529. </parameter>
  22530. <parameter name="b" transfer-ownership="none">
  22531. <doc xml:space="preserve">a #GSequenceIter</doc>
  22532. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22533. </parameter>
  22534. </parameters>
  22535. </function>
  22536. </record>
  22537. <record name="SequenceIter" c:type="GSequenceIter" disguised="1">
  22538. <doc xml:space="preserve">The #GSequenceIter struct is an opaque data type representing an
  22539. iterator pointing into a #GSequence.</doc>
  22540. <method name="compare"
  22541. c:identifier="g_sequence_iter_compare"
  22542. version="2.14">
  22543. <doc xml:space="preserve">Returns a negative number if @a comes before @b, 0 if they are equal,
  22544. and a positive number if @a comes after @b.
  22545. The @a and @b iterators must point into the same sequence.</doc>
  22546. <return-value transfer-ownership="none">
  22547. <doc xml:space="preserve">a negative number if @a comes before @b, 0 if they are
  22548. equal, and a positive number if @a comes after @b</doc>
  22549. <type name="gint" c:type="gint"/>
  22550. </return-value>
  22551. <parameters>
  22552. <instance-parameter name="a" transfer-ownership="none">
  22553. <doc xml:space="preserve">a #GSequenceIter</doc>
  22554. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22555. </instance-parameter>
  22556. <parameter name="b" transfer-ownership="none">
  22557. <doc xml:space="preserve">a #GSequenceIter</doc>
  22558. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22559. </parameter>
  22560. </parameters>
  22561. </method>
  22562. <method name="get_position"
  22563. c:identifier="g_sequence_iter_get_position"
  22564. version="2.14">
  22565. <doc xml:space="preserve">Returns the position of @iter</doc>
  22566. <return-value transfer-ownership="none">
  22567. <doc xml:space="preserve">the position of @iter</doc>
  22568. <type name="gint" c:type="gint"/>
  22569. </return-value>
  22570. <parameters>
  22571. <instance-parameter name="iter" transfer-ownership="none">
  22572. <doc xml:space="preserve">a #GSequenceIter</doc>
  22573. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22574. </instance-parameter>
  22575. </parameters>
  22576. </method>
  22577. <method name="get_sequence"
  22578. c:identifier="g_sequence_iter_get_sequence"
  22579. version="2.14"
  22580. introspectable="0">
  22581. <doc xml:space="preserve">Returns the #GSequence that @iter points into.</doc>
  22582. <return-value>
  22583. <doc xml:space="preserve">the #GSequence that @iter points into</doc>
  22584. <type name="Sequence" c:type="GSequence*"/>
  22585. </return-value>
  22586. <parameters>
  22587. <instance-parameter name="iter" transfer-ownership="none">
  22588. <doc xml:space="preserve">a #GSequenceIter</doc>
  22589. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22590. </instance-parameter>
  22591. </parameters>
  22592. </method>
  22593. <method name="is_begin"
  22594. c:identifier="g_sequence_iter_is_begin"
  22595. version="2.14">
  22596. <doc xml:space="preserve">Returns whether @iter is the begin iterator</doc>
  22597. <return-value transfer-ownership="none">
  22598. <doc xml:space="preserve">whether @iter is the begin iterator</doc>
  22599. <type name="gboolean" c:type="gboolean"/>
  22600. </return-value>
  22601. <parameters>
  22602. <instance-parameter name="iter" transfer-ownership="none">
  22603. <doc xml:space="preserve">a #GSequenceIter</doc>
  22604. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22605. </instance-parameter>
  22606. </parameters>
  22607. </method>
  22608. <method name="is_end"
  22609. c:identifier="g_sequence_iter_is_end"
  22610. version="2.14">
  22611. <doc xml:space="preserve">Returns whether @iter is the end iterator</doc>
  22612. <return-value transfer-ownership="none">
  22613. <doc xml:space="preserve">Whether @iter is the end iterator</doc>
  22614. <type name="gboolean" c:type="gboolean"/>
  22615. </return-value>
  22616. <parameters>
  22617. <instance-parameter name="iter" transfer-ownership="none">
  22618. <doc xml:space="preserve">a #GSequenceIter</doc>
  22619. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22620. </instance-parameter>
  22621. </parameters>
  22622. </method>
  22623. <method name="move"
  22624. c:identifier="g_sequence_iter_move"
  22625. version="2.14"
  22626. introspectable="0">
  22627. <doc xml:space="preserve">Returns the #GSequenceIter which is @delta positions away from @iter.
  22628. If @iter is closer than -@delta positions to the beginning of the sequence,
  22629. the begin iterator is returned. If @iter is closer than @delta positions
  22630. to the end of the sequence, the end iterator is returned.</doc>
  22631. <return-value>
  22632. <doc xml:space="preserve">a #GSequenceIter which is @delta positions away from @iter</doc>
  22633. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22634. </return-value>
  22635. <parameters>
  22636. <instance-parameter name="iter" transfer-ownership="none">
  22637. <doc xml:space="preserve">a #GSequenceIter</doc>
  22638. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22639. </instance-parameter>
  22640. <parameter name="delta" transfer-ownership="none">
  22641. <doc xml:space="preserve">A positive or negative number indicating how many positions away
  22642. from @iter the returned #GSequenceIter will be</doc>
  22643. <type name="gint" c:type="gint"/>
  22644. </parameter>
  22645. </parameters>
  22646. </method>
  22647. <method name="next"
  22648. c:identifier="g_sequence_iter_next"
  22649. version="2.14"
  22650. introspectable="0">
  22651. <doc xml:space="preserve">Returns an iterator pointing to the next position after @iter.
  22652. If @iter is the end iterator, the end iterator is returned.</doc>
  22653. <return-value>
  22654. <doc xml:space="preserve">a #GSequenceIter pointing to the next position after @iter</doc>
  22655. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22656. </return-value>
  22657. <parameters>
  22658. <instance-parameter name="iter" transfer-ownership="none">
  22659. <doc xml:space="preserve">a #GSequenceIter</doc>
  22660. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22661. </instance-parameter>
  22662. </parameters>
  22663. </method>
  22664. <method name="prev"
  22665. c:identifier="g_sequence_iter_prev"
  22666. version="2.14"
  22667. introspectable="0">
  22668. <doc xml:space="preserve">Returns an iterator pointing to the previous position before @iter.
  22669. If @iter is the begin iterator, the begin iterator is returned.</doc>
  22670. <return-value>
  22671. <doc xml:space="preserve">a #GSequenceIter pointing to the previous position
  22672. before @iter</doc>
  22673. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22674. </return-value>
  22675. <parameters>
  22676. <instance-parameter name="iter" transfer-ownership="none">
  22677. <doc xml:space="preserve">a #GSequenceIter</doc>
  22678. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22679. </instance-parameter>
  22680. </parameters>
  22681. </method>
  22682. </record>
  22683. <callback name="SequenceIterCompareFunc" c:type="GSequenceIterCompareFunc">
  22684. <doc xml:space="preserve">A #GSequenceIterCompareFunc is a function used to compare iterators.
  22685. It must return zero if the iterators compare equal, a negative value
  22686. if @a comes before @b, and a positive value if @b comes before @a.</doc>
  22687. <return-value transfer-ownership="none">
  22688. <doc xml:space="preserve">zero if the iterators are equal, a negative value if @a
  22689. comes before @b, and a positive value if @b comes before @a.</doc>
  22690. <type name="gint" c:type="gint"/>
  22691. </return-value>
  22692. <parameters>
  22693. <parameter name="a" transfer-ownership="none">
  22694. <doc xml:space="preserve">a #GSequenceIter</doc>
  22695. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22696. </parameter>
  22697. <parameter name="b" transfer-ownership="none">
  22698. <doc xml:space="preserve">a #GSequenceIter</doc>
  22699. <type name="SequenceIter" c:type="GSequenceIter*"/>
  22700. </parameter>
  22701. <parameter name="data"
  22702. transfer-ownership="none"
  22703. nullable="1"
  22704. allow-none="1">
  22705. <doc xml:space="preserve">user data</doc>
  22706. <type name="gpointer" c:type="gpointer"/>
  22707. </parameter>
  22708. </parameters>
  22709. </callback>
  22710. <enumeration name="ShellError"
  22711. c:type="GShellError"
  22712. glib:error-domain="g-shell-error-quark">
  22713. <doc xml:space="preserve">Error codes returned by shell functions.</doc>
  22714. <member name="bad_quoting"
  22715. value="0"
  22716. c:identifier="G_SHELL_ERROR_BAD_QUOTING">
  22717. <doc xml:space="preserve">Mismatched or otherwise mangled quoting.</doc>
  22718. </member>
  22719. <member name="empty_string"
  22720. value="1"
  22721. c:identifier="G_SHELL_ERROR_EMPTY_STRING">
  22722. <doc xml:space="preserve">String to be parsed was empty.</doc>
  22723. </member>
  22724. <member name="failed" value="2" c:identifier="G_SHELL_ERROR_FAILED">
  22725. <doc xml:space="preserve">Some other error.</doc>
  22726. </member>
  22727. </enumeration>
  22728. <enumeration name="SliceConfig" c:type="GSliceConfig">
  22729. <member name="always_malloc"
  22730. value="1"
  22731. c:identifier="G_SLICE_CONFIG_ALWAYS_MALLOC">
  22732. </member>
  22733. <member name="bypass_magazines"
  22734. value="2"
  22735. c:identifier="G_SLICE_CONFIG_BYPASS_MAGAZINES">
  22736. </member>
  22737. <member name="working_set_msecs"
  22738. value="3"
  22739. c:identifier="G_SLICE_CONFIG_WORKING_SET_MSECS">
  22740. </member>
  22741. <member name="color_increment"
  22742. value="4"
  22743. c:identifier="G_SLICE_CONFIG_COLOR_INCREMENT">
  22744. </member>
  22745. <member name="chunk_sizes"
  22746. value="5"
  22747. c:identifier="G_SLICE_CONFIG_CHUNK_SIZES">
  22748. </member>
  22749. <member name="contention_counter"
  22750. value="6"
  22751. c:identifier="G_SLICE_CONFIG_CONTENTION_COUNTER">
  22752. </member>
  22753. </enumeration>
  22754. <record name="Source"
  22755. c:type="GSource"
  22756. glib:type-name="GSource"
  22757. glib:get-type="g_source_get_type"
  22758. c:symbol-prefix="source">
  22759. <doc xml:space="preserve">The `GSource` struct is an opaque data type
  22760. representing an event source.</doc>
  22761. <field name="callback_data" readable="0" private="1">
  22762. <type name="gpointer" c:type="gpointer"/>
  22763. </field>
  22764. <field name="callback_funcs" readable="0" private="1">
  22765. <type name="SourceCallbackFuncs" c:type="GSourceCallbackFuncs*"/>
  22766. </field>
  22767. <field name="source_funcs" readable="0" private="1">
  22768. <type name="SourceFuncs" c:type="const GSourceFuncs*"/>
  22769. </field>
  22770. <field name="ref_count" readable="0" private="1">
  22771. <type name="guint" c:type="guint"/>
  22772. </field>
  22773. <field name="context" readable="0" private="1">
  22774. <type name="MainContext" c:type="GMainContext*"/>
  22775. </field>
  22776. <field name="priority" readable="0" private="1">
  22777. <type name="gint" c:type="gint"/>
  22778. </field>
  22779. <field name="flags" readable="0" private="1">
  22780. <type name="guint" c:type="guint"/>
  22781. </field>
  22782. <field name="source_id" readable="0" private="1">
  22783. <type name="guint" c:type="guint"/>
  22784. </field>
  22785. <field name="poll_fds" readable="0" private="1">
  22786. <type name="GLib.SList" c:type="GSList*">
  22787. <type name="gpointer" c:type="gpointer"/>
  22788. </type>
  22789. </field>
  22790. <field name="prev" readable="0" private="1">
  22791. <type name="Source" c:type="GSource*"/>
  22792. </field>
  22793. <field name="next" readable="0" private="1">
  22794. <type name="Source" c:type="GSource*"/>
  22795. </field>
  22796. <field name="name" readable="0" private="1">
  22797. <type name="utf8" c:type="char*"/>
  22798. </field>
  22799. <field name="priv" readable="0" private="1">
  22800. <type name="SourcePrivate" c:type="GSourcePrivate*"/>
  22801. </field>
  22802. <constructor name="new" c:identifier="g_source_new">
  22803. <doc xml:space="preserve">Creates a new #GSource structure. The size is specified to
  22804. allow creating structures derived from #GSource that contain
  22805. additional data. The size passed in must be at least
  22806. `sizeof (GSource)`.
  22807. The source will not initially be associated with any #GMainContext
  22808. and must be added to one with g_source_attach() before it will be
  22809. executed.</doc>
  22810. <return-value transfer-ownership="full">
  22811. <doc xml:space="preserve">the newly-created #GSource.</doc>
  22812. <type name="Source" c:type="GSource*"/>
  22813. </return-value>
  22814. <parameters>
  22815. <parameter name="source_funcs" transfer-ownership="none">
  22816. <doc xml:space="preserve">structure containing functions that implement
  22817. the sources behavior.</doc>
  22818. <type name="SourceFuncs" c:type="GSourceFuncs*"/>
  22819. </parameter>
  22820. <parameter name="struct_size" transfer-ownership="none">
  22821. <doc xml:space="preserve">size of the #GSource structure to create.</doc>
  22822. <type name="guint" c:type="guint"/>
  22823. </parameter>
  22824. </parameters>
  22825. </constructor>
  22826. <method name="add_child_source"
  22827. c:identifier="g_source_add_child_source"
  22828. version="2.28">
  22829. <doc xml:space="preserve">Adds @child_source to @source as a "polled" source; when @source is
  22830. added to a #GMainContext, @child_source will be automatically added
  22831. with the same priority, when @child_source is triggered, it will
  22832. cause @source to dispatch (in addition to calling its own
  22833. callback), and when @source is destroyed, it will destroy
  22834. @child_source as well. (@source will also still be dispatched if
  22835. its own prepare/check functions indicate that it is ready.)
  22836. If you don't need @child_source to do anything on its own when it
  22837. triggers, you can call g_source_set_dummy_callback() on it to set a
  22838. callback that does nothing (except return %TRUE if appropriate).
  22839. @source will hold a reference on @child_source while @child_source
  22840. is attached to it.
  22841. This API is only intended to be used by implementations of #GSource.
  22842. Do not call this API on a #GSource that you did not create.</doc>
  22843. <return-value transfer-ownership="none">
  22844. <type name="none" c:type="void"/>
  22845. </return-value>
  22846. <parameters>
  22847. <instance-parameter name="source" transfer-ownership="none">
  22848. <doc xml:space="preserve">a #GSource</doc>
  22849. <type name="Source" c:type="GSource*"/>
  22850. </instance-parameter>
  22851. <parameter name="child_source" transfer-ownership="none">
  22852. <doc xml:space="preserve">a second #GSource that @source should "poll"</doc>
  22853. <type name="Source" c:type="GSource*"/>
  22854. </parameter>
  22855. </parameters>
  22856. </method>
  22857. <method name="add_poll" c:identifier="g_source_add_poll">
  22858. <doc xml:space="preserve">Adds a file descriptor to the set of file descriptors polled for
  22859. this source. This is usually combined with g_source_new() to add an
  22860. event source. The event source's check function will typically test
  22861. the @revents field in the #GPollFD struct and return %TRUE if events need
  22862. to be processed.
  22863. This API is only intended to be used by implementations of #GSource.
  22864. Do not call this API on a #GSource that you did not create.
  22865. Using this API forces the linear scanning of event sources on each
  22866. main loop iteration. Newly-written event sources should try to use
  22867. g_source_add_unix_fd() instead of this API.</doc>
  22868. <return-value transfer-ownership="none">
  22869. <type name="none" c:type="void"/>
  22870. </return-value>
  22871. <parameters>
  22872. <instance-parameter name="source" transfer-ownership="none">
  22873. <doc xml:space="preserve">a #GSource</doc>
  22874. <type name="Source" c:type="GSource*"/>
  22875. </instance-parameter>
  22876. <parameter name="fd" transfer-ownership="none">
  22877. <doc xml:space="preserve">a #GPollFD structure holding information about a file
  22878. descriptor to watch.</doc>
  22879. <type name="PollFD" c:type="GPollFD*"/>
  22880. </parameter>
  22881. </parameters>
  22882. </method>
  22883. <method name="add_unix_fd"
  22884. c:identifier="g_source_add_unix_fd"
  22885. version="2.36">
  22886. <doc xml:space="preserve">Monitors @fd for the IO events in @events.
  22887. The tag returned by this function can be used to remove or modify the
  22888. monitoring of the fd using g_source_remove_unix_fd() or
  22889. g_source_modify_unix_fd().
  22890. It is not necessary to remove the fd before destroying the source; it
  22891. will be cleaned up automatically.
  22892. This API is only intended to be used by implementations of #GSource.
  22893. Do not call this API on a #GSource that you did not create.
  22894. As the name suggests, this function is not available on Windows.</doc>
  22895. <return-value transfer-ownership="none">
  22896. <doc xml:space="preserve">an opaque tag</doc>
  22897. <type name="gpointer" c:type="gpointer"/>
  22898. </return-value>
  22899. <parameters>
  22900. <instance-parameter name="source" transfer-ownership="none">
  22901. <doc xml:space="preserve">a #GSource</doc>
  22902. <type name="Source" c:type="GSource*"/>
  22903. </instance-parameter>
  22904. <parameter name="fd" transfer-ownership="none">
  22905. <doc xml:space="preserve">the fd to monitor</doc>
  22906. <type name="gint" c:type="gint"/>
  22907. </parameter>
  22908. <parameter name="events" transfer-ownership="none">
  22909. <doc xml:space="preserve">an event mask</doc>
  22910. <type name="IOCondition" c:type="GIOCondition"/>
  22911. </parameter>
  22912. </parameters>
  22913. </method>
  22914. <method name="attach" c:identifier="g_source_attach">
  22915. <doc xml:space="preserve">Adds a #GSource to a @context so that it will be executed within
  22916. that context. Remove it by calling g_source_destroy().</doc>
  22917. <return-value transfer-ownership="none">
  22918. <doc xml:space="preserve">the ID (greater than 0) for the source within the
  22919. #GMainContext.</doc>
  22920. <type name="guint" c:type="guint"/>
  22921. </return-value>
  22922. <parameters>
  22923. <instance-parameter name="source" transfer-ownership="none">
  22924. <doc xml:space="preserve">a #GSource</doc>
  22925. <type name="Source" c:type="GSource*"/>
  22926. </instance-parameter>
  22927. <parameter name="context"
  22928. transfer-ownership="none"
  22929. nullable="1"
  22930. allow-none="1">
  22931. <doc xml:space="preserve">a #GMainContext (if %NULL, the default context will be used)</doc>
  22932. <type name="MainContext" c:type="GMainContext*"/>
  22933. </parameter>
  22934. </parameters>
  22935. </method>
  22936. <method name="destroy" c:identifier="g_source_destroy">
  22937. <doc xml:space="preserve">Removes a source from its #GMainContext, if any, and mark it as
  22938. destroyed. The source cannot be subsequently added to another
  22939. context. It is safe to call this on sources which have already been
  22940. removed from their context.</doc>
  22941. <return-value transfer-ownership="none">
  22942. <type name="none" c:type="void"/>
  22943. </return-value>
  22944. <parameters>
  22945. <instance-parameter name="source" transfer-ownership="none">
  22946. <doc xml:space="preserve">a #GSource</doc>
  22947. <type name="Source" c:type="GSource*"/>
  22948. </instance-parameter>
  22949. </parameters>
  22950. </method>
  22951. <method name="get_can_recurse" c:identifier="g_source_get_can_recurse">
  22952. <doc xml:space="preserve">Checks whether a source is allowed to be called recursively.
  22953. see g_source_set_can_recurse().</doc>
  22954. <return-value transfer-ownership="none">
  22955. <doc xml:space="preserve">whether recursion is allowed.</doc>
  22956. <type name="gboolean" c:type="gboolean"/>
  22957. </return-value>
  22958. <parameters>
  22959. <instance-parameter name="source" transfer-ownership="none">
  22960. <doc xml:space="preserve">a #GSource</doc>
  22961. <type name="Source" c:type="GSource*"/>
  22962. </instance-parameter>
  22963. </parameters>
  22964. </method>
  22965. <method name="get_context" c:identifier="g_source_get_context">
  22966. <doc xml:space="preserve">Gets the #GMainContext with which the source is associated.
  22967. You can call this on a source that has been destroyed, provided
  22968. that the #GMainContext it was attached to still exists (in which
  22969. case it will return that #GMainContext). In particular, you can
  22970. always call this function on the source returned from
  22971. g_main_current_source(). But calling this function on a source
  22972. whose #GMainContext has been destroyed is an error.</doc>
  22973. <return-value transfer-ownership="none" nullable="1">
  22974. <doc xml:space="preserve">the #GMainContext with which the
  22975. source is associated, or %NULL if the context has not
  22976. yet been added to a source.</doc>
  22977. <type name="MainContext" c:type="GMainContext*"/>
  22978. </return-value>
  22979. <parameters>
  22980. <instance-parameter name="source" transfer-ownership="none">
  22981. <doc xml:space="preserve">a #GSource</doc>
  22982. <type name="Source" c:type="GSource*"/>
  22983. </instance-parameter>
  22984. </parameters>
  22985. </method>
  22986. <method name="get_current_time"
  22987. c:identifier="g_source_get_current_time"
  22988. deprecated="1"
  22989. deprecated-version="2.28">
  22990. <doc xml:space="preserve">This function ignores @source and is otherwise the same as
  22991. g_get_current_time().</doc>
  22992. <doc-deprecated xml:space="preserve">use g_source_get_time() instead</doc-deprecated>
  22993. <return-value transfer-ownership="none">
  22994. <type name="none" c:type="void"/>
  22995. </return-value>
  22996. <parameters>
  22997. <instance-parameter name="source" transfer-ownership="none">
  22998. <doc xml:space="preserve">a #GSource</doc>
  22999. <type name="Source" c:type="GSource*"/>
  23000. </instance-parameter>
  23001. <parameter name="timeval" transfer-ownership="none">
  23002. <doc xml:space="preserve">#GTimeVal structure in which to store current time.</doc>
  23003. <type name="TimeVal" c:type="GTimeVal*"/>
  23004. </parameter>
  23005. </parameters>
  23006. </method>
  23007. <method name="get_id" c:identifier="g_source_get_id">
  23008. <doc xml:space="preserve">Returns the numeric ID for a particular source. The ID of a source
  23009. is a positive integer which is unique within a particular main loop
  23010. context. The reverse
  23011. mapping from ID to source is done by g_main_context_find_source_by_id().</doc>
  23012. <return-value transfer-ownership="none">
  23013. <doc xml:space="preserve">the ID (greater than 0) for the source</doc>
  23014. <type name="guint" c:type="guint"/>
  23015. </return-value>
  23016. <parameters>
  23017. <instance-parameter name="source" transfer-ownership="none">
  23018. <doc xml:space="preserve">a #GSource</doc>
  23019. <type name="Source" c:type="GSource*"/>
  23020. </instance-parameter>
  23021. </parameters>
  23022. </method>
  23023. <method name="get_name" c:identifier="g_source_get_name" version="2.26">
  23024. <doc xml:space="preserve">Gets a name for the source, used in debugging and profiling. The
  23025. name may be #NULL if it has never been set with g_source_set_name().</doc>
  23026. <return-value transfer-ownership="none">
  23027. <doc xml:space="preserve">the name of the source</doc>
  23028. <type name="utf8" c:type="const char*"/>
  23029. </return-value>
  23030. <parameters>
  23031. <instance-parameter name="source" transfer-ownership="none">
  23032. <doc xml:space="preserve">a #GSource</doc>
  23033. <type name="Source" c:type="GSource*"/>
  23034. </instance-parameter>
  23035. </parameters>
  23036. </method>
  23037. <method name="get_priority" c:identifier="g_source_get_priority">
  23038. <doc xml:space="preserve">Gets the priority of a source.</doc>
  23039. <return-value transfer-ownership="none">
  23040. <doc xml:space="preserve">the priority of the source</doc>
  23041. <type name="gint" c:type="gint"/>
  23042. </return-value>
  23043. <parameters>
  23044. <instance-parameter name="source" transfer-ownership="none">
  23045. <doc xml:space="preserve">a #GSource</doc>
  23046. <type name="Source" c:type="GSource*"/>
  23047. </instance-parameter>
  23048. </parameters>
  23049. </method>
  23050. <method name="get_ready_time" c:identifier="g_source_get_ready_time">
  23051. <doc xml:space="preserve">Gets the "ready time" of @source, as set by
  23052. g_source_set_ready_time().
  23053. Any time before the current monotonic time (including 0) is an
  23054. indication that the source will fire immediately.</doc>
  23055. <return-value transfer-ownership="none">
  23056. <doc xml:space="preserve">the monotonic ready time, -1 for "never"</doc>
  23057. <type name="gint64" c:type="gint64"/>
  23058. </return-value>
  23059. <parameters>
  23060. <instance-parameter name="source" transfer-ownership="none">
  23061. <doc xml:space="preserve">a #GSource</doc>
  23062. <type name="Source" c:type="GSource*"/>
  23063. </instance-parameter>
  23064. </parameters>
  23065. </method>
  23066. <method name="get_time" c:identifier="g_source_get_time" version="2.28">
  23067. <doc xml:space="preserve">Gets the time to be used when checking this source. The advantage of
  23068. calling this function over calling g_get_monotonic_time() directly is
  23069. that when checking multiple sources, GLib can cache a single value
  23070. instead of having to repeatedly get the system monotonic time.
  23071. The time here is the system monotonic time, if available, or some
  23072. other reasonable alternative otherwise. See g_get_monotonic_time().</doc>
  23073. <return-value transfer-ownership="none">
  23074. <doc xml:space="preserve">the monotonic time in microseconds</doc>
  23075. <type name="gint64" c:type="gint64"/>
  23076. </return-value>
  23077. <parameters>
  23078. <instance-parameter name="source" transfer-ownership="none">
  23079. <doc xml:space="preserve">a #GSource</doc>
  23080. <type name="Source" c:type="GSource*"/>
  23081. </instance-parameter>
  23082. </parameters>
  23083. </method>
  23084. <method name="is_destroyed"
  23085. c:identifier="g_source_is_destroyed"
  23086. version="2.12">
  23087. <doc xml:space="preserve">Returns whether @source has been destroyed.
  23088. This is important when you operate upon your objects
  23089. from within idle handlers, but may have freed the object
  23090. before the dispatch of your idle handler.
  23091. |[&lt;!-- language="C" --&gt;
  23092. static gboolean
  23093. idle_callback (gpointer data)
  23094. {
  23095. SomeWidget *self = data;
  23096. GDK_THREADS_ENTER ();
  23097. // do stuff with self
  23098. self-&gt;idle_id = 0;
  23099. GDK_THREADS_LEAVE ();
  23100. return G_SOURCE_REMOVE;
  23101. }
  23102. static void
  23103. some_widget_do_stuff_later (SomeWidget *self)
  23104. {
  23105. self-&gt;idle_id = g_idle_add (idle_callback, self);
  23106. }
  23107. static void
  23108. some_widget_finalize (GObject *object)
  23109. {
  23110. SomeWidget *self = SOME_WIDGET (object);
  23111. if (self-&gt;idle_id)
  23112. g_source_remove (self-&gt;idle_id);
  23113. G_OBJECT_CLASS (parent_class)-&gt;finalize (object);
  23114. }
  23115. ]|
  23116. This will fail in a multi-threaded application if the
  23117. widget is destroyed before the idle handler fires due
  23118. to the use after free in the callback. A solution, to
  23119. this particular problem, is to check to if the source
  23120. has already been destroy within the callback.
  23121. |[&lt;!-- language="C" --&gt;
  23122. static gboolean
  23123. idle_callback (gpointer data)
  23124. {
  23125. SomeWidget *self = data;
  23126. GDK_THREADS_ENTER ();
  23127. if (!g_source_is_destroyed (g_main_current_source ()))
  23128. {
  23129. // do stuff with self
  23130. }
  23131. GDK_THREADS_LEAVE ();
  23132. return FALSE;
  23133. }
  23134. ]|</doc>
  23135. <return-value transfer-ownership="none">
  23136. <doc xml:space="preserve">%TRUE if the source has been destroyed</doc>
  23137. <type name="gboolean" c:type="gboolean"/>
  23138. </return-value>
  23139. <parameters>
  23140. <instance-parameter name="source" transfer-ownership="none">
  23141. <doc xml:space="preserve">a #GSource</doc>
  23142. <type name="Source" c:type="GSource*"/>
  23143. </instance-parameter>
  23144. </parameters>
  23145. </method>
  23146. <method name="modify_unix_fd"
  23147. c:identifier="g_source_modify_unix_fd"
  23148. version="2.36">
  23149. <doc xml:space="preserve">Updates the event mask to watch for the fd identified by @tag.
  23150. @tag is the tag returned from g_source_add_unix_fd().
  23151. If you want to remove a fd, don't set its event mask to zero.
  23152. Instead, call g_source_remove_unix_fd().
  23153. This API is only intended to be used by implementations of #GSource.
  23154. Do not call this API on a #GSource that you did not create.
  23155. As the name suggests, this function is not available on Windows.</doc>
  23156. <return-value transfer-ownership="none">
  23157. <type name="none" c:type="void"/>
  23158. </return-value>
  23159. <parameters>
  23160. <instance-parameter name="source" transfer-ownership="none">
  23161. <doc xml:space="preserve">a #GSource</doc>
  23162. <type name="Source" c:type="GSource*"/>
  23163. </instance-parameter>
  23164. <parameter name="tag" transfer-ownership="none">
  23165. <doc xml:space="preserve">the tag from g_source_add_unix_fd()</doc>
  23166. <type name="gpointer" c:type="gpointer"/>
  23167. </parameter>
  23168. <parameter name="new_events" transfer-ownership="none">
  23169. <doc xml:space="preserve">the new event mask to watch</doc>
  23170. <type name="IOCondition" c:type="GIOCondition"/>
  23171. </parameter>
  23172. </parameters>
  23173. </method>
  23174. <method name="query_unix_fd"
  23175. c:identifier="g_source_query_unix_fd"
  23176. version="2.36">
  23177. <doc xml:space="preserve">Queries the events reported for the fd corresponding to @tag on
  23178. @source during the last poll.
  23179. The return value of this function is only defined when the function
  23180. is called from the check or dispatch functions for @source.
  23181. This API is only intended to be used by implementations of #GSource.
  23182. Do not call this API on a #GSource that you did not create.
  23183. As the name suggests, this function is not available on Windows.</doc>
  23184. <return-value transfer-ownership="none">
  23185. <doc xml:space="preserve">the conditions reported on the fd</doc>
  23186. <type name="IOCondition" c:type="GIOCondition"/>
  23187. </return-value>
  23188. <parameters>
  23189. <instance-parameter name="source" transfer-ownership="none">
  23190. <doc xml:space="preserve">a #GSource</doc>
  23191. <type name="Source" c:type="GSource*"/>
  23192. </instance-parameter>
  23193. <parameter name="tag" transfer-ownership="none">
  23194. <doc xml:space="preserve">the tag from g_source_add_unix_fd()</doc>
  23195. <type name="gpointer" c:type="gpointer"/>
  23196. </parameter>
  23197. </parameters>
  23198. </method>
  23199. <method name="ref" c:identifier="g_source_ref">
  23200. <doc xml:space="preserve">Increases the reference count on a source by one.</doc>
  23201. <return-value transfer-ownership="full">
  23202. <doc xml:space="preserve">@source</doc>
  23203. <type name="Source" c:type="GSource*"/>
  23204. </return-value>
  23205. <parameters>
  23206. <instance-parameter name="source" transfer-ownership="none">
  23207. <doc xml:space="preserve">a #GSource</doc>
  23208. <type name="Source" c:type="GSource*"/>
  23209. </instance-parameter>
  23210. </parameters>
  23211. </method>
  23212. <method name="remove_child_source"
  23213. c:identifier="g_source_remove_child_source"
  23214. version="2.28">
  23215. <doc xml:space="preserve">Detaches @child_source from @source and destroys it.
  23216. This API is only intended to be used by implementations of #GSource.
  23217. Do not call this API on a #GSource that you did not create.</doc>
  23218. <return-value transfer-ownership="none">
  23219. <type name="none" c:type="void"/>
  23220. </return-value>
  23221. <parameters>
  23222. <instance-parameter name="source" transfer-ownership="none">
  23223. <doc xml:space="preserve">a #GSource</doc>
  23224. <type name="Source" c:type="GSource*"/>
  23225. </instance-parameter>
  23226. <parameter name="child_source" transfer-ownership="none">
  23227. <doc xml:space="preserve">a #GSource previously passed to
  23228. g_source_add_child_source().</doc>
  23229. <type name="Source" c:type="GSource*"/>
  23230. </parameter>
  23231. </parameters>
  23232. </method>
  23233. <method name="remove_poll" c:identifier="g_source_remove_poll">
  23234. <doc xml:space="preserve">Removes a file descriptor from the set of file descriptors polled for
  23235. this source.
  23236. This API is only intended to be used by implementations of #GSource.
  23237. Do not call this API on a #GSource that you did not create.</doc>
  23238. <return-value transfer-ownership="none">
  23239. <type name="none" c:type="void"/>
  23240. </return-value>
  23241. <parameters>
  23242. <instance-parameter name="source" transfer-ownership="none">
  23243. <doc xml:space="preserve">a #GSource</doc>
  23244. <type name="Source" c:type="GSource*"/>
  23245. </instance-parameter>
  23246. <parameter name="fd" transfer-ownership="none">
  23247. <doc xml:space="preserve">a #GPollFD structure previously passed to g_source_add_poll().</doc>
  23248. <type name="PollFD" c:type="GPollFD*"/>
  23249. </parameter>
  23250. </parameters>
  23251. </method>
  23252. <method name="remove_unix_fd"
  23253. c:identifier="g_source_remove_unix_fd"
  23254. version="2.36">
  23255. <doc xml:space="preserve">Reverses the effect of a previous call to g_source_add_unix_fd().
  23256. You only need to call this if you want to remove an fd from being
  23257. watched while keeping the same source around. In the normal case you
  23258. will just want to destroy the source.
  23259. This API is only intended to be used by implementations of #GSource.
  23260. Do not call this API on a #GSource that you did not create.
  23261. As the name suggests, this function is not available on Windows.</doc>
  23262. <return-value transfer-ownership="none">
  23263. <type name="none" c:type="void"/>
  23264. </return-value>
  23265. <parameters>
  23266. <instance-parameter name="source" transfer-ownership="none">
  23267. <doc xml:space="preserve">a #GSource</doc>
  23268. <type name="Source" c:type="GSource*"/>
  23269. </instance-parameter>
  23270. <parameter name="tag" transfer-ownership="none">
  23271. <doc xml:space="preserve">the tag from g_source_add_unix_fd()</doc>
  23272. <type name="gpointer" c:type="gpointer"/>
  23273. </parameter>
  23274. </parameters>
  23275. </method>
  23276. <method name="set_callback" c:identifier="g_source_set_callback">
  23277. <doc xml:space="preserve">Sets the callback function for a source. The callback for a source is
  23278. called from the source's dispatch function.
  23279. The exact type of @func depends on the type of source; ie. you
  23280. should not count on @func being called with @data as its first
  23281. parameter.
  23282. See [memory management of sources][mainloop-memory-management] for details
  23283. on how to handle memory management of @data.
  23284. Typically, you won't use this function. Instead use functions specific
  23285. to the type of source you are using.</doc>
  23286. <return-value transfer-ownership="none">
  23287. <type name="none" c:type="void"/>
  23288. </return-value>
  23289. <parameters>
  23290. <instance-parameter name="source" transfer-ownership="none">
  23291. <doc xml:space="preserve">the source</doc>
  23292. <type name="Source" c:type="GSource*"/>
  23293. </instance-parameter>
  23294. <parameter name="func"
  23295. transfer-ownership="none"
  23296. scope="notified"
  23297. closure="1"
  23298. destroy="2">
  23299. <doc xml:space="preserve">a callback function</doc>
  23300. <type name="SourceFunc" c:type="GSourceFunc"/>
  23301. </parameter>
  23302. <parameter name="data"
  23303. transfer-ownership="none"
  23304. nullable="1"
  23305. allow-none="1">
  23306. <doc xml:space="preserve">the data to pass to callback function</doc>
  23307. <type name="gpointer" c:type="gpointer"/>
  23308. </parameter>
  23309. <parameter name="notify"
  23310. transfer-ownership="none"
  23311. nullable="1"
  23312. allow-none="1"
  23313. scope="async">
  23314. <doc xml:space="preserve">a function to call when @data is no longer in use, or %NULL.</doc>
  23315. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  23316. </parameter>
  23317. </parameters>
  23318. </method>
  23319. <method name="set_callback_indirect"
  23320. c:identifier="g_source_set_callback_indirect">
  23321. <doc xml:space="preserve">Sets the callback function storing the data as a refcounted callback
  23322. "object". This is used internally. Note that calling
  23323. g_source_set_callback_indirect() assumes
  23324. an initial reference count on @callback_data, and thus
  23325. @callback_funcs-&gt;unref will eventually be called once more
  23326. than @callback_funcs-&gt;ref.</doc>
  23327. <return-value transfer-ownership="none">
  23328. <type name="none" c:type="void"/>
  23329. </return-value>
  23330. <parameters>
  23331. <instance-parameter name="source" transfer-ownership="none">
  23332. <doc xml:space="preserve">the source</doc>
  23333. <type name="Source" c:type="GSource*"/>
  23334. </instance-parameter>
  23335. <parameter name="callback_data"
  23336. transfer-ownership="none"
  23337. nullable="1"
  23338. allow-none="1">
  23339. <doc xml:space="preserve">pointer to callback data "object"</doc>
  23340. <type name="gpointer" c:type="gpointer"/>
  23341. </parameter>
  23342. <parameter name="callback_funcs" transfer-ownership="none">
  23343. <doc xml:space="preserve">functions for reference counting @callback_data
  23344. and getting the callback and data</doc>
  23345. <type name="SourceCallbackFuncs" c:type="GSourceCallbackFuncs*"/>
  23346. </parameter>
  23347. </parameters>
  23348. </method>
  23349. <method name="set_can_recurse" c:identifier="g_source_set_can_recurse">
  23350. <doc xml:space="preserve">Sets whether a source can be called recursively. If @can_recurse is
  23351. %TRUE, then while the source is being dispatched then this source
  23352. will be processed normally. Otherwise, all processing of this
  23353. source is blocked until the dispatch function returns.</doc>
  23354. <return-value transfer-ownership="none">
  23355. <type name="none" c:type="void"/>
  23356. </return-value>
  23357. <parameters>
  23358. <instance-parameter name="source" transfer-ownership="none">
  23359. <doc xml:space="preserve">a #GSource</doc>
  23360. <type name="Source" c:type="GSource*"/>
  23361. </instance-parameter>
  23362. <parameter name="can_recurse" transfer-ownership="none">
  23363. <doc xml:space="preserve">whether recursion is allowed for this source</doc>
  23364. <type name="gboolean" c:type="gboolean"/>
  23365. </parameter>
  23366. </parameters>
  23367. </method>
  23368. <method name="set_funcs"
  23369. c:identifier="g_source_set_funcs"
  23370. version="2.12">
  23371. <doc xml:space="preserve">Sets the source functions (can be used to override
  23372. default implementations) of an unattached source.</doc>
  23373. <return-value transfer-ownership="none">
  23374. <type name="none" c:type="void"/>
  23375. </return-value>
  23376. <parameters>
  23377. <instance-parameter name="source" transfer-ownership="none">
  23378. <doc xml:space="preserve">a #GSource</doc>
  23379. <type name="Source" c:type="GSource*"/>
  23380. </instance-parameter>
  23381. <parameter name="funcs" transfer-ownership="none">
  23382. <doc xml:space="preserve">the new #GSourceFuncs</doc>
  23383. <type name="SourceFuncs" c:type="GSourceFuncs*"/>
  23384. </parameter>
  23385. </parameters>
  23386. </method>
  23387. <method name="set_name" c:identifier="g_source_set_name" version="2.26">
  23388. <doc xml:space="preserve">Sets a name for the source, used in debugging and profiling.
  23389. The name defaults to #NULL.
  23390. The source name should describe in a human-readable way
  23391. what the source does. For example, "X11 event queue"
  23392. or "GTK+ repaint idle handler" or whatever it is.
  23393. It is permitted to call this function multiple times, but is not
  23394. recommended due to the potential performance impact. For example,
  23395. one could change the name in the "check" function of a #GSourceFuncs
  23396. to include details like the event type in the source name.
  23397. Use caution if changing the name while another thread may be
  23398. accessing it with g_source_get_name(); that function does not copy
  23399. the value, and changing the value will free it while the other thread
  23400. may be attempting to use it.</doc>
  23401. <return-value transfer-ownership="none">
  23402. <type name="none" c:type="void"/>
  23403. </return-value>
  23404. <parameters>
  23405. <instance-parameter name="source" transfer-ownership="none">
  23406. <doc xml:space="preserve">a #GSource</doc>
  23407. <type name="Source" c:type="GSource*"/>
  23408. </instance-parameter>
  23409. <parameter name="name" transfer-ownership="none">
  23410. <doc xml:space="preserve">debug name for the source</doc>
  23411. <type name="utf8" c:type="const char*"/>
  23412. </parameter>
  23413. </parameters>
  23414. </method>
  23415. <method name="set_priority" c:identifier="g_source_set_priority">
  23416. <doc xml:space="preserve">Sets the priority of a source. While the main loop is being run, a
  23417. source will be dispatched if it is ready to be dispatched and no
  23418. sources at a higher (numerically smaller) priority are ready to be
  23419. dispatched.
  23420. A child source always has the same priority as its parent. It is not
  23421. permitted to change the priority of a source once it has been added
  23422. as a child of another source.</doc>
  23423. <return-value transfer-ownership="none">
  23424. <type name="none" c:type="void"/>
  23425. </return-value>
  23426. <parameters>
  23427. <instance-parameter name="source" transfer-ownership="none">
  23428. <doc xml:space="preserve">a #GSource</doc>
  23429. <type name="Source" c:type="GSource*"/>
  23430. </instance-parameter>
  23431. <parameter name="priority" transfer-ownership="none">
  23432. <doc xml:space="preserve">the new priority.</doc>
  23433. <type name="gint" c:type="gint"/>
  23434. </parameter>
  23435. </parameters>
  23436. </method>
  23437. <method name="set_ready_time"
  23438. c:identifier="g_source_set_ready_time"
  23439. version="2.36">
  23440. <doc xml:space="preserve">Sets a #GSource to be dispatched when the given monotonic time is
  23441. reached (or passed). If the monotonic time is in the past (as it
  23442. always will be if @ready_time is 0) then the source will be
  23443. dispatched immediately.
  23444. If @ready_time is -1 then the source is never woken up on the basis
  23445. of the passage of time.
  23446. Dispatching the source does not reset the ready time. You should do
  23447. so yourself, from the source dispatch function.
  23448. Note that if you have a pair of sources where the ready time of one
  23449. suggests that it will be delivered first but the priority for the
  23450. other suggests that it would be delivered first, and the ready time
  23451. for both sources is reached during the same main context iteration
  23452. then the order of dispatch is undefined.
  23453. This API is only intended to be used by implementations of #GSource.
  23454. Do not call this API on a #GSource that you did not create.</doc>
  23455. <return-value transfer-ownership="none">
  23456. <type name="none" c:type="void"/>
  23457. </return-value>
  23458. <parameters>
  23459. <instance-parameter name="source" transfer-ownership="none">
  23460. <doc xml:space="preserve">a #GSource</doc>
  23461. <type name="Source" c:type="GSource*"/>
  23462. </instance-parameter>
  23463. <parameter name="ready_time" transfer-ownership="none">
  23464. <doc xml:space="preserve">the monotonic time at which the source will be ready,
  23465. 0 for "immediately", -1 for "never"</doc>
  23466. <type name="gint64" c:type="gint64"/>
  23467. </parameter>
  23468. </parameters>
  23469. </method>
  23470. <method name="unref" c:identifier="g_source_unref">
  23471. <doc xml:space="preserve">Decreases the reference count of a source by one. If the
  23472. resulting reference count is zero the source and associated
  23473. memory will be destroyed.</doc>
  23474. <return-value transfer-ownership="none">
  23475. <type name="none" c:type="void"/>
  23476. </return-value>
  23477. <parameters>
  23478. <instance-parameter name="source" transfer-ownership="none">
  23479. <doc xml:space="preserve">a #GSource</doc>
  23480. <type name="Source" c:type="GSource*"/>
  23481. </instance-parameter>
  23482. </parameters>
  23483. </method>
  23484. <function name="remove" c:identifier="g_source_remove">
  23485. <doc xml:space="preserve">Removes the source with the given id from the default main context.
  23486. The id of a #GSource is given by g_source_get_id(), or will be
  23487. returned by the functions g_source_attach(), g_idle_add(),
  23488. g_idle_add_full(), g_timeout_add(), g_timeout_add_full(),
  23489. g_child_watch_add(), g_child_watch_add_full(), g_io_add_watch(), and
  23490. g_io_add_watch_full().
  23491. See also g_source_destroy(). You must use g_source_destroy() for sources
  23492. added to a non-default main context.
  23493. It is a programmer error to attempt to remove a non-existent source.
  23494. More specifically: source IDs can be reissued after a source has been
  23495. destroyed and therefore it is never valid to use this function with a
  23496. source ID which may have already been removed. An example is when
  23497. scheduling an idle to run in another thread with g_idle_add(): the
  23498. idle may already have run and been removed by the time this function
  23499. is called on its (now invalid) source ID. This source ID may have
  23500. been reissued, leading to the operation being performed against the
  23501. wrong source.</doc>
  23502. <return-value transfer-ownership="none">
  23503. <doc xml:space="preserve">For historical reasons, this function always returns %TRUE</doc>
  23504. <type name="gboolean" c:type="gboolean"/>
  23505. </return-value>
  23506. <parameters>
  23507. <parameter name="tag" transfer-ownership="none">
  23508. <doc xml:space="preserve">the ID of the source to remove.</doc>
  23509. <type name="guint" c:type="guint"/>
  23510. </parameter>
  23511. </parameters>
  23512. </function>
  23513. <function name="remove_by_funcs_user_data"
  23514. c:identifier="g_source_remove_by_funcs_user_data">
  23515. <doc xml:space="preserve">Removes a source from the default main loop context given the
  23516. source functions and user data. If multiple sources exist with the
  23517. same source functions and user data, only one will be destroyed.</doc>
  23518. <return-value transfer-ownership="none">
  23519. <doc xml:space="preserve">%TRUE if a source was found and removed.</doc>
  23520. <type name="gboolean" c:type="gboolean"/>
  23521. </return-value>
  23522. <parameters>
  23523. <parameter name="funcs" transfer-ownership="none">
  23524. <doc xml:space="preserve">The @source_funcs passed to g_source_new()</doc>
  23525. <type name="SourceFuncs" c:type="GSourceFuncs*"/>
  23526. </parameter>
  23527. <parameter name="user_data"
  23528. transfer-ownership="none"
  23529. nullable="1"
  23530. allow-none="1">
  23531. <doc xml:space="preserve">the user data for the callback</doc>
  23532. <type name="gpointer" c:type="gpointer"/>
  23533. </parameter>
  23534. </parameters>
  23535. </function>
  23536. <function name="remove_by_user_data"
  23537. c:identifier="g_source_remove_by_user_data">
  23538. <doc xml:space="preserve">Removes a source from the default main loop context given the user
  23539. data for the callback. If multiple sources exist with the same user
  23540. data, only one will be destroyed.</doc>
  23541. <return-value transfer-ownership="none">
  23542. <doc xml:space="preserve">%TRUE if a source was found and removed.</doc>
  23543. <type name="gboolean" c:type="gboolean"/>
  23544. </return-value>
  23545. <parameters>
  23546. <parameter name="user_data"
  23547. transfer-ownership="none"
  23548. nullable="1"
  23549. allow-none="1">
  23550. <doc xml:space="preserve">the user_data for the callback.</doc>
  23551. <type name="gpointer" c:type="gpointer"/>
  23552. </parameter>
  23553. </parameters>
  23554. </function>
  23555. <function name="set_name_by_id"
  23556. c:identifier="g_source_set_name_by_id"
  23557. version="2.26">
  23558. <doc xml:space="preserve">Sets the name of a source using its ID.
  23559. This is a convenience utility to set source names from the return
  23560. value of g_idle_add(), g_timeout_add(), etc.
  23561. It is a programmer error to attempt to set the name of a non-existent
  23562. source.
  23563. More specifically: source IDs can be reissued after a source has been
  23564. destroyed and therefore it is never valid to use this function with a
  23565. source ID which may have already been removed. An example is when
  23566. scheduling an idle to run in another thread with g_idle_add(): the
  23567. idle may already have run and been removed by the time this function
  23568. is called on its (now invalid) source ID. This source ID may have
  23569. been reissued, leading to the operation being performed against the
  23570. wrong source.</doc>
  23571. <return-value transfer-ownership="none">
  23572. <type name="none" c:type="void"/>
  23573. </return-value>
  23574. <parameters>
  23575. <parameter name="tag" transfer-ownership="none">
  23576. <doc xml:space="preserve">a #GSource ID</doc>
  23577. <type name="guint" c:type="guint"/>
  23578. </parameter>
  23579. <parameter name="name" transfer-ownership="none">
  23580. <doc xml:space="preserve">debug name for the source</doc>
  23581. <type name="utf8" c:type="const char*"/>
  23582. </parameter>
  23583. </parameters>
  23584. </function>
  23585. </record>
  23586. <record name="SourceCallbackFuncs" c:type="GSourceCallbackFuncs">
  23587. <doc xml:space="preserve">The `GSourceCallbackFuncs` struct contains
  23588. functions for managing callback objects.</doc>
  23589. <field name="ref">
  23590. <callback name="ref">
  23591. <return-value transfer-ownership="none">
  23592. <type name="none" c:type="void"/>
  23593. </return-value>
  23594. <parameters>
  23595. <parameter name="cb_data" transfer-ownership="none">
  23596. <type name="gpointer" c:type="gpointer"/>
  23597. </parameter>
  23598. </parameters>
  23599. </callback>
  23600. </field>
  23601. <field name="unref">
  23602. <callback name="unref">
  23603. <return-value transfer-ownership="none">
  23604. <type name="none" c:type="void"/>
  23605. </return-value>
  23606. <parameters>
  23607. <parameter name="cb_data" transfer-ownership="none">
  23608. <type name="gpointer" c:type="gpointer"/>
  23609. </parameter>
  23610. </parameters>
  23611. </callback>
  23612. </field>
  23613. <field name="get" introspectable="0">
  23614. <callback name="get" introspectable="0">
  23615. <return-value transfer-ownership="none">
  23616. <type name="none" c:type="void"/>
  23617. </return-value>
  23618. <parameters>
  23619. <parameter name="cb_data" transfer-ownership="none">
  23620. <type name="gpointer" c:type="gpointer"/>
  23621. </parameter>
  23622. <parameter name="source" transfer-ownership="none">
  23623. <type name="Source" c:type="GSource*"/>
  23624. </parameter>
  23625. <parameter name="func" transfer-ownership="none" closure="3">
  23626. <type name="SourceFunc" c:type="GSourceFunc*"/>
  23627. </parameter>
  23628. <parameter name="data"
  23629. transfer-ownership="none"
  23630. nullable="1"
  23631. allow-none="1">
  23632. <type name="gpointer" c:type="gpointer*"/>
  23633. </parameter>
  23634. </parameters>
  23635. </callback>
  23636. </field>
  23637. </record>
  23638. <callback name="SourceDummyMarshal" c:type="GSourceDummyMarshal">
  23639. <doc xml:space="preserve">This is just a placeholder for #GClosureMarshal,
  23640. which cannot be used here for dependency reasons.</doc>
  23641. <return-value transfer-ownership="none">
  23642. <type name="none" c:type="void"/>
  23643. </return-value>
  23644. </callback>
  23645. <callback name="SourceFunc" c:type="GSourceFunc">
  23646. <doc xml:space="preserve">Specifies the type of function passed to g_timeout_add(),
  23647. g_timeout_add_full(), g_idle_add(), and g_idle_add_full().</doc>
  23648. <return-value transfer-ownership="none">
  23649. <doc xml:space="preserve">%FALSE if the source should be removed. #G_SOURCE_CONTINUE and
  23650. #G_SOURCE_REMOVE are more memorable names for the return value.</doc>
  23651. <type name="gboolean" c:type="gboolean"/>
  23652. </return-value>
  23653. <parameters>
  23654. <parameter name="user_data"
  23655. transfer-ownership="none"
  23656. nullable="1"
  23657. allow-none="1"
  23658. closure="0">
  23659. <doc xml:space="preserve">data passed to the function, set when the source was
  23660. created with one of the above functions</doc>
  23661. <type name="gpointer" c:type="gpointer"/>
  23662. </parameter>
  23663. </parameters>
  23664. </callback>
  23665. <record name="SourceFuncs" c:type="GSourceFuncs">
  23666. <doc xml:space="preserve">The `GSourceFuncs` struct contains a table of
  23667. functions used to handle event sources in a generic manner.
  23668. For idle sources, the prepare and check functions always return %TRUE
  23669. to indicate that the source is always ready to be processed. The prepare
  23670. function also returns a timeout value of 0 to ensure that the poll() call
  23671. doesn't block (since that would be time wasted which could have been spent
  23672. running the idle function).
  23673. For timeout sources, the prepare and check functions both return %TRUE
  23674. if the timeout interval has expired. The prepare function also returns
  23675. a timeout value to ensure that the poll() call doesn't block too long
  23676. and miss the next timeout.
  23677. For file descriptor sources, the prepare function typically returns %FALSE,
  23678. since it must wait until poll() has been called before it knows whether
  23679. any events need to be processed. It sets the returned timeout to -1 to
  23680. indicate that it doesn't mind how long the poll() call blocks. In the
  23681. check function, it tests the results of the poll() call to see if the
  23682. required condition has been met, and returns %TRUE if so.</doc>
  23683. <field name="prepare">
  23684. <callback name="prepare">
  23685. <return-value transfer-ownership="none">
  23686. <type name="gboolean" c:type="gboolean"/>
  23687. </return-value>
  23688. <parameters>
  23689. <parameter name="source" transfer-ownership="none">
  23690. <type name="Source" c:type="GSource*"/>
  23691. </parameter>
  23692. <parameter name="timeout_" transfer-ownership="none">
  23693. <type name="gint" c:type="gint*"/>
  23694. </parameter>
  23695. </parameters>
  23696. </callback>
  23697. </field>
  23698. <field name="check">
  23699. <callback name="check">
  23700. <return-value transfer-ownership="none">
  23701. <type name="gboolean" c:type="gboolean"/>
  23702. </return-value>
  23703. <parameters>
  23704. <parameter name="source" transfer-ownership="none">
  23705. <type name="Source" c:type="GSource*"/>
  23706. </parameter>
  23707. </parameters>
  23708. </callback>
  23709. </field>
  23710. <field name="dispatch" introspectable="0">
  23711. <callback name="dispatch" introspectable="0">
  23712. <return-value transfer-ownership="none">
  23713. <type name="gboolean" c:type="gboolean"/>
  23714. </return-value>
  23715. <parameters>
  23716. <parameter name="source" transfer-ownership="none">
  23717. <type name="Source" c:type="GSource*"/>
  23718. </parameter>
  23719. <parameter name="callback" transfer-ownership="none" closure="2">
  23720. <type name="SourceFunc" c:type="GSourceFunc"/>
  23721. </parameter>
  23722. <parameter name="user_data"
  23723. transfer-ownership="none"
  23724. nullable="1"
  23725. allow-none="1"
  23726. closure="2">
  23727. <type name="gpointer" c:type="gpointer"/>
  23728. </parameter>
  23729. </parameters>
  23730. </callback>
  23731. </field>
  23732. <field name="finalize">
  23733. <callback name="finalize">
  23734. <return-value transfer-ownership="none">
  23735. <type name="none" c:type="void"/>
  23736. </return-value>
  23737. <parameters>
  23738. <parameter name="source" transfer-ownership="none">
  23739. <type name="Source" c:type="GSource*"/>
  23740. </parameter>
  23741. </parameters>
  23742. </callback>
  23743. </field>
  23744. <field name="closure_callback" readable="0" private="1">
  23745. <type name="SourceFunc" c:type="GSourceFunc"/>
  23746. </field>
  23747. <field name="closure_marshal" readable="0" private="1">
  23748. <type name="SourceDummyMarshal" c:type="GSourceDummyMarshal"/>
  23749. </field>
  23750. </record>
  23751. <record name="SourcePrivate" c:type="GSourcePrivate" disguised="1">
  23752. </record>
  23753. <callback name="SpawnChildSetupFunc" c:type="GSpawnChildSetupFunc">
  23754. <doc xml:space="preserve">Specifies the type of the setup function passed to g_spawn_async(),
  23755. g_spawn_sync() and g_spawn_async_with_pipes(), which can, in very
  23756. limited ways, be used to affect the child's execution.
  23757. On POSIX platforms, the function is called in the child after GLib
  23758. has performed all the setup it plans to perform, but before calling
  23759. exec(). Actions taken in this function will only affect the child,
  23760. not the parent.
  23761. On Windows, the function is called in the parent. Its usefulness on
  23762. Windows is thus questionable. In many cases executing the child setup
  23763. function in the parent can have ill effects, and you should be very
  23764. careful when porting software to Windows that uses child setup
  23765. functions.
  23766. However, even on POSIX, you are extremely limited in what you can
  23767. safely do from a #GSpawnChildSetupFunc, because any mutexes that were
  23768. held by other threads in the parent process at the time of the fork()
  23769. will still be locked in the child process, and they will never be
  23770. unlocked (since the threads that held them don't exist in the child).
  23771. POSIX allows only async-signal-safe functions (see signal(7)) to be
  23772. called in the child between fork() and exec(), which drastically limits
  23773. the usefulness of child setup functions.
  23774. In particular, it is not safe to call any function which may
  23775. call malloc(), which includes POSIX functions such as setenv().
  23776. If you need to set up the child environment differently from
  23777. the parent, you should use g_get_environ(), g_environ_setenv(),
  23778. and g_environ_unsetenv(), and then pass the complete environment
  23779. list to the `g_spawn...` function.</doc>
  23780. <return-value transfer-ownership="none">
  23781. <type name="none" c:type="void"/>
  23782. </return-value>
  23783. <parameters>
  23784. <parameter name="user_data"
  23785. transfer-ownership="none"
  23786. nullable="1"
  23787. allow-none="1"
  23788. closure="0">
  23789. <doc xml:space="preserve">user data to pass to the function.</doc>
  23790. <type name="gpointer" c:type="gpointer"/>
  23791. </parameter>
  23792. </parameters>
  23793. </callback>
  23794. <enumeration name="SpawnError"
  23795. c:type="GSpawnError"
  23796. glib:error-domain="g-exec-error-quark">
  23797. <doc xml:space="preserve">Error codes returned by spawning processes.</doc>
  23798. <member name="fork" value="0" c:identifier="G_SPAWN_ERROR_FORK">
  23799. <doc xml:space="preserve">Fork failed due to lack of memory.</doc>
  23800. </member>
  23801. <member name="read" value="1" c:identifier="G_SPAWN_ERROR_READ">
  23802. <doc xml:space="preserve">Read or select on pipes failed.</doc>
  23803. </member>
  23804. <member name="chdir" value="2" c:identifier="G_SPAWN_ERROR_CHDIR">
  23805. <doc xml:space="preserve">Changing to working directory failed.</doc>
  23806. </member>
  23807. <member name="acces" value="3" c:identifier="G_SPAWN_ERROR_ACCES">
  23808. <doc xml:space="preserve">execv() returned `EACCES`</doc>
  23809. </member>
  23810. <member name="perm" value="4" c:identifier="G_SPAWN_ERROR_PERM">
  23811. <doc xml:space="preserve">execv() returned `EPERM`</doc>
  23812. </member>
  23813. <member name="too_big" value="5" c:identifier="G_SPAWN_ERROR_TOO_BIG">
  23814. <doc xml:space="preserve">execv() returned `E2BIG`</doc>
  23815. </member>
  23816. <member name="2big" value="5" c:identifier="G_SPAWN_ERROR_2BIG">
  23817. <doc xml:space="preserve">deprecated alias for %G_SPAWN_ERROR_TOO_BIG</doc>
  23818. </member>
  23819. <member name="noexec" value="6" c:identifier="G_SPAWN_ERROR_NOEXEC">
  23820. <doc xml:space="preserve">execv() returned `ENOEXEC`</doc>
  23821. </member>
  23822. <member name="nametoolong"
  23823. value="7"
  23824. c:identifier="G_SPAWN_ERROR_NAMETOOLONG">
  23825. <doc xml:space="preserve">execv() returned `ENAMETOOLONG`</doc>
  23826. </member>
  23827. <member name="noent" value="8" c:identifier="G_SPAWN_ERROR_NOENT">
  23828. <doc xml:space="preserve">execv() returned `ENOENT`</doc>
  23829. </member>
  23830. <member name="nomem" value="9" c:identifier="G_SPAWN_ERROR_NOMEM">
  23831. <doc xml:space="preserve">execv() returned `ENOMEM`</doc>
  23832. </member>
  23833. <member name="notdir" value="10" c:identifier="G_SPAWN_ERROR_NOTDIR">
  23834. <doc xml:space="preserve">execv() returned `ENOTDIR`</doc>
  23835. </member>
  23836. <member name="loop" value="11" c:identifier="G_SPAWN_ERROR_LOOP">
  23837. <doc xml:space="preserve">execv() returned `ELOOP`</doc>
  23838. </member>
  23839. <member name="txtbusy" value="12" c:identifier="G_SPAWN_ERROR_TXTBUSY">
  23840. <doc xml:space="preserve">execv() returned `ETXTBUSY`</doc>
  23841. </member>
  23842. <member name="io" value="13" c:identifier="G_SPAWN_ERROR_IO">
  23843. <doc xml:space="preserve">execv() returned `EIO`</doc>
  23844. </member>
  23845. <member name="nfile" value="14" c:identifier="G_SPAWN_ERROR_NFILE">
  23846. <doc xml:space="preserve">execv() returned `ENFILE`</doc>
  23847. </member>
  23848. <member name="mfile" value="15" c:identifier="G_SPAWN_ERROR_MFILE">
  23849. <doc xml:space="preserve">execv() returned `EMFILE`</doc>
  23850. </member>
  23851. <member name="inval" value="16" c:identifier="G_SPAWN_ERROR_INVAL">
  23852. <doc xml:space="preserve">execv() returned `EINVAL`</doc>
  23853. </member>
  23854. <member name="isdir" value="17" c:identifier="G_SPAWN_ERROR_ISDIR">
  23855. <doc xml:space="preserve">execv() returned `EISDIR`</doc>
  23856. </member>
  23857. <member name="libbad" value="18" c:identifier="G_SPAWN_ERROR_LIBBAD">
  23858. <doc xml:space="preserve">execv() returned `ELIBBAD`</doc>
  23859. </member>
  23860. <member name="failed" value="19" c:identifier="G_SPAWN_ERROR_FAILED">
  23861. <doc xml:space="preserve">Some other fatal failure,
  23862. `error-&gt;message` should explain.</doc>
  23863. </member>
  23864. </enumeration>
  23865. <bitfield name="SpawnFlags" c:type="GSpawnFlags">
  23866. <doc xml:space="preserve">Flags passed to g_spawn_sync(), g_spawn_async() and g_spawn_async_with_pipes().</doc>
  23867. <member name="default" value="0" c:identifier="G_SPAWN_DEFAULT">
  23868. <doc xml:space="preserve">no flags, default behaviour</doc>
  23869. </member>
  23870. <member name="leave_descriptors_open"
  23871. value="1"
  23872. c:identifier="G_SPAWN_LEAVE_DESCRIPTORS_OPEN">
  23873. <doc xml:space="preserve">the parent's open file descriptors will
  23874. be inherited by the child; otherwise all descriptors except stdin,
  23875. stdout and stderr will be closed before calling exec() in the child.</doc>
  23876. </member>
  23877. <member name="do_not_reap_child"
  23878. value="2"
  23879. c:identifier="G_SPAWN_DO_NOT_REAP_CHILD">
  23880. <doc xml:space="preserve">the child will not be automatically reaped;
  23881. you must use g_child_watch_add() yourself (or call waitpid() or handle
  23882. `SIGCHLD` yourself), or the child will become a zombie.</doc>
  23883. </member>
  23884. <member name="search_path" value="4" c:identifier="G_SPAWN_SEARCH_PATH">
  23885. <doc xml:space="preserve">`argv[0]` need not be an absolute path, it will be
  23886. looked for in the user's `PATH`.</doc>
  23887. </member>
  23888. <member name="stdout_to_dev_null"
  23889. value="8"
  23890. c:identifier="G_SPAWN_STDOUT_TO_DEV_NULL">
  23891. <doc xml:space="preserve">the child's standard output will be discarded,
  23892. instead of going to the same location as the parent's standard output.</doc>
  23893. </member>
  23894. <member name="stderr_to_dev_null"
  23895. value="16"
  23896. c:identifier="G_SPAWN_STDERR_TO_DEV_NULL">
  23897. <doc xml:space="preserve">the child's standard error will be discarded.</doc>
  23898. </member>
  23899. <member name="child_inherits_stdin"
  23900. value="32"
  23901. c:identifier="G_SPAWN_CHILD_INHERITS_STDIN">
  23902. <doc xml:space="preserve">the child will inherit the parent's standard
  23903. input (by default, the child's standard input is attached to `/dev/null`).</doc>
  23904. </member>
  23905. <member name="file_and_argv_zero"
  23906. value="64"
  23907. c:identifier="G_SPAWN_FILE_AND_ARGV_ZERO">
  23908. <doc xml:space="preserve">the first element of `argv` is the file to
  23909. execute, while the remaining elements are the actual argument vector
  23910. to pass to the file. Normally g_spawn_async_with_pipes() uses `argv[0]`
  23911. as the file to execute, and passes all of `argv` to the child.</doc>
  23912. </member>
  23913. <member name="search_path_from_envp"
  23914. value="128"
  23915. c:identifier="G_SPAWN_SEARCH_PATH_FROM_ENVP">
  23916. <doc xml:space="preserve">if `argv[0]` is not an abolute path,
  23917. it will be looked for in the `PATH` from the passed child environment.
  23918. Since: 2.34</doc>
  23919. </member>
  23920. <member name="cloexec_pipes"
  23921. value="256"
  23922. c:identifier="G_SPAWN_CLOEXEC_PIPES">
  23923. <doc xml:space="preserve">create all pipes with the `O_CLOEXEC` flag set.
  23924. Since: 2.40</doc>
  23925. </member>
  23926. </bitfield>
  23927. <record name="StatBuf" c:type="GStatBuf" disguised="1">
  23928. <doc xml:space="preserve">A type corresponding to the appropriate struct type for the stat()
  23929. system call, depending on the platform and/or compiler being used.
  23930. See g_stat() for more information.</doc>
  23931. </record>
  23932. <record name="String"
  23933. c:type="GString"
  23934. glib:type-name="GString"
  23935. glib:get-type="g_gstring_get_type"
  23936. c:symbol-prefix="gstring">
  23937. <doc xml:space="preserve">The GString struct contains the public fields of a GString.</doc>
  23938. <field name="str" writable="1">
  23939. <doc xml:space="preserve">points to the character data. It may move as text is added.
  23940. The @str field is null-terminated and so
  23941. can be used as an ordinary C string.</doc>
  23942. <type name="utf8" c:type="gchar*"/>
  23943. </field>
  23944. <field name="len" writable="1">
  23945. <doc xml:space="preserve">contains the length of the string, not including the
  23946. terminating nul byte.</doc>
  23947. <type name="gsize" c:type="gsize"/>
  23948. </field>
  23949. <field name="allocated_len" writable="1">
  23950. <doc xml:space="preserve">the number of bytes that can be stored in the
  23951. string before it needs to be reallocated. May be larger than @len.</doc>
  23952. <type name="gsize" c:type="gsize"/>
  23953. </field>
  23954. <method name="append" c:identifier="g_string_append">
  23955. <doc xml:space="preserve">Adds a string onto the end of a #GString, expanding
  23956. it if necessary.</doc>
  23957. <return-value transfer-ownership="none">
  23958. <doc xml:space="preserve">@string</doc>
  23959. <type name="String" c:type="GString*"/>
  23960. </return-value>
  23961. <parameters>
  23962. <instance-parameter name="string" transfer-ownership="none">
  23963. <doc xml:space="preserve">a #GString</doc>
  23964. <type name="String" c:type="GString*"/>
  23965. </instance-parameter>
  23966. <parameter name="val" transfer-ownership="none">
  23967. <doc xml:space="preserve">the string to append onto the end of @string</doc>
  23968. <type name="utf8" c:type="const gchar*"/>
  23969. </parameter>
  23970. </parameters>
  23971. </method>
  23972. <method name="append_c" c:identifier="g_string_append_c">
  23973. <doc xml:space="preserve">Adds a byte onto the end of a #GString, expanding
  23974. it if necessary.</doc>
  23975. <return-value transfer-ownership="none">
  23976. <doc xml:space="preserve">@string</doc>
  23977. <type name="String" c:type="GString*"/>
  23978. </return-value>
  23979. <parameters>
  23980. <instance-parameter name="string" transfer-ownership="none">
  23981. <doc xml:space="preserve">a #GString</doc>
  23982. <type name="String" c:type="GString*"/>
  23983. </instance-parameter>
  23984. <parameter name="c" transfer-ownership="none">
  23985. <doc xml:space="preserve">the byte to append onto the end of @string</doc>
  23986. <type name="gchar" c:type="gchar"/>
  23987. </parameter>
  23988. </parameters>
  23989. </method>
  23990. <method name="append_len" c:identifier="g_string_append_len">
  23991. <doc xml:space="preserve">Appends @len bytes of @val to @string. Because @len is
  23992. provided, @val may contain embedded nuls and need not
  23993. be nul-terminated.
  23994. Since this function does not stop at nul bytes, it is
  23995. the caller's responsibility to ensure that @val has at
  23996. least @len addressable bytes.</doc>
  23997. <return-value transfer-ownership="none">
  23998. <doc xml:space="preserve">@string</doc>
  23999. <type name="String" c:type="GString*"/>
  24000. </return-value>
  24001. <parameters>
  24002. <instance-parameter name="string" transfer-ownership="none">
  24003. <doc xml:space="preserve">a #GString</doc>
  24004. <type name="String" c:type="GString*"/>
  24005. </instance-parameter>
  24006. <parameter name="val" transfer-ownership="none">
  24007. <doc xml:space="preserve">bytes to append</doc>
  24008. <type name="utf8" c:type="const gchar*"/>
  24009. </parameter>
  24010. <parameter name="len" transfer-ownership="none">
  24011. <doc xml:space="preserve">number of bytes of @val to use</doc>
  24012. <type name="gssize" c:type="gssize"/>
  24013. </parameter>
  24014. </parameters>
  24015. </method>
  24016. <method name="append_printf"
  24017. c:identifier="g_string_append_printf"
  24018. introspectable="0">
  24019. <doc xml:space="preserve">Appends a formatted string onto the end of a #GString.
  24020. This function is similar to g_string_printf() except
  24021. that the text is appended to the #GString.</doc>
  24022. <return-value transfer-ownership="none">
  24023. <type name="none" c:type="void"/>
  24024. </return-value>
  24025. <parameters>
  24026. <instance-parameter name="string" transfer-ownership="none">
  24027. <doc xml:space="preserve">a #GString</doc>
  24028. <type name="String" c:type="GString*"/>
  24029. </instance-parameter>
  24030. <parameter name="format" transfer-ownership="none">
  24031. <doc xml:space="preserve">the string format. See the printf() documentation</doc>
  24032. <type name="utf8" c:type="const gchar*"/>
  24033. </parameter>
  24034. <parameter name="..." transfer-ownership="none">
  24035. <doc xml:space="preserve">the parameters to insert into the format string</doc>
  24036. <varargs/>
  24037. </parameter>
  24038. </parameters>
  24039. </method>
  24040. <method name="append_unichar" c:identifier="g_string_append_unichar">
  24041. <doc xml:space="preserve">Converts a Unicode character into UTF-8, and appends it
  24042. to the string.</doc>
  24043. <return-value transfer-ownership="none">
  24044. <doc xml:space="preserve">@string</doc>
  24045. <type name="String" c:type="GString*"/>
  24046. </return-value>
  24047. <parameters>
  24048. <instance-parameter name="string" transfer-ownership="none">
  24049. <doc xml:space="preserve">a #GString</doc>
  24050. <type name="String" c:type="GString*"/>
  24051. </instance-parameter>
  24052. <parameter name="wc" transfer-ownership="none">
  24053. <doc xml:space="preserve">a Unicode character</doc>
  24054. <type name="gunichar" c:type="gunichar"/>
  24055. </parameter>
  24056. </parameters>
  24057. </method>
  24058. <method name="append_uri_escaped"
  24059. c:identifier="g_string_append_uri_escaped"
  24060. version="2.16">
  24061. <doc xml:space="preserve">Appends @unescaped to @string, escaped any characters that
  24062. are reserved in URIs using URI-style escape sequences.</doc>
  24063. <return-value transfer-ownership="none">
  24064. <doc xml:space="preserve">@string</doc>
  24065. <type name="String" c:type="GString*"/>
  24066. </return-value>
  24067. <parameters>
  24068. <instance-parameter name="string" transfer-ownership="none">
  24069. <doc xml:space="preserve">a #GString</doc>
  24070. <type name="String" c:type="GString*"/>
  24071. </instance-parameter>
  24072. <parameter name="unescaped" transfer-ownership="none">
  24073. <doc xml:space="preserve">a string</doc>
  24074. <type name="utf8" c:type="const gchar*"/>
  24075. </parameter>
  24076. <parameter name="reserved_chars_allowed" transfer-ownership="none">
  24077. <doc xml:space="preserve">a string of reserved characters allowed
  24078. to be used, or %NULL</doc>
  24079. <type name="utf8" c:type="const gchar*"/>
  24080. </parameter>
  24081. <parameter name="allow_utf8" transfer-ownership="none">
  24082. <doc xml:space="preserve">set %TRUE if the escaped string may include UTF8 characters</doc>
  24083. <type name="gboolean" c:type="gboolean"/>
  24084. </parameter>
  24085. </parameters>
  24086. </method>
  24087. <method name="append_vprintf"
  24088. c:identifier="g_string_append_vprintf"
  24089. version="2.14"
  24090. introspectable="0">
  24091. <doc xml:space="preserve">Appends a formatted string onto the end of a #GString.
  24092. This function is similar to g_string_append_printf()
  24093. except that the arguments to the format string are passed
  24094. as a va_list.</doc>
  24095. <return-value transfer-ownership="none">
  24096. <type name="none" c:type="void"/>
  24097. </return-value>
  24098. <parameters>
  24099. <instance-parameter name="string" transfer-ownership="none">
  24100. <doc xml:space="preserve">a #GString</doc>
  24101. <type name="String" c:type="GString*"/>
  24102. </instance-parameter>
  24103. <parameter name="format" transfer-ownership="none">
  24104. <doc xml:space="preserve">the string format. See the printf() documentation</doc>
  24105. <type name="utf8" c:type="const gchar*"/>
  24106. </parameter>
  24107. <parameter name="args" transfer-ownership="none">
  24108. <doc xml:space="preserve">the list of arguments to insert in the output</doc>
  24109. <type name="va_list" c:type="va_list"/>
  24110. </parameter>
  24111. </parameters>
  24112. </method>
  24113. <method name="ascii_down" c:identifier="g_string_ascii_down">
  24114. <doc xml:space="preserve">Converts all uppercase ASCII letters to lowercase ASCII letters.</doc>
  24115. <return-value transfer-ownership="none">
  24116. <doc xml:space="preserve">passed-in @string pointer, with all the
  24117. uppercase characters converted to lowercase in place,
  24118. with semantics that exactly match g_ascii_tolower().</doc>
  24119. <type name="String" c:type="GString*"/>
  24120. </return-value>
  24121. <parameters>
  24122. <instance-parameter name="string" transfer-ownership="none">
  24123. <doc xml:space="preserve">a GString</doc>
  24124. <type name="String" c:type="GString*"/>
  24125. </instance-parameter>
  24126. </parameters>
  24127. </method>
  24128. <method name="ascii_up" c:identifier="g_string_ascii_up">
  24129. <doc xml:space="preserve">Converts all lowercase ASCII letters to uppercase ASCII letters.</doc>
  24130. <return-value transfer-ownership="none">
  24131. <doc xml:space="preserve">passed-in @string pointer, with all the
  24132. lowercase characters converted to uppercase in place,
  24133. with semantics that exactly match g_ascii_toupper().</doc>
  24134. <type name="String" c:type="GString*"/>
  24135. </return-value>
  24136. <parameters>
  24137. <instance-parameter name="string" transfer-ownership="none">
  24138. <doc xml:space="preserve">a GString</doc>
  24139. <type name="String" c:type="GString*"/>
  24140. </instance-parameter>
  24141. </parameters>
  24142. </method>
  24143. <method name="assign" c:identifier="g_string_assign">
  24144. <doc xml:space="preserve">Copies the bytes from a string into a #GString,
  24145. destroying any previous contents. It is rather like
  24146. the standard strcpy() function, except that you do not
  24147. have to worry about having enough space to copy the string.</doc>
  24148. <return-value transfer-ownership="none">
  24149. <doc xml:space="preserve">@string</doc>
  24150. <type name="String" c:type="GString*"/>
  24151. </return-value>
  24152. <parameters>
  24153. <instance-parameter name="string" transfer-ownership="none">
  24154. <doc xml:space="preserve">the destination #GString. Its current contents
  24155. are destroyed.</doc>
  24156. <type name="String" c:type="GString*"/>
  24157. </instance-parameter>
  24158. <parameter name="rval" transfer-ownership="none">
  24159. <doc xml:space="preserve">the string to copy into @string</doc>
  24160. <type name="utf8" c:type="const gchar*"/>
  24161. </parameter>
  24162. </parameters>
  24163. </method>
  24164. <method name="down"
  24165. c:identifier="g_string_down"
  24166. deprecated="1"
  24167. deprecated-version="2.2">
  24168. <doc xml:space="preserve">Converts a #GString to lowercase.</doc>
  24169. <doc-deprecated xml:space="preserve">This function uses the locale-specific
  24170. tolower() function, which is almost never the right thing.
  24171. Use g_string_ascii_down() or g_utf8_strdown() instead.</doc-deprecated>
  24172. <return-value transfer-ownership="none">
  24173. <doc xml:space="preserve">the #GString</doc>
  24174. <type name="String" c:type="GString*"/>
  24175. </return-value>
  24176. <parameters>
  24177. <instance-parameter name="string" transfer-ownership="none">
  24178. <doc xml:space="preserve">a #GString</doc>
  24179. <type name="String" c:type="GString*"/>
  24180. </instance-parameter>
  24181. </parameters>
  24182. </method>
  24183. <method name="equal" c:identifier="g_string_equal">
  24184. <doc xml:space="preserve">Compares two strings for equality, returning %TRUE if they are equal.
  24185. For use with #GHashTable.</doc>
  24186. <return-value transfer-ownership="none">
  24187. <doc xml:space="preserve">%TRUE if the strings are the same length and contain the
  24188. same bytes</doc>
  24189. <type name="gboolean" c:type="gboolean"/>
  24190. </return-value>
  24191. <parameters>
  24192. <instance-parameter name="v" transfer-ownership="none">
  24193. <doc xml:space="preserve">a #GString</doc>
  24194. <type name="String" c:type="const GString*"/>
  24195. </instance-parameter>
  24196. <parameter name="v2" transfer-ownership="none">
  24197. <doc xml:space="preserve">another #GString</doc>
  24198. <type name="String" c:type="const GString*"/>
  24199. </parameter>
  24200. </parameters>
  24201. </method>
  24202. <method name="erase" c:identifier="g_string_erase">
  24203. <doc xml:space="preserve">Removes @len bytes from a #GString, starting at position @pos.
  24204. The rest of the #GString is shifted down to fill the gap.</doc>
  24205. <return-value transfer-ownership="none">
  24206. <doc xml:space="preserve">@string</doc>
  24207. <type name="String" c:type="GString*"/>
  24208. </return-value>
  24209. <parameters>
  24210. <instance-parameter name="string" transfer-ownership="none">
  24211. <doc xml:space="preserve">a #GString</doc>
  24212. <type name="String" c:type="GString*"/>
  24213. </instance-parameter>
  24214. <parameter name="pos" transfer-ownership="none">
  24215. <doc xml:space="preserve">the position of the content to remove</doc>
  24216. <type name="gssize" c:type="gssize"/>
  24217. </parameter>
  24218. <parameter name="len" transfer-ownership="none">
  24219. <doc xml:space="preserve">the number of bytes to remove, or -1 to remove all
  24220. following bytes</doc>
  24221. <type name="gssize" c:type="gssize"/>
  24222. </parameter>
  24223. </parameters>
  24224. </method>
  24225. <method name="free" c:identifier="g_string_free">
  24226. <doc xml:space="preserve">Frees the memory allocated for the #GString.
  24227. If @free_segment is %TRUE it also frees the character data. If
  24228. it's %FALSE, the caller gains ownership of the buffer and must
  24229. free it after use with g_free().</doc>
  24230. <return-value transfer-ownership="full" nullable="1">
  24231. <doc xml:space="preserve">the character data of @string
  24232. (i.e. %NULL if @free_segment is %TRUE)</doc>
  24233. <type name="utf8" c:type="gchar*"/>
  24234. </return-value>
  24235. <parameters>
  24236. <instance-parameter name="string" transfer-ownership="full">
  24237. <doc xml:space="preserve">a #GString</doc>
  24238. <type name="String" c:type="GString*"/>
  24239. </instance-parameter>
  24240. <parameter name="free_segment" transfer-ownership="none">
  24241. <doc xml:space="preserve">if %TRUE, the actual character data is freed as well</doc>
  24242. <type name="gboolean" c:type="gboolean"/>
  24243. </parameter>
  24244. </parameters>
  24245. </method>
  24246. <method name="free_to_bytes"
  24247. c:identifier="g_string_free_to_bytes"
  24248. version="2.34">
  24249. <doc xml:space="preserve">Transfers ownership of the contents of @string to a newly allocated
  24250. #GBytes. The #GString structure itself is deallocated, and it is
  24251. therefore invalid to use @string after invoking this function.
  24252. Note that while #GString ensures that its buffer always has a
  24253. trailing nul character (not reflected in its "len"), the returned
  24254. #GBytes does not include this extra nul; i.e. it has length exactly
  24255. equal to the "len" member.</doc>
  24256. <return-value transfer-ownership="full">
  24257. <doc xml:space="preserve">A newly allocated #GBytes containing contents of @string; @string itself is freed</doc>
  24258. <type name="Bytes" c:type="GBytes*"/>
  24259. </return-value>
  24260. <parameters>
  24261. <instance-parameter name="string" transfer-ownership="full">
  24262. <doc xml:space="preserve">a #GString</doc>
  24263. <type name="String" c:type="GString*"/>
  24264. </instance-parameter>
  24265. </parameters>
  24266. </method>
  24267. <method name="hash" c:identifier="g_string_hash">
  24268. <doc xml:space="preserve">Creates a hash code for @str; for use with #GHashTable.</doc>
  24269. <return-value transfer-ownership="none">
  24270. <doc xml:space="preserve">hash code for @str</doc>
  24271. <type name="guint" c:type="guint"/>
  24272. </return-value>
  24273. <parameters>
  24274. <instance-parameter name="str" transfer-ownership="none">
  24275. <doc xml:space="preserve">a string to hash</doc>
  24276. <type name="String" c:type="const GString*"/>
  24277. </instance-parameter>
  24278. </parameters>
  24279. </method>
  24280. <method name="insert" c:identifier="g_string_insert">
  24281. <doc xml:space="preserve">Inserts a copy of a string into a #GString,
  24282. expanding it if necessary.</doc>
  24283. <return-value transfer-ownership="none">
  24284. <doc xml:space="preserve">@string</doc>
  24285. <type name="String" c:type="GString*"/>
  24286. </return-value>
  24287. <parameters>
  24288. <instance-parameter name="string" transfer-ownership="none">
  24289. <doc xml:space="preserve">a #GString</doc>
  24290. <type name="String" c:type="GString*"/>
  24291. </instance-parameter>
  24292. <parameter name="pos" transfer-ownership="none">
  24293. <doc xml:space="preserve">the position to insert the copy of the string</doc>
  24294. <type name="gssize" c:type="gssize"/>
  24295. </parameter>
  24296. <parameter name="val" transfer-ownership="none">
  24297. <doc xml:space="preserve">the string to insert</doc>
  24298. <type name="utf8" c:type="const gchar*"/>
  24299. </parameter>
  24300. </parameters>
  24301. </method>
  24302. <method name="insert_c" c:identifier="g_string_insert_c">
  24303. <doc xml:space="preserve">Inserts a byte into a #GString, expanding it if necessary.</doc>
  24304. <return-value transfer-ownership="none">
  24305. <doc xml:space="preserve">@string</doc>
  24306. <type name="String" c:type="GString*"/>
  24307. </return-value>
  24308. <parameters>
  24309. <instance-parameter name="string" transfer-ownership="none">
  24310. <doc xml:space="preserve">a #GString</doc>
  24311. <type name="String" c:type="GString*"/>
  24312. </instance-parameter>
  24313. <parameter name="pos" transfer-ownership="none">
  24314. <doc xml:space="preserve">the position to insert the byte</doc>
  24315. <type name="gssize" c:type="gssize"/>
  24316. </parameter>
  24317. <parameter name="c" transfer-ownership="none">
  24318. <doc xml:space="preserve">the byte to insert</doc>
  24319. <type name="gchar" c:type="gchar"/>
  24320. </parameter>
  24321. </parameters>
  24322. </method>
  24323. <method name="insert_len" c:identifier="g_string_insert_len">
  24324. <doc xml:space="preserve">Inserts @len bytes of @val into @string at @pos.
  24325. Because @len is provided, @val may contain embedded
  24326. nuls and need not be nul-terminated. If @pos is -1,
  24327. bytes are inserted at the end of the string.
  24328. Since this function does not stop at nul bytes, it is
  24329. the caller's responsibility to ensure that @val has at
  24330. least @len addressable bytes.</doc>
  24331. <return-value transfer-ownership="none">
  24332. <doc xml:space="preserve">@string</doc>
  24333. <type name="String" c:type="GString*"/>
  24334. </return-value>
  24335. <parameters>
  24336. <instance-parameter name="string" transfer-ownership="none">
  24337. <doc xml:space="preserve">a #GString</doc>
  24338. <type name="String" c:type="GString*"/>
  24339. </instance-parameter>
  24340. <parameter name="pos" transfer-ownership="none">
  24341. <doc xml:space="preserve">position in @string where insertion should
  24342. happen, or -1 for at the end</doc>
  24343. <type name="gssize" c:type="gssize"/>
  24344. </parameter>
  24345. <parameter name="val" transfer-ownership="none">
  24346. <doc xml:space="preserve">bytes to insert</doc>
  24347. <type name="utf8" c:type="const gchar*"/>
  24348. </parameter>
  24349. <parameter name="len" transfer-ownership="none">
  24350. <doc xml:space="preserve">number of bytes of @val to insert</doc>
  24351. <type name="gssize" c:type="gssize"/>
  24352. </parameter>
  24353. </parameters>
  24354. </method>
  24355. <method name="insert_unichar" c:identifier="g_string_insert_unichar">
  24356. <doc xml:space="preserve">Converts a Unicode character into UTF-8, and insert it
  24357. into the string at the given position.</doc>
  24358. <return-value transfer-ownership="none">
  24359. <doc xml:space="preserve">@string</doc>
  24360. <type name="String" c:type="GString*"/>
  24361. </return-value>
  24362. <parameters>
  24363. <instance-parameter name="string" transfer-ownership="none">
  24364. <doc xml:space="preserve">a #GString</doc>
  24365. <type name="String" c:type="GString*"/>
  24366. </instance-parameter>
  24367. <parameter name="pos" transfer-ownership="none">
  24368. <doc xml:space="preserve">the position at which to insert character, or -1
  24369. to append at the end of the string</doc>
  24370. <type name="gssize" c:type="gssize"/>
  24371. </parameter>
  24372. <parameter name="wc" transfer-ownership="none">
  24373. <doc xml:space="preserve">a Unicode character</doc>
  24374. <type name="gunichar" c:type="gunichar"/>
  24375. </parameter>
  24376. </parameters>
  24377. </method>
  24378. <method name="overwrite"
  24379. c:identifier="g_string_overwrite"
  24380. version="2.14">
  24381. <doc xml:space="preserve">Overwrites part of a string, lengthening it if necessary.</doc>
  24382. <return-value transfer-ownership="none">
  24383. <doc xml:space="preserve">@string</doc>
  24384. <type name="String" c:type="GString*"/>
  24385. </return-value>
  24386. <parameters>
  24387. <instance-parameter name="string" transfer-ownership="none">
  24388. <doc xml:space="preserve">a #GString</doc>
  24389. <type name="String" c:type="GString*"/>
  24390. </instance-parameter>
  24391. <parameter name="pos" transfer-ownership="none">
  24392. <doc xml:space="preserve">the position at which to start overwriting</doc>
  24393. <type name="gsize" c:type="gsize"/>
  24394. </parameter>
  24395. <parameter name="val" transfer-ownership="none">
  24396. <doc xml:space="preserve">the string that will overwrite the @string starting at @pos</doc>
  24397. <type name="utf8" c:type="const gchar*"/>
  24398. </parameter>
  24399. </parameters>
  24400. </method>
  24401. <method name="overwrite_len"
  24402. c:identifier="g_string_overwrite_len"
  24403. version="2.14">
  24404. <doc xml:space="preserve">Overwrites part of a string, lengthening it if necessary.
  24405. This function will work with embedded nuls.</doc>
  24406. <return-value transfer-ownership="none">
  24407. <doc xml:space="preserve">@string</doc>
  24408. <type name="String" c:type="GString*"/>
  24409. </return-value>
  24410. <parameters>
  24411. <instance-parameter name="string" transfer-ownership="none">
  24412. <doc xml:space="preserve">a #GString</doc>
  24413. <type name="String" c:type="GString*"/>
  24414. </instance-parameter>
  24415. <parameter name="pos" transfer-ownership="none">
  24416. <doc xml:space="preserve">the position at which to start overwriting</doc>
  24417. <type name="gsize" c:type="gsize"/>
  24418. </parameter>
  24419. <parameter name="val" transfer-ownership="none">
  24420. <doc xml:space="preserve">the string that will overwrite the @string starting at @pos</doc>
  24421. <type name="utf8" c:type="const gchar*"/>
  24422. </parameter>
  24423. <parameter name="len" transfer-ownership="none">
  24424. <doc xml:space="preserve">the number of bytes to write from @val</doc>
  24425. <type name="gssize" c:type="gssize"/>
  24426. </parameter>
  24427. </parameters>
  24428. </method>
  24429. <method name="prepend" c:identifier="g_string_prepend">
  24430. <doc xml:space="preserve">Adds a string on to the start of a #GString,
  24431. expanding it if necessary.</doc>
  24432. <return-value transfer-ownership="none">
  24433. <doc xml:space="preserve">@string</doc>
  24434. <type name="String" c:type="GString*"/>
  24435. </return-value>
  24436. <parameters>
  24437. <instance-parameter name="string" transfer-ownership="none">
  24438. <doc xml:space="preserve">a #GString</doc>
  24439. <type name="String" c:type="GString*"/>
  24440. </instance-parameter>
  24441. <parameter name="val" transfer-ownership="none">
  24442. <doc xml:space="preserve">the string to prepend on the start of @string</doc>
  24443. <type name="utf8" c:type="const gchar*"/>
  24444. </parameter>
  24445. </parameters>
  24446. </method>
  24447. <method name="prepend_c" c:identifier="g_string_prepend_c">
  24448. <doc xml:space="preserve">Adds a byte onto the start of a #GString,
  24449. expanding it if necessary.</doc>
  24450. <return-value transfer-ownership="none">
  24451. <doc xml:space="preserve">@string</doc>
  24452. <type name="String" c:type="GString*"/>
  24453. </return-value>
  24454. <parameters>
  24455. <instance-parameter name="string" transfer-ownership="none">
  24456. <doc xml:space="preserve">a #GString</doc>
  24457. <type name="String" c:type="GString*"/>
  24458. </instance-parameter>
  24459. <parameter name="c" transfer-ownership="none">
  24460. <doc xml:space="preserve">the byte to prepend on the start of the #GString</doc>
  24461. <type name="gchar" c:type="gchar"/>
  24462. </parameter>
  24463. </parameters>
  24464. </method>
  24465. <method name="prepend_len" c:identifier="g_string_prepend_len">
  24466. <doc xml:space="preserve">Prepends @len bytes of @val to @string.
  24467. Because @len is provided, @val may contain
  24468. embedded nuls and need not be nul-terminated.
  24469. Since this function does not stop at nul bytes,
  24470. it is the caller's responsibility to ensure that
  24471. @val has at least @len addressable bytes.</doc>
  24472. <return-value transfer-ownership="none">
  24473. <doc xml:space="preserve">@string</doc>
  24474. <type name="String" c:type="GString*"/>
  24475. </return-value>
  24476. <parameters>
  24477. <instance-parameter name="string" transfer-ownership="none">
  24478. <doc xml:space="preserve">a #GString</doc>
  24479. <type name="String" c:type="GString*"/>
  24480. </instance-parameter>
  24481. <parameter name="val" transfer-ownership="none">
  24482. <doc xml:space="preserve">bytes to prepend</doc>
  24483. <type name="utf8" c:type="const gchar*"/>
  24484. </parameter>
  24485. <parameter name="len" transfer-ownership="none">
  24486. <doc xml:space="preserve">number of bytes in @val to prepend</doc>
  24487. <type name="gssize" c:type="gssize"/>
  24488. </parameter>
  24489. </parameters>
  24490. </method>
  24491. <method name="prepend_unichar" c:identifier="g_string_prepend_unichar">
  24492. <doc xml:space="preserve">Converts a Unicode character into UTF-8, and prepends it
  24493. to the string.</doc>
  24494. <return-value transfer-ownership="none">
  24495. <doc xml:space="preserve">@string</doc>
  24496. <type name="String" c:type="GString*"/>
  24497. </return-value>
  24498. <parameters>
  24499. <instance-parameter name="string" transfer-ownership="none">
  24500. <doc xml:space="preserve">a #GString</doc>
  24501. <type name="String" c:type="GString*"/>
  24502. </instance-parameter>
  24503. <parameter name="wc" transfer-ownership="none">
  24504. <doc xml:space="preserve">a Unicode character</doc>
  24505. <type name="gunichar" c:type="gunichar"/>
  24506. </parameter>
  24507. </parameters>
  24508. </method>
  24509. <method name="printf" c:identifier="g_string_printf" introspectable="0">
  24510. <doc xml:space="preserve">Writes a formatted string into a #GString.
  24511. This is similar to the standard sprintf() function,
  24512. except that the #GString buffer automatically expands
  24513. to contain the results. The previous contents of the
  24514. #GString are destroyed.</doc>
  24515. <return-value transfer-ownership="none">
  24516. <type name="none" c:type="void"/>
  24517. </return-value>
  24518. <parameters>
  24519. <instance-parameter name="string" transfer-ownership="none">
  24520. <doc xml:space="preserve">a #GString</doc>
  24521. <type name="String" c:type="GString*"/>
  24522. </instance-parameter>
  24523. <parameter name="format" transfer-ownership="none">
  24524. <doc xml:space="preserve">the string format. See the printf() documentation</doc>
  24525. <type name="utf8" c:type="const gchar*"/>
  24526. </parameter>
  24527. <parameter name="..." transfer-ownership="none">
  24528. <doc xml:space="preserve">the parameters to insert into the format string</doc>
  24529. <varargs/>
  24530. </parameter>
  24531. </parameters>
  24532. </method>
  24533. <method name="set_size" c:identifier="g_string_set_size">
  24534. <doc xml:space="preserve">Sets the length of a #GString. If the length is less than
  24535. the current length, the string will be truncated. If the
  24536. length is greater than the current length, the contents
  24537. of the newly added area are undefined. (However, as
  24538. always, string-&gt;str[string-&gt;len] will be a nul byte.)</doc>
  24539. <return-value transfer-ownership="none">
  24540. <doc xml:space="preserve">@string</doc>
  24541. <type name="String" c:type="GString*"/>
  24542. </return-value>
  24543. <parameters>
  24544. <instance-parameter name="string" transfer-ownership="none">
  24545. <doc xml:space="preserve">a #GString</doc>
  24546. <type name="String" c:type="GString*"/>
  24547. </instance-parameter>
  24548. <parameter name="len" transfer-ownership="none">
  24549. <doc xml:space="preserve">the new length</doc>
  24550. <type name="gsize" c:type="gsize"/>
  24551. </parameter>
  24552. </parameters>
  24553. </method>
  24554. <method name="truncate" c:identifier="g_string_truncate">
  24555. <doc xml:space="preserve">Cuts off the end of the GString, leaving the first @len bytes.</doc>
  24556. <return-value transfer-ownership="none">
  24557. <doc xml:space="preserve">@string</doc>
  24558. <type name="String" c:type="GString*"/>
  24559. </return-value>
  24560. <parameters>
  24561. <instance-parameter name="string" transfer-ownership="none">
  24562. <doc xml:space="preserve">a #GString</doc>
  24563. <type name="String" c:type="GString*"/>
  24564. </instance-parameter>
  24565. <parameter name="len" transfer-ownership="none">
  24566. <doc xml:space="preserve">the new size of @string</doc>
  24567. <type name="gsize" c:type="gsize"/>
  24568. </parameter>
  24569. </parameters>
  24570. </method>
  24571. <method name="up"
  24572. c:identifier="g_string_up"
  24573. deprecated="1"
  24574. deprecated-version="2.2">
  24575. <doc xml:space="preserve">Converts a #GString to uppercase.</doc>
  24576. <doc-deprecated xml:space="preserve">This function uses the locale-specific
  24577. toupper() function, which is almost never the right thing.
  24578. Use g_string_ascii_up() or g_utf8_strup() instead.</doc-deprecated>
  24579. <return-value transfer-ownership="none">
  24580. <doc xml:space="preserve">@string</doc>
  24581. <type name="String" c:type="GString*"/>
  24582. </return-value>
  24583. <parameters>
  24584. <instance-parameter name="string" transfer-ownership="none">
  24585. <doc xml:space="preserve">a #GString</doc>
  24586. <type name="String" c:type="GString*"/>
  24587. </instance-parameter>
  24588. </parameters>
  24589. </method>
  24590. <method name="vprintf"
  24591. c:identifier="g_string_vprintf"
  24592. version="2.14"
  24593. introspectable="0">
  24594. <doc xml:space="preserve">Writes a formatted string into a #GString.
  24595. This function is similar to g_string_printf() except that
  24596. the arguments to the format string are passed as a va_list.</doc>
  24597. <return-value transfer-ownership="none">
  24598. <type name="none" c:type="void"/>
  24599. </return-value>
  24600. <parameters>
  24601. <instance-parameter name="string" transfer-ownership="none">
  24602. <doc xml:space="preserve">a #GString</doc>
  24603. <type name="String" c:type="GString*"/>
  24604. </instance-parameter>
  24605. <parameter name="format" transfer-ownership="none">
  24606. <doc xml:space="preserve">the string format. See the printf() documentation</doc>
  24607. <type name="utf8" c:type="const gchar*"/>
  24608. </parameter>
  24609. <parameter name="args" transfer-ownership="none">
  24610. <doc xml:space="preserve">the parameters to insert into the format string</doc>
  24611. <type name="va_list" c:type="va_list"/>
  24612. </parameter>
  24613. </parameters>
  24614. </method>
  24615. </record>
  24616. <record name="StringChunk" c:type="GStringChunk" disguised="1">
  24617. <doc xml:space="preserve">An opaque data structure representing String Chunks.
  24618. It should only be accessed by using the following functions.</doc>
  24619. <method name="clear" c:identifier="g_string_chunk_clear" version="2.14">
  24620. <doc xml:space="preserve">Frees all strings contained within the #GStringChunk.
  24621. After calling g_string_chunk_clear() it is not safe to
  24622. access any of the strings which were contained within it.</doc>
  24623. <return-value transfer-ownership="none">
  24624. <type name="none" c:type="void"/>
  24625. </return-value>
  24626. <parameters>
  24627. <instance-parameter name="chunk" transfer-ownership="none">
  24628. <doc xml:space="preserve">a #GStringChunk</doc>
  24629. <type name="StringChunk" c:type="GStringChunk*"/>
  24630. </instance-parameter>
  24631. </parameters>
  24632. </method>
  24633. <method name="free" c:identifier="g_string_chunk_free">
  24634. <doc xml:space="preserve">Frees all memory allocated by the #GStringChunk.
  24635. After calling g_string_chunk_free() it is not safe to
  24636. access any of the strings which were contained within it.</doc>
  24637. <return-value transfer-ownership="none">
  24638. <type name="none" c:type="void"/>
  24639. </return-value>
  24640. <parameters>
  24641. <instance-parameter name="chunk" transfer-ownership="none">
  24642. <doc xml:space="preserve">a #GStringChunk</doc>
  24643. <type name="StringChunk" c:type="GStringChunk*"/>
  24644. </instance-parameter>
  24645. </parameters>
  24646. </method>
  24647. <method name="insert" c:identifier="g_string_chunk_insert">
  24648. <doc xml:space="preserve">Adds a copy of @string to the #GStringChunk.
  24649. It returns a pointer to the new copy of the string
  24650. in the #GStringChunk. The characters in the string
  24651. can be changed, if necessary, though you should not
  24652. change anything after the end of the string.
  24653. Unlike g_string_chunk_insert_const(), this function
  24654. does not check for duplicates. Also strings added
  24655. with g_string_chunk_insert() will not be searched
  24656. by g_string_chunk_insert_const() when looking for
  24657. duplicates.</doc>
  24658. <return-value transfer-ownership="full">
  24659. <doc xml:space="preserve">a pointer to the copy of @string within
  24660. the #GStringChunk</doc>
  24661. <type name="utf8" c:type="gchar*"/>
  24662. </return-value>
  24663. <parameters>
  24664. <instance-parameter name="chunk" transfer-ownership="none">
  24665. <doc xml:space="preserve">a #GStringChunk</doc>
  24666. <type name="StringChunk" c:type="GStringChunk*"/>
  24667. </instance-parameter>
  24668. <parameter name="string" transfer-ownership="none">
  24669. <doc xml:space="preserve">the string to add</doc>
  24670. <type name="utf8" c:type="const gchar*"/>
  24671. </parameter>
  24672. </parameters>
  24673. </method>
  24674. <method name="insert_const" c:identifier="g_string_chunk_insert_const">
  24675. <doc xml:space="preserve">Adds a copy of @string to the #GStringChunk, unless the same
  24676. string has already been added to the #GStringChunk with
  24677. g_string_chunk_insert_const().
  24678. This function is useful if you need to copy a large number
  24679. of strings but do not want to waste space storing duplicates.
  24680. But you must remember that there may be several pointers to
  24681. the same string, and so any changes made to the strings
  24682. should be done very carefully.
  24683. Note that g_string_chunk_insert_const() will not return a
  24684. pointer to a string added with g_string_chunk_insert(), even
  24685. if they do match.</doc>
  24686. <return-value transfer-ownership="full">
  24687. <doc xml:space="preserve">a pointer to the new or existing copy of @string
  24688. within the #GStringChunk</doc>
  24689. <type name="utf8" c:type="gchar*"/>
  24690. </return-value>
  24691. <parameters>
  24692. <instance-parameter name="chunk" transfer-ownership="none">
  24693. <doc xml:space="preserve">a #GStringChunk</doc>
  24694. <type name="StringChunk" c:type="GStringChunk*"/>
  24695. </instance-parameter>
  24696. <parameter name="string" transfer-ownership="none">
  24697. <doc xml:space="preserve">the string to add</doc>
  24698. <type name="utf8" c:type="const gchar*"/>
  24699. </parameter>
  24700. </parameters>
  24701. </method>
  24702. <method name="insert_len"
  24703. c:identifier="g_string_chunk_insert_len"
  24704. version="2.4">
  24705. <doc xml:space="preserve">Adds a copy of the first @len bytes of @string to the #GStringChunk.
  24706. The copy is nul-terminated.
  24707. Since this function does not stop at nul bytes, it is the caller's
  24708. responsibility to ensure that @string has at least @len addressable
  24709. bytes.
  24710. The characters in the returned string can be changed, if necessary,
  24711. though you should not change anything after the end of the string.</doc>
  24712. <return-value transfer-ownership="full">
  24713. <doc xml:space="preserve">a pointer to the copy of @string within the #GStringChunk</doc>
  24714. <type name="utf8" c:type="gchar*"/>
  24715. </return-value>
  24716. <parameters>
  24717. <instance-parameter name="chunk" transfer-ownership="none">
  24718. <doc xml:space="preserve">a #GStringChunk</doc>
  24719. <type name="StringChunk" c:type="GStringChunk*"/>
  24720. </instance-parameter>
  24721. <parameter name="string" transfer-ownership="none">
  24722. <doc xml:space="preserve">bytes to insert</doc>
  24723. <type name="utf8" c:type="const gchar*"/>
  24724. </parameter>
  24725. <parameter name="len" transfer-ownership="none">
  24726. <doc xml:space="preserve">number of bytes of @string to insert, or -1 to insert a
  24727. nul-terminated string</doc>
  24728. <type name="gssize" c:type="gssize"/>
  24729. </parameter>
  24730. </parameters>
  24731. </method>
  24732. <function name="new"
  24733. c:identifier="g_string_chunk_new"
  24734. introspectable="0">
  24735. <doc xml:space="preserve">Creates a new #GStringChunk.</doc>
  24736. <return-value>
  24737. <doc xml:space="preserve">a new #GStringChunk</doc>
  24738. <type name="StringChunk" c:type="GStringChunk*"/>
  24739. </return-value>
  24740. <parameters>
  24741. <parameter name="size" transfer-ownership="none">
  24742. <doc xml:space="preserve">the default size of the blocks of memory which are
  24743. allocated to store the strings. If a particular string
  24744. is larger than this default size, a larger block of
  24745. memory will be allocated for it.</doc>
  24746. <type name="gsize" c:type="gsize"/>
  24747. </parameter>
  24748. </parameters>
  24749. </function>
  24750. </record>
  24751. <constant name="TIME_SPAN_DAY"
  24752. value="86400000000"
  24753. c:type="G_TIME_SPAN_DAY"
  24754. version="2.26">
  24755. <doc xml:space="preserve">Evaluates to a time span of one day.</doc>
  24756. <type name="gint64" c:type="gint64"/>
  24757. </constant>
  24758. <constant name="TIME_SPAN_HOUR"
  24759. value="3600000000"
  24760. c:type="G_TIME_SPAN_HOUR"
  24761. version="2.26">
  24762. <doc xml:space="preserve">Evaluates to a time span of one hour.</doc>
  24763. <type name="gint64" c:type="gint64"/>
  24764. </constant>
  24765. <constant name="TIME_SPAN_MILLISECOND"
  24766. value="1000"
  24767. c:type="G_TIME_SPAN_MILLISECOND"
  24768. version="2.26">
  24769. <doc xml:space="preserve">Evaluates to a time span of one millisecond.</doc>
  24770. <type name="gint64" c:type="gint64"/>
  24771. </constant>
  24772. <constant name="TIME_SPAN_MINUTE"
  24773. value="60000000"
  24774. c:type="G_TIME_SPAN_MINUTE"
  24775. version="2.26">
  24776. <doc xml:space="preserve">Evaluates to a time span of one minute.</doc>
  24777. <type name="gint64" c:type="gint64"/>
  24778. </constant>
  24779. <constant name="TIME_SPAN_SECOND"
  24780. value="1000000"
  24781. c:type="G_TIME_SPAN_SECOND"
  24782. version="2.26">
  24783. <doc xml:space="preserve">Evaluates to a time span of one second.</doc>
  24784. <type name="gint64" c:type="gint64"/>
  24785. </constant>
  24786. <record name="TestCase" c:type="GTestCase" disguised="1">
  24787. <doc xml:space="preserve">An opaque structure representing a test case.</doc>
  24788. </record>
  24789. <record name="TestConfig" c:type="GTestConfig">
  24790. <field name="test_initialized" writable="1">
  24791. <type name="gboolean" c:type="gboolean"/>
  24792. </field>
  24793. <field name="test_quick" writable="1">
  24794. <type name="gboolean" c:type="gboolean"/>
  24795. </field>
  24796. <field name="test_perf" writable="1">
  24797. <type name="gboolean" c:type="gboolean"/>
  24798. </field>
  24799. <field name="test_verbose" writable="1">
  24800. <type name="gboolean" c:type="gboolean"/>
  24801. </field>
  24802. <field name="test_quiet" writable="1">
  24803. <type name="gboolean" c:type="gboolean"/>
  24804. </field>
  24805. <field name="test_undefined" writable="1">
  24806. <type name="gboolean" c:type="gboolean"/>
  24807. </field>
  24808. </record>
  24809. <callback name="TestDataFunc" c:type="GTestDataFunc" version="2.28">
  24810. <doc xml:space="preserve">The type used for test case functions that take an extra pointer
  24811. argument.</doc>
  24812. <return-value transfer-ownership="none">
  24813. <type name="none" c:type="void"/>
  24814. </return-value>
  24815. <parameters>
  24816. <parameter name="user_data"
  24817. transfer-ownership="none"
  24818. nullable="1"
  24819. allow-none="1"
  24820. closure="0">
  24821. <doc xml:space="preserve">the data provided when registering the test</doc>
  24822. <type name="gpointer" c:type="gconstpointer"/>
  24823. </parameter>
  24824. </parameters>
  24825. </callback>
  24826. <enumeration name="TestFileType" version="2.38" c:type="GTestFileType">
  24827. <doc xml:space="preserve">The type of file to return the filename for, when used with
  24828. g_test_build_filename().
  24829. These two options correspond rather directly to the 'dist' and
  24830. 'built' terminology that automake uses and are explicitly used to
  24831. distinguish between the 'srcdir' and 'builddir' being separate. All
  24832. files in your project should either be dist (in the
  24833. `DIST_EXTRA` or `dist_schema_DATA`
  24834. sense, in which case they will always be in the srcdir) or built (in
  24835. the `BUILT_SOURCES` sense, in which case they will
  24836. always be in the builddir).
  24837. Note: as a general rule of automake, files that are generated only as
  24838. part of the build-from-git process (but then are distributed with the
  24839. tarball) always go in srcdir (even if doing a srcdir != builddir
  24840. build from git) and are considered as distributed files.</doc>
  24841. <member name="dist" value="0" c:identifier="G_TEST_DIST">
  24842. <doc xml:space="preserve">a file that was included in the distribution tarball</doc>
  24843. </member>
  24844. <member name="built" value="1" c:identifier="G_TEST_BUILT">
  24845. <doc xml:space="preserve">a file that was built on the compiling machine</doc>
  24846. </member>
  24847. </enumeration>
  24848. <callback name="TestFixtureFunc" c:type="GTestFixtureFunc" version="2.28">
  24849. <doc xml:space="preserve">The type used for functions that operate on test fixtures. This is
  24850. used for the fixture setup and teardown functions as well as for the
  24851. testcases themselves.
  24852. @user_data is a pointer to the data that was given when registering
  24853. the test case.
  24854. @fixture will be a pointer to the area of memory allocated by the
  24855. test framework, of the size requested. If the requested size was
  24856. zero then @fixture will be equal to @user_data.</doc>
  24857. <return-value transfer-ownership="none">
  24858. <type name="none" c:type="void"/>
  24859. </return-value>
  24860. <parameters>
  24861. <parameter name="fixture" transfer-ownership="none">
  24862. <doc xml:space="preserve">the test fixture</doc>
  24863. <type name="gpointer" c:type="gpointer"/>
  24864. </parameter>
  24865. <parameter name="user_data"
  24866. transfer-ownership="none"
  24867. nullable="1"
  24868. allow-none="1"
  24869. closure="1">
  24870. <doc xml:space="preserve">the data provided when registering the test</doc>
  24871. <type name="gpointer" c:type="gconstpointer"/>
  24872. </parameter>
  24873. </parameters>
  24874. </callback>
  24875. <callback name="TestFunc" c:type="GTestFunc" version="2.28">
  24876. <doc xml:space="preserve">The type used for test case functions.</doc>
  24877. <return-value transfer-ownership="none">
  24878. <type name="none" c:type="void"/>
  24879. </return-value>
  24880. </callback>
  24881. <record name="TestLogBuffer" c:type="GTestLogBuffer">
  24882. <field name="data" readable="0" private="1">
  24883. <type name="String" c:type="GString*"/>
  24884. </field>
  24885. <field name="msgs" readable="0" private="1">
  24886. <type name="GLib.SList" c:type="GSList*">
  24887. <type name="gpointer" c:type="gpointer"/>
  24888. </type>
  24889. </field>
  24890. <method name="free" c:identifier="g_test_log_buffer_free">
  24891. <doc xml:space="preserve">Internal function for gtester to free test log messages, no ABI guarantees provided.</doc>
  24892. <return-value transfer-ownership="none">
  24893. <type name="none" c:type="void"/>
  24894. </return-value>
  24895. <parameters>
  24896. <instance-parameter name="tbuffer" transfer-ownership="none">
  24897. <type name="TestLogBuffer" c:type="GTestLogBuffer*"/>
  24898. </instance-parameter>
  24899. </parameters>
  24900. </method>
  24901. <method name="pop"
  24902. c:identifier="g_test_log_buffer_pop"
  24903. introspectable="0">
  24904. <doc xml:space="preserve">Internal function for gtester to retrieve test log messages, no ABI guarantees provided.</doc>
  24905. <return-value>
  24906. <type name="TestLogMsg" c:type="GTestLogMsg*"/>
  24907. </return-value>
  24908. <parameters>
  24909. <instance-parameter name="tbuffer" transfer-ownership="none">
  24910. <type name="TestLogBuffer" c:type="GTestLogBuffer*"/>
  24911. </instance-parameter>
  24912. </parameters>
  24913. </method>
  24914. <method name="push" c:identifier="g_test_log_buffer_push">
  24915. <doc xml:space="preserve">Internal function for gtester to decode test log messages, no ABI guarantees provided.</doc>
  24916. <return-value transfer-ownership="none">
  24917. <type name="none" c:type="void"/>
  24918. </return-value>
  24919. <parameters>
  24920. <instance-parameter name="tbuffer" transfer-ownership="none">
  24921. <type name="TestLogBuffer" c:type="GTestLogBuffer*"/>
  24922. </instance-parameter>
  24923. <parameter name="n_bytes" transfer-ownership="none">
  24924. <type name="guint" c:type="guint"/>
  24925. </parameter>
  24926. <parameter name="bytes" transfer-ownership="none">
  24927. <type name="guint8" c:type="const guint8*"/>
  24928. </parameter>
  24929. </parameters>
  24930. </method>
  24931. <function name="new"
  24932. c:identifier="g_test_log_buffer_new"
  24933. introspectable="0">
  24934. <doc xml:space="preserve">Internal function for gtester to decode test log messages, no ABI guarantees provided.</doc>
  24935. <return-value>
  24936. <type name="TestLogBuffer" c:type="GTestLogBuffer*"/>
  24937. </return-value>
  24938. </function>
  24939. </record>
  24940. <callback name="TestLogFatalFunc"
  24941. c:type="GTestLogFatalFunc"
  24942. version="2.22">
  24943. <doc xml:space="preserve">Specifies the prototype of fatal log handler functions.</doc>
  24944. <return-value transfer-ownership="none">
  24945. <doc xml:space="preserve">%TRUE if the program should abort, %FALSE otherwise</doc>
  24946. <type name="gboolean" c:type="gboolean"/>
  24947. </return-value>
  24948. <parameters>
  24949. <parameter name="log_domain" transfer-ownership="none">
  24950. <doc xml:space="preserve">the log domain of the message</doc>
  24951. <type name="utf8" c:type="const gchar*"/>
  24952. </parameter>
  24953. <parameter name="log_level" transfer-ownership="none">
  24954. <doc xml:space="preserve">the log level of the message (including the fatal and recursion flags)</doc>
  24955. <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
  24956. </parameter>
  24957. <parameter name="message" transfer-ownership="none">
  24958. <doc xml:space="preserve">the message to process</doc>
  24959. <type name="utf8" c:type="const gchar*"/>
  24960. </parameter>
  24961. <parameter name="user_data"
  24962. transfer-ownership="none"
  24963. nullable="1"
  24964. allow-none="1"
  24965. closure="3">
  24966. <doc xml:space="preserve">user data, set in g_test_log_set_fatal_handler()</doc>
  24967. <type name="gpointer" c:type="gpointer"/>
  24968. </parameter>
  24969. </parameters>
  24970. </callback>
  24971. <record name="TestLogMsg" c:type="GTestLogMsg">
  24972. <field name="log_type" writable="1">
  24973. <type name="TestLogType" c:type="GTestLogType"/>
  24974. </field>
  24975. <field name="n_strings" writable="1">
  24976. <type name="guint" c:type="guint"/>
  24977. </field>
  24978. <field name="strings" writable="1">
  24979. <type name="utf8" c:type="gchar**"/>
  24980. </field>
  24981. <field name="n_nums" writable="1">
  24982. <type name="guint" c:type="guint"/>
  24983. </field>
  24984. <field name="nums" writable="1">
  24985. <type name="glong" c:type="long*"/>
  24986. </field>
  24987. <method name="free" c:identifier="g_test_log_msg_free">
  24988. <doc xml:space="preserve">Internal function for gtester to free test log messages, no ABI guarantees provided.</doc>
  24989. <return-value transfer-ownership="none">
  24990. <type name="none" c:type="void"/>
  24991. </return-value>
  24992. <parameters>
  24993. <instance-parameter name="tmsg" transfer-ownership="none">
  24994. <type name="TestLogMsg" c:type="GTestLogMsg*"/>
  24995. </instance-parameter>
  24996. </parameters>
  24997. </method>
  24998. </record>
  24999. <enumeration name="TestLogType" c:type="GTestLogType">
  25000. <member name="none" value="0" c:identifier="G_TEST_LOG_NONE">
  25001. </member>
  25002. <member name="error" value="1" c:identifier="G_TEST_LOG_ERROR">
  25003. </member>
  25004. <member name="start_binary"
  25005. value="2"
  25006. c:identifier="G_TEST_LOG_START_BINARY">
  25007. </member>
  25008. <member name="list_case" value="3" c:identifier="G_TEST_LOG_LIST_CASE">
  25009. </member>
  25010. <member name="skip_case" value="4" c:identifier="G_TEST_LOG_SKIP_CASE">
  25011. </member>
  25012. <member name="start_case" value="5" c:identifier="G_TEST_LOG_START_CASE">
  25013. </member>
  25014. <member name="stop_case" value="6" c:identifier="G_TEST_LOG_STOP_CASE">
  25015. </member>
  25016. <member name="min_result" value="7" c:identifier="G_TEST_LOG_MIN_RESULT">
  25017. </member>
  25018. <member name="max_result" value="8" c:identifier="G_TEST_LOG_MAX_RESULT">
  25019. </member>
  25020. <member name="message" value="9" c:identifier="G_TEST_LOG_MESSAGE">
  25021. </member>
  25022. <member name="start_suite"
  25023. value="10"
  25024. c:identifier="G_TEST_LOG_START_SUITE">
  25025. </member>
  25026. <member name="stop_suite"
  25027. value="11"
  25028. c:identifier="G_TEST_LOG_STOP_SUITE">
  25029. </member>
  25030. </enumeration>
  25031. <bitfield name="TestSubprocessFlags" c:type="GTestSubprocessFlags">
  25032. <doc xml:space="preserve">Flags to pass to g_test_trap_subprocess() to control input and output.
  25033. Note that in contrast with g_test_trap_fork(), the default is to
  25034. not show stdout and stderr.</doc>
  25035. <member name="stdin"
  25036. value="1"
  25037. c:identifier="G_TEST_SUBPROCESS_INHERIT_STDIN">
  25038. <doc xml:space="preserve">If this flag is given, the child
  25039. process will inherit the parent's stdin. Otherwise, the child's
  25040. stdin is redirected to `/dev/null`.</doc>
  25041. </member>
  25042. <member name="stdout"
  25043. value="2"
  25044. c:identifier="G_TEST_SUBPROCESS_INHERIT_STDOUT">
  25045. <doc xml:space="preserve">If this flag is given, the child
  25046. process will inherit the parent's stdout. Otherwise, the child's
  25047. stdout will not be visible, but it will be captured to allow
  25048. later tests with g_test_trap_assert_stdout().</doc>
  25049. </member>
  25050. <member name="stderr"
  25051. value="4"
  25052. c:identifier="G_TEST_SUBPROCESS_INHERIT_STDERR">
  25053. <doc xml:space="preserve">If this flag is given, the child
  25054. process will inherit the parent's stderr. Otherwise, the child's
  25055. stderr will not be visible, but it will be captured to allow
  25056. later tests with g_test_trap_assert_stderr().</doc>
  25057. </member>
  25058. </bitfield>
  25059. <record name="TestSuite" c:type="GTestSuite" disguised="1">
  25060. <doc xml:space="preserve">An opaque structure representing a test suite.</doc>
  25061. <method name="add" c:identifier="g_test_suite_add" version="2.16">
  25062. <doc xml:space="preserve">Adds @test_case to @suite.</doc>
  25063. <return-value transfer-ownership="none">
  25064. <type name="none" c:type="void"/>
  25065. </return-value>
  25066. <parameters>
  25067. <instance-parameter name="suite" transfer-ownership="none">
  25068. <doc xml:space="preserve">a #GTestSuite</doc>
  25069. <type name="TestSuite" c:type="GTestSuite*"/>
  25070. </instance-parameter>
  25071. <parameter name="test_case" transfer-ownership="none">
  25072. <doc xml:space="preserve">a #GTestCase</doc>
  25073. <type name="TestCase" c:type="GTestCase*"/>
  25074. </parameter>
  25075. </parameters>
  25076. </method>
  25077. <method name="add_suite"
  25078. c:identifier="g_test_suite_add_suite"
  25079. version="2.16">
  25080. <doc xml:space="preserve">Adds @nestedsuite to @suite.</doc>
  25081. <return-value transfer-ownership="none">
  25082. <type name="none" c:type="void"/>
  25083. </return-value>
  25084. <parameters>
  25085. <instance-parameter name="suite" transfer-ownership="none">
  25086. <doc xml:space="preserve">a #GTestSuite</doc>
  25087. <type name="TestSuite" c:type="GTestSuite*"/>
  25088. </instance-parameter>
  25089. <parameter name="nestedsuite" transfer-ownership="none">
  25090. <doc xml:space="preserve">another #GTestSuite</doc>
  25091. <type name="TestSuite" c:type="GTestSuite*"/>
  25092. </parameter>
  25093. </parameters>
  25094. </method>
  25095. </record>
  25096. <bitfield name="TestTrapFlags" deprecated="1" c:type="GTestTrapFlags">
  25097. <doc xml:space="preserve">Test traps are guards around forked tests.
  25098. These flags determine what traps to set.</doc>
  25099. <doc-deprecated xml:space="preserve">#GTestTrapFlags is used only with g_test_trap_fork(),
  25100. which is deprecated. g_test_trap_subprocess() uses
  25101. #GTestTrapSubprocessFlags.</doc-deprecated>
  25102. <member name="silence_stdout"
  25103. value="128"
  25104. c:identifier="G_TEST_TRAP_SILENCE_STDOUT">
  25105. <doc xml:space="preserve">Redirect stdout of the test child to
  25106. `/dev/null` so it cannot be observed on the console during test
  25107. runs. The actual output is still captured though to allow later
  25108. tests with g_test_trap_assert_stdout().</doc>
  25109. </member>
  25110. <member name="silence_stderr"
  25111. value="256"
  25112. c:identifier="G_TEST_TRAP_SILENCE_STDERR">
  25113. <doc xml:space="preserve">Redirect stderr of the test child to
  25114. `/dev/null` so it cannot be observed on the console during test
  25115. runs. The actual output is still captured though to allow later
  25116. tests with g_test_trap_assert_stderr().</doc>
  25117. </member>
  25118. <member name="inherit_stdin"
  25119. value="512"
  25120. c:identifier="G_TEST_TRAP_INHERIT_STDIN">
  25121. <doc xml:space="preserve">If this flag is given, stdin of the
  25122. child process is shared with stdin of its parent process.
  25123. It is redirected to `/dev/null` otherwise.</doc>
  25124. </member>
  25125. </bitfield>
  25126. <record name="Thread"
  25127. c:type="GThread"
  25128. glib:type-name="GThread"
  25129. glib:get-type="g_thread_get_type"
  25130. c:symbol-prefix="thread">
  25131. <doc xml:space="preserve">The #GThread struct represents a running thread. This struct
  25132. is returned by g_thread_new() or g_thread_try_new(). You can
  25133. obtain the #GThread struct representing the current thread by
  25134. calling g_thread_self().
  25135. GThread is refcounted, see g_thread_ref() and g_thread_unref().
  25136. The thread represented by it holds a reference while it is running,
  25137. and g_thread_join() consumes the reference that it is given, so
  25138. it is normally not necessary to manage GThread references
  25139. explicitly.
  25140. The structure is opaque -- none of its fields may be directly
  25141. accessed.</doc>
  25142. <constructor name="new"
  25143. c:identifier="g_thread_new"
  25144. version="2.32"
  25145. introspectable="0">
  25146. <doc xml:space="preserve">This function creates a new thread. The new thread starts by invoking
  25147. @func with the argument data. The thread will run until @func returns
  25148. or until g_thread_exit() is called from the new thread. The return value
  25149. of @func becomes the return value of the thread, which can be obtained
  25150. with g_thread_join().
  25151. The @name can be useful for discriminating threads in a debugger.
  25152. It is not used for other purposes and does not have to be unique.
  25153. Some systems restrict the length of @name to 16 bytes.
  25154. If the thread can not be created the program aborts. See
  25155. g_thread_try_new() if you want to attempt to deal with failures.
  25156. If you are using threads to offload (potentially many) short-lived tasks,
  25157. #GThreadPool may be more appropriate than manually spawning and tracking
  25158. multiple #GThreads.
  25159. To free the struct returned by this function, use g_thread_unref().
  25160. Note that g_thread_join() implicitly unrefs the #GThread as well.</doc>
  25161. <return-value transfer-ownership="full">
  25162. <doc xml:space="preserve">the new #GThread</doc>
  25163. <type name="Thread" c:type="GThread*"/>
  25164. </return-value>
  25165. <parameters>
  25166. <parameter name="name"
  25167. transfer-ownership="none"
  25168. nullable="1"
  25169. allow-none="1">
  25170. <doc xml:space="preserve">an (optional) name for the new thread</doc>
  25171. <type name="utf8" c:type="const gchar*"/>
  25172. </parameter>
  25173. <parameter name="func" transfer-ownership="none" closure="2">
  25174. <doc xml:space="preserve">a function to execute in the new thread</doc>
  25175. <type name="ThreadFunc" c:type="GThreadFunc"/>
  25176. </parameter>
  25177. <parameter name="data"
  25178. transfer-ownership="none"
  25179. nullable="1"
  25180. allow-none="1">
  25181. <doc xml:space="preserve">an argument to supply to the new thread</doc>
  25182. <type name="gpointer" c:type="gpointer"/>
  25183. </parameter>
  25184. </parameters>
  25185. </constructor>
  25186. <constructor name="try_new"
  25187. c:identifier="g_thread_try_new"
  25188. version="2.32"
  25189. introspectable="0"
  25190. throws="1">
  25191. <doc xml:space="preserve">This function is the same as g_thread_new() except that
  25192. it allows for the possibility of failure.
  25193. If a thread can not be created (due to resource limits),
  25194. @error is set and %NULL is returned.</doc>
  25195. <return-value transfer-ownership="full">
  25196. <doc xml:space="preserve">the new #GThread, or %NULL if an error occurred</doc>
  25197. <type name="Thread" c:type="GThread*"/>
  25198. </return-value>
  25199. <parameters>
  25200. <parameter name="name"
  25201. transfer-ownership="none"
  25202. nullable="1"
  25203. allow-none="1">
  25204. <doc xml:space="preserve">an (optional) name for the new thread</doc>
  25205. <type name="utf8" c:type="const gchar*"/>
  25206. </parameter>
  25207. <parameter name="func" transfer-ownership="none" closure="2">
  25208. <doc xml:space="preserve">a function to execute in the new thread</doc>
  25209. <type name="ThreadFunc" c:type="GThreadFunc"/>
  25210. </parameter>
  25211. <parameter name="data"
  25212. transfer-ownership="none"
  25213. nullable="1"
  25214. allow-none="1">
  25215. <doc xml:space="preserve">an argument to supply to the new thread</doc>
  25216. <type name="gpointer" c:type="gpointer"/>
  25217. </parameter>
  25218. </parameters>
  25219. </constructor>
  25220. <method name="join" c:identifier="g_thread_join">
  25221. <doc xml:space="preserve">Waits until @thread finishes, i.e. the function @func, as
  25222. given to g_thread_new(), returns or g_thread_exit() is called.
  25223. If @thread has already terminated, then g_thread_join()
  25224. returns immediately.
  25225. Any thread can wait for any other thread by calling g_thread_join(),
  25226. not just its 'creator'. Calling g_thread_join() from multiple threads
  25227. for the same @thread leads to undefined behaviour.
  25228. The value returned by @func or given to g_thread_exit() is
  25229. returned by this function.
  25230. g_thread_join() consumes the reference to the passed-in @thread.
  25231. This will usually cause the #GThread struct and associated resources
  25232. to be freed. Use g_thread_ref() to obtain an extra reference if you
  25233. want to keep the GThread alive beyond the g_thread_join() call.</doc>
  25234. <return-value transfer-ownership="none" nullable="1">
  25235. <doc xml:space="preserve">the return value of the thread</doc>
  25236. <type name="gpointer" c:type="gpointer"/>
  25237. </return-value>
  25238. <parameters>
  25239. <instance-parameter name="thread" transfer-ownership="none">
  25240. <doc xml:space="preserve">a #GThread</doc>
  25241. <type name="Thread" c:type="GThread*"/>
  25242. </instance-parameter>
  25243. </parameters>
  25244. </method>
  25245. <method name="ref" c:identifier="g_thread_ref" version="2.32">
  25246. <doc xml:space="preserve">Increase the reference count on @thread.</doc>
  25247. <return-value transfer-ownership="full">
  25248. <doc xml:space="preserve">a new reference to @thread</doc>
  25249. <type name="Thread" c:type="GThread*"/>
  25250. </return-value>
  25251. <parameters>
  25252. <instance-parameter name="thread" transfer-ownership="none">
  25253. <doc xml:space="preserve">a #GThread</doc>
  25254. <type name="Thread" c:type="GThread*"/>
  25255. </instance-parameter>
  25256. </parameters>
  25257. </method>
  25258. <method name="unref" c:identifier="g_thread_unref" version="2.32">
  25259. <doc xml:space="preserve">Decrease the reference count on @thread, possibly freeing all
  25260. resources associated with it.
  25261. Note that each thread holds a reference to its #GThread while
  25262. it is running, so it is safe to drop your own reference to it
  25263. if you don't need it anymore.</doc>
  25264. <return-value transfer-ownership="none">
  25265. <type name="none" c:type="void"/>
  25266. </return-value>
  25267. <parameters>
  25268. <instance-parameter name="thread" transfer-ownership="none">
  25269. <doc xml:space="preserve">a #GThread</doc>
  25270. <type name="Thread" c:type="GThread*"/>
  25271. </instance-parameter>
  25272. </parameters>
  25273. </method>
  25274. <function name="error_quark" c:identifier="g_thread_error_quark">
  25275. <return-value transfer-ownership="none">
  25276. <type name="Quark" c:type="GQuark"/>
  25277. </return-value>
  25278. </function>
  25279. <function name="exit" c:identifier="g_thread_exit">
  25280. <doc xml:space="preserve">Terminates the current thread.
  25281. If another thread is waiting for us using g_thread_join() then the
  25282. waiting thread will be woken up and get @retval as the return value
  25283. of g_thread_join().
  25284. Calling g_thread_exit() with a parameter @retval is equivalent to
  25285. returning @retval from the function @func, as given to g_thread_new().
  25286. You must only call g_thread_exit() from a thread that you created
  25287. yourself with g_thread_new() or related APIs. You must not call
  25288. this function from a thread created with another threading library
  25289. or or from within a #GThreadPool.</doc>
  25290. <return-value transfer-ownership="none">
  25291. <type name="none" c:type="void"/>
  25292. </return-value>
  25293. <parameters>
  25294. <parameter name="retval"
  25295. transfer-ownership="none"
  25296. nullable="1"
  25297. allow-none="1">
  25298. <doc xml:space="preserve">the return value of this thread</doc>
  25299. <type name="gpointer" c:type="gpointer"/>
  25300. </parameter>
  25301. </parameters>
  25302. </function>
  25303. <function name="self" c:identifier="g_thread_self">
  25304. <doc xml:space="preserve">This function returns the #GThread corresponding to the
  25305. current thread. Note that this function does not increase
  25306. the reference count of the returned struct.
  25307. This function will return a #GThread even for threads that
  25308. were not created by GLib (i.e. those created by other threading
  25309. APIs). This may be useful for thread identification purposes
  25310. (i.e. comparisons) but you must not use GLib functions (such
  25311. as g_thread_join()) on these threads.</doc>
  25312. <return-value transfer-ownership="full">
  25313. <doc xml:space="preserve">the #GThread representing the current thread</doc>
  25314. <type name="Thread" c:type="GThread*"/>
  25315. </return-value>
  25316. </function>
  25317. <function name="yield" c:identifier="g_thread_yield">
  25318. <doc xml:space="preserve">Causes the calling thread to voluntarily relinquish the CPU, so
  25319. that other threads can run.
  25320. This function is often used as a method to make busy wait less evil.</doc>
  25321. <return-value transfer-ownership="none">
  25322. <type name="none" c:type="void"/>
  25323. </return-value>
  25324. </function>
  25325. </record>
  25326. <enumeration name="ThreadError"
  25327. c:type="GThreadError"
  25328. glib:error-domain="g_thread_error">
  25329. <doc xml:space="preserve">Possible errors of thread related functions.</doc>
  25330. <member name="thread_error_again"
  25331. value="0"
  25332. c:identifier="G_THREAD_ERROR_AGAIN">
  25333. <doc xml:space="preserve">a thread couldn't be created due to resource
  25334. shortage. Try again later.</doc>
  25335. </member>
  25336. </enumeration>
  25337. <callback name="ThreadFunc" c:type="GThreadFunc">
  25338. <doc xml:space="preserve">Specifies the type of the @func functions passed to g_thread_new()
  25339. or g_thread_try_new().</doc>
  25340. <return-value transfer-ownership="none" nullable="1">
  25341. <doc xml:space="preserve">the return value of the thread</doc>
  25342. <type name="gpointer" c:type="gpointer"/>
  25343. </return-value>
  25344. <parameters>
  25345. <parameter name="data"
  25346. transfer-ownership="none"
  25347. nullable="1"
  25348. allow-none="1">
  25349. <doc xml:space="preserve">data passed to the thread</doc>
  25350. <type name="gpointer" c:type="gpointer"/>
  25351. </parameter>
  25352. </parameters>
  25353. </callback>
  25354. <record name="ThreadPool" c:type="GThreadPool">
  25355. <doc xml:space="preserve">The #GThreadPool struct represents a thread pool. It has three
  25356. public read-only members, but the underlying struct is bigger,
  25357. so you must not copy this struct.</doc>
  25358. <field name="func" writable="1">
  25359. <doc xml:space="preserve">the function to execute in the threads of this pool</doc>
  25360. <type name="Func" c:type="GFunc"/>
  25361. </field>
  25362. <field name="user_data" writable="1">
  25363. <doc xml:space="preserve">the user data for the threads of this pool</doc>
  25364. <type name="gpointer" c:type="gpointer"/>
  25365. </field>
  25366. <field name="exclusive" writable="1">
  25367. <doc xml:space="preserve">are all threads exclusive to this pool</doc>
  25368. <type name="gboolean" c:type="gboolean"/>
  25369. </field>
  25370. <method name="free" c:identifier="g_thread_pool_free">
  25371. <doc xml:space="preserve">Frees all resources allocated for @pool.
  25372. If @immediate is %TRUE, no new task is processed for @pool.
  25373. Otherwise @pool is not freed before the last task is processed.
  25374. Note however, that no thread of this pool is interrupted while
  25375. processing a task. Instead at least all still running threads
  25376. can finish their tasks before the @pool is freed.
  25377. If @wait_ is %TRUE, the functions does not return before all
  25378. tasks to be processed (dependent on @immediate, whether all
  25379. or only the currently running) are ready.
  25380. Otherwise the function returns immediately.
  25381. After calling this function @pool must not be used anymore.</doc>
  25382. <return-value transfer-ownership="none">
  25383. <type name="none" c:type="void"/>
  25384. </return-value>
  25385. <parameters>
  25386. <instance-parameter name="pool" transfer-ownership="none">
  25387. <doc xml:space="preserve">a #GThreadPool</doc>
  25388. <type name="ThreadPool" c:type="GThreadPool*"/>
  25389. </instance-parameter>
  25390. <parameter name="immediate" transfer-ownership="none">
  25391. <doc xml:space="preserve">should @pool shut down immediately?</doc>
  25392. <type name="gboolean" c:type="gboolean"/>
  25393. </parameter>
  25394. <parameter name="wait_" transfer-ownership="none">
  25395. <doc xml:space="preserve">should the function wait for all tasks to be finished?</doc>
  25396. <type name="gboolean" c:type="gboolean"/>
  25397. </parameter>
  25398. </parameters>
  25399. </method>
  25400. <method name="get_max_threads"
  25401. c:identifier="g_thread_pool_get_max_threads">
  25402. <doc xml:space="preserve">Returns the maximal number of threads for @pool.</doc>
  25403. <return-value transfer-ownership="none">
  25404. <doc xml:space="preserve">the maximal number of threads</doc>
  25405. <type name="gint" c:type="gint"/>
  25406. </return-value>
  25407. <parameters>
  25408. <instance-parameter name="pool" transfer-ownership="none">
  25409. <doc xml:space="preserve">a #GThreadPool</doc>
  25410. <type name="ThreadPool" c:type="GThreadPool*"/>
  25411. </instance-parameter>
  25412. </parameters>
  25413. </method>
  25414. <method name="get_num_threads"
  25415. c:identifier="g_thread_pool_get_num_threads">
  25416. <doc xml:space="preserve">Returns the number of threads currently running in @pool.</doc>
  25417. <return-value transfer-ownership="none">
  25418. <doc xml:space="preserve">the number of threads currently running</doc>
  25419. <type name="guint" c:type="guint"/>
  25420. </return-value>
  25421. <parameters>
  25422. <instance-parameter name="pool" transfer-ownership="none">
  25423. <doc xml:space="preserve">a #GThreadPool</doc>
  25424. <type name="ThreadPool" c:type="GThreadPool*"/>
  25425. </instance-parameter>
  25426. </parameters>
  25427. </method>
  25428. <method name="move_to_front"
  25429. c:identifier="g_thread_pool_move_to_front"
  25430. version="2.46">
  25431. <doc xml:space="preserve">Moves the item to the front of the queue of unprocessed
  25432. items, so that it will be processed next.</doc>
  25433. <return-value transfer-ownership="none">
  25434. <doc xml:space="preserve">%TRUE if the item was found and moved</doc>
  25435. <type name="gboolean" c:type="gboolean"/>
  25436. </return-value>
  25437. <parameters>
  25438. <instance-parameter name="pool" transfer-ownership="none">
  25439. <doc xml:space="preserve">a #GThreadPool</doc>
  25440. <type name="ThreadPool" c:type="GThreadPool*"/>
  25441. </instance-parameter>
  25442. <parameter name="data"
  25443. transfer-ownership="none"
  25444. nullable="1"
  25445. allow-none="1">
  25446. <doc xml:space="preserve">an unprocessed item in the pool</doc>
  25447. <type name="gpointer" c:type="gpointer"/>
  25448. </parameter>
  25449. </parameters>
  25450. </method>
  25451. <method name="push" c:identifier="g_thread_pool_push" throws="1">
  25452. <doc xml:space="preserve">Inserts @data into the list of tasks to be executed by @pool.
  25453. When the number of currently running threads is lower than the
  25454. maximal allowed number of threads, a new thread is started (or
  25455. reused) with the properties given to g_thread_pool_new().
  25456. Otherwise, @data stays in the queue until a thread in this pool
  25457. finishes its previous task and processes @data.
  25458. @error can be %NULL to ignore errors, or non-%NULL to report
  25459. errors. An error can only occur when a new thread couldn't be
  25460. created. In that case @data is simply appended to the queue of
  25461. work to do.
  25462. Before version 2.32, this function did not return a success status.</doc>
  25463. <return-value transfer-ownership="none">
  25464. <doc xml:space="preserve">%TRUE on success, %FALSE if an error occurred</doc>
  25465. <type name="gboolean" c:type="gboolean"/>
  25466. </return-value>
  25467. <parameters>
  25468. <instance-parameter name="pool" transfer-ownership="none">
  25469. <doc xml:space="preserve">a #GThreadPool</doc>
  25470. <type name="ThreadPool" c:type="GThreadPool*"/>
  25471. </instance-parameter>
  25472. <parameter name="data"
  25473. transfer-ownership="none"
  25474. nullable="1"
  25475. allow-none="1">
  25476. <doc xml:space="preserve">a new task for @pool</doc>
  25477. <type name="gpointer" c:type="gpointer"/>
  25478. </parameter>
  25479. </parameters>
  25480. </method>
  25481. <method name="set_max_threads"
  25482. c:identifier="g_thread_pool_set_max_threads"
  25483. throws="1">
  25484. <doc xml:space="preserve">Sets the maximal allowed number of threads for @pool.
  25485. A value of -1 means that the maximal number of threads
  25486. is unlimited. If @pool is an exclusive thread pool, setting
  25487. the maximal number of threads to -1 is not allowed.
  25488. Setting @max_threads to 0 means stopping all work for @pool.
  25489. It is effectively frozen until @max_threads is set to a non-zero
  25490. value again.
  25491. A thread is never terminated while calling @func, as supplied by
  25492. g_thread_pool_new(). Instead the maximal number of threads only
  25493. has effect for the allocation of new threads in g_thread_pool_push().
  25494. A new thread is allocated, whenever the number of currently
  25495. running threads in @pool is smaller than the maximal number.
  25496. @error can be %NULL to ignore errors, or non-%NULL to report
  25497. errors. An error can only occur when a new thread couldn't be
  25498. created.
  25499. Before version 2.32, this function did not return a success status.</doc>
  25500. <return-value transfer-ownership="none">
  25501. <doc xml:space="preserve">%TRUE on success, %FALSE if an error occurred</doc>
  25502. <type name="gboolean" c:type="gboolean"/>
  25503. </return-value>
  25504. <parameters>
  25505. <instance-parameter name="pool" transfer-ownership="none">
  25506. <doc xml:space="preserve">a #GThreadPool</doc>
  25507. <type name="ThreadPool" c:type="GThreadPool*"/>
  25508. </instance-parameter>
  25509. <parameter name="max_threads" transfer-ownership="none">
  25510. <doc xml:space="preserve">a new maximal number of threads for @pool,
  25511. or -1 for unlimited</doc>
  25512. <type name="gint" c:type="gint"/>
  25513. </parameter>
  25514. </parameters>
  25515. </method>
  25516. <method name="set_sort_function"
  25517. c:identifier="g_thread_pool_set_sort_function"
  25518. version="2.10"
  25519. introspectable="0">
  25520. <doc xml:space="preserve">Sets the function used to sort the list of tasks. This allows the
  25521. tasks to be processed by a priority determined by @func, and not
  25522. just in the order in which they were added to the pool.
  25523. Note, if the maximum number of threads is more than 1, the order
  25524. that threads are executed cannot be guaranteed 100%. Threads are
  25525. scheduled by the operating system and are executed at random. It
  25526. cannot be assumed that threads are executed in the order they are
  25527. created.</doc>
  25528. <return-value transfer-ownership="none">
  25529. <type name="none" c:type="void"/>
  25530. </return-value>
  25531. <parameters>
  25532. <instance-parameter name="pool" transfer-ownership="none">
  25533. <doc xml:space="preserve">a #GThreadPool</doc>
  25534. <type name="ThreadPool" c:type="GThreadPool*"/>
  25535. </instance-parameter>
  25536. <parameter name="func" transfer-ownership="none" closure="1">
  25537. <doc xml:space="preserve">the #GCompareDataFunc used to sort the list of tasks.
  25538. This function is passed two tasks. It should return
  25539. 0 if the order in which they are handled does not matter,
  25540. a negative value if the first task should be processed before
  25541. the second or a positive value if the second task should be
  25542. processed first.</doc>
  25543. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  25544. </parameter>
  25545. <parameter name="user_data"
  25546. transfer-ownership="none"
  25547. nullable="1"
  25548. allow-none="1">
  25549. <doc xml:space="preserve">user data passed to @func</doc>
  25550. <type name="gpointer" c:type="gpointer"/>
  25551. </parameter>
  25552. </parameters>
  25553. </method>
  25554. <method name="unprocessed" c:identifier="g_thread_pool_unprocessed">
  25555. <doc xml:space="preserve">Returns the number of tasks still unprocessed in @pool.</doc>
  25556. <return-value transfer-ownership="none">
  25557. <doc xml:space="preserve">the number of unprocessed tasks</doc>
  25558. <type name="guint" c:type="guint"/>
  25559. </return-value>
  25560. <parameters>
  25561. <instance-parameter name="pool" transfer-ownership="none">
  25562. <doc xml:space="preserve">a #GThreadPool</doc>
  25563. <type name="ThreadPool" c:type="GThreadPool*"/>
  25564. </instance-parameter>
  25565. </parameters>
  25566. </method>
  25567. <function name="get_max_idle_time"
  25568. c:identifier="g_thread_pool_get_max_idle_time"
  25569. version="2.10">
  25570. <doc xml:space="preserve">This function will return the maximum @interval that a
  25571. thread will wait in the thread pool for new tasks before
  25572. being stopped.
  25573. If this function returns 0, threads waiting in the thread
  25574. pool for new work are not stopped.</doc>
  25575. <return-value transfer-ownership="none">
  25576. <doc xml:space="preserve">the maximum @interval (milliseconds) to wait
  25577. for new tasks in the thread pool before stopping the
  25578. thread</doc>
  25579. <type name="guint" c:type="guint"/>
  25580. </return-value>
  25581. </function>
  25582. <function name="get_max_unused_threads"
  25583. c:identifier="g_thread_pool_get_max_unused_threads">
  25584. <doc xml:space="preserve">Returns the maximal allowed number of unused threads.</doc>
  25585. <return-value transfer-ownership="none">
  25586. <doc xml:space="preserve">the maximal number of unused threads</doc>
  25587. <type name="gint" c:type="gint"/>
  25588. </return-value>
  25589. </function>
  25590. <function name="get_num_unused_threads"
  25591. c:identifier="g_thread_pool_get_num_unused_threads">
  25592. <doc xml:space="preserve">Returns the number of currently unused threads.</doc>
  25593. <return-value transfer-ownership="none">
  25594. <doc xml:space="preserve">the number of currently unused threads</doc>
  25595. <type name="guint" c:type="guint"/>
  25596. </return-value>
  25597. </function>
  25598. <function name="new"
  25599. c:identifier="g_thread_pool_new"
  25600. introspectable="0"
  25601. throws="1">
  25602. <doc xml:space="preserve">This function creates a new thread pool.
  25603. Whenever you call g_thread_pool_push(), either a new thread is
  25604. created or an unused one is reused. At most @max_threads threads
  25605. are running concurrently for this thread pool. @max_threads = -1
  25606. allows unlimited threads to be created for this thread pool. The
  25607. newly created or reused thread now executes the function @func
  25608. with the two arguments. The first one is the parameter to
  25609. g_thread_pool_push() and the second one is @user_data.
  25610. The parameter @exclusive determines whether the thread pool owns
  25611. all threads exclusive or shares them with other thread pools.
  25612. If @exclusive is %TRUE, @max_threads threads are started
  25613. immediately and they will run exclusively for this thread pool
  25614. until it is destroyed by g_thread_pool_free(). If @exclusive is
  25615. %FALSE, threads are created when needed and shared between all
  25616. non-exclusive thread pools. This implies that @max_threads may
  25617. not be -1 for exclusive thread pools. Besides, exclusive thread
  25618. pools are not affected by g_thread_pool_set_max_idle_time()
  25619. since their threads are never considered idle and returned to the
  25620. global pool.
  25621. @error can be %NULL to ignore errors, or non-%NULL to report
  25622. errors. An error can only occur when @exclusive is set to %TRUE
  25623. and not all @max_threads threads could be created.
  25624. See #GThreadError for possible errors that may occur.
  25625. Note, even in case of error a valid #GThreadPool is returned.</doc>
  25626. <return-value>
  25627. <doc xml:space="preserve">the new #GThreadPool</doc>
  25628. <type name="ThreadPool" c:type="GThreadPool*"/>
  25629. </return-value>
  25630. <parameters>
  25631. <parameter name="func" transfer-ownership="none" closure="1">
  25632. <doc xml:space="preserve">a function to execute in the threads of the new thread pool</doc>
  25633. <type name="Func" c:type="GFunc"/>
  25634. </parameter>
  25635. <parameter name="user_data"
  25636. transfer-ownership="none"
  25637. nullable="1"
  25638. allow-none="1">
  25639. <doc xml:space="preserve">user data that is handed over to @func every time it
  25640. is called</doc>
  25641. <type name="gpointer" c:type="gpointer"/>
  25642. </parameter>
  25643. <parameter name="max_threads" transfer-ownership="none">
  25644. <doc xml:space="preserve">the maximal number of threads to execute concurrently
  25645. in the new thread pool, -1 means no limit</doc>
  25646. <type name="gint" c:type="gint"/>
  25647. </parameter>
  25648. <parameter name="exclusive" transfer-ownership="none">
  25649. <doc xml:space="preserve">should this thread pool be exclusive?</doc>
  25650. <type name="gboolean" c:type="gboolean"/>
  25651. </parameter>
  25652. </parameters>
  25653. </function>
  25654. <function name="set_max_idle_time"
  25655. c:identifier="g_thread_pool_set_max_idle_time"
  25656. version="2.10">
  25657. <doc xml:space="preserve">This function will set the maximum @interval that a thread
  25658. waiting in the pool for new tasks can be idle for before
  25659. being stopped. This function is similar to calling
  25660. g_thread_pool_stop_unused_threads() on a regular timeout,
  25661. except this is done on a per thread basis.
  25662. By setting @interval to 0, idle threads will not be stopped.
  25663. The default value is 15000 (15 seconds).</doc>
  25664. <return-value transfer-ownership="none">
  25665. <type name="none" c:type="void"/>
  25666. </return-value>
  25667. <parameters>
  25668. <parameter name="interval" transfer-ownership="none">
  25669. <doc xml:space="preserve">the maximum @interval (in milliseconds)
  25670. a thread can be idle</doc>
  25671. <type name="guint" c:type="guint"/>
  25672. </parameter>
  25673. </parameters>
  25674. </function>
  25675. <function name="set_max_unused_threads"
  25676. c:identifier="g_thread_pool_set_max_unused_threads">
  25677. <doc xml:space="preserve">Sets the maximal number of unused threads to @max_threads.
  25678. If @max_threads is -1, no limit is imposed on the number
  25679. of unused threads.
  25680. The default value is 2.</doc>
  25681. <return-value transfer-ownership="none">
  25682. <type name="none" c:type="void"/>
  25683. </return-value>
  25684. <parameters>
  25685. <parameter name="max_threads" transfer-ownership="none">
  25686. <doc xml:space="preserve">maximal number of unused threads</doc>
  25687. <type name="gint" c:type="gint"/>
  25688. </parameter>
  25689. </parameters>
  25690. </function>
  25691. <function name="stop_unused_threads"
  25692. c:identifier="g_thread_pool_stop_unused_threads">
  25693. <doc xml:space="preserve">Stops all currently unused threads. This does not change the
  25694. maximal number of unused threads. This function can be used to
  25695. regularly stop all unused threads e.g. from g_timeout_add().</doc>
  25696. <return-value transfer-ownership="none">
  25697. <type name="none" c:type="void"/>
  25698. </return-value>
  25699. </function>
  25700. </record>
  25701. <enumeration name="TimeType" c:type="GTimeType">
  25702. <doc xml:space="preserve">Disambiguates a given time in two ways.
  25703. First, specifies if the given time is in universal or local time.
  25704. Second, if the time is in local time, specifies if it is local
  25705. standard time or local daylight time. This is important for the case
  25706. where the same local time occurs twice (during daylight savings time
  25707. transitions, for example).</doc>
  25708. <member name="standard" value="0" c:identifier="G_TIME_TYPE_STANDARD">
  25709. <doc xml:space="preserve">the time is in local standard time</doc>
  25710. </member>
  25711. <member name="daylight" value="1" c:identifier="G_TIME_TYPE_DAYLIGHT">
  25712. <doc xml:space="preserve">the time is in local daylight time</doc>
  25713. </member>
  25714. <member name="universal" value="2" c:identifier="G_TIME_TYPE_UNIVERSAL">
  25715. <doc xml:space="preserve">the time is in UTC</doc>
  25716. </member>
  25717. </enumeration>
  25718. <record name="TimeVal" c:type="GTimeVal">
  25719. <doc xml:space="preserve">Represents a precise time, with seconds and microseconds.
  25720. Similar to the struct timeval returned by the gettimeofday()
  25721. UNIX system call.
  25722. GLib is attempting to unify around the use of 64bit integers to
  25723. represent microsecond-precision time. As such, this type will be
  25724. removed from a future version of GLib.</doc>
  25725. <field name="tv_sec" writable="1">
  25726. <doc xml:space="preserve">seconds</doc>
  25727. <type name="glong" c:type="glong"/>
  25728. </field>
  25729. <field name="tv_usec" writable="1">
  25730. <doc xml:space="preserve">microseconds</doc>
  25731. <type name="glong" c:type="glong"/>
  25732. </field>
  25733. <method name="add" c:identifier="g_time_val_add">
  25734. <doc xml:space="preserve">Adds the given number of microseconds to @time_. @microseconds can
  25735. also be negative to decrease the value of @time_.</doc>
  25736. <return-value transfer-ownership="none">
  25737. <type name="none" c:type="void"/>
  25738. </return-value>
  25739. <parameters>
  25740. <instance-parameter name="time_" transfer-ownership="none">
  25741. <doc xml:space="preserve">a #GTimeVal</doc>
  25742. <type name="TimeVal" c:type="GTimeVal*"/>
  25743. </instance-parameter>
  25744. <parameter name="microseconds" transfer-ownership="none">
  25745. <doc xml:space="preserve">number of microseconds to add to @time</doc>
  25746. <type name="glong" c:type="glong"/>
  25747. </parameter>
  25748. </parameters>
  25749. </method>
  25750. <method name="to_iso8601"
  25751. c:identifier="g_time_val_to_iso8601"
  25752. version="2.12">
  25753. <doc xml:space="preserve">Converts @time_ into an RFC 3339 encoded string, relative to the
  25754. Coordinated Universal Time (UTC). This is one of the many formats
  25755. allowed by ISO 8601.
  25756. ISO 8601 allows a large number of date/time formats, with or without
  25757. punctuation and optional elements. The format returned by this function
  25758. is a complete date and time, with optional punctuation included, the
  25759. UTC time zone represented as "Z", and the @tv_usec part included if
  25760. and only if it is nonzero, i.e. either
  25761. "YYYY-MM-DDTHH:MM:SSZ" or "YYYY-MM-DDTHH:MM:SS.fffffZ".
  25762. This corresponds to the Internet date/time format defined by
  25763. [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt),
  25764. and to either of the two most-precise formats defined by
  25765. the W3C Note
  25766. [Date and Time Formats](http://www.w3.org/TR/NOTE-datetime-19980827).
  25767. Both of these documents are profiles of ISO 8601.
  25768. Use g_date_time_format() or g_strdup_printf() if a different
  25769. variation of ISO 8601 format is required.</doc>
  25770. <return-value transfer-ownership="full">
  25771. <doc xml:space="preserve">a newly allocated string containing an ISO 8601 date</doc>
  25772. <type name="utf8" c:type="gchar*"/>
  25773. </return-value>
  25774. <parameters>
  25775. <instance-parameter name="time_" transfer-ownership="none">
  25776. <doc xml:space="preserve">a #GTimeVal</doc>
  25777. <type name="TimeVal" c:type="GTimeVal*"/>
  25778. </instance-parameter>
  25779. </parameters>
  25780. </method>
  25781. <function name="from_iso8601"
  25782. c:identifier="g_time_val_from_iso8601"
  25783. version="2.12">
  25784. <doc xml:space="preserve">Converts a string containing an ISO 8601 encoded date and time
  25785. to a #GTimeVal and puts it into @time_.
  25786. @iso_date must include year, month, day, hours, minutes, and
  25787. seconds. It can optionally include fractions of a second and a time
  25788. zone indicator. (In the absence of any time zone indication, the
  25789. timestamp is assumed to be in local time.)</doc>
  25790. <return-value transfer-ownership="none">
  25791. <doc xml:space="preserve">%TRUE if the conversion was successful.</doc>
  25792. <type name="gboolean" c:type="gboolean"/>
  25793. </return-value>
  25794. <parameters>
  25795. <parameter name="iso_date" transfer-ownership="none">
  25796. <doc xml:space="preserve">an ISO 8601 encoded date string</doc>
  25797. <type name="utf8" c:type="const gchar*"/>
  25798. </parameter>
  25799. <parameter name="time_"
  25800. direction="out"
  25801. caller-allocates="1"
  25802. transfer-ownership="none">
  25803. <doc xml:space="preserve">a #GTimeVal</doc>
  25804. <type name="TimeVal" c:type="GTimeVal*"/>
  25805. </parameter>
  25806. </parameters>
  25807. </function>
  25808. </record>
  25809. <record name="TimeZone"
  25810. c:type="GTimeZone"
  25811. version="2.26"
  25812. glib:type-name="GTimeZone"
  25813. glib:get-type="g_time_zone_get_type"
  25814. c:symbol-prefix="time_zone">
  25815. <doc xml:space="preserve">#GTimeZone is an opaque structure whose members cannot be accessed
  25816. directly.</doc>
  25817. <constructor name="new" c:identifier="g_time_zone_new" version="2.26">
  25818. <doc xml:space="preserve">Creates a #GTimeZone corresponding to @identifier.
  25819. @identifier can either be an RFC3339/ISO 8601 time offset or
  25820. something that would pass as a valid value for the `TZ` environment
  25821. variable (including %NULL).
  25822. In Windows, @identifier can also be the unlocalized name of a time
  25823. zone for standard time, for example "Pacific Standard Time".
  25824. Valid RFC3339 time offsets are `"Z"` (for UTC) or
  25825. `"±hh:mm"`. ISO 8601 additionally specifies
  25826. `"±hhmm"` and `"±hh"`. Offsets are
  25827. time values to be added to Coordinated Universal Time (UTC) to get
  25828. the local time.
  25829. In UNIX, the `TZ` environment variable typically corresponds
  25830. to the name of a file in the zoneinfo database, or string in
  25831. "std offset [dst [offset],start[/time],end[/time]]" (POSIX) format.
  25832. There are no spaces in the specification. The name of standard
  25833. and daylight savings time zone must be three or more alphabetic
  25834. characters. Offsets are time values to be added to local time to
  25835. get Coordinated Universal Time (UTC) and should be
  25836. `"[±]hh[[:]mm[:ss]]"`. Dates are either
  25837. `"Jn"` (Julian day with n between 1 and 365, leap
  25838. years not counted), `"n"` (zero-based Julian day
  25839. with n between 0 and 365) or `"Mm.w.d"` (day d
  25840. (0 &lt;= d &lt;= 6) of week w (1 &lt;= w &lt;= 5) of month m (1 &lt;= m &lt;= 12), day
  25841. 0 is a Sunday). Times are in local wall clock time, the default is
  25842. 02:00:00.
  25843. In Windows, the "tzn[+|–]hh[:mm[:ss]][dzn]" format is used, but also
  25844. accepts POSIX format. The Windows format uses US rules for all time
  25845. zones; daylight savings time is 60 minutes behind the standard time
  25846. with date and time of change taken from Pacific Standard Time.
  25847. Offsets are time values to be added to the local time to get
  25848. Coordinated Universal Time (UTC).
  25849. g_time_zone_new_local() calls this function with the value of the
  25850. `TZ` environment variable. This function itself is independent of
  25851. the value of `TZ`, but if @identifier is %NULL then `/etc/localtime`
  25852. will be consulted to discover the correct time zone on UNIX and the
  25853. registry will be consulted or GetTimeZoneInformation() will be used
  25854. to get the local time zone on Windows.
  25855. If intervals are not available, only time zone rules from `TZ`
  25856. environment variable or other means, then they will be computed
  25857. from year 1900 to 2037. If the maximum year for the rules is
  25858. available and it is greater than 2037, then it will followed
  25859. instead.
  25860. See
  25861. [RFC3339 §5.6](http://tools.ietf.org/html/rfc3339#section-5.6)
  25862. for a precise definition of valid RFC3339 time offsets
  25863. (the `time-offset` expansion) and ISO 8601 for the
  25864. full list of valid time offsets. See
  25865. [The GNU C Library manual](http://www.gnu.org/s/libc/manual/html_node/TZ-Variable.html)
  25866. for an explanation of the possible
  25867. values of the `TZ` environment variable. See
  25868. [Microsoft Time Zone Index Values](http://msdn.microsoft.com/en-us/library/ms912391%28v=winembedded.11%29.aspx)
  25869. for the list of time zones on Windows.
  25870. You should release the return value by calling g_time_zone_unref()
  25871. when you are done with it.</doc>
  25872. <return-value transfer-ownership="full">
  25873. <doc xml:space="preserve">the requested timezone</doc>
  25874. <type name="TimeZone" c:type="GTimeZone*"/>
  25875. </return-value>
  25876. <parameters>
  25877. <parameter name="identifier"
  25878. transfer-ownership="none"
  25879. nullable="1"
  25880. allow-none="1">
  25881. <doc xml:space="preserve">a timezone identifier</doc>
  25882. <type name="utf8" c:type="const gchar*"/>
  25883. </parameter>
  25884. </parameters>
  25885. </constructor>
  25886. <constructor name="new_local"
  25887. c:identifier="g_time_zone_new_local"
  25888. version="2.26">
  25889. <doc xml:space="preserve">Creates a #GTimeZone corresponding to local time. The local time
  25890. zone may change between invocations to this function; for example,
  25891. if the system administrator changes it.
  25892. This is equivalent to calling g_time_zone_new() with the value of
  25893. the `TZ` environment variable (including the possibility of %NULL).
  25894. You should release the return value by calling g_time_zone_unref()
  25895. when you are done with it.</doc>
  25896. <return-value transfer-ownership="full">
  25897. <doc xml:space="preserve">the local timezone</doc>
  25898. <type name="TimeZone" c:type="GTimeZone*"/>
  25899. </return-value>
  25900. </constructor>
  25901. <constructor name="new_utc"
  25902. c:identifier="g_time_zone_new_utc"
  25903. version="2.26">
  25904. <doc xml:space="preserve">Creates a #GTimeZone corresponding to UTC.
  25905. This is equivalent to calling g_time_zone_new() with a value like
  25906. "Z", "UTC", "+00", etc.
  25907. You should release the return value by calling g_time_zone_unref()
  25908. when you are done with it.</doc>
  25909. <return-value transfer-ownership="full">
  25910. <doc xml:space="preserve">the universal timezone</doc>
  25911. <type name="TimeZone" c:type="GTimeZone*"/>
  25912. </return-value>
  25913. </constructor>
  25914. <method name="adjust_time"
  25915. c:identifier="g_time_zone_adjust_time"
  25916. version="2.26">
  25917. <doc xml:space="preserve">Finds an interval within @tz that corresponds to the given @time_,
  25918. possibly adjusting @time_ if required to fit into an interval.
  25919. The meaning of @time_ depends on @type.
  25920. This function is similar to g_time_zone_find_interval(), with the
  25921. difference that it always succeeds (by making the adjustments
  25922. described below).
  25923. In any of the cases where g_time_zone_find_interval() succeeds then
  25924. this function returns the same value, without modifying @time_.
  25925. This function may, however, modify @time_ in order to deal with
  25926. non-existent times. If the non-existent local @time_ of 02:30 were
  25927. requested on March 14th 2010 in Toronto then this function would
  25928. adjust @time_ to be 03:00 and return the interval containing the
  25929. adjusted time.</doc>
  25930. <return-value transfer-ownership="none">
  25931. <doc xml:space="preserve">the interval containing @time_, never -1</doc>
  25932. <type name="gint" c:type="gint"/>
  25933. </return-value>
  25934. <parameters>
  25935. <instance-parameter name="tz" transfer-ownership="none">
  25936. <doc xml:space="preserve">a #GTimeZone</doc>
  25937. <type name="TimeZone" c:type="GTimeZone*"/>
  25938. </instance-parameter>
  25939. <parameter name="type" transfer-ownership="none">
  25940. <doc xml:space="preserve">the #GTimeType of @time_</doc>
  25941. <type name="TimeType" c:type="GTimeType"/>
  25942. </parameter>
  25943. <parameter name="time_" transfer-ownership="none">
  25944. <doc xml:space="preserve">a pointer to a number of seconds since January 1, 1970</doc>
  25945. <type name="gint64" c:type="gint64*"/>
  25946. </parameter>
  25947. </parameters>
  25948. </method>
  25949. <method name="find_interval"
  25950. c:identifier="g_time_zone_find_interval"
  25951. version="2.26">
  25952. <doc xml:space="preserve">Finds an the interval within @tz that corresponds to the given @time_.
  25953. The meaning of @time_ depends on @type.
  25954. If @type is %G_TIME_TYPE_UNIVERSAL then this function will always
  25955. succeed (since universal time is monotonic and continuous).
  25956. Otherwise @time_ is treated as local time. The distinction between
  25957. %G_TIME_TYPE_STANDARD and %G_TIME_TYPE_DAYLIGHT is ignored except in
  25958. the case that the given @time_ is ambiguous. In Toronto, for example,
  25959. 01:30 on November 7th 2010 occurred twice (once inside of daylight
  25960. savings time and the next, an hour later, outside of daylight savings
  25961. time). In this case, the different value of @type would result in a
  25962. different interval being returned.
  25963. It is still possible for this function to fail. In Toronto, for
  25964. example, 02:00 on March 14th 2010 does not exist (due to the leap
  25965. forward to begin daylight savings time). -1 is returned in that
  25966. case.</doc>
  25967. <return-value transfer-ownership="none">
  25968. <doc xml:space="preserve">the interval containing @time_, or -1 in case of failure</doc>
  25969. <type name="gint" c:type="gint"/>
  25970. </return-value>
  25971. <parameters>
  25972. <instance-parameter name="tz" transfer-ownership="none">
  25973. <doc xml:space="preserve">a #GTimeZone</doc>
  25974. <type name="TimeZone" c:type="GTimeZone*"/>
  25975. </instance-parameter>
  25976. <parameter name="type" transfer-ownership="none">
  25977. <doc xml:space="preserve">the #GTimeType of @time_</doc>
  25978. <type name="TimeType" c:type="GTimeType"/>
  25979. </parameter>
  25980. <parameter name="time_" transfer-ownership="none">
  25981. <doc xml:space="preserve">a number of seconds since January 1, 1970</doc>
  25982. <type name="gint64" c:type="gint64"/>
  25983. </parameter>
  25984. </parameters>
  25985. </method>
  25986. <method name="get_abbreviation"
  25987. c:identifier="g_time_zone_get_abbreviation"
  25988. version="2.26">
  25989. <doc xml:space="preserve">Determines the time zone abbreviation to be used during a particular
  25990. @interval of time in the time zone @tz.
  25991. For example, in Toronto this is currently "EST" during the winter
  25992. months and "EDT" during the summer months when daylight savings time
  25993. is in effect.</doc>
  25994. <return-value transfer-ownership="none">
  25995. <doc xml:space="preserve">the time zone abbreviation, which belongs to @tz</doc>
  25996. <type name="utf8" c:type="const gchar*"/>
  25997. </return-value>
  25998. <parameters>
  25999. <instance-parameter name="tz" transfer-ownership="none">
  26000. <doc xml:space="preserve">a #GTimeZone</doc>
  26001. <type name="TimeZone" c:type="GTimeZone*"/>
  26002. </instance-parameter>
  26003. <parameter name="interval" transfer-ownership="none">
  26004. <doc xml:space="preserve">an interval within the timezone</doc>
  26005. <type name="gint" c:type="gint"/>
  26006. </parameter>
  26007. </parameters>
  26008. </method>
  26009. <method name="get_offset"
  26010. c:identifier="g_time_zone_get_offset"
  26011. version="2.26">
  26012. <doc xml:space="preserve">Determines the offset to UTC in effect during a particular @interval
  26013. of time in the time zone @tz.
  26014. The offset is the number of seconds that you add to UTC time to
  26015. arrive at local time for @tz (ie: negative numbers for time zones
  26016. west of GMT, positive numbers for east).</doc>
  26017. <return-value transfer-ownership="none">
  26018. <doc xml:space="preserve">the number of seconds that should be added to UTC to get the
  26019. local time in @tz</doc>
  26020. <type name="gint32" c:type="gint32"/>
  26021. </return-value>
  26022. <parameters>
  26023. <instance-parameter name="tz" transfer-ownership="none">
  26024. <doc xml:space="preserve">a #GTimeZone</doc>
  26025. <type name="TimeZone" c:type="GTimeZone*"/>
  26026. </instance-parameter>
  26027. <parameter name="interval" transfer-ownership="none">
  26028. <doc xml:space="preserve">an interval within the timezone</doc>
  26029. <type name="gint" c:type="gint"/>
  26030. </parameter>
  26031. </parameters>
  26032. </method>
  26033. <method name="is_dst" c:identifier="g_time_zone_is_dst" version="2.26">
  26034. <doc xml:space="preserve">Determines if daylight savings time is in effect during a particular
  26035. @interval of time in the time zone @tz.</doc>
  26036. <return-value transfer-ownership="none">
  26037. <doc xml:space="preserve">%TRUE if daylight savings time is in effect</doc>
  26038. <type name="gboolean" c:type="gboolean"/>
  26039. </return-value>
  26040. <parameters>
  26041. <instance-parameter name="tz" transfer-ownership="none">
  26042. <doc xml:space="preserve">a #GTimeZone</doc>
  26043. <type name="TimeZone" c:type="GTimeZone*"/>
  26044. </instance-parameter>
  26045. <parameter name="interval" transfer-ownership="none">
  26046. <doc xml:space="preserve">an interval within the timezone</doc>
  26047. <type name="gint" c:type="gint"/>
  26048. </parameter>
  26049. </parameters>
  26050. </method>
  26051. <method name="ref" c:identifier="g_time_zone_ref" version="2.26">
  26052. <doc xml:space="preserve">Increases the reference count on @tz.</doc>
  26053. <return-value transfer-ownership="full">
  26054. <doc xml:space="preserve">a new reference to @tz.</doc>
  26055. <type name="TimeZone" c:type="GTimeZone*"/>
  26056. </return-value>
  26057. <parameters>
  26058. <instance-parameter name="tz" transfer-ownership="none">
  26059. <doc xml:space="preserve">a #GTimeZone</doc>
  26060. <type name="TimeZone" c:type="GTimeZone*"/>
  26061. </instance-parameter>
  26062. </parameters>
  26063. </method>
  26064. <method name="unref" c:identifier="g_time_zone_unref" version="2.26">
  26065. <doc xml:space="preserve">Decreases the reference count on @tz.</doc>
  26066. <return-value transfer-ownership="none">
  26067. <type name="none" c:type="void"/>
  26068. </return-value>
  26069. <parameters>
  26070. <instance-parameter name="tz" transfer-ownership="none">
  26071. <doc xml:space="preserve">a #GTimeZone</doc>
  26072. <type name="TimeZone" c:type="GTimeZone*"/>
  26073. </instance-parameter>
  26074. </parameters>
  26075. </method>
  26076. </record>
  26077. <record name="Timer" c:type="GTimer" disguised="1">
  26078. <doc xml:space="preserve">Opaque datatype that records a start time.</doc>
  26079. <method name="continue" c:identifier="g_timer_continue" version="2.4">
  26080. <doc xml:space="preserve">Resumes a timer that has previously been stopped with
  26081. g_timer_stop(). g_timer_stop() must be called before using this
  26082. function.</doc>
  26083. <return-value transfer-ownership="none">
  26084. <type name="none" c:type="void"/>
  26085. </return-value>
  26086. <parameters>
  26087. <instance-parameter name="timer" transfer-ownership="none">
  26088. <doc xml:space="preserve">a #GTimer.</doc>
  26089. <type name="Timer" c:type="GTimer*"/>
  26090. </instance-parameter>
  26091. </parameters>
  26092. </method>
  26093. <method name="destroy" c:identifier="g_timer_destroy">
  26094. <doc xml:space="preserve">Destroys a timer, freeing associated resources.</doc>
  26095. <return-value transfer-ownership="none">
  26096. <type name="none" c:type="void"/>
  26097. </return-value>
  26098. <parameters>
  26099. <instance-parameter name="timer" transfer-ownership="none">
  26100. <doc xml:space="preserve">a #GTimer to destroy.</doc>
  26101. <type name="Timer" c:type="GTimer*"/>
  26102. </instance-parameter>
  26103. </parameters>
  26104. </method>
  26105. <method name="elapsed" c:identifier="g_timer_elapsed">
  26106. <doc xml:space="preserve">If @timer has been started but not stopped, obtains the time since
  26107. the timer was started. If @timer has been stopped, obtains the
  26108. elapsed time between the time it was started and the time it was
  26109. stopped. The return value is the number of seconds elapsed,
  26110. including any fractional part. The @microseconds out parameter is
  26111. essentially useless.</doc>
  26112. <return-value transfer-ownership="none">
  26113. <doc xml:space="preserve">seconds elapsed as a floating point value, including any
  26114. fractional part.</doc>
  26115. <type name="gdouble" c:type="gdouble"/>
  26116. </return-value>
  26117. <parameters>
  26118. <instance-parameter name="timer" transfer-ownership="none">
  26119. <doc xml:space="preserve">a #GTimer.</doc>
  26120. <type name="Timer" c:type="GTimer*"/>
  26121. </instance-parameter>
  26122. <parameter name="microseconds" transfer-ownership="none">
  26123. <doc xml:space="preserve">return location for the fractional part of seconds
  26124. elapsed, in microseconds (that is, the total number
  26125. of microseconds elapsed, modulo 1000000), or %NULL</doc>
  26126. <type name="gulong" c:type="gulong*"/>
  26127. </parameter>
  26128. </parameters>
  26129. </method>
  26130. <method name="reset" c:identifier="g_timer_reset">
  26131. <doc xml:space="preserve">This function is useless; it's fine to call g_timer_start() on an
  26132. already-started timer to reset the start time, so g_timer_reset()
  26133. serves no purpose.</doc>
  26134. <return-value transfer-ownership="none">
  26135. <type name="none" c:type="void"/>
  26136. </return-value>
  26137. <parameters>
  26138. <instance-parameter name="timer" transfer-ownership="none">
  26139. <doc xml:space="preserve">a #GTimer.</doc>
  26140. <type name="Timer" c:type="GTimer*"/>
  26141. </instance-parameter>
  26142. </parameters>
  26143. </method>
  26144. <method name="start" c:identifier="g_timer_start">
  26145. <doc xml:space="preserve">Marks a start time, so that future calls to g_timer_elapsed() will
  26146. report the time since g_timer_start() was called. g_timer_new()
  26147. automatically marks the start time, so no need to call
  26148. g_timer_start() immediately after creating the timer.</doc>
  26149. <return-value transfer-ownership="none">
  26150. <type name="none" c:type="void"/>
  26151. </return-value>
  26152. <parameters>
  26153. <instance-parameter name="timer" transfer-ownership="none">
  26154. <doc xml:space="preserve">a #GTimer.</doc>
  26155. <type name="Timer" c:type="GTimer*"/>
  26156. </instance-parameter>
  26157. </parameters>
  26158. </method>
  26159. <method name="stop" c:identifier="g_timer_stop">
  26160. <doc xml:space="preserve">Marks an end time, so calls to g_timer_elapsed() will return the
  26161. difference between this end time and the start time.</doc>
  26162. <return-value transfer-ownership="none">
  26163. <type name="none" c:type="void"/>
  26164. </return-value>
  26165. <parameters>
  26166. <instance-parameter name="timer" transfer-ownership="none">
  26167. <doc xml:space="preserve">a #GTimer.</doc>
  26168. <type name="Timer" c:type="GTimer*"/>
  26169. </instance-parameter>
  26170. </parameters>
  26171. </method>
  26172. <function name="new" c:identifier="g_timer_new" introspectable="0">
  26173. <doc xml:space="preserve">Creates a new timer, and starts timing (i.e. g_timer_start() is
  26174. implicitly called for you).</doc>
  26175. <return-value>
  26176. <doc xml:space="preserve">a new #GTimer.</doc>
  26177. <type name="Timer" c:type="GTimer*"/>
  26178. </return-value>
  26179. </function>
  26180. </record>
  26181. <enumeration name="TokenType" c:type="GTokenType">
  26182. <doc xml:space="preserve">The possible types of token returned from each
  26183. g_scanner_get_next_token() call.</doc>
  26184. <member name="eof" value="0" c:identifier="G_TOKEN_EOF">
  26185. <doc xml:space="preserve">the end of the file</doc>
  26186. </member>
  26187. <member name="left_paren" value="40" c:identifier="G_TOKEN_LEFT_PAREN">
  26188. <doc xml:space="preserve">a '(' character</doc>
  26189. </member>
  26190. <member name="right_paren" value="41" c:identifier="G_TOKEN_RIGHT_PAREN">
  26191. <doc xml:space="preserve">a ')' character</doc>
  26192. </member>
  26193. <member name="left_curly" value="123" c:identifier="G_TOKEN_LEFT_CURLY">
  26194. <doc xml:space="preserve">a '{' character</doc>
  26195. </member>
  26196. <member name="right_curly"
  26197. value="125"
  26198. c:identifier="G_TOKEN_RIGHT_CURLY">
  26199. <doc xml:space="preserve">a '}' character</doc>
  26200. </member>
  26201. <member name="left_brace" value="91" c:identifier="G_TOKEN_LEFT_BRACE">
  26202. <doc xml:space="preserve">a '[' character</doc>
  26203. </member>
  26204. <member name="right_brace" value="93" c:identifier="G_TOKEN_RIGHT_BRACE">
  26205. <doc xml:space="preserve">a ']' character</doc>
  26206. </member>
  26207. <member name="equal_sign" value="61" c:identifier="G_TOKEN_EQUAL_SIGN">
  26208. <doc xml:space="preserve">a '=' character</doc>
  26209. </member>
  26210. <member name="comma" value="44" c:identifier="G_TOKEN_COMMA">
  26211. <doc xml:space="preserve">a ',' character</doc>
  26212. </member>
  26213. <member name="none" value="256" c:identifier="G_TOKEN_NONE">
  26214. <doc xml:space="preserve">not a token</doc>
  26215. </member>
  26216. <member name="error" value="257" c:identifier="G_TOKEN_ERROR">
  26217. <doc xml:space="preserve">an error occurred</doc>
  26218. </member>
  26219. <member name="char" value="258" c:identifier="G_TOKEN_CHAR">
  26220. <doc xml:space="preserve">a character</doc>
  26221. </member>
  26222. <member name="binary" value="259" c:identifier="G_TOKEN_BINARY">
  26223. <doc xml:space="preserve">a binary integer</doc>
  26224. </member>
  26225. <member name="octal" value="260" c:identifier="G_TOKEN_OCTAL">
  26226. <doc xml:space="preserve">an octal integer</doc>
  26227. </member>
  26228. <member name="int" value="261" c:identifier="G_TOKEN_INT">
  26229. <doc xml:space="preserve">an integer</doc>
  26230. </member>
  26231. <member name="hex" value="262" c:identifier="G_TOKEN_HEX">
  26232. <doc xml:space="preserve">a hex integer</doc>
  26233. </member>
  26234. <member name="float" value="263" c:identifier="G_TOKEN_FLOAT">
  26235. <doc xml:space="preserve">a floating point number</doc>
  26236. </member>
  26237. <member name="string" value="264" c:identifier="G_TOKEN_STRING">
  26238. <doc xml:space="preserve">a string</doc>
  26239. </member>
  26240. <member name="symbol" value="265" c:identifier="G_TOKEN_SYMBOL">
  26241. <doc xml:space="preserve">a symbol</doc>
  26242. </member>
  26243. <member name="identifier" value="266" c:identifier="G_TOKEN_IDENTIFIER">
  26244. <doc xml:space="preserve">an identifier</doc>
  26245. </member>
  26246. <member name="identifier_null"
  26247. value="267"
  26248. c:identifier="G_TOKEN_IDENTIFIER_NULL">
  26249. <doc xml:space="preserve">a null identifier</doc>
  26250. </member>
  26251. <member name="comment_single"
  26252. value="268"
  26253. c:identifier="G_TOKEN_COMMENT_SINGLE">
  26254. <doc xml:space="preserve">one line comment</doc>
  26255. </member>
  26256. <member name="comment_multi"
  26257. value="269"
  26258. c:identifier="G_TOKEN_COMMENT_MULTI">
  26259. <doc xml:space="preserve">multi line comment</doc>
  26260. </member>
  26261. </enumeration>
  26262. <union name="TokenValue" c:type="GTokenValue">
  26263. <doc xml:space="preserve">A union holding the value of the token.</doc>
  26264. <field name="v_symbol" writable="1">
  26265. <doc xml:space="preserve">token symbol value</doc>
  26266. <type name="gpointer" c:type="gpointer"/>
  26267. </field>
  26268. <field name="v_identifier" writable="1">
  26269. <doc xml:space="preserve">token identifier value</doc>
  26270. <type name="utf8" c:type="gchar*"/>
  26271. </field>
  26272. <field name="v_binary" writable="1">
  26273. <doc xml:space="preserve">token binary integer value</doc>
  26274. <type name="gulong" c:type="gulong"/>
  26275. </field>
  26276. <field name="v_octal" writable="1">
  26277. <doc xml:space="preserve">octal integer value</doc>
  26278. <type name="gulong" c:type="gulong"/>
  26279. </field>
  26280. <field name="v_int" writable="1">
  26281. <doc xml:space="preserve">integer value</doc>
  26282. <type name="gulong" c:type="gulong"/>
  26283. </field>
  26284. <field name="v_int64" writable="1">
  26285. <doc xml:space="preserve">64-bit integer value</doc>
  26286. <type name="guint64" c:type="guint64"/>
  26287. </field>
  26288. <field name="v_float" writable="1">
  26289. <doc xml:space="preserve">floating point value</doc>
  26290. <type name="gdouble" c:type="gdouble"/>
  26291. </field>
  26292. <field name="v_hex" writable="1">
  26293. <doc xml:space="preserve">hex integer value</doc>
  26294. <type name="gulong" c:type="gulong"/>
  26295. </field>
  26296. <field name="v_string" writable="1">
  26297. <doc xml:space="preserve">string value</doc>
  26298. <type name="utf8" c:type="gchar*"/>
  26299. </field>
  26300. <field name="v_comment" writable="1">
  26301. <doc xml:space="preserve">comment value</doc>
  26302. <type name="utf8" c:type="gchar*"/>
  26303. </field>
  26304. <field name="v_char" writable="1">
  26305. <doc xml:space="preserve">character value</doc>
  26306. <type name="guint8" c:type="guchar"/>
  26307. </field>
  26308. <field name="v_error" writable="1">
  26309. <doc xml:space="preserve">error value</doc>
  26310. <type name="guint" c:type="guint"/>
  26311. </field>
  26312. </union>
  26313. <callback name="TranslateFunc" c:type="GTranslateFunc">
  26314. <doc xml:space="preserve">The type of functions which are used to translate user-visible
  26315. strings, for &lt;option&gt;--help&lt;/option&gt; output.</doc>
  26316. <return-value transfer-ownership="none">
  26317. <doc xml:space="preserve">a translation of the string for the current locale.
  26318. The returned string is owned by GLib and must not be freed.</doc>
  26319. <type name="utf8" c:type="const gchar*"/>
  26320. </return-value>
  26321. <parameters>
  26322. <parameter name="str" transfer-ownership="none">
  26323. <doc xml:space="preserve">the untranslated string</doc>
  26324. <type name="utf8" c:type="const gchar*"/>
  26325. </parameter>
  26326. <parameter name="data"
  26327. transfer-ownership="none"
  26328. nullable="1"
  26329. allow-none="1">
  26330. <doc xml:space="preserve">user data specified when installing the function, e.g.
  26331. in g_option_group_set_translate_func()</doc>
  26332. <type name="gpointer" c:type="gpointer"/>
  26333. </parameter>
  26334. </parameters>
  26335. </callback>
  26336. <record name="TrashStack"
  26337. c:type="GTrashStack"
  26338. deprecated="1"
  26339. deprecated-version="2.48">
  26340. <doc xml:space="preserve">Each piece of memory that is pushed onto the stack
  26341. is cast to a GTrashStack*.</doc>
  26342. <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
  26343. <field name="next" writable="1">
  26344. <doc xml:space="preserve">pointer to the previous element of the stack,
  26345. gets stored in the first `sizeof (gpointer)`
  26346. bytes of the element</doc>
  26347. <type name="TrashStack" c:type="GTrashStack*"/>
  26348. </field>
  26349. <function name="height"
  26350. c:identifier="g_trash_stack_height"
  26351. deprecated="1"
  26352. deprecated-version="2.48">
  26353. <doc xml:space="preserve">Returns the height of a #GTrashStack.
  26354. Note that execution of this function is of O(N) complexity
  26355. where N denotes the number of items on the stack.</doc>
  26356. <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
  26357. <return-value transfer-ownership="none">
  26358. <doc xml:space="preserve">the height of the stack</doc>
  26359. <type name="guint" c:type="guint"/>
  26360. </return-value>
  26361. <parameters>
  26362. <parameter name="stack_p" transfer-ownership="none">
  26363. <doc xml:space="preserve">a #GTrashStack</doc>
  26364. <type name="TrashStack" c:type="GTrashStack**"/>
  26365. </parameter>
  26366. </parameters>
  26367. </function>
  26368. <function name="peek"
  26369. c:identifier="g_trash_stack_peek"
  26370. deprecated="1"
  26371. deprecated-version="2.48">
  26372. <doc xml:space="preserve">Returns the element at the top of a #GTrashStack
  26373. which may be %NULL.</doc>
  26374. <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
  26375. <return-value transfer-ownership="none" nullable="1">
  26376. <doc xml:space="preserve">the element at the top of the stack</doc>
  26377. <type name="gpointer" c:type="gpointer"/>
  26378. </return-value>
  26379. <parameters>
  26380. <parameter name="stack_p" transfer-ownership="none">
  26381. <doc xml:space="preserve">a #GTrashStack</doc>
  26382. <type name="TrashStack" c:type="GTrashStack**"/>
  26383. </parameter>
  26384. </parameters>
  26385. </function>
  26386. <function name="pop"
  26387. c:identifier="g_trash_stack_pop"
  26388. deprecated="1"
  26389. deprecated-version="2.48">
  26390. <doc xml:space="preserve">Pops a piece of memory off a #GTrashStack.</doc>
  26391. <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
  26392. <return-value transfer-ownership="none" nullable="1">
  26393. <doc xml:space="preserve">the element at the top of the stack</doc>
  26394. <type name="gpointer" c:type="gpointer"/>
  26395. </return-value>
  26396. <parameters>
  26397. <parameter name="stack_p" transfer-ownership="none">
  26398. <doc xml:space="preserve">a #GTrashStack</doc>
  26399. <type name="TrashStack" c:type="GTrashStack**"/>
  26400. </parameter>
  26401. </parameters>
  26402. </function>
  26403. <function name="push"
  26404. c:identifier="g_trash_stack_push"
  26405. deprecated="1"
  26406. deprecated-version="2.48">
  26407. <doc xml:space="preserve">Pushes a piece of memory onto a #GTrashStack.</doc>
  26408. <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
  26409. <return-value transfer-ownership="none">
  26410. <type name="none" c:type="void"/>
  26411. </return-value>
  26412. <parameters>
  26413. <parameter name="stack_p" transfer-ownership="none">
  26414. <doc xml:space="preserve">a #GTrashStack</doc>
  26415. <type name="TrashStack" c:type="GTrashStack**"/>
  26416. </parameter>
  26417. <parameter name="data_p" transfer-ownership="none">
  26418. <doc xml:space="preserve">the piece of memory to push on the stack</doc>
  26419. <type name="gpointer" c:type="gpointer"/>
  26420. </parameter>
  26421. </parameters>
  26422. </function>
  26423. </record>
  26424. <bitfield name="TraverseFlags" c:type="GTraverseFlags">
  26425. <doc xml:space="preserve">Specifies which nodes are visited during several of the tree
  26426. functions, including g_node_traverse() and g_node_find().</doc>
  26427. <member name="leaves" value="1" c:identifier="G_TRAVERSE_LEAVES">
  26428. <doc xml:space="preserve">only leaf nodes should be visited. This name has
  26429. been introduced in 2.6, for older version use
  26430. %G_TRAVERSE_LEAFS.</doc>
  26431. </member>
  26432. <member name="non_leaves" value="2" c:identifier="G_TRAVERSE_NON_LEAVES">
  26433. <doc xml:space="preserve">only non-leaf nodes should be visited. This
  26434. name has been introduced in 2.6, for older
  26435. version use %G_TRAVERSE_NON_LEAFS.</doc>
  26436. </member>
  26437. <member name="all" value="3" c:identifier="G_TRAVERSE_ALL">
  26438. <doc xml:space="preserve">all nodes should be visited.</doc>
  26439. </member>
  26440. <member name="mask" value="3" c:identifier="G_TRAVERSE_MASK">
  26441. <doc xml:space="preserve">a mask of all traverse flags.</doc>
  26442. </member>
  26443. <member name="leafs" value="1" c:identifier="G_TRAVERSE_LEAFS">
  26444. <doc xml:space="preserve">identical to %G_TRAVERSE_LEAVES.</doc>
  26445. </member>
  26446. <member name="non_leafs" value="2" c:identifier="G_TRAVERSE_NON_LEAFS">
  26447. <doc xml:space="preserve">identical to %G_TRAVERSE_NON_LEAVES.</doc>
  26448. </member>
  26449. </bitfield>
  26450. <callback name="TraverseFunc" c:type="GTraverseFunc">
  26451. <doc xml:space="preserve">Specifies the type of function passed to g_tree_traverse(). It is
  26452. passed the key and value of each node, together with the @user_data
  26453. parameter passed to g_tree_traverse(). If the function returns
  26454. %TRUE, the traversal is stopped.</doc>
  26455. <return-value transfer-ownership="none">
  26456. <doc xml:space="preserve">%TRUE to stop the traversal</doc>
  26457. <type name="gboolean" c:type="gboolean"/>
  26458. </return-value>
  26459. <parameters>
  26460. <parameter name="key"
  26461. transfer-ownership="none"
  26462. nullable="1"
  26463. allow-none="1">
  26464. <doc xml:space="preserve">a key of a #GTree node</doc>
  26465. <type name="gpointer" c:type="gpointer"/>
  26466. </parameter>
  26467. <parameter name="value"
  26468. transfer-ownership="none"
  26469. nullable="1"
  26470. allow-none="1">
  26471. <doc xml:space="preserve">the value corresponding to the key</doc>
  26472. <type name="gpointer" c:type="gpointer"/>
  26473. </parameter>
  26474. <parameter name="data"
  26475. transfer-ownership="none"
  26476. nullable="1"
  26477. allow-none="1">
  26478. <doc xml:space="preserve">user data passed to g_tree_traverse()</doc>
  26479. <type name="gpointer" c:type="gpointer"/>
  26480. </parameter>
  26481. </parameters>
  26482. </callback>
  26483. <enumeration name="TraverseType" c:type="GTraverseType">
  26484. <doc xml:space="preserve">Specifies the type of traveral performed by g_tree_traverse(),
  26485. g_node_traverse() and g_node_find(). The different orders are
  26486. illustrated here:
  26487. - In order: A, B, C, D, E, F, G, H, I
  26488. ![](Sorted_binary_tree_inorder.svg)
  26489. - Pre order: F, B, A, D, C, E, G, I, H
  26490. ![](Sorted_binary_tree_preorder.svg)
  26491. - Post order: A, C, E, D, B, H, I, G, F
  26492. ![](Sorted_binary_tree_postorder.svg)
  26493. - Level order: F, B, G, A, D, I, C, E, H
  26494. ![](Sorted_binary_tree_breadth-first_traversal.svg)</doc>
  26495. <member name="in_order" value="0" c:identifier="G_IN_ORDER">
  26496. <doc xml:space="preserve">vists a node's left child first, then the node itself,
  26497. then its right child. This is the one to use if you
  26498. want the output sorted according to the compare
  26499. function.</doc>
  26500. </member>
  26501. <member name="pre_order" value="1" c:identifier="G_PRE_ORDER">
  26502. <doc xml:space="preserve">visits a node, then its children.</doc>
  26503. </member>
  26504. <member name="post_order" value="2" c:identifier="G_POST_ORDER">
  26505. <doc xml:space="preserve">visits the node's children, then the node itself.</doc>
  26506. </member>
  26507. <member name="level_order" value="3" c:identifier="G_LEVEL_ORDER">
  26508. <doc xml:space="preserve">is not implemented for
  26509. [balanced binary trees][glib-Balanced-Binary-Trees].
  26510. For [n-ary trees][glib-N-ary-Trees], it
  26511. vists the root node first, then its children, then
  26512. its grandchildren, and so on. Note that this is less
  26513. efficient than the other orders.</doc>
  26514. </member>
  26515. </enumeration>
  26516. <record name="Tree" c:type="GTree" disguised="1">
  26517. <doc xml:space="preserve">The GTree struct is an opaque data structure representing a
  26518. [balanced binary tree][glib-Balanced-Binary-Trees]. It should be
  26519. accessed only by using the following functions.</doc>
  26520. <method name="destroy" c:identifier="g_tree_destroy">
  26521. <doc xml:space="preserve">Removes all keys and values from the #GTree and decreases its
  26522. reference count by one. If keys and/or values are dynamically
  26523. allocated, you should either free them first or create the #GTree
  26524. using g_tree_new_full(). In the latter case the destroy functions
  26525. you supplied will be called on all keys and values before destroying
  26526. the #GTree.</doc>
  26527. <return-value transfer-ownership="none">
  26528. <type name="none" c:type="void"/>
  26529. </return-value>
  26530. <parameters>
  26531. <instance-parameter name="tree" transfer-ownership="none">
  26532. <doc xml:space="preserve">a #GTree</doc>
  26533. <type name="Tree" c:type="GTree*"/>
  26534. </instance-parameter>
  26535. </parameters>
  26536. </method>
  26537. <method name="foreach" c:identifier="g_tree_foreach" introspectable="0">
  26538. <doc xml:space="preserve">Calls the given function for each of the key/value pairs in the #GTree.
  26539. The function is passed the key and value of each pair, and the given
  26540. @data parameter. The tree is traversed in sorted order.
  26541. The tree may not be modified while iterating over it (you can't
  26542. add/remove items). To remove all items matching a predicate, you need
  26543. to add each item to a list in your #GTraverseFunc as you walk over
  26544. the tree, then walk the list and remove each item.</doc>
  26545. <return-value transfer-ownership="none">
  26546. <type name="none" c:type="void"/>
  26547. </return-value>
  26548. <parameters>
  26549. <instance-parameter name="tree" transfer-ownership="none">
  26550. <doc xml:space="preserve">a #GTree</doc>
  26551. <type name="Tree" c:type="GTree*"/>
  26552. </instance-parameter>
  26553. <parameter name="func" transfer-ownership="none" closure="1">
  26554. <doc xml:space="preserve">the function to call for each node visited.
  26555. If this function returns %TRUE, the traversal is stopped.</doc>
  26556. <type name="TraverseFunc" c:type="GTraverseFunc"/>
  26557. </parameter>
  26558. <parameter name="user_data"
  26559. transfer-ownership="none"
  26560. nullable="1"
  26561. allow-none="1">
  26562. <doc xml:space="preserve">user data to pass to the function</doc>
  26563. <type name="gpointer" c:type="gpointer"/>
  26564. </parameter>
  26565. </parameters>
  26566. </method>
  26567. <method name="height" c:identifier="g_tree_height">
  26568. <doc xml:space="preserve">Gets the height of a #GTree.
  26569. If the #GTree contains no nodes, the height is 0.
  26570. If the #GTree contains only one root node the height is 1.
  26571. If the root node has children the height is 2, etc.</doc>
  26572. <return-value transfer-ownership="none">
  26573. <doc xml:space="preserve">the height of @tree</doc>
  26574. <type name="gint" c:type="gint"/>
  26575. </return-value>
  26576. <parameters>
  26577. <instance-parameter name="tree" transfer-ownership="none">
  26578. <doc xml:space="preserve">a #GTree</doc>
  26579. <type name="Tree" c:type="GTree*"/>
  26580. </instance-parameter>
  26581. </parameters>
  26582. </method>
  26583. <method name="insert" c:identifier="g_tree_insert">
  26584. <doc xml:space="preserve">Inserts a key/value pair into a #GTree.
  26585. If the given key already exists in the #GTree its corresponding value
  26586. is set to the new value. If you supplied a @value_destroy_func when
  26587. creating the #GTree, the old value is freed using that function. If
  26588. you supplied a @key_destroy_func when creating the #GTree, the passed
  26589. key is freed using that function.
  26590. The tree is automatically 'balanced' as new key/value pairs are added,
  26591. so that the distance from the root to every leaf is as small as possible.</doc>
  26592. <return-value transfer-ownership="none">
  26593. <type name="none" c:type="void"/>
  26594. </return-value>
  26595. <parameters>
  26596. <instance-parameter name="tree" transfer-ownership="none">
  26597. <doc xml:space="preserve">a #GTree</doc>
  26598. <type name="Tree" c:type="GTree*"/>
  26599. </instance-parameter>
  26600. <parameter name="key"
  26601. transfer-ownership="none"
  26602. nullable="1"
  26603. allow-none="1">
  26604. <doc xml:space="preserve">the key to insert</doc>
  26605. <type name="gpointer" c:type="gpointer"/>
  26606. </parameter>
  26607. <parameter name="value"
  26608. transfer-ownership="none"
  26609. nullable="1"
  26610. allow-none="1">
  26611. <doc xml:space="preserve">the value corresponding to the key</doc>
  26612. <type name="gpointer" c:type="gpointer"/>
  26613. </parameter>
  26614. </parameters>
  26615. </method>
  26616. <method name="lookup" c:identifier="g_tree_lookup">
  26617. <doc xml:space="preserve">Gets the value corresponding to the given key. Since a #GTree is
  26618. automatically balanced as key/value pairs are added, key lookup
  26619. is O(log n) (where n is the number of key/value pairs in the tree).</doc>
  26620. <return-value transfer-ownership="none" nullable="1">
  26621. <doc xml:space="preserve">the value corresponding to the key, or %NULL
  26622. if the key was not found</doc>
  26623. <type name="gpointer" c:type="gpointer"/>
  26624. </return-value>
  26625. <parameters>
  26626. <instance-parameter name="tree" transfer-ownership="none">
  26627. <doc xml:space="preserve">a #GTree</doc>
  26628. <type name="Tree" c:type="GTree*"/>
  26629. </instance-parameter>
  26630. <parameter name="key"
  26631. transfer-ownership="none"
  26632. nullable="1"
  26633. allow-none="1">
  26634. <doc xml:space="preserve">the key to look up</doc>
  26635. <type name="gpointer" c:type="gconstpointer"/>
  26636. </parameter>
  26637. </parameters>
  26638. </method>
  26639. <method name="lookup_extended" c:identifier="g_tree_lookup_extended">
  26640. <doc xml:space="preserve">Looks up a key in the #GTree, returning the original key and the
  26641. associated value. This is useful if you need to free the memory
  26642. allocated for the original key, for example before calling
  26643. g_tree_remove().</doc>
  26644. <return-value transfer-ownership="none">
  26645. <doc xml:space="preserve">%TRUE if the key was found in the #GTree</doc>
  26646. <type name="gboolean" c:type="gboolean"/>
  26647. </return-value>
  26648. <parameters>
  26649. <instance-parameter name="tree" transfer-ownership="none">
  26650. <doc xml:space="preserve">a #GTree</doc>
  26651. <type name="Tree" c:type="GTree*"/>
  26652. </instance-parameter>
  26653. <parameter name="lookup_key"
  26654. transfer-ownership="none"
  26655. nullable="1"
  26656. allow-none="1">
  26657. <doc xml:space="preserve">the key to look up</doc>
  26658. <type name="gpointer" c:type="gconstpointer"/>
  26659. </parameter>
  26660. <parameter name="orig_key"
  26661. transfer-ownership="none"
  26662. nullable="1"
  26663. allow-none="1">
  26664. <doc xml:space="preserve">returns the original key</doc>
  26665. <type name="gpointer" c:type="gpointer*"/>
  26666. </parameter>
  26667. <parameter name="value"
  26668. transfer-ownership="none"
  26669. nullable="1"
  26670. allow-none="1">
  26671. <doc xml:space="preserve">returns the value associated with the key</doc>
  26672. <type name="gpointer" c:type="gpointer*"/>
  26673. </parameter>
  26674. </parameters>
  26675. </method>
  26676. <method name="nnodes" c:identifier="g_tree_nnodes">
  26677. <doc xml:space="preserve">Gets the number of nodes in a #GTree.</doc>
  26678. <return-value transfer-ownership="none">
  26679. <doc xml:space="preserve">the number of nodes in @tree</doc>
  26680. <type name="gint" c:type="gint"/>
  26681. </return-value>
  26682. <parameters>
  26683. <instance-parameter name="tree" transfer-ownership="none">
  26684. <doc xml:space="preserve">a #GTree</doc>
  26685. <type name="Tree" c:type="GTree*"/>
  26686. </instance-parameter>
  26687. </parameters>
  26688. </method>
  26689. <method name="ref"
  26690. c:identifier="g_tree_ref"
  26691. version="2.22"
  26692. introspectable="0">
  26693. <doc xml:space="preserve">Increments the reference count of @tree by one.
  26694. It is safe to call this function from any thread.</doc>
  26695. <return-value>
  26696. <doc xml:space="preserve">the passed in #GTree</doc>
  26697. <type name="Tree" c:type="GTree*"/>
  26698. </return-value>
  26699. <parameters>
  26700. <instance-parameter name="tree" transfer-ownership="none">
  26701. <doc xml:space="preserve">a #GTree</doc>
  26702. <type name="Tree" c:type="GTree*"/>
  26703. </instance-parameter>
  26704. </parameters>
  26705. </method>
  26706. <method name="remove" c:identifier="g_tree_remove">
  26707. <doc xml:space="preserve">Removes a key/value pair from a #GTree.
  26708. If the #GTree was created using g_tree_new_full(), the key and value
  26709. are freed using the supplied destroy functions, otherwise you have to
  26710. make sure that any dynamically allocated values are freed yourself.
  26711. If the key does not exist in the #GTree, the function does nothing.</doc>
  26712. <return-value transfer-ownership="none">
  26713. <doc xml:space="preserve">%TRUE if the key was found (prior to 2.8, this function
  26714. returned nothing)</doc>
  26715. <type name="gboolean" c:type="gboolean"/>
  26716. </return-value>
  26717. <parameters>
  26718. <instance-parameter name="tree" transfer-ownership="none">
  26719. <doc xml:space="preserve">a #GTree</doc>
  26720. <type name="Tree" c:type="GTree*"/>
  26721. </instance-parameter>
  26722. <parameter name="key"
  26723. transfer-ownership="none"
  26724. nullable="1"
  26725. allow-none="1">
  26726. <doc xml:space="preserve">the key to remove</doc>
  26727. <type name="gpointer" c:type="gconstpointer"/>
  26728. </parameter>
  26729. </parameters>
  26730. </method>
  26731. <method name="replace" c:identifier="g_tree_replace">
  26732. <doc xml:space="preserve">Inserts a new key and value into a #GTree similar to g_tree_insert().
  26733. The difference is that if the key already exists in the #GTree, it gets
  26734. replaced by the new key. If you supplied a @value_destroy_func when
  26735. creating the #GTree, the old value is freed using that function. If you
  26736. supplied a @key_destroy_func when creating the #GTree, the old key is
  26737. freed using that function.
  26738. The tree is automatically 'balanced' as new key/value pairs are added,
  26739. so that the distance from the root to every leaf is as small as possible.</doc>
  26740. <return-value transfer-ownership="none">
  26741. <type name="none" c:type="void"/>
  26742. </return-value>
  26743. <parameters>
  26744. <instance-parameter name="tree" transfer-ownership="none">
  26745. <doc xml:space="preserve">a #GTree</doc>
  26746. <type name="Tree" c:type="GTree*"/>
  26747. </instance-parameter>
  26748. <parameter name="key"
  26749. transfer-ownership="none"
  26750. nullable="1"
  26751. allow-none="1">
  26752. <doc xml:space="preserve">the key to insert</doc>
  26753. <type name="gpointer" c:type="gpointer"/>
  26754. </parameter>
  26755. <parameter name="value"
  26756. transfer-ownership="none"
  26757. nullable="1"
  26758. allow-none="1">
  26759. <doc xml:space="preserve">the value corresponding to the key</doc>
  26760. <type name="gpointer" c:type="gpointer"/>
  26761. </parameter>
  26762. </parameters>
  26763. </method>
  26764. <method name="search" c:identifier="g_tree_search" introspectable="0">
  26765. <doc xml:space="preserve">Searches a #GTree using @search_func.
  26766. The @search_func is called with a pointer to the key of a key/value
  26767. pair in the tree, and the passed in @user_data. If @search_func returns
  26768. 0 for a key/value pair, then the corresponding value is returned as
  26769. the result of g_tree_search(). If @search_func returns -1, searching
  26770. will proceed among the key/value pairs that have a smaller key; if
  26771. @search_func returns 1, searching will proceed among the key/value
  26772. pairs that have a larger key.</doc>
  26773. <return-value transfer-ownership="none" nullable="1">
  26774. <doc xml:space="preserve">the value corresponding to the found key, or %NULL
  26775. if the key was not found</doc>
  26776. <type name="gpointer" c:type="gpointer"/>
  26777. </return-value>
  26778. <parameters>
  26779. <instance-parameter name="tree" transfer-ownership="none">
  26780. <doc xml:space="preserve">a #GTree</doc>
  26781. <type name="Tree" c:type="GTree*"/>
  26782. </instance-parameter>
  26783. <parameter name="search_func" transfer-ownership="none" closure="1">
  26784. <doc xml:space="preserve">a function used to search the #GTree</doc>
  26785. <type name="CompareFunc" c:type="GCompareFunc"/>
  26786. </parameter>
  26787. <parameter name="user_data"
  26788. transfer-ownership="none"
  26789. nullable="1"
  26790. allow-none="1">
  26791. <doc xml:space="preserve">the data passed as the second argument to @search_func</doc>
  26792. <type name="gpointer" c:type="gconstpointer"/>
  26793. </parameter>
  26794. </parameters>
  26795. </method>
  26796. <method name="steal" c:identifier="g_tree_steal">
  26797. <doc xml:space="preserve">Removes a key and its associated value from a #GTree without calling
  26798. the key and value destroy functions.
  26799. If the key does not exist in the #GTree, the function does nothing.</doc>
  26800. <return-value transfer-ownership="none">
  26801. <doc xml:space="preserve">%TRUE if the key was found (prior to 2.8, this function
  26802. returned nothing)</doc>
  26803. <type name="gboolean" c:type="gboolean"/>
  26804. </return-value>
  26805. <parameters>
  26806. <instance-parameter name="tree" transfer-ownership="none">
  26807. <doc xml:space="preserve">a #GTree</doc>
  26808. <type name="Tree" c:type="GTree*"/>
  26809. </instance-parameter>
  26810. <parameter name="key"
  26811. transfer-ownership="none"
  26812. nullable="1"
  26813. allow-none="1">
  26814. <doc xml:space="preserve">the key to remove</doc>
  26815. <type name="gpointer" c:type="gconstpointer"/>
  26816. </parameter>
  26817. </parameters>
  26818. </method>
  26819. <method name="traverse"
  26820. c:identifier="g_tree_traverse"
  26821. introspectable="0"
  26822. deprecated="1"
  26823. deprecated-version="2.2">
  26824. <doc xml:space="preserve">Calls the given function for each node in the #GTree.</doc>
  26825. <doc-deprecated xml:space="preserve">The order of a balanced tree is somewhat arbitrary.
  26826. If you just want to visit all nodes in sorted order, use
  26827. g_tree_foreach() instead. If you really need to visit nodes in
  26828. a different order, consider using an [n-ary tree][glib-N-ary-Trees].</doc-deprecated>
  26829. <return-value transfer-ownership="none">
  26830. <type name="none" c:type="void"/>
  26831. </return-value>
  26832. <parameters>
  26833. <instance-parameter name="tree" transfer-ownership="none">
  26834. <doc xml:space="preserve">a #GTree</doc>
  26835. <type name="Tree" c:type="GTree*"/>
  26836. </instance-parameter>
  26837. <parameter name="traverse_func"
  26838. transfer-ownership="none"
  26839. closure="2">
  26840. <doc xml:space="preserve">the function to call for each node visited. If this
  26841. function returns %TRUE, the traversal is stopped.</doc>
  26842. <type name="TraverseFunc" c:type="GTraverseFunc"/>
  26843. </parameter>
  26844. <parameter name="traverse_type" transfer-ownership="none">
  26845. <doc xml:space="preserve">the order in which nodes are visited, one of %G_IN_ORDER,
  26846. %G_PRE_ORDER and %G_POST_ORDER</doc>
  26847. <type name="TraverseType" c:type="GTraverseType"/>
  26848. </parameter>
  26849. <parameter name="user_data"
  26850. transfer-ownership="none"
  26851. nullable="1"
  26852. allow-none="1">
  26853. <doc xml:space="preserve">user data to pass to the function</doc>
  26854. <type name="gpointer" c:type="gpointer"/>
  26855. </parameter>
  26856. </parameters>
  26857. </method>
  26858. <method name="unref" c:identifier="g_tree_unref" version="2.22">
  26859. <doc xml:space="preserve">Decrements the reference count of @tree by one.
  26860. If the reference count drops to 0, all keys and values will
  26861. be destroyed (if destroy functions were specified) and all
  26862. memory allocated by @tree will be released.
  26863. It is safe to call this function from any thread.</doc>
  26864. <return-value transfer-ownership="none">
  26865. <type name="none" c:type="void"/>
  26866. </return-value>
  26867. <parameters>
  26868. <instance-parameter name="tree" transfer-ownership="none">
  26869. <doc xml:space="preserve">a #GTree</doc>
  26870. <type name="Tree" c:type="GTree*"/>
  26871. </instance-parameter>
  26872. </parameters>
  26873. </method>
  26874. <function name="new" c:identifier="g_tree_new" introspectable="0">
  26875. <doc xml:space="preserve">Creates a new #GTree.</doc>
  26876. <return-value>
  26877. <doc xml:space="preserve">a newly allocated #GTree</doc>
  26878. <type name="Tree" c:type="GTree*"/>
  26879. </return-value>
  26880. <parameters>
  26881. <parameter name="key_compare_func" transfer-ownership="none">
  26882. <doc xml:space="preserve">the function used to order the nodes in the #GTree.
  26883. It should return values similar to the standard strcmp() function -
  26884. 0 if the two arguments are equal, a negative value if the first argument
  26885. comes before the second, or a positive value if the first argument comes
  26886. after the second.</doc>
  26887. <type name="CompareFunc" c:type="GCompareFunc"/>
  26888. </parameter>
  26889. </parameters>
  26890. </function>
  26891. <function name="new_full"
  26892. c:identifier="g_tree_new_full"
  26893. introspectable="0">
  26894. <doc xml:space="preserve">Creates a new #GTree like g_tree_new() and allows to specify functions
  26895. to free the memory allocated for the key and value that get called when
  26896. removing the entry from the #GTree.</doc>
  26897. <return-value>
  26898. <doc xml:space="preserve">a newly allocated #GTree</doc>
  26899. <type name="Tree" c:type="GTree*"/>
  26900. </return-value>
  26901. <parameters>
  26902. <parameter name="key_compare_func"
  26903. transfer-ownership="none"
  26904. scope="notified"
  26905. closure="1"
  26906. destroy="3">
  26907. <doc xml:space="preserve">qsort()-style comparison function</doc>
  26908. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  26909. </parameter>
  26910. <parameter name="key_compare_data"
  26911. transfer-ownership="none"
  26912. nullable="1"
  26913. allow-none="1">
  26914. <doc xml:space="preserve">data to pass to comparison function</doc>
  26915. <type name="gpointer" c:type="gpointer"/>
  26916. </parameter>
  26917. <parameter name="key_destroy_func"
  26918. transfer-ownership="none"
  26919. scope="async">
  26920. <doc xml:space="preserve">a function to free the memory allocated for the key
  26921. used when removing the entry from the #GTree or %NULL if you don't
  26922. want to supply such a function</doc>
  26923. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  26924. </parameter>
  26925. <parameter name="value_destroy_func"
  26926. transfer-ownership="none"
  26927. scope="async">
  26928. <doc xml:space="preserve">a function to free the memory allocated for the
  26929. value used when removing the entry from the #GTree or %NULL if you
  26930. don't want to supply such a function</doc>
  26931. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  26932. </parameter>
  26933. </parameters>
  26934. </function>
  26935. <function name="new_with_data"
  26936. c:identifier="g_tree_new_with_data"
  26937. introspectable="0">
  26938. <doc xml:space="preserve">Creates a new #GTree with a comparison function that accepts user data.
  26939. See g_tree_new() for more details.</doc>
  26940. <return-value>
  26941. <doc xml:space="preserve">a newly allocated #GTree</doc>
  26942. <type name="Tree" c:type="GTree*"/>
  26943. </return-value>
  26944. <parameters>
  26945. <parameter name="key_compare_func"
  26946. transfer-ownership="none"
  26947. closure="1">
  26948. <doc xml:space="preserve">qsort()-style comparison function</doc>
  26949. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  26950. </parameter>
  26951. <parameter name="key_compare_data"
  26952. transfer-ownership="none"
  26953. nullable="1"
  26954. allow-none="1">
  26955. <doc xml:space="preserve">data to pass to comparison function</doc>
  26956. <type name="gpointer" c:type="gpointer"/>
  26957. </parameter>
  26958. </parameters>
  26959. </function>
  26960. </record>
  26961. <constant name="UNICHAR_MAX_DECOMPOSITION_LENGTH"
  26962. value="18"
  26963. c:type="G_UNICHAR_MAX_DECOMPOSITION_LENGTH"
  26964. version="2.32">
  26965. <doc xml:space="preserve">The maximum length (in codepoints) of a compatibility or canonical
  26966. decomposition of a single Unicode character.
  26967. This is as defined by Unicode 6.1.</doc>
  26968. <type name="gint" c:type="gint"/>
  26969. </constant>
  26970. <constant name="URI_RESERVED_CHARS_GENERIC_DELIMITERS"
  26971. value=":/?#[]@"
  26972. c:type="G_URI_RESERVED_CHARS_GENERIC_DELIMITERS">
  26973. <doc xml:space="preserve">Generic delimiters characters as defined in RFC 3986. Includes ":/?#[]@".</doc>
  26974. <type name="utf8" c:type="gchar*"/>
  26975. </constant>
  26976. <constant name="URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS"
  26977. value="!$&amp;&apos;()*+,;="
  26978. c:type="G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS">
  26979. <doc xml:space="preserve">Subcomponent delimiter characters as defined in RFC 3986. Includes "!$&amp;'()*+,;=".</doc>
  26980. <type name="utf8" c:type="gchar*"/>
  26981. </constant>
  26982. <constant name="USEC_PER_SEC" value="1000000" c:type="G_USEC_PER_SEC">
  26983. <doc xml:space="preserve">Number of microseconds in one second (1 million).
  26984. This macro is provided for code readability.</doc>
  26985. <type name="gint" c:type="gint"/>
  26986. </constant>
  26987. <enumeration name="UnicodeBreakType" c:type="GUnicodeBreakType">
  26988. <doc xml:space="preserve">These are the possible line break classifications.
  26989. Since new unicode versions may add new types here, applications should be ready
  26990. to handle unknown values. They may be regarded as %G_UNICODE_BREAK_UNKNOWN.
  26991. See &lt;ulink url="http://www.unicode.org/unicode/reports/tr14/"&gt;http://www.unicode.org/unicode/reports/tr14/&lt;/ulink&gt;.</doc>
  26992. <member name="mandatory"
  26993. value="0"
  26994. c:identifier="G_UNICODE_BREAK_MANDATORY">
  26995. <doc xml:space="preserve">Mandatory Break (BK)</doc>
  26996. </member>
  26997. <member name="carriage_return"
  26998. value="1"
  26999. c:identifier="G_UNICODE_BREAK_CARRIAGE_RETURN">
  27000. <doc xml:space="preserve">Carriage Return (CR)</doc>
  27001. </member>
  27002. <member name="line_feed"
  27003. value="2"
  27004. c:identifier="G_UNICODE_BREAK_LINE_FEED">
  27005. <doc xml:space="preserve">Line Feed (LF)</doc>
  27006. </member>
  27007. <member name="combining_mark"
  27008. value="3"
  27009. c:identifier="G_UNICODE_BREAK_COMBINING_MARK">
  27010. <doc xml:space="preserve">Attached Characters and Combining Marks (CM)</doc>
  27011. </member>
  27012. <member name="surrogate"
  27013. value="4"
  27014. c:identifier="G_UNICODE_BREAK_SURROGATE">
  27015. <doc xml:space="preserve">Surrogates (SG)</doc>
  27016. </member>
  27017. <member name="zero_width_space"
  27018. value="5"
  27019. c:identifier="G_UNICODE_BREAK_ZERO_WIDTH_SPACE">
  27020. <doc xml:space="preserve">Zero Width Space (ZW)</doc>
  27021. </member>
  27022. <member name="inseparable"
  27023. value="6"
  27024. c:identifier="G_UNICODE_BREAK_INSEPARABLE">
  27025. <doc xml:space="preserve">Inseparable (IN)</doc>
  27026. </member>
  27027. <member name="non_breaking_glue"
  27028. value="7"
  27029. c:identifier="G_UNICODE_BREAK_NON_BREAKING_GLUE">
  27030. <doc xml:space="preserve">Non-breaking ("Glue") (GL)</doc>
  27031. </member>
  27032. <member name="contingent"
  27033. value="8"
  27034. c:identifier="G_UNICODE_BREAK_CONTINGENT">
  27035. <doc xml:space="preserve">Contingent Break Opportunity (CB)</doc>
  27036. </member>
  27037. <member name="space" value="9" c:identifier="G_UNICODE_BREAK_SPACE">
  27038. <doc xml:space="preserve">Space (SP)</doc>
  27039. </member>
  27040. <member name="after" value="10" c:identifier="G_UNICODE_BREAK_AFTER">
  27041. <doc xml:space="preserve">Break Opportunity After (BA)</doc>
  27042. </member>
  27043. <member name="before" value="11" c:identifier="G_UNICODE_BREAK_BEFORE">
  27044. <doc xml:space="preserve">Break Opportunity Before (BB)</doc>
  27045. </member>
  27046. <member name="before_and_after"
  27047. value="12"
  27048. c:identifier="G_UNICODE_BREAK_BEFORE_AND_AFTER">
  27049. <doc xml:space="preserve">Break Opportunity Before and After (B2)</doc>
  27050. </member>
  27051. <member name="hyphen" value="13" c:identifier="G_UNICODE_BREAK_HYPHEN">
  27052. <doc xml:space="preserve">Hyphen (HY)</doc>
  27053. </member>
  27054. <member name="non_starter"
  27055. value="14"
  27056. c:identifier="G_UNICODE_BREAK_NON_STARTER">
  27057. <doc xml:space="preserve">Nonstarter (NS)</doc>
  27058. </member>
  27059. <member name="open_punctuation"
  27060. value="15"
  27061. c:identifier="G_UNICODE_BREAK_OPEN_PUNCTUATION">
  27062. <doc xml:space="preserve">Opening Punctuation (OP)</doc>
  27063. </member>
  27064. <member name="close_punctuation"
  27065. value="16"
  27066. c:identifier="G_UNICODE_BREAK_CLOSE_PUNCTUATION">
  27067. <doc xml:space="preserve">Closing Punctuation (CL)</doc>
  27068. </member>
  27069. <member name="quotation"
  27070. value="17"
  27071. c:identifier="G_UNICODE_BREAK_QUOTATION">
  27072. <doc xml:space="preserve">Ambiguous Quotation (QU)</doc>
  27073. </member>
  27074. <member name="exclamation"
  27075. value="18"
  27076. c:identifier="G_UNICODE_BREAK_EXCLAMATION">
  27077. <doc xml:space="preserve">Exclamation/Interrogation (EX)</doc>
  27078. </member>
  27079. <member name="ideographic"
  27080. value="19"
  27081. c:identifier="G_UNICODE_BREAK_IDEOGRAPHIC">
  27082. <doc xml:space="preserve">Ideographic (ID)</doc>
  27083. </member>
  27084. <member name="numeric" value="20" c:identifier="G_UNICODE_BREAK_NUMERIC">
  27085. <doc xml:space="preserve">Numeric (NU)</doc>
  27086. </member>
  27087. <member name="infix_separator"
  27088. value="21"
  27089. c:identifier="G_UNICODE_BREAK_INFIX_SEPARATOR">
  27090. <doc xml:space="preserve">Infix Separator (Numeric) (IS)</doc>
  27091. </member>
  27092. <member name="symbol" value="22" c:identifier="G_UNICODE_BREAK_SYMBOL">
  27093. <doc xml:space="preserve">Symbols Allowing Break After (SY)</doc>
  27094. </member>
  27095. <member name="alphabetic"
  27096. value="23"
  27097. c:identifier="G_UNICODE_BREAK_ALPHABETIC">
  27098. <doc xml:space="preserve">Ordinary Alphabetic and Symbol Characters (AL)</doc>
  27099. </member>
  27100. <member name="prefix" value="24" c:identifier="G_UNICODE_BREAK_PREFIX">
  27101. <doc xml:space="preserve">Prefix (Numeric) (PR)</doc>
  27102. </member>
  27103. <member name="postfix" value="25" c:identifier="G_UNICODE_BREAK_POSTFIX">
  27104. <doc xml:space="preserve">Postfix (Numeric) (PO)</doc>
  27105. </member>
  27106. <member name="complex_context"
  27107. value="26"
  27108. c:identifier="G_UNICODE_BREAK_COMPLEX_CONTEXT">
  27109. <doc xml:space="preserve">Complex Content Dependent (South East Asian) (SA)</doc>
  27110. </member>
  27111. <member name="ambiguous"
  27112. value="27"
  27113. c:identifier="G_UNICODE_BREAK_AMBIGUOUS">
  27114. <doc xml:space="preserve">Ambiguous (Alphabetic or Ideographic) (AI)</doc>
  27115. </member>
  27116. <member name="unknown" value="28" c:identifier="G_UNICODE_BREAK_UNKNOWN">
  27117. <doc xml:space="preserve">Unknown (XX)</doc>
  27118. </member>
  27119. <member name="next_line"
  27120. value="29"
  27121. c:identifier="G_UNICODE_BREAK_NEXT_LINE">
  27122. <doc xml:space="preserve">Next Line (NL)</doc>
  27123. </member>
  27124. <member name="word_joiner"
  27125. value="30"
  27126. c:identifier="G_UNICODE_BREAK_WORD_JOINER">
  27127. <doc xml:space="preserve">Word Joiner (WJ)</doc>
  27128. </member>
  27129. <member name="hangul_l_jamo"
  27130. value="31"
  27131. c:identifier="G_UNICODE_BREAK_HANGUL_L_JAMO">
  27132. <doc xml:space="preserve">Hangul L Jamo (JL)</doc>
  27133. </member>
  27134. <member name="hangul_v_jamo"
  27135. value="32"
  27136. c:identifier="G_UNICODE_BREAK_HANGUL_V_JAMO">
  27137. <doc xml:space="preserve">Hangul V Jamo (JV)</doc>
  27138. </member>
  27139. <member name="hangul_t_jamo"
  27140. value="33"
  27141. c:identifier="G_UNICODE_BREAK_HANGUL_T_JAMO">
  27142. <doc xml:space="preserve">Hangul T Jamo (JT)</doc>
  27143. </member>
  27144. <member name="hangul_lv_syllable"
  27145. value="34"
  27146. c:identifier="G_UNICODE_BREAK_HANGUL_LV_SYLLABLE">
  27147. <doc xml:space="preserve">Hangul LV Syllable (H2)</doc>
  27148. </member>
  27149. <member name="hangul_lvt_syllable"
  27150. value="35"
  27151. c:identifier="G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE">
  27152. <doc xml:space="preserve">Hangul LVT Syllable (H3)</doc>
  27153. </member>
  27154. <member name="close_paranthesis"
  27155. value="36"
  27156. c:identifier="G_UNICODE_BREAK_CLOSE_PARANTHESIS">
  27157. <doc xml:space="preserve">Closing Parenthesis (CP). Since 2.28</doc>
  27158. </member>
  27159. <member name="conditional_japanese_starter"
  27160. value="37"
  27161. c:identifier="G_UNICODE_BREAK_CONDITIONAL_JAPANESE_STARTER">
  27162. <doc xml:space="preserve">Conditional Japanese Starter (CJ). Since: 2.32</doc>
  27163. </member>
  27164. <member name="hebrew_letter"
  27165. value="38"
  27166. c:identifier="G_UNICODE_BREAK_HEBREW_LETTER">
  27167. <doc xml:space="preserve">Hebrew Letter (HL). Since: 2.32</doc>
  27168. </member>
  27169. <member name="regional_indicator"
  27170. value="39"
  27171. c:identifier="G_UNICODE_BREAK_REGIONAL_INDICATOR">
  27172. <doc xml:space="preserve">Regional Indicator (RI). Since: 2.36</doc>
  27173. </member>
  27174. </enumeration>
  27175. <enumeration name="UnicodeScript" c:type="GUnicodeScript">
  27176. <doc xml:space="preserve">The #GUnicodeScript enumeration identifies different writing
  27177. systems. The values correspond to the names as defined in the
  27178. Unicode standard. The enumeration has been added in GLib 2.14,
  27179. and is interchangeable with #PangoScript.
  27180. Note that new types may be added in the future. Applications
  27181. should be ready to handle unknown values.
  27182. See &lt;ulink
  27183. url="http://www.unicode.org/reports/tr24/"&gt;Unicode Standard Annex
  27184. #24: Script names&lt;/ulink&gt;.</doc>
  27185. <member name="invalid_code"
  27186. value="-1"
  27187. c:identifier="G_UNICODE_SCRIPT_INVALID_CODE">
  27188. <doc xml:space="preserve">a value never returned from g_unichar_get_script()</doc>
  27189. </member>
  27190. <member name="common" value="0" c:identifier="G_UNICODE_SCRIPT_COMMON">
  27191. <doc xml:space="preserve">a character used by multiple different scripts</doc>
  27192. </member>
  27193. <member name="inherited"
  27194. value="1"
  27195. c:identifier="G_UNICODE_SCRIPT_INHERITED">
  27196. <doc xml:space="preserve">a mark glyph that takes its script from the
  27197. base glyph to which it is attached</doc>
  27198. </member>
  27199. <member name="arabic" value="2" c:identifier="G_UNICODE_SCRIPT_ARABIC">
  27200. <doc xml:space="preserve">Arabic</doc>
  27201. </member>
  27202. <member name="armenian"
  27203. value="3"
  27204. c:identifier="G_UNICODE_SCRIPT_ARMENIAN">
  27205. <doc xml:space="preserve">Armenian</doc>
  27206. </member>
  27207. <member name="bengali" value="4" c:identifier="G_UNICODE_SCRIPT_BENGALI">
  27208. <doc xml:space="preserve">Bengali</doc>
  27209. </member>
  27210. <member name="bopomofo"
  27211. value="5"
  27212. c:identifier="G_UNICODE_SCRIPT_BOPOMOFO">
  27213. <doc xml:space="preserve">Bopomofo</doc>
  27214. </member>
  27215. <member name="cherokee"
  27216. value="6"
  27217. c:identifier="G_UNICODE_SCRIPT_CHEROKEE">
  27218. <doc xml:space="preserve">Cherokee</doc>
  27219. </member>
  27220. <member name="coptic" value="7" c:identifier="G_UNICODE_SCRIPT_COPTIC">
  27221. <doc xml:space="preserve">Coptic</doc>
  27222. </member>
  27223. <member name="cyrillic"
  27224. value="8"
  27225. c:identifier="G_UNICODE_SCRIPT_CYRILLIC">
  27226. <doc xml:space="preserve">Cyrillic</doc>
  27227. </member>
  27228. <member name="deseret" value="9" c:identifier="G_UNICODE_SCRIPT_DESERET">
  27229. <doc xml:space="preserve">Deseret</doc>
  27230. </member>
  27231. <member name="devanagari"
  27232. value="10"
  27233. c:identifier="G_UNICODE_SCRIPT_DEVANAGARI">
  27234. <doc xml:space="preserve">Devanagari</doc>
  27235. </member>
  27236. <member name="ethiopic"
  27237. value="11"
  27238. c:identifier="G_UNICODE_SCRIPT_ETHIOPIC">
  27239. <doc xml:space="preserve">Ethiopic</doc>
  27240. </member>
  27241. <member name="georgian"
  27242. value="12"
  27243. c:identifier="G_UNICODE_SCRIPT_GEORGIAN">
  27244. <doc xml:space="preserve">Georgian</doc>
  27245. </member>
  27246. <member name="gothic" value="13" c:identifier="G_UNICODE_SCRIPT_GOTHIC">
  27247. <doc xml:space="preserve">Gothic</doc>
  27248. </member>
  27249. <member name="greek" value="14" c:identifier="G_UNICODE_SCRIPT_GREEK">
  27250. <doc xml:space="preserve">Greek</doc>
  27251. </member>
  27252. <member name="gujarati"
  27253. value="15"
  27254. c:identifier="G_UNICODE_SCRIPT_GUJARATI">
  27255. <doc xml:space="preserve">Gujarati</doc>
  27256. </member>
  27257. <member name="gurmukhi"
  27258. value="16"
  27259. c:identifier="G_UNICODE_SCRIPT_GURMUKHI">
  27260. <doc xml:space="preserve">Gurmukhi</doc>
  27261. </member>
  27262. <member name="han" value="17" c:identifier="G_UNICODE_SCRIPT_HAN">
  27263. <doc xml:space="preserve">Han</doc>
  27264. </member>
  27265. <member name="hangul" value="18" c:identifier="G_UNICODE_SCRIPT_HANGUL">
  27266. <doc xml:space="preserve">Hangul</doc>
  27267. </member>
  27268. <member name="hebrew" value="19" c:identifier="G_UNICODE_SCRIPT_HEBREW">
  27269. <doc xml:space="preserve">Hebrew</doc>
  27270. </member>
  27271. <member name="hiragana"
  27272. value="20"
  27273. c:identifier="G_UNICODE_SCRIPT_HIRAGANA">
  27274. <doc xml:space="preserve">Hiragana</doc>
  27275. </member>
  27276. <member name="kannada"
  27277. value="21"
  27278. c:identifier="G_UNICODE_SCRIPT_KANNADA">
  27279. <doc xml:space="preserve">Kannada</doc>
  27280. </member>
  27281. <member name="katakana"
  27282. value="22"
  27283. c:identifier="G_UNICODE_SCRIPT_KATAKANA">
  27284. <doc xml:space="preserve">Katakana</doc>
  27285. </member>
  27286. <member name="khmer" value="23" c:identifier="G_UNICODE_SCRIPT_KHMER">
  27287. <doc xml:space="preserve">Khmer</doc>
  27288. </member>
  27289. <member name="lao" value="24" c:identifier="G_UNICODE_SCRIPT_LAO">
  27290. <doc xml:space="preserve">Lao</doc>
  27291. </member>
  27292. <member name="latin" value="25" c:identifier="G_UNICODE_SCRIPT_LATIN">
  27293. <doc xml:space="preserve">Latin</doc>
  27294. </member>
  27295. <member name="malayalam"
  27296. value="26"
  27297. c:identifier="G_UNICODE_SCRIPT_MALAYALAM">
  27298. <doc xml:space="preserve">Malayalam</doc>
  27299. </member>
  27300. <member name="mongolian"
  27301. value="27"
  27302. c:identifier="G_UNICODE_SCRIPT_MONGOLIAN">
  27303. <doc xml:space="preserve">Mongolian</doc>
  27304. </member>
  27305. <member name="myanmar"
  27306. value="28"
  27307. c:identifier="G_UNICODE_SCRIPT_MYANMAR">
  27308. <doc xml:space="preserve">Myanmar</doc>
  27309. </member>
  27310. <member name="ogham" value="29" c:identifier="G_UNICODE_SCRIPT_OGHAM">
  27311. <doc xml:space="preserve">Ogham</doc>
  27312. </member>
  27313. <member name="old_italic"
  27314. value="30"
  27315. c:identifier="G_UNICODE_SCRIPT_OLD_ITALIC">
  27316. <doc xml:space="preserve">Old Italic</doc>
  27317. </member>
  27318. <member name="oriya" value="31" c:identifier="G_UNICODE_SCRIPT_ORIYA">
  27319. <doc xml:space="preserve">Oriya</doc>
  27320. </member>
  27321. <member name="runic" value="32" c:identifier="G_UNICODE_SCRIPT_RUNIC">
  27322. <doc xml:space="preserve">Runic</doc>
  27323. </member>
  27324. <member name="sinhala"
  27325. value="33"
  27326. c:identifier="G_UNICODE_SCRIPT_SINHALA">
  27327. <doc xml:space="preserve">Sinhala</doc>
  27328. </member>
  27329. <member name="syriac" value="34" c:identifier="G_UNICODE_SCRIPT_SYRIAC">
  27330. <doc xml:space="preserve">Syriac</doc>
  27331. </member>
  27332. <member name="tamil" value="35" c:identifier="G_UNICODE_SCRIPT_TAMIL">
  27333. <doc xml:space="preserve">Tamil</doc>
  27334. </member>
  27335. <member name="telugu" value="36" c:identifier="G_UNICODE_SCRIPT_TELUGU">
  27336. <doc xml:space="preserve">Telugu</doc>
  27337. </member>
  27338. <member name="thaana" value="37" c:identifier="G_UNICODE_SCRIPT_THAANA">
  27339. <doc xml:space="preserve">Thaana</doc>
  27340. </member>
  27341. <member name="thai" value="38" c:identifier="G_UNICODE_SCRIPT_THAI">
  27342. <doc xml:space="preserve">Thai</doc>
  27343. </member>
  27344. <member name="tibetan"
  27345. value="39"
  27346. c:identifier="G_UNICODE_SCRIPT_TIBETAN">
  27347. <doc xml:space="preserve">Tibetan</doc>
  27348. </member>
  27349. <member name="canadian_aboriginal"
  27350. value="40"
  27351. c:identifier="G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL">
  27352. <doc xml:space="preserve">Canadian Aboriginal</doc>
  27353. </member>
  27354. <member name="yi" value="41" c:identifier="G_UNICODE_SCRIPT_YI">
  27355. <doc xml:space="preserve">Yi</doc>
  27356. </member>
  27357. <member name="tagalog"
  27358. value="42"
  27359. c:identifier="G_UNICODE_SCRIPT_TAGALOG">
  27360. <doc xml:space="preserve">Tagalog</doc>
  27361. </member>
  27362. <member name="hanunoo"
  27363. value="43"
  27364. c:identifier="G_UNICODE_SCRIPT_HANUNOO">
  27365. <doc xml:space="preserve">Hanunoo</doc>
  27366. </member>
  27367. <member name="buhid" value="44" c:identifier="G_UNICODE_SCRIPT_BUHID">
  27368. <doc xml:space="preserve">Buhid</doc>
  27369. </member>
  27370. <member name="tagbanwa"
  27371. value="45"
  27372. c:identifier="G_UNICODE_SCRIPT_TAGBANWA">
  27373. <doc xml:space="preserve">Tagbanwa</doc>
  27374. </member>
  27375. <member name="braille"
  27376. value="46"
  27377. c:identifier="G_UNICODE_SCRIPT_BRAILLE">
  27378. <doc xml:space="preserve">Braille</doc>
  27379. </member>
  27380. <member name="cypriot"
  27381. value="47"
  27382. c:identifier="G_UNICODE_SCRIPT_CYPRIOT">
  27383. <doc xml:space="preserve">Cypriot</doc>
  27384. </member>
  27385. <member name="limbu" value="48" c:identifier="G_UNICODE_SCRIPT_LIMBU">
  27386. <doc xml:space="preserve">Limbu</doc>
  27387. </member>
  27388. <member name="osmanya"
  27389. value="49"
  27390. c:identifier="G_UNICODE_SCRIPT_OSMANYA">
  27391. <doc xml:space="preserve">Osmanya</doc>
  27392. </member>
  27393. <member name="shavian"
  27394. value="50"
  27395. c:identifier="G_UNICODE_SCRIPT_SHAVIAN">
  27396. <doc xml:space="preserve">Shavian</doc>
  27397. </member>
  27398. <member name="linear_b"
  27399. value="51"
  27400. c:identifier="G_UNICODE_SCRIPT_LINEAR_B">
  27401. <doc xml:space="preserve">Linear B</doc>
  27402. </member>
  27403. <member name="tai_le" value="52" c:identifier="G_UNICODE_SCRIPT_TAI_LE">
  27404. <doc xml:space="preserve">Tai Le</doc>
  27405. </member>
  27406. <member name="ugaritic"
  27407. value="53"
  27408. c:identifier="G_UNICODE_SCRIPT_UGARITIC">
  27409. <doc xml:space="preserve">Ugaritic</doc>
  27410. </member>
  27411. <member name="new_tai_lue"
  27412. value="54"
  27413. c:identifier="G_UNICODE_SCRIPT_NEW_TAI_LUE">
  27414. <doc xml:space="preserve">New Tai Lue</doc>
  27415. </member>
  27416. <member name="buginese"
  27417. value="55"
  27418. c:identifier="G_UNICODE_SCRIPT_BUGINESE">
  27419. <doc xml:space="preserve">Buginese</doc>
  27420. </member>
  27421. <member name="glagolitic"
  27422. value="56"
  27423. c:identifier="G_UNICODE_SCRIPT_GLAGOLITIC">
  27424. <doc xml:space="preserve">Glagolitic</doc>
  27425. </member>
  27426. <member name="tifinagh"
  27427. value="57"
  27428. c:identifier="G_UNICODE_SCRIPT_TIFINAGH">
  27429. <doc xml:space="preserve">Tifinagh</doc>
  27430. </member>
  27431. <member name="syloti_nagri"
  27432. value="58"
  27433. c:identifier="G_UNICODE_SCRIPT_SYLOTI_NAGRI">
  27434. <doc xml:space="preserve">Syloti Nagri</doc>
  27435. </member>
  27436. <member name="old_persian"
  27437. value="59"
  27438. c:identifier="G_UNICODE_SCRIPT_OLD_PERSIAN">
  27439. <doc xml:space="preserve">Old Persian</doc>
  27440. </member>
  27441. <member name="kharoshthi"
  27442. value="60"
  27443. c:identifier="G_UNICODE_SCRIPT_KHAROSHTHI">
  27444. <doc xml:space="preserve">Kharoshthi</doc>
  27445. </member>
  27446. <member name="unknown"
  27447. value="61"
  27448. c:identifier="G_UNICODE_SCRIPT_UNKNOWN">
  27449. <doc xml:space="preserve">an unassigned code point</doc>
  27450. </member>
  27451. <member name="balinese"
  27452. value="62"
  27453. c:identifier="G_UNICODE_SCRIPT_BALINESE">
  27454. <doc xml:space="preserve">Balinese</doc>
  27455. </member>
  27456. <member name="cuneiform"
  27457. value="63"
  27458. c:identifier="G_UNICODE_SCRIPT_CUNEIFORM">
  27459. <doc xml:space="preserve">Cuneiform</doc>
  27460. </member>
  27461. <member name="phoenician"
  27462. value="64"
  27463. c:identifier="G_UNICODE_SCRIPT_PHOENICIAN">
  27464. <doc xml:space="preserve">Phoenician</doc>
  27465. </member>
  27466. <member name="phags_pa"
  27467. value="65"
  27468. c:identifier="G_UNICODE_SCRIPT_PHAGS_PA">
  27469. <doc xml:space="preserve">Phags-pa</doc>
  27470. </member>
  27471. <member name="nko" value="66" c:identifier="G_UNICODE_SCRIPT_NKO">
  27472. <doc xml:space="preserve">N'Ko</doc>
  27473. </member>
  27474. <member name="kayah_li"
  27475. value="67"
  27476. c:identifier="G_UNICODE_SCRIPT_KAYAH_LI">
  27477. <doc xml:space="preserve">Kayah Li. Since 2.16.3</doc>
  27478. </member>
  27479. <member name="lepcha" value="68" c:identifier="G_UNICODE_SCRIPT_LEPCHA">
  27480. <doc xml:space="preserve">Lepcha. Since 2.16.3</doc>
  27481. </member>
  27482. <member name="rejang" value="69" c:identifier="G_UNICODE_SCRIPT_REJANG">
  27483. <doc xml:space="preserve">Rejang. Since 2.16.3</doc>
  27484. </member>
  27485. <member name="sundanese"
  27486. value="70"
  27487. c:identifier="G_UNICODE_SCRIPT_SUNDANESE">
  27488. <doc xml:space="preserve">Sundanese. Since 2.16.3</doc>
  27489. </member>
  27490. <member name="saurashtra"
  27491. value="71"
  27492. c:identifier="G_UNICODE_SCRIPT_SAURASHTRA">
  27493. <doc xml:space="preserve">Saurashtra. Since 2.16.3</doc>
  27494. </member>
  27495. <member name="cham" value="72" c:identifier="G_UNICODE_SCRIPT_CHAM">
  27496. <doc xml:space="preserve">Cham. Since 2.16.3</doc>
  27497. </member>
  27498. <member name="ol_chiki"
  27499. value="73"
  27500. c:identifier="G_UNICODE_SCRIPT_OL_CHIKI">
  27501. <doc xml:space="preserve">Ol Chiki. Since 2.16.3</doc>
  27502. </member>
  27503. <member name="vai" value="74" c:identifier="G_UNICODE_SCRIPT_VAI">
  27504. <doc xml:space="preserve">Vai. Since 2.16.3</doc>
  27505. </member>
  27506. <member name="carian" value="75" c:identifier="G_UNICODE_SCRIPT_CARIAN">
  27507. <doc xml:space="preserve">Carian. Since 2.16.3</doc>
  27508. </member>
  27509. <member name="lycian" value="76" c:identifier="G_UNICODE_SCRIPT_LYCIAN">
  27510. <doc xml:space="preserve">Lycian. Since 2.16.3</doc>
  27511. </member>
  27512. <member name="lydian" value="77" c:identifier="G_UNICODE_SCRIPT_LYDIAN">
  27513. <doc xml:space="preserve">Lydian. Since 2.16.3</doc>
  27514. </member>
  27515. <member name="avestan"
  27516. value="78"
  27517. c:identifier="G_UNICODE_SCRIPT_AVESTAN">
  27518. <doc xml:space="preserve">Avestan. Since 2.26</doc>
  27519. </member>
  27520. <member name="bamum" value="79" c:identifier="G_UNICODE_SCRIPT_BAMUM">
  27521. <doc xml:space="preserve">Bamum. Since 2.26</doc>
  27522. </member>
  27523. <member name="egyptian_hieroglyphs"
  27524. value="80"
  27525. c:identifier="G_UNICODE_SCRIPT_EGYPTIAN_HIEROGLYPHS">
  27526. <doc xml:space="preserve">Egyptian Hieroglpyhs. Since 2.26</doc>
  27527. </member>
  27528. <member name="imperial_aramaic"
  27529. value="81"
  27530. c:identifier="G_UNICODE_SCRIPT_IMPERIAL_ARAMAIC">
  27531. <doc xml:space="preserve">Imperial Aramaic. Since 2.26</doc>
  27532. </member>
  27533. <member name="inscriptional_pahlavi"
  27534. value="82"
  27535. c:identifier="G_UNICODE_SCRIPT_INSCRIPTIONAL_PAHLAVI">
  27536. <doc xml:space="preserve">Inscriptional Pahlavi. Since 2.26</doc>
  27537. </member>
  27538. <member name="inscriptional_parthian"
  27539. value="83"
  27540. c:identifier="G_UNICODE_SCRIPT_INSCRIPTIONAL_PARTHIAN">
  27541. <doc xml:space="preserve">Inscriptional Parthian. Since 2.26</doc>
  27542. </member>
  27543. <member name="javanese"
  27544. value="84"
  27545. c:identifier="G_UNICODE_SCRIPT_JAVANESE">
  27546. <doc xml:space="preserve">Javanese. Since 2.26</doc>
  27547. </member>
  27548. <member name="kaithi" value="85" c:identifier="G_UNICODE_SCRIPT_KAITHI">
  27549. <doc xml:space="preserve">Kaithi. Since 2.26</doc>
  27550. </member>
  27551. <member name="lisu" value="86" c:identifier="G_UNICODE_SCRIPT_LISU">
  27552. <doc xml:space="preserve">Lisu. Since 2.26</doc>
  27553. </member>
  27554. <member name="meetei_mayek"
  27555. value="87"
  27556. c:identifier="G_UNICODE_SCRIPT_MEETEI_MAYEK">
  27557. <doc xml:space="preserve">Meetei Mayek. Since 2.26</doc>
  27558. </member>
  27559. <member name="old_south_arabian"
  27560. value="88"
  27561. c:identifier="G_UNICODE_SCRIPT_OLD_SOUTH_ARABIAN">
  27562. <doc xml:space="preserve">Old South Arabian. Since 2.26</doc>
  27563. </member>
  27564. <member name="old_turkic"
  27565. value="89"
  27566. c:identifier="G_UNICODE_SCRIPT_OLD_TURKIC">
  27567. <doc xml:space="preserve">Old Turkic. Since 2.28</doc>
  27568. </member>
  27569. <member name="samaritan"
  27570. value="90"
  27571. c:identifier="G_UNICODE_SCRIPT_SAMARITAN">
  27572. <doc xml:space="preserve">Samaritan. Since 2.26</doc>
  27573. </member>
  27574. <member name="tai_tham"
  27575. value="91"
  27576. c:identifier="G_UNICODE_SCRIPT_TAI_THAM">
  27577. <doc xml:space="preserve">Tai Tham. Since 2.26</doc>
  27578. </member>
  27579. <member name="tai_viet"
  27580. value="92"
  27581. c:identifier="G_UNICODE_SCRIPT_TAI_VIET">
  27582. <doc xml:space="preserve">Tai Viet. Since 2.26</doc>
  27583. </member>
  27584. <member name="batak" value="93" c:identifier="G_UNICODE_SCRIPT_BATAK">
  27585. <doc xml:space="preserve">Batak. Since 2.28</doc>
  27586. </member>
  27587. <member name="brahmi" value="94" c:identifier="G_UNICODE_SCRIPT_BRAHMI">
  27588. <doc xml:space="preserve">Brahmi. Since 2.28</doc>
  27589. </member>
  27590. <member name="mandaic"
  27591. value="95"
  27592. c:identifier="G_UNICODE_SCRIPT_MANDAIC">
  27593. <doc xml:space="preserve">Mandaic. Since 2.28</doc>
  27594. </member>
  27595. <member name="chakma" value="96" c:identifier="G_UNICODE_SCRIPT_CHAKMA">
  27596. <doc xml:space="preserve">Chakma. Since: 2.32</doc>
  27597. </member>
  27598. <member name="meroitic_cursive"
  27599. value="97"
  27600. c:identifier="G_UNICODE_SCRIPT_MEROITIC_CURSIVE">
  27601. <doc xml:space="preserve">Meroitic Cursive. Since: 2.32</doc>
  27602. </member>
  27603. <member name="meroitic_hieroglyphs"
  27604. value="98"
  27605. c:identifier="G_UNICODE_SCRIPT_MEROITIC_HIEROGLYPHS">
  27606. <doc xml:space="preserve">Meroitic Hieroglyphs. Since: 2.32</doc>
  27607. </member>
  27608. <member name="miao" value="99" c:identifier="G_UNICODE_SCRIPT_MIAO">
  27609. <doc xml:space="preserve">Miao. Since: 2.32</doc>
  27610. </member>
  27611. <member name="sharada"
  27612. value="100"
  27613. c:identifier="G_UNICODE_SCRIPT_SHARADA">
  27614. <doc xml:space="preserve">Sharada. Since: 2.32</doc>
  27615. </member>
  27616. <member name="sora_sompeng"
  27617. value="101"
  27618. c:identifier="G_UNICODE_SCRIPT_SORA_SOMPENG">
  27619. <doc xml:space="preserve">Sora Sompeng. Since: 2.32</doc>
  27620. </member>
  27621. <member name="takri" value="102" c:identifier="G_UNICODE_SCRIPT_TAKRI">
  27622. <doc xml:space="preserve">Takri. Since: 2.32</doc>
  27623. </member>
  27624. <member name="bassa_vah"
  27625. value="103"
  27626. c:identifier="G_UNICODE_SCRIPT_BASSA_VAH">
  27627. <doc xml:space="preserve">Bassa. Since: 2.42</doc>
  27628. </member>
  27629. <member name="caucasian_albanian"
  27630. value="104"
  27631. c:identifier="G_UNICODE_SCRIPT_CAUCASIAN_ALBANIAN">
  27632. <doc xml:space="preserve">Caucasian Albanian. Since: 2.42</doc>
  27633. </member>
  27634. <member name="duployan"
  27635. value="105"
  27636. c:identifier="G_UNICODE_SCRIPT_DUPLOYAN">
  27637. <doc xml:space="preserve">Duployan. Since: 2.42</doc>
  27638. </member>
  27639. <member name="elbasan"
  27640. value="106"
  27641. c:identifier="G_UNICODE_SCRIPT_ELBASAN">
  27642. <doc xml:space="preserve">Elbasan. Since: 2.42</doc>
  27643. </member>
  27644. <member name="grantha"
  27645. value="107"
  27646. c:identifier="G_UNICODE_SCRIPT_GRANTHA">
  27647. <doc xml:space="preserve">Grantha. Since: 2.42</doc>
  27648. </member>
  27649. <member name="khojki" value="108" c:identifier="G_UNICODE_SCRIPT_KHOJKI">
  27650. <doc xml:space="preserve">Kjohki. Since: 2.42</doc>
  27651. </member>
  27652. <member name="khudawadi"
  27653. value="109"
  27654. c:identifier="G_UNICODE_SCRIPT_KHUDAWADI">
  27655. <doc xml:space="preserve">Khudawadi, Sindhi. Since: 2.42</doc>
  27656. </member>
  27657. <member name="linear_a"
  27658. value="110"
  27659. c:identifier="G_UNICODE_SCRIPT_LINEAR_A">
  27660. <doc xml:space="preserve">Linear A. Since: 2.42</doc>
  27661. </member>
  27662. <member name="mahajani"
  27663. value="111"
  27664. c:identifier="G_UNICODE_SCRIPT_MAHAJANI">
  27665. <doc xml:space="preserve">Mahajani. Since: 2.42</doc>
  27666. </member>
  27667. <member name="manichaean"
  27668. value="112"
  27669. c:identifier="G_UNICODE_SCRIPT_MANICHAEAN">
  27670. <doc xml:space="preserve">Manichaean. Since: 2.42</doc>
  27671. </member>
  27672. <member name="mende_kikakui"
  27673. value="113"
  27674. c:identifier="G_UNICODE_SCRIPT_MENDE_KIKAKUI">
  27675. <doc xml:space="preserve">Mende Kikakui. Since: 2.42</doc>
  27676. </member>
  27677. <member name="modi" value="114" c:identifier="G_UNICODE_SCRIPT_MODI">
  27678. <doc xml:space="preserve">Modi. Since: 2.42</doc>
  27679. </member>
  27680. <member name="mro" value="115" c:identifier="G_UNICODE_SCRIPT_MRO">
  27681. <doc xml:space="preserve">Mro. Since: 2.42</doc>
  27682. </member>
  27683. <member name="nabataean"
  27684. value="116"
  27685. c:identifier="G_UNICODE_SCRIPT_NABATAEAN">
  27686. <doc xml:space="preserve">Nabataean. Since: 2.42</doc>
  27687. </member>
  27688. <member name="old_north_arabian"
  27689. value="117"
  27690. c:identifier="G_UNICODE_SCRIPT_OLD_NORTH_ARABIAN">
  27691. <doc xml:space="preserve">Old North Arabian. Since: 2.42</doc>
  27692. </member>
  27693. <member name="old_permic"
  27694. value="118"
  27695. c:identifier="G_UNICODE_SCRIPT_OLD_PERMIC">
  27696. <doc xml:space="preserve">Old Permic. Since: 2.42</doc>
  27697. </member>
  27698. <member name="pahawh_hmong"
  27699. value="119"
  27700. c:identifier="G_UNICODE_SCRIPT_PAHAWH_HMONG">
  27701. <doc xml:space="preserve">Pahawh Hmong. Since: 2.42</doc>
  27702. </member>
  27703. <member name="palmyrene"
  27704. value="120"
  27705. c:identifier="G_UNICODE_SCRIPT_PALMYRENE">
  27706. <doc xml:space="preserve">Palmyrene. Since: 2.42</doc>
  27707. </member>
  27708. <member name="pau_cin_hau"
  27709. value="121"
  27710. c:identifier="G_UNICODE_SCRIPT_PAU_CIN_HAU">
  27711. <doc xml:space="preserve">Pau Cin Hau. Since: 2.42</doc>
  27712. </member>
  27713. <member name="psalter_pahlavi"
  27714. value="122"
  27715. c:identifier="G_UNICODE_SCRIPT_PSALTER_PAHLAVI">
  27716. <doc xml:space="preserve">Psalter Pahlavi. Since: 2.42</doc>
  27717. </member>
  27718. <member name="siddham"
  27719. value="123"
  27720. c:identifier="G_UNICODE_SCRIPT_SIDDHAM">
  27721. <doc xml:space="preserve">Siddham. Since: 2.42</doc>
  27722. </member>
  27723. <member name="tirhuta"
  27724. value="124"
  27725. c:identifier="G_UNICODE_SCRIPT_TIRHUTA">
  27726. <doc xml:space="preserve">Tirhuta. Since: 2.42</doc>
  27727. </member>
  27728. <member name="warang_citi"
  27729. value="125"
  27730. c:identifier="G_UNICODE_SCRIPT_WARANG_CITI">
  27731. <doc xml:space="preserve">Warang Citi. Since: 2.42</doc>
  27732. </member>
  27733. <member name="ahom" value="126" c:identifier="G_UNICODE_SCRIPT_AHOM">
  27734. <doc xml:space="preserve">Ahom. Since: 2.48</doc>
  27735. </member>
  27736. <member name="anatolian_hieroglyphs"
  27737. value="127"
  27738. c:identifier="G_UNICODE_SCRIPT_ANATOLIAN_HIEROGLYPHS">
  27739. <doc xml:space="preserve">Anatolian Hieroglyphs. Since: 2.48</doc>
  27740. </member>
  27741. <member name="hatran" value="128" c:identifier="G_UNICODE_SCRIPT_HATRAN">
  27742. <doc xml:space="preserve">Hatran. Since: 2.48</doc>
  27743. </member>
  27744. <member name="multani"
  27745. value="129"
  27746. c:identifier="G_UNICODE_SCRIPT_MULTANI">
  27747. <doc xml:space="preserve">Multani. Since: 2.48</doc>
  27748. </member>
  27749. <member name="old_hungarian"
  27750. value="130"
  27751. c:identifier="G_UNICODE_SCRIPT_OLD_HUNGARIAN">
  27752. <doc xml:space="preserve">Old Hungarian. Since: 2.48</doc>
  27753. </member>
  27754. <member name="signwriting"
  27755. value="131"
  27756. c:identifier="G_UNICODE_SCRIPT_SIGNWRITING">
  27757. <doc xml:space="preserve">Signwriting. Since: 2.48</doc>
  27758. </member>
  27759. </enumeration>
  27760. <enumeration name="UnicodeType" c:type="GUnicodeType">
  27761. <doc xml:space="preserve">These are the possible character classifications from the
  27762. Unicode specification.
  27763. See &lt;ulink url="http://www.unicode.org/Public/UNIDATA/UnicodeData.html"&gt;http://www.unicode.org/Public/UNIDATA/UnicodeData.html&lt;/ulink&gt;.</doc>
  27764. <member name="control" value="0" c:identifier="G_UNICODE_CONTROL">
  27765. <doc xml:space="preserve">General category "Other, Control" (Cc)</doc>
  27766. </member>
  27767. <member name="format" value="1" c:identifier="G_UNICODE_FORMAT">
  27768. <doc xml:space="preserve">General category "Other, Format" (Cf)</doc>
  27769. </member>
  27770. <member name="unassigned" value="2" c:identifier="G_UNICODE_UNASSIGNED">
  27771. <doc xml:space="preserve">General category "Other, Not Assigned" (Cn)</doc>
  27772. </member>
  27773. <member name="private_use"
  27774. value="3"
  27775. c:identifier="G_UNICODE_PRIVATE_USE">
  27776. <doc xml:space="preserve">General category "Other, Private Use" (Co)</doc>
  27777. </member>
  27778. <member name="surrogate" value="4" c:identifier="G_UNICODE_SURROGATE">
  27779. <doc xml:space="preserve">General category "Other, Surrogate" (Cs)</doc>
  27780. </member>
  27781. <member name="lowercase_letter"
  27782. value="5"
  27783. c:identifier="G_UNICODE_LOWERCASE_LETTER">
  27784. <doc xml:space="preserve">General category "Letter, Lowercase" (Ll)</doc>
  27785. </member>
  27786. <member name="modifier_letter"
  27787. value="6"
  27788. c:identifier="G_UNICODE_MODIFIER_LETTER">
  27789. <doc xml:space="preserve">General category "Letter, Modifier" (Lm)</doc>
  27790. </member>
  27791. <member name="other_letter"
  27792. value="7"
  27793. c:identifier="G_UNICODE_OTHER_LETTER">
  27794. <doc xml:space="preserve">General category "Letter, Other" (Lo)</doc>
  27795. </member>
  27796. <member name="titlecase_letter"
  27797. value="8"
  27798. c:identifier="G_UNICODE_TITLECASE_LETTER">
  27799. <doc xml:space="preserve">General category "Letter, Titlecase" (Lt)</doc>
  27800. </member>
  27801. <member name="uppercase_letter"
  27802. value="9"
  27803. c:identifier="G_UNICODE_UPPERCASE_LETTER">
  27804. <doc xml:space="preserve">General category "Letter, Uppercase" (Lu)</doc>
  27805. </member>
  27806. <member name="spacing_mark"
  27807. value="10"
  27808. c:identifier="G_UNICODE_SPACING_MARK">
  27809. <doc xml:space="preserve">General category "Mark, Spacing" (Mc)</doc>
  27810. </member>
  27811. <member name="enclosing_mark"
  27812. value="11"
  27813. c:identifier="G_UNICODE_ENCLOSING_MARK">
  27814. <doc xml:space="preserve">General category "Mark, Enclosing" (Me)</doc>
  27815. </member>
  27816. <member name="non_spacing_mark"
  27817. value="12"
  27818. c:identifier="G_UNICODE_NON_SPACING_MARK">
  27819. <doc xml:space="preserve">General category "Mark, Nonspacing" (Mn)</doc>
  27820. </member>
  27821. <member name="decimal_number"
  27822. value="13"
  27823. c:identifier="G_UNICODE_DECIMAL_NUMBER">
  27824. <doc xml:space="preserve">General category "Number, Decimal Digit" (Nd)</doc>
  27825. </member>
  27826. <member name="letter_number"
  27827. value="14"
  27828. c:identifier="G_UNICODE_LETTER_NUMBER">
  27829. <doc xml:space="preserve">General category "Number, Letter" (Nl)</doc>
  27830. </member>
  27831. <member name="other_number"
  27832. value="15"
  27833. c:identifier="G_UNICODE_OTHER_NUMBER">
  27834. <doc xml:space="preserve">General category "Number, Other" (No)</doc>
  27835. </member>
  27836. <member name="connect_punctuation"
  27837. value="16"
  27838. c:identifier="G_UNICODE_CONNECT_PUNCTUATION">
  27839. <doc xml:space="preserve">General category "Punctuation, Connector" (Pc)</doc>
  27840. </member>
  27841. <member name="dash_punctuation"
  27842. value="17"
  27843. c:identifier="G_UNICODE_DASH_PUNCTUATION">
  27844. <doc xml:space="preserve">General category "Punctuation, Dash" (Pd)</doc>
  27845. </member>
  27846. <member name="close_punctuation"
  27847. value="18"
  27848. c:identifier="G_UNICODE_CLOSE_PUNCTUATION">
  27849. <doc xml:space="preserve">General category "Punctuation, Close" (Pe)</doc>
  27850. </member>
  27851. <member name="final_punctuation"
  27852. value="19"
  27853. c:identifier="G_UNICODE_FINAL_PUNCTUATION">
  27854. <doc xml:space="preserve">General category "Punctuation, Final quote" (Pf)</doc>
  27855. </member>
  27856. <member name="initial_punctuation"
  27857. value="20"
  27858. c:identifier="G_UNICODE_INITIAL_PUNCTUATION">
  27859. <doc xml:space="preserve">General category "Punctuation, Initial quote" (Pi)</doc>
  27860. </member>
  27861. <member name="other_punctuation"
  27862. value="21"
  27863. c:identifier="G_UNICODE_OTHER_PUNCTUATION">
  27864. <doc xml:space="preserve">General category "Punctuation, Other" (Po)</doc>
  27865. </member>
  27866. <member name="open_punctuation"
  27867. value="22"
  27868. c:identifier="G_UNICODE_OPEN_PUNCTUATION">
  27869. <doc xml:space="preserve">General category "Punctuation, Open" (Ps)</doc>
  27870. </member>
  27871. <member name="currency_symbol"
  27872. value="23"
  27873. c:identifier="G_UNICODE_CURRENCY_SYMBOL">
  27874. <doc xml:space="preserve">General category "Symbol, Currency" (Sc)</doc>
  27875. </member>
  27876. <member name="modifier_symbol"
  27877. value="24"
  27878. c:identifier="G_UNICODE_MODIFIER_SYMBOL">
  27879. <doc xml:space="preserve">General category "Symbol, Modifier" (Sk)</doc>
  27880. </member>
  27881. <member name="math_symbol"
  27882. value="25"
  27883. c:identifier="G_UNICODE_MATH_SYMBOL">
  27884. <doc xml:space="preserve">General category "Symbol, Math" (Sm)</doc>
  27885. </member>
  27886. <member name="other_symbol"
  27887. value="26"
  27888. c:identifier="G_UNICODE_OTHER_SYMBOL">
  27889. <doc xml:space="preserve">General category "Symbol, Other" (So)</doc>
  27890. </member>
  27891. <member name="line_separator"
  27892. value="27"
  27893. c:identifier="G_UNICODE_LINE_SEPARATOR">
  27894. <doc xml:space="preserve">General category "Separator, Line" (Zl)</doc>
  27895. </member>
  27896. <member name="paragraph_separator"
  27897. value="28"
  27898. c:identifier="G_UNICODE_PARAGRAPH_SEPARATOR">
  27899. <doc xml:space="preserve">General category "Separator, Paragraph" (Zp)</doc>
  27900. </member>
  27901. <member name="space_separator"
  27902. value="29"
  27903. c:identifier="G_UNICODE_SPACE_SEPARATOR">
  27904. <doc xml:space="preserve">General category "Separator, Space" (Zs)</doc>
  27905. </member>
  27906. </enumeration>
  27907. <callback name="UnixFDSourceFunc" c:type="GUnixFDSourceFunc">
  27908. <doc xml:space="preserve">The type of functions to be called when a UNIX fd watch source
  27909. triggers.</doc>
  27910. <return-value transfer-ownership="none">
  27911. <doc xml:space="preserve">%FALSE if the source should be removed</doc>
  27912. <type name="gboolean" c:type="gboolean"/>
  27913. </return-value>
  27914. <parameters>
  27915. <parameter name="fd" transfer-ownership="none">
  27916. <doc xml:space="preserve">the fd that triggered the event</doc>
  27917. <type name="gint" c:type="gint"/>
  27918. </parameter>
  27919. <parameter name="condition" transfer-ownership="none">
  27920. <doc xml:space="preserve">the IO conditions reported on @fd</doc>
  27921. <type name="IOCondition" c:type="GIOCondition"/>
  27922. </parameter>
  27923. <parameter name="user_data"
  27924. transfer-ownership="none"
  27925. nullable="1"
  27926. allow-none="1"
  27927. closure="2">
  27928. <doc xml:space="preserve">user data passed to g_unix_fd_add()</doc>
  27929. <type name="gpointer" c:type="gpointer"/>
  27930. </parameter>
  27931. </parameters>
  27932. </callback>
  27933. <enumeration name="UserDirectory" version="2.14" c:type="GUserDirectory">
  27934. <doc xml:space="preserve">These are logical ids for special directories which are defined
  27935. depending on the platform used. You should use g_get_user_special_dir()
  27936. to retrieve the full path associated to the logical id.
  27937. The #GUserDirectory enumeration can be extended at later date. Not
  27938. every platform has a directory for every logical id in this
  27939. enumeration.</doc>
  27940. <member name="directory_desktop"
  27941. value="0"
  27942. c:identifier="G_USER_DIRECTORY_DESKTOP">
  27943. <doc xml:space="preserve">the user's Desktop directory</doc>
  27944. </member>
  27945. <member name="directory_documents"
  27946. value="1"
  27947. c:identifier="G_USER_DIRECTORY_DOCUMENTS">
  27948. <doc xml:space="preserve">the user's Documents directory</doc>
  27949. </member>
  27950. <member name="directory_download"
  27951. value="2"
  27952. c:identifier="G_USER_DIRECTORY_DOWNLOAD">
  27953. <doc xml:space="preserve">the user's Downloads directory</doc>
  27954. </member>
  27955. <member name="directory_music"
  27956. value="3"
  27957. c:identifier="G_USER_DIRECTORY_MUSIC">
  27958. <doc xml:space="preserve">the user's Music directory</doc>
  27959. </member>
  27960. <member name="directory_pictures"
  27961. value="4"
  27962. c:identifier="G_USER_DIRECTORY_PICTURES">
  27963. <doc xml:space="preserve">the user's Pictures directory</doc>
  27964. </member>
  27965. <member name="directory_public_share"
  27966. value="5"
  27967. c:identifier="G_USER_DIRECTORY_PUBLIC_SHARE">
  27968. <doc xml:space="preserve">the user's shared directory</doc>
  27969. </member>
  27970. <member name="directory_templates"
  27971. value="6"
  27972. c:identifier="G_USER_DIRECTORY_TEMPLATES">
  27973. <doc xml:space="preserve">the user's Templates directory</doc>
  27974. </member>
  27975. <member name="directory_videos"
  27976. value="7"
  27977. c:identifier="G_USER_DIRECTORY_VIDEOS">
  27978. <doc xml:space="preserve">the user's Movies directory</doc>
  27979. </member>
  27980. <member name="n_directories"
  27981. value="8"
  27982. c:identifier="G_USER_N_DIRECTORIES">
  27983. <doc xml:space="preserve">the number of enum values</doc>
  27984. </member>
  27985. </enumeration>
  27986. <constant name="VERSION_MIN_REQUIRED"
  27987. value="2"
  27988. c:type="GLIB_VERSION_MIN_REQUIRED"
  27989. version="2.32">
  27990. <doc xml:space="preserve">A macro that should be defined by the user prior to including
  27991. the glib.h header.
  27992. The definition should be one of the predefined GLib version
  27993. macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
  27994. This macro defines the earliest version of GLib that the package is
  27995. required to be able to compile against.
  27996. If the compiler is configured to warn about the use of deprecated
  27997. functions, then using functions that were deprecated in version
  27998. %GLIB_VERSION_MIN_REQUIRED or earlier will cause warnings (but
  27999. using functions deprecated in later releases will not).</doc>
  28000. <type name="gint" c:type="gint"/>
  28001. </constant>
  28002. <record name="Variant"
  28003. c:type="GVariant"
  28004. version="2.24"
  28005. glib:type-name="GVariant"
  28006. glib:get-type="intern"
  28007. c:symbol-prefix="variant">
  28008. <doc xml:space="preserve">#GVariant is a variant datatype; it stores a value along with
  28009. information about the type of that value. The range of possible
  28010. values is determined by the type. The type system used by #GVariant
  28011. is #GVariantType.
  28012. #GVariant instances always have a type and a value (which are given
  28013. at construction time). The type and value of a #GVariant instance
  28014. can never change other than by the #GVariant itself being
  28015. destroyed. A #GVariant cannot contain a pointer.
  28016. #GVariant is reference counted using g_variant_ref() and
  28017. g_variant_unref(). #GVariant also has floating reference counts --
  28018. see g_variant_ref_sink().
  28019. #GVariant is completely threadsafe. A #GVariant instance can be
  28020. concurrently accessed in any way from any number of threads without
  28021. problems.
  28022. #GVariant is heavily optimised for dealing with data in serialised
  28023. form. It works particularly well with data located in memory-mapped
  28024. files. It can perform nearly all deserialisation operations in a
  28025. small constant time, usually touching only a single memory page.
  28026. Serialised #GVariant data can also be sent over the network.
  28027. #GVariant is largely compatible with D-Bus. Almost all types of
  28028. #GVariant instances can be sent over D-Bus. See #GVariantType for
  28029. exceptions. (However, #GVariant's serialisation format is not the same
  28030. as the serialisation format of a D-Bus message body: use #GDBusMessage,
  28031. in the gio library, for those.)
  28032. For space-efficiency, the #GVariant serialisation format does not
  28033. automatically include the variant's length, type or endianness,
  28034. which must either be implied from context (such as knowledge that a
  28035. particular file format always contains a little-endian
  28036. %G_VARIANT_TYPE_VARIANT which occupies the whole length of the file)
  28037. or supplied out-of-band (for instance, a length, type and/or endianness
  28038. indicator could be placed at the beginning of a file, network message
  28039. or network stream).
  28040. A #GVariant's size is limited mainly by any lower level operating
  28041. system constraints, such as the number of bits in #gsize. For
  28042. example, it is reasonable to have a 2GB file mapped into memory
  28043. with #GMappedFile, and call g_variant_new_from_data() on it.
  28044. For convenience to C programmers, #GVariant features powerful
  28045. varargs-based value construction and destruction. This feature is
  28046. designed to be embedded in other libraries.
  28047. There is a Python-inspired text language for describing #GVariant
  28048. values. #GVariant includes a printer for this language and a parser
  28049. with type inferencing.
  28050. ## Memory Use
  28051. #GVariant tries to be quite efficient with respect to memory use.
  28052. This section gives a rough idea of how much memory is used by the
  28053. current implementation. The information here is subject to change
  28054. in the future.
  28055. The memory allocated by #GVariant can be grouped into 4 broad
  28056. purposes: memory for serialised data, memory for the type
  28057. information cache, buffer management memory and memory for the
  28058. #GVariant structure itself.
  28059. ## Serialised Data Memory
  28060. This is the memory that is used for storing GVariant data in
  28061. serialised form. This is what would be sent over the network or
  28062. what would end up on disk, not counting any indicator of the
  28063. endianness, or of the length or type of the top-level variant.
  28064. The amount of memory required to store a boolean is 1 byte. 16,
  28065. 32 and 64 bit integers and double precision floating point numbers
  28066. use their "natural" size. Strings (including object path and
  28067. signature strings) are stored with a nul terminator, and as such
  28068. use the length of the string plus 1 byte.
  28069. Maybe types use no space at all to represent the null value and
  28070. use the same amount of space (sometimes plus one byte) as the
  28071. equivalent non-maybe-typed value to represent the non-null case.
  28072. Arrays use the amount of space required to store each of their
  28073. members, concatenated. Additionally, if the items stored in an
  28074. array are not of a fixed-size (ie: strings, other arrays, etc)
  28075. then an additional framing offset is stored for each item. The
  28076. size of this offset is either 1, 2 or 4 bytes depending on the
  28077. overall size of the container. Additionally, extra padding bytes
  28078. are added as required for alignment of child values.
  28079. Tuples (including dictionary entries) use the amount of space
  28080. required to store each of their members, concatenated, plus one
  28081. framing offset (as per arrays) for each non-fixed-sized item in
  28082. the tuple, except for the last one. Additionally, extra padding
  28083. bytes are added as required for alignment of child values.
  28084. Variants use the same amount of space as the item inside of the
  28085. variant, plus 1 byte, plus the length of the type string for the
  28086. item inside the variant.
  28087. As an example, consider a dictionary mapping strings to variants.
  28088. In the case that the dictionary is empty, 0 bytes are required for
  28089. the serialisation.
  28090. If we add an item "width" that maps to the int32 value of 500 then
  28091. we will use 4 byte to store the int32 (so 6 for the variant
  28092. containing it) and 6 bytes for the string. The variant must be
  28093. aligned to 8 after the 6 bytes of the string, so that's 2 extra
  28094. bytes. 6 (string) + 2 (padding) + 6 (variant) is 14 bytes used
  28095. for the dictionary entry. An additional 1 byte is added to the
  28096. array as a framing offset making a total of 15 bytes.
  28097. If we add another entry, "title" that maps to a nullable string
  28098. that happens to have a value of null, then we use 0 bytes for the
  28099. null value (and 3 bytes for the variant to contain it along with
  28100. its type string) plus 6 bytes for the string. Again, we need 2
  28101. padding bytes. That makes a total of 6 + 2 + 3 = 11 bytes.
  28102. We now require extra padding between the two items in the array.
  28103. After the 14 bytes of the first item, that's 2 bytes required.
  28104. We now require 2 framing offsets for an extra two
  28105. bytes. 14 + 2 + 11 + 2 = 29 bytes to encode the entire two-item
  28106. dictionary.
  28107. ## Type Information Cache
  28108. For each GVariant type that currently exists in the program a type
  28109. information structure is kept in the type information cache. The
  28110. type information structure is required for rapid deserialisation.
  28111. Continuing with the above example, if a #GVariant exists with the
  28112. type "a{sv}" then a type information struct will exist for
  28113. "a{sv}", "{sv}", "s", and "v". Multiple uses of the same type
  28114. will share the same type information. Additionally, all
  28115. single-digit types are stored in read-only static memory and do
  28116. not contribute to the writable memory footprint of a program using
  28117. #GVariant.
  28118. Aside from the type information structures stored in read-only
  28119. memory, there are two forms of type information. One is used for
  28120. container types where there is a single element type: arrays and
  28121. maybe types. The other is used for container types where there
  28122. are multiple element types: tuples and dictionary entries.
  28123. Array type info structures are 6 * sizeof (void *), plus the
  28124. memory required to store the type string itself. This means that
  28125. on 32-bit systems, the cache entry for "a{sv}" would require 30
  28126. bytes of memory (plus malloc overhead).
  28127. Tuple type info structures are 6 * sizeof (void *), plus 4 *
  28128. sizeof (void *) for each item in the tuple, plus the memory
  28129. required to store the type string itself. A 2-item tuple, for
  28130. example, would have a type information structure that consumed
  28131. writable memory in the size of 14 * sizeof (void *) (plus type
  28132. string) This means that on 32-bit systems, the cache entry for
  28133. "{sv}" would require 61 bytes of memory (plus malloc overhead).
  28134. This means that in total, for our "a{sv}" example, 91 bytes of
  28135. type information would be allocated.
  28136. The type information cache, additionally, uses a #GHashTable to
  28137. store and lookup the cached items and stores a pointer to this
  28138. hash table in static storage. The hash table is freed when there
  28139. are zero items in the type cache.
  28140. Although these sizes may seem large it is important to remember
  28141. that a program will probably only have a very small number of
  28142. different types of values in it and that only one type information
  28143. structure is required for many different values of the same type.
  28144. ## Buffer Management Memory
  28145. #GVariant uses an internal buffer management structure to deal
  28146. with the various different possible sources of serialised data
  28147. that it uses. The buffer is responsible for ensuring that the
  28148. correct call is made when the data is no longer in use by
  28149. #GVariant. This may involve a g_free() or a g_slice_free() or
  28150. even g_mapped_file_unref().
  28151. One buffer management structure is used for each chunk of
  28152. serialised data. The size of the buffer management structure
  28153. is 4 * (void *). On 32-bit systems, that's 16 bytes.
  28154. ## GVariant structure
  28155. The size of a #GVariant structure is 6 * (void *). On 32-bit
  28156. systems, that's 24 bytes.
  28157. #GVariant structures only exist if they are explicitly created
  28158. with API calls. For example, if a #GVariant is constructed out of
  28159. serialised data for the example given above (with the dictionary)
  28160. then although there are 9 individual values that comprise the
  28161. entire dictionary (two keys, two values, two variants containing
  28162. the values, two dictionary entries, plus the dictionary itself),
  28163. only 1 #GVariant instance exists -- the one referring to the
  28164. dictionary.
  28165. If calls are made to start accessing the other values then
  28166. #GVariant instances will exist for those values only for as long
  28167. as they are in use (ie: until you call g_variant_unref()). The
  28168. type information is shared. The serialised data and the buffer
  28169. management structure for that serialised data is shared by the
  28170. child.
  28171. ## Summary
  28172. To put the entire example together, for our dictionary mapping
  28173. strings to variants (with two entries, as given above), we are
  28174. using 91 bytes of memory for type information, 29 byes of memory
  28175. for the serialised data, 16 bytes for buffer management and 24
  28176. bytes for the #GVariant instance, or a total of 160 bytes, plus
  28177. malloc overhead. If we were to use g_variant_get_child_value() to
  28178. access the two dictionary entries, we would use an additional 48
  28179. bytes. If we were to have other dictionaries of the same type, we
  28180. would use more memory for the serialised data and buffer
  28181. management for those dictionaries, but the type information would
  28182. be shared.</doc>
  28183. <constructor name="new"
  28184. c:identifier="g_variant_new"
  28185. version="2.24"
  28186. introspectable="0">
  28187. <doc xml:space="preserve">Creates a new #GVariant instance.
  28188. Think of this function as an analogue to g_strdup_printf().
  28189. The type of the created instance and the arguments that are expected
  28190. by this function are determined by @format_string. See the section on
  28191. [GVariant format strings][gvariant-format-strings]. Please note that
  28192. the syntax of the format string is very likely to be extended in the
  28193. future.
  28194. The first character of the format string must not be '*' '?' '@' or
  28195. 'r'; in essence, a new #GVariant must always be constructed by this
  28196. function (and not merely passed through it unmodified).
  28197. Note that the arguments must be of the correct width for their types
  28198. specified in @format_string. This can be achieved by casting them. See
  28199. the [GVariant varargs documentation][gvariant-varargs].
  28200. |[&lt;!-- language="C" --&gt;
  28201. MyFlags some_flags = FLAG_ONE | FLAG_TWO;
  28202. const gchar *some_strings[] = { "a", "b", "c", NULL };
  28203. GVariant *new_variant;
  28204. new_variant = g_variant_new ("(t^as)",
  28205. /&lt;!-- --&gt;* This cast is required. *&lt;!-- --&gt;/
  28206. (guint64) some_flags,
  28207. some_strings);
  28208. ]|</doc>
  28209. <return-value transfer-ownership="full">
  28210. <doc xml:space="preserve">a new floating #GVariant instance</doc>
  28211. <type name="Variant" c:type="GVariant*"/>
  28212. </return-value>
  28213. <parameters>
  28214. <parameter name="format_string" transfer-ownership="none">
  28215. <doc xml:space="preserve">a #GVariant format string</doc>
  28216. <type name="utf8" c:type="const gchar*"/>
  28217. </parameter>
  28218. <parameter name="..." transfer-ownership="none">
  28219. <doc xml:space="preserve">arguments, as per @format_string</doc>
  28220. <varargs/>
  28221. </parameter>
  28222. </parameters>
  28223. </constructor>
  28224. <constructor name="new_array"
  28225. c:identifier="g_variant_new_array"
  28226. version="2.24">
  28227. <doc xml:space="preserve">Creates a new #GVariant array from @children.
  28228. @child_type must be non-%NULL if @n_children is zero. Otherwise, the
  28229. child type is determined by inspecting the first element of the
  28230. @children array. If @child_type is non-%NULL then it must be a
  28231. definite type.
  28232. The items of the array are taken from the @children array. No entry
  28233. in the @children array may be %NULL.
  28234. All items in the array must have the same type, which must be the
  28235. same as @child_type, if given.
  28236. If the @children are floating references (see g_variant_ref_sink()), the
  28237. new instance takes ownership of them as if via g_variant_ref_sink().</doc>
  28238. <return-value transfer-ownership="none">
  28239. <doc xml:space="preserve">a floating reference to a new #GVariant array</doc>
  28240. <type name="Variant" c:type="GVariant*"/>
  28241. </return-value>
  28242. <parameters>
  28243. <parameter name="child_type"
  28244. transfer-ownership="none"
  28245. nullable="1"
  28246. allow-none="1">
  28247. <doc xml:space="preserve">the element type of the new array</doc>
  28248. <type name="VariantType" c:type="const GVariantType*"/>
  28249. </parameter>
  28250. <parameter name="children"
  28251. transfer-ownership="none"
  28252. nullable="1"
  28253. allow-none="1">
  28254. <doc xml:space="preserve">an array of
  28255. #GVariant pointers, the children</doc>
  28256. <array length="2" zero-terminated="0" c:type="GVariant**">
  28257. <type name="Variant" c:type="GVariant*"/>
  28258. </array>
  28259. </parameter>
  28260. <parameter name="n_children" transfer-ownership="none">
  28261. <doc xml:space="preserve">the length of @children</doc>
  28262. <type name="gsize" c:type="gsize"/>
  28263. </parameter>
  28264. </parameters>
  28265. </constructor>
  28266. <constructor name="new_boolean"
  28267. c:identifier="g_variant_new_boolean"
  28268. version="2.24">
  28269. <doc xml:space="preserve">Creates a new boolean #GVariant instance -- either %TRUE or %FALSE.</doc>
  28270. <return-value transfer-ownership="none">
  28271. <doc xml:space="preserve">a floating reference to a new boolean #GVariant instance</doc>
  28272. <type name="Variant" c:type="GVariant*"/>
  28273. </return-value>
  28274. <parameters>
  28275. <parameter name="value" transfer-ownership="none">
  28276. <doc xml:space="preserve">a #gboolean value</doc>
  28277. <type name="gboolean" c:type="gboolean"/>
  28278. </parameter>
  28279. </parameters>
  28280. </constructor>
  28281. <constructor name="new_byte"
  28282. c:identifier="g_variant_new_byte"
  28283. version="2.24">
  28284. <doc xml:space="preserve">Creates a new byte #GVariant instance.</doc>
  28285. <return-value transfer-ownership="none">
  28286. <doc xml:space="preserve">a floating reference to a new byte #GVariant instance</doc>
  28287. <type name="Variant" c:type="GVariant*"/>
  28288. </return-value>
  28289. <parameters>
  28290. <parameter name="value" transfer-ownership="none">
  28291. <doc xml:space="preserve">a #guint8 value</doc>
  28292. <type name="guint8" c:type="guchar"/>
  28293. </parameter>
  28294. </parameters>
  28295. </constructor>
  28296. <constructor name="new_bytestring"
  28297. c:identifier="g_variant_new_bytestring"
  28298. version="2.26">
  28299. <doc xml:space="preserve">Creates an array-of-bytes #GVariant with the contents of @string.
  28300. This function is just like g_variant_new_string() except that the
  28301. string need not be valid UTF-8.
  28302. The nul terminator character at the end of the string is stored in
  28303. the array.</doc>
  28304. <return-value transfer-ownership="none">
  28305. <doc xml:space="preserve">a floating reference to a new bytestring #GVariant instance</doc>
  28306. <type name="Variant" c:type="GVariant*"/>
  28307. </return-value>
  28308. <parameters>
  28309. <parameter name="string" transfer-ownership="none">
  28310. <doc xml:space="preserve">a normal
  28311. nul-terminated string in no particular encoding</doc>
  28312. <array c:type="gchar*">
  28313. <type name="guint8"/>
  28314. </array>
  28315. </parameter>
  28316. </parameters>
  28317. </constructor>
  28318. <constructor name="new_bytestring_array"
  28319. c:identifier="g_variant_new_bytestring_array"
  28320. version="2.26">
  28321. <doc xml:space="preserve">Constructs an array of bytestring #GVariant from the given array of
  28322. strings.
  28323. If @length is -1 then @strv is %NULL-terminated.</doc>
  28324. <return-value transfer-ownership="none">
  28325. <doc xml:space="preserve">a new floating #GVariant instance</doc>
  28326. <type name="Variant" c:type="GVariant*"/>
  28327. </return-value>
  28328. <parameters>
  28329. <parameter name="strv" transfer-ownership="none">
  28330. <doc xml:space="preserve">an array of strings</doc>
  28331. <array length="1" zero-terminated="0" c:type="gchar**">
  28332. <type name="utf8" c:type="gchar*"/>
  28333. </array>
  28334. </parameter>
  28335. <parameter name="length" transfer-ownership="none">
  28336. <doc xml:space="preserve">the length of @strv, or -1</doc>
  28337. <type name="gssize" c:type="gssize"/>
  28338. </parameter>
  28339. </parameters>
  28340. </constructor>
  28341. <constructor name="new_dict_entry"
  28342. c:identifier="g_variant_new_dict_entry"
  28343. version="2.24">
  28344. <doc xml:space="preserve">Creates a new dictionary entry #GVariant. @key and @value must be
  28345. non-%NULL. @key must be a value of a basic type (ie: not a container).
  28346. If the @key or @value are floating references (see g_variant_ref_sink()),
  28347. the new instance takes ownership of them as if via g_variant_ref_sink().</doc>
  28348. <return-value transfer-ownership="none">
  28349. <doc xml:space="preserve">a floating reference to a new dictionary entry #GVariant</doc>
  28350. <type name="Variant" c:type="GVariant*"/>
  28351. </return-value>
  28352. <parameters>
  28353. <parameter name="key" transfer-ownership="none">
  28354. <doc xml:space="preserve">a basic #GVariant, the key</doc>
  28355. <type name="Variant" c:type="GVariant*"/>
  28356. </parameter>
  28357. <parameter name="value" transfer-ownership="none">
  28358. <doc xml:space="preserve">a #GVariant, the value</doc>
  28359. <type name="Variant" c:type="GVariant*"/>
  28360. </parameter>
  28361. </parameters>
  28362. </constructor>
  28363. <constructor name="new_double"
  28364. c:identifier="g_variant_new_double"
  28365. version="2.24">
  28366. <doc xml:space="preserve">Creates a new double #GVariant instance.</doc>
  28367. <return-value transfer-ownership="none">
  28368. <doc xml:space="preserve">a floating reference to a new double #GVariant instance</doc>
  28369. <type name="Variant" c:type="GVariant*"/>
  28370. </return-value>
  28371. <parameters>
  28372. <parameter name="value" transfer-ownership="none">
  28373. <doc xml:space="preserve">a #gdouble floating point value</doc>
  28374. <type name="gdouble" c:type="gdouble"/>
  28375. </parameter>
  28376. </parameters>
  28377. </constructor>
  28378. <constructor name="new_fixed_array"
  28379. c:identifier="g_variant_new_fixed_array"
  28380. version="2.32">
  28381. <doc xml:space="preserve">Provides access to the serialised data for an array of fixed-sized
  28382. items.
  28383. @value must be an array with fixed-sized elements. Numeric types are
  28384. fixed-size as are tuples containing only other fixed-sized types.
  28385. @element_size must be the size of a single element in the array.
  28386. For example, if calling this function for an array of 32-bit integers,
  28387. you might say sizeof(gint32). This value isn't used except for the purpose
  28388. of a double-check that the form of the serialised data matches the caller's
  28389. expectation.
  28390. @n_elements, which must be non-%NULL is set equal to the number of
  28391. items in the array.</doc>
  28392. <return-value transfer-ownership="none">
  28393. <doc xml:space="preserve">a floating reference to a new array #GVariant instance</doc>
  28394. <type name="Variant" c:type="GVariant*"/>
  28395. </return-value>
  28396. <parameters>
  28397. <parameter name="element_type" transfer-ownership="none">
  28398. <doc xml:space="preserve">the #GVariantType of each element</doc>
  28399. <type name="VariantType" c:type="const GVariantType*"/>
  28400. </parameter>
  28401. <parameter name="elements"
  28402. transfer-ownership="none"
  28403. nullable="1"
  28404. allow-none="1">
  28405. <doc xml:space="preserve">a pointer to the fixed array of contiguous elements</doc>
  28406. <type name="gpointer" c:type="gconstpointer"/>
  28407. </parameter>
  28408. <parameter name="n_elements" transfer-ownership="none">
  28409. <doc xml:space="preserve">the number of elements</doc>
  28410. <type name="gsize" c:type="gsize"/>
  28411. </parameter>
  28412. <parameter name="element_size" transfer-ownership="none">
  28413. <doc xml:space="preserve">the size of each element</doc>
  28414. <type name="gsize" c:type="gsize"/>
  28415. </parameter>
  28416. </parameters>
  28417. </constructor>
  28418. <constructor name="new_from_bytes"
  28419. c:identifier="g_variant_new_from_bytes"
  28420. version="2.36">
  28421. <doc xml:space="preserve">Constructs a new serialised-mode #GVariant instance. This is the
  28422. inner interface for creation of new serialised values that gets
  28423. called from various functions in gvariant.c.
  28424. A reference is taken on @bytes.</doc>
  28425. <return-value transfer-ownership="none">
  28426. <doc xml:space="preserve">a new #GVariant with a floating reference</doc>
  28427. <type name="Variant" c:type="GVariant*"/>
  28428. </return-value>
  28429. <parameters>
  28430. <parameter name="type" transfer-ownership="none">
  28431. <doc xml:space="preserve">a #GVariantType</doc>
  28432. <type name="VariantType" c:type="const GVariantType*"/>
  28433. </parameter>
  28434. <parameter name="bytes" transfer-ownership="none">
  28435. <doc xml:space="preserve">a #GBytes</doc>
  28436. <type name="Bytes" c:type="GBytes*"/>
  28437. </parameter>
  28438. <parameter name="trusted" transfer-ownership="none">
  28439. <doc xml:space="preserve">if the contents of @bytes are trusted</doc>
  28440. <type name="gboolean" c:type="gboolean"/>
  28441. </parameter>
  28442. </parameters>
  28443. </constructor>
  28444. <constructor name="new_from_data"
  28445. c:identifier="g_variant_new_from_data"
  28446. version="2.24">
  28447. <doc xml:space="preserve">Creates a new #GVariant instance from serialised data.
  28448. @type is the type of #GVariant instance that will be constructed.
  28449. The interpretation of @data depends on knowing the type.
  28450. @data is not modified by this function and must remain valid with an
  28451. unchanging value until such a time as @notify is called with
  28452. @user_data. If the contents of @data change before that time then
  28453. the result is undefined.
  28454. If @data is trusted to be serialised data in normal form then
  28455. @trusted should be %TRUE. This applies to serialised data created
  28456. within this process or read from a trusted location on the disk (such
  28457. as a file installed in /usr/lib alongside your application). You
  28458. should set trusted to %FALSE if @data is read from the network, a
  28459. file in the user's home directory, etc.
  28460. If @data was not stored in this machine's native endianness, any multi-byte
  28461. numeric values in the returned variant will also be in non-native
  28462. endianness. g_variant_byteswap() can be used to recover the original values.
  28463. @notify will be called with @user_data when @data is no longer
  28464. needed. The exact time of this call is unspecified and might even be
  28465. before this function returns.</doc>
  28466. <return-value transfer-ownership="none">
  28467. <doc xml:space="preserve">a new floating #GVariant of type @type</doc>
  28468. <type name="Variant" c:type="GVariant*"/>
  28469. </return-value>
  28470. <parameters>
  28471. <parameter name="type" transfer-ownership="none">
  28472. <doc xml:space="preserve">a definite #GVariantType</doc>
  28473. <type name="VariantType" c:type="const GVariantType*"/>
  28474. </parameter>
  28475. <parameter name="data" transfer-ownership="none">
  28476. <doc xml:space="preserve">the serialised data</doc>
  28477. <array length="2" zero-terminated="0" c:type="gconstpointer">
  28478. <type name="guint8"/>
  28479. </array>
  28480. </parameter>
  28481. <parameter name="size" transfer-ownership="none">
  28482. <doc xml:space="preserve">the size of @data</doc>
  28483. <type name="gsize" c:type="gsize"/>
  28484. </parameter>
  28485. <parameter name="trusted" transfer-ownership="none">
  28486. <doc xml:space="preserve">%TRUE if @data is definitely in normal form</doc>
  28487. <type name="gboolean" c:type="gboolean"/>
  28488. </parameter>
  28489. <parameter name="notify" transfer-ownership="none" scope="async">
  28490. <doc xml:space="preserve">function to call when @data is no longer needed</doc>
  28491. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  28492. </parameter>
  28493. <parameter name="user_data"
  28494. transfer-ownership="none"
  28495. nullable="1"
  28496. allow-none="1">
  28497. <doc xml:space="preserve">data for @notify</doc>
  28498. <type name="gpointer" c:type="gpointer"/>
  28499. </parameter>
  28500. </parameters>
  28501. </constructor>
  28502. <constructor name="new_handle"
  28503. c:identifier="g_variant_new_handle"
  28504. version="2.24">
  28505. <doc xml:space="preserve">Creates a new handle #GVariant instance.
  28506. By convention, handles are indexes into an array of file descriptors
  28507. that are sent alongside a D-Bus message. If you're not interacting
  28508. with D-Bus, you probably don't need them.</doc>
  28509. <return-value transfer-ownership="none">
  28510. <doc xml:space="preserve">a floating reference to a new handle #GVariant instance</doc>
  28511. <type name="Variant" c:type="GVariant*"/>
  28512. </return-value>
  28513. <parameters>
  28514. <parameter name="value" transfer-ownership="none">
  28515. <doc xml:space="preserve">a #gint32 value</doc>
  28516. <type name="gint32" c:type="gint32"/>
  28517. </parameter>
  28518. </parameters>
  28519. </constructor>
  28520. <constructor name="new_int16"
  28521. c:identifier="g_variant_new_int16"
  28522. version="2.24">
  28523. <doc xml:space="preserve">Creates a new int16 #GVariant instance.</doc>
  28524. <return-value transfer-ownership="none">
  28525. <doc xml:space="preserve">a floating reference to a new int16 #GVariant instance</doc>
  28526. <type name="Variant" c:type="GVariant*"/>
  28527. </return-value>
  28528. <parameters>
  28529. <parameter name="value" transfer-ownership="none">
  28530. <doc xml:space="preserve">a #gint16 value</doc>
  28531. <type name="gint16" c:type="gint16"/>
  28532. </parameter>
  28533. </parameters>
  28534. </constructor>
  28535. <constructor name="new_int32"
  28536. c:identifier="g_variant_new_int32"
  28537. version="2.24">
  28538. <doc xml:space="preserve">Creates a new int32 #GVariant instance.</doc>
  28539. <return-value transfer-ownership="none">
  28540. <doc xml:space="preserve">a floating reference to a new int32 #GVariant instance</doc>
  28541. <type name="Variant" c:type="GVariant*"/>
  28542. </return-value>
  28543. <parameters>
  28544. <parameter name="value" transfer-ownership="none">
  28545. <doc xml:space="preserve">a #gint32 value</doc>
  28546. <type name="gint32" c:type="gint32"/>
  28547. </parameter>
  28548. </parameters>
  28549. </constructor>
  28550. <constructor name="new_int64"
  28551. c:identifier="g_variant_new_int64"
  28552. version="2.24">
  28553. <doc xml:space="preserve">Creates a new int64 #GVariant instance.</doc>
  28554. <return-value transfer-ownership="none">
  28555. <doc xml:space="preserve">a floating reference to a new int64 #GVariant instance</doc>
  28556. <type name="Variant" c:type="GVariant*"/>
  28557. </return-value>
  28558. <parameters>
  28559. <parameter name="value" transfer-ownership="none">
  28560. <doc xml:space="preserve">a #gint64 value</doc>
  28561. <type name="gint64" c:type="gint64"/>
  28562. </parameter>
  28563. </parameters>
  28564. </constructor>
  28565. <constructor name="new_maybe"
  28566. c:identifier="g_variant_new_maybe"
  28567. version="2.24">
  28568. <doc xml:space="preserve">Depending on if @child is %NULL, either wraps @child inside of a
  28569. maybe container or creates a Nothing instance for the given @type.
  28570. At least one of @child_type and @child must be non-%NULL.
  28571. If @child_type is non-%NULL then it must be a definite type.
  28572. If they are both non-%NULL then @child_type must be the type
  28573. of @child.
  28574. If @child is a floating reference (see g_variant_ref_sink()), the new
  28575. instance takes ownership of @child.</doc>
  28576. <return-value transfer-ownership="none">
  28577. <doc xml:space="preserve">a floating reference to a new #GVariant maybe instance</doc>
  28578. <type name="Variant" c:type="GVariant*"/>
  28579. </return-value>
  28580. <parameters>
  28581. <parameter name="child_type"
  28582. transfer-ownership="none"
  28583. nullable="1"
  28584. allow-none="1">
  28585. <doc xml:space="preserve">the #GVariantType of the child, or %NULL</doc>
  28586. <type name="VariantType" c:type="const GVariantType*"/>
  28587. </parameter>
  28588. <parameter name="child"
  28589. transfer-ownership="none"
  28590. nullable="1"
  28591. allow-none="1">
  28592. <doc xml:space="preserve">the child value, or %NULL</doc>
  28593. <type name="Variant" c:type="GVariant*"/>
  28594. </parameter>
  28595. </parameters>
  28596. </constructor>
  28597. <constructor name="new_object_path"
  28598. c:identifier="g_variant_new_object_path"
  28599. version="2.24">
  28600. <doc xml:space="preserve">Creates a D-Bus object path #GVariant with the contents of @string.
  28601. @string must be a valid D-Bus object path. Use
  28602. g_variant_is_object_path() if you're not sure.</doc>
  28603. <return-value transfer-ownership="none">
  28604. <doc xml:space="preserve">a floating reference to a new object path #GVariant instance</doc>
  28605. <type name="Variant" c:type="GVariant*"/>
  28606. </return-value>
  28607. <parameters>
  28608. <parameter name="object_path" transfer-ownership="none">
  28609. <doc xml:space="preserve">a normal C nul-terminated string</doc>
  28610. <type name="utf8" c:type="const gchar*"/>
  28611. </parameter>
  28612. </parameters>
  28613. </constructor>
  28614. <constructor name="new_objv"
  28615. c:identifier="g_variant_new_objv"
  28616. version="2.30">
  28617. <doc xml:space="preserve">Constructs an array of object paths #GVariant from the given array of
  28618. strings.
  28619. Each string must be a valid #GVariant object path; see
  28620. g_variant_is_object_path().
  28621. If @length is -1 then @strv is %NULL-terminated.</doc>
  28622. <return-value transfer-ownership="none">
  28623. <doc xml:space="preserve">a new floating #GVariant instance</doc>
  28624. <type name="Variant" c:type="GVariant*"/>
  28625. </return-value>
  28626. <parameters>
  28627. <parameter name="strv" transfer-ownership="none">
  28628. <doc xml:space="preserve">an array of strings</doc>
  28629. <array length="1" zero-terminated="0" c:type="gchar**">
  28630. <type name="utf8"/>
  28631. </array>
  28632. </parameter>
  28633. <parameter name="length" transfer-ownership="none">
  28634. <doc xml:space="preserve">the length of @strv, or -1</doc>
  28635. <type name="gssize" c:type="gssize"/>
  28636. </parameter>
  28637. </parameters>
  28638. </constructor>
  28639. <constructor name="new_parsed"
  28640. c:identifier="g_variant_new_parsed"
  28641. introspectable="0">
  28642. <doc xml:space="preserve">Parses @format and returns the result.
  28643. @format must be a text format #GVariant with one extension: at any
  28644. point that a value may appear in the text, a '%' character followed
  28645. by a GVariant format string (as per g_variant_new()) may appear. In
  28646. that case, the same arguments are collected from the argument list as
  28647. g_variant_new() would have collected.
  28648. Note that the arguments must be of the correct width for their types
  28649. specified in @format. This can be achieved by casting them. See
  28650. the [GVariant varargs documentation][gvariant-varargs].
  28651. Consider this simple example:
  28652. |[&lt;!-- language="C" --&gt;
  28653. g_variant_new_parsed ("[('one', 1), ('two', %i), (%s, 3)]", 2, "three");
  28654. ]|
  28655. In the example, the variable argument parameters are collected and
  28656. filled in as if they were part of the original string to produce the
  28657. result of
  28658. |[&lt;!-- language="C" --&gt;
  28659. [('one', 1), ('two', 2), ('three', 3)]
  28660. ]|
  28661. This function is intended only to be used with @format as a string
  28662. literal. Any parse error is fatal to the calling process. If you
  28663. want to parse data from untrusted sources, use g_variant_parse().
  28664. You may not use this function to return, unmodified, a single
  28665. #GVariant pointer from the argument list. ie: @format may not solely
  28666. be anything along the lines of "%*", "%?", "\%r", or anything starting
  28667. with "%@".</doc>
  28668. <return-value transfer-ownership="full">
  28669. <doc xml:space="preserve">a new floating #GVariant instance</doc>
  28670. <type name="Variant" c:type="GVariant*"/>
  28671. </return-value>
  28672. <parameters>
  28673. <parameter name="format" transfer-ownership="none">
  28674. <doc xml:space="preserve">a text format #GVariant</doc>
  28675. <type name="utf8" c:type="const gchar*"/>
  28676. </parameter>
  28677. <parameter name="..." transfer-ownership="none">
  28678. <doc xml:space="preserve">arguments as per @format</doc>
  28679. <varargs/>
  28680. </parameter>
  28681. </parameters>
  28682. </constructor>
  28683. <constructor name="new_parsed_va"
  28684. c:identifier="g_variant_new_parsed_va"
  28685. introspectable="0">
  28686. <doc xml:space="preserve">Parses @format and returns the result.
  28687. This is the version of g_variant_new_parsed() intended to be used
  28688. from libraries.
  28689. The return value will be floating if it was a newly created GVariant
  28690. instance. In the case that @format simply specified the collection
  28691. of a #GVariant pointer (eg: @format was "%*") then the collected
  28692. #GVariant pointer will be returned unmodified, without adding any
  28693. additional references.
  28694. Note that the arguments in @app must be of the correct width for their types
  28695. specified in @format when collected into the #va_list. See
  28696. the [GVariant varargs documentation][gvariant-varargs].
  28697. In order to behave correctly in all cases it is necessary for the
  28698. calling function to g_variant_ref_sink() the return result before
  28699. returning control to the user that originally provided the pointer.
  28700. At this point, the caller will have their own full reference to the
  28701. result. This can also be done by adding the result to a container,
  28702. or by passing it to another g_variant_new() call.</doc>
  28703. <return-value transfer-ownership="full">
  28704. <doc xml:space="preserve">a new, usually floating, #GVariant</doc>
  28705. <type name="Variant" c:type="GVariant*"/>
  28706. </return-value>
  28707. <parameters>
  28708. <parameter name="format" transfer-ownership="none">
  28709. <doc xml:space="preserve">a text format #GVariant</doc>
  28710. <type name="utf8" c:type="const gchar*"/>
  28711. </parameter>
  28712. <parameter name="app" transfer-ownership="none">
  28713. <doc xml:space="preserve">a pointer to a #va_list</doc>
  28714. <type name="va_list" c:type="va_list*"/>
  28715. </parameter>
  28716. </parameters>
  28717. </constructor>
  28718. <constructor name="new_printf"
  28719. c:identifier="g_variant_new_printf"
  28720. version="2.38"
  28721. introspectable="0">
  28722. <doc xml:space="preserve">Creates a string-type GVariant using printf formatting.
  28723. This is similar to calling g_strdup_printf() and then
  28724. g_variant_new_string() but it saves a temporary variable and an
  28725. unnecessary copy.</doc>
  28726. <return-value transfer-ownership="none">
  28727. <doc xml:space="preserve">a floating reference to a new string
  28728. #GVariant instance</doc>
  28729. <type name="Variant" c:type="GVariant*"/>
  28730. </return-value>
  28731. <parameters>
  28732. <parameter name="format_string" transfer-ownership="none">
  28733. <doc xml:space="preserve">a printf-style format string</doc>
  28734. <type name="utf8" c:type="const gchar*"/>
  28735. </parameter>
  28736. <parameter name="..." transfer-ownership="none">
  28737. <doc xml:space="preserve">arguments for @format_string</doc>
  28738. <varargs/>
  28739. </parameter>
  28740. </parameters>
  28741. </constructor>
  28742. <constructor name="new_signature"
  28743. c:identifier="g_variant_new_signature"
  28744. version="2.24">
  28745. <doc xml:space="preserve">Creates a D-Bus type signature #GVariant with the contents of
  28746. @string. @string must be a valid D-Bus type signature. Use
  28747. g_variant_is_signature() if you're not sure.</doc>
  28748. <return-value transfer-ownership="none">
  28749. <doc xml:space="preserve">a floating reference to a new signature #GVariant instance</doc>
  28750. <type name="Variant" c:type="GVariant*"/>
  28751. </return-value>
  28752. <parameters>
  28753. <parameter name="signature" transfer-ownership="none">
  28754. <doc xml:space="preserve">a normal C nul-terminated string</doc>
  28755. <type name="utf8" c:type="const gchar*"/>
  28756. </parameter>
  28757. </parameters>
  28758. </constructor>
  28759. <constructor name="new_string"
  28760. c:identifier="g_variant_new_string"
  28761. version="2.24">
  28762. <doc xml:space="preserve">Creates a string #GVariant with the contents of @string.
  28763. @string must be valid UTF-8, and must not be %NULL. To encode
  28764. potentially-%NULL strings, use g_variant_new() with `ms` as the
  28765. [format string][gvariant-format-strings-maybe-types].</doc>
  28766. <return-value transfer-ownership="none">
  28767. <doc xml:space="preserve">a floating reference to a new string #GVariant instance</doc>
  28768. <type name="Variant" c:type="GVariant*"/>
  28769. </return-value>
  28770. <parameters>
  28771. <parameter name="string" transfer-ownership="none">
  28772. <doc xml:space="preserve">a normal UTF-8 nul-terminated string</doc>
  28773. <type name="utf8" c:type="const gchar*"/>
  28774. </parameter>
  28775. </parameters>
  28776. </constructor>
  28777. <constructor name="new_strv"
  28778. c:identifier="g_variant_new_strv"
  28779. version="2.24">
  28780. <doc xml:space="preserve">Constructs an array of strings #GVariant from the given array of
  28781. strings.
  28782. If @length is -1 then @strv is %NULL-terminated.</doc>
  28783. <return-value transfer-ownership="none">
  28784. <doc xml:space="preserve">a new floating #GVariant instance</doc>
  28785. <type name="Variant" c:type="GVariant*"/>
  28786. </return-value>
  28787. <parameters>
  28788. <parameter name="strv" transfer-ownership="none">
  28789. <doc xml:space="preserve">an array of strings</doc>
  28790. <array length="1" zero-terminated="0" c:type="gchar**">
  28791. <type name="utf8"/>
  28792. </array>
  28793. </parameter>
  28794. <parameter name="length" transfer-ownership="none">
  28795. <doc xml:space="preserve">the length of @strv, or -1</doc>
  28796. <type name="gssize" c:type="gssize"/>
  28797. </parameter>
  28798. </parameters>
  28799. </constructor>
  28800. <constructor name="new_take_string"
  28801. c:identifier="g_variant_new_take_string"
  28802. version="2.38"
  28803. introspectable="0">
  28804. <doc xml:space="preserve">Creates a string #GVariant with the contents of @string.
  28805. @string must be valid UTF-8, and must not be %NULL. To encode
  28806. potentially-%NULL strings, use this with g_variant_new_maybe().
  28807. This function consumes @string. g_free() will be called on @string
  28808. when it is no longer required.
  28809. You must not modify or access @string in any other way after passing
  28810. it to this function. It is even possible that @string is immediately
  28811. freed.</doc>
  28812. <return-value transfer-ownership="none">
  28813. <doc xml:space="preserve">a floating reference to a new string
  28814. #GVariant instance</doc>
  28815. <type name="Variant" c:type="GVariant*"/>
  28816. </return-value>
  28817. <parameters>
  28818. <parameter name="string" transfer-ownership="none">
  28819. <doc xml:space="preserve">a normal UTF-8 nul-terminated string</doc>
  28820. <type name="utf8" c:type="gchar*"/>
  28821. </parameter>
  28822. </parameters>
  28823. </constructor>
  28824. <constructor name="new_tuple"
  28825. c:identifier="g_variant_new_tuple"
  28826. version="2.24">
  28827. <doc xml:space="preserve">Creates a new tuple #GVariant out of the items in @children. The
  28828. type is determined from the types of @children. No entry in the
  28829. @children array may be %NULL.
  28830. If @n_children is 0 then the unit tuple is constructed.
  28831. If the @children are floating references (see g_variant_ref_sink()), the
  28832. new instance takes ownership of them as if via g_variant_ref_sink().</doc>
  28833. <return-value transfer-ownership="none">
  28834. <doc xml:space="preserve">a floating reference to a new #GVariant tuple</doc>
  28835. <type name="Variant" c:type="GVariant*"/>
  28836. </return-value>
  28837. <parameters>
  28838. <parameter name="children" transfer-ownership="none">
  28839. <doc xml:space="preserve">the items to make the tuple out of</doc>
  28840. <array length="1" zero-terminated="0" c:type="GVariant**">
  28841. <type name="Variant" c:type="GVariant*"/>
  28842. </array>
  28843. </parameter>
  28844. <parameter name="n_children" transfer-ownership="none">
  28845. <doc xml:space="preserve">the length of @children</doc>
  28846. <type name="gsize" c:type="gsize"/>
  28847. </parameter>
  28848. </parameters>
  28849. </constructor>
  28850. <constructor name="new_uint16"
  28851. c:identifier="g_variant_new_uint16"
  28852. version="2.24">
  28853. <doc xml:space="preserve">Creates a new uint16 #GVariant instance.</doc>
  28854. <return-value transfer-ownership="none">
  28855. <doc xml:space="preserve">a floating reference to a new uint16 #GVariant instance</doc>
  28856. <type name="Variant" c:type="GVariant*"/>
  28857. </return-value>
  28858. <parameters>
  28859. <parameter name="value" transfer-ownership="none">
  28860. <doc xml:space="preserve">a #guint16 value</doc>
  28861. <type name="guint16" c:type="guint16"/>
  28862. </parameter>
  28863. </parameters>
  28864. </constructor>
  28865. <constructor name="new_uint32"
  28866. c:identifier="g_variant_new_uint32"
  28867. version="2.24">
  28868. <doc xml:space="preserve">Creates a new uint32 #GVariant instance.</doc>
  28869. <return-value transfer-ownership="none">
  28870. <doc xml:space="preserve">a floating reference to a new uint32 #GVariant instance</doc>
  28871. <type name="Variant" c:type="GVariant*"/>
  28872. </return-value>
  28873. <parameters>
  28874. <parameter name="value" transfer-ownership="none">
  28875. <doc xml:space="preserve">a #guint32 value</doc>
  28876. <type name="guint32" c:type="guint32"/>
  28877. </parameter>
  28878. </parameters>
  28879. </constructor>
  28880. <constructor name="new_uint64"
  28881. c:identifier="g_variant_new_uint64"
  28882. version="2.24">
  28883. <doc xml:space="preserve">Creates a new uint64 #GVariant instance.</doc>
  28884. <return-value transfer-ownership="none">
  28885. <doc xml:space="preserve">a floating reference to a new uint64 #GVariant instance</doc>
  28886. <type name="Variant" c:type="GVariant*"/>
  28887. </return-value>
  28888. <parameters>
  28889. <parameter name="value" transfer-ownership="none">
  28890. <doc xml:space="preserve">a #guint64 value</doc>
  28891. <type name="guint64" c:type="guint64"/>
  28892. </parameter>
  28893. </parameters>
  28894. </constructor>
  28895. <constructor name="new_va"
  28896. c:identifier="g_variant_new_va"
  28897. version="2.24"
  28898. introspectable="0">
  28899. <doc xml:space="preserve">This function is intended to be used by libraries based on
  28900. #GVariant that want to provide g_variant_new()-like functionality
  28901. to their users.
  28902. The API is more general than g_variant_new() to allow a wider range
  28903. of possible uses.
  28904. @format_string must still point to a valid format string, but it only
  28905. needs to be nul-terminated if @endptr is %NULL. If @endptr is
  28906. non-%NULL then it is updated to point to the first character past the
  28907. end of the format string.
  28908. @app is a pointer to a #va_list. The arguments, according to
  28909. @format_string, are collected from this #va_list and the list is left
  28910. pointing to the argument following the last.
  28911. Note that the arguments in @app must be of the correct width for their
  28912. types specified in @format_string when collected into the #va_list.
  28913. See the [GVariant varargs documentation][gvariant-varargs.
  28914. These two generalisations allow mixing of multiple calls to
  28915. g_variant_new_va() and g_variant_get_va() within a single actual
  28916. varargs call by the user.
  28917. The return value will be floating if it was a newly created GVariant
  28918. instance (for example, if the format string was "(ii)"). In the case
  28919. that the format_string was '*', '?', 'r', or a format starting with
  28920. '@' then the collected #GVariant pointer will be returned unmodified,
  28921. without adding any additional references.
  28922. In order to behave correctly in all cases it is necessary for the
  28923. calling function to g_variant_ref_sink() the return result before
  28924. returning control to the user that originally provided the pointer.
  28925. At this point, the caller will have their own full reference to the
  28926. result. This can also be done by adding the result to a container,
  28927. or by passing it to another g_variant_new() call.</doc>
  28928. <return-value transfer-ownership="full">
  28929. <doc xml:space="preserve">a new, usually floating, #GVariant</doc>
  28930. <type name="Variant" c:type="GVariant*"/>
  28931. </return-value>
  28932. <parameters>
  28933. <parameter name="format_string" transfer-ownership="none">
  28934. <doc xml:space="preserve">a string that is prefixed with a format string</doc>
  28935. <type name="utf8" c:type="const gchar*"/>
  28936. </parameter>
  28937. <parameter name="endptr"
  28938. transfer-ownership="none"
  28939. nullable="1"
  28940. allow-none="1">
  28941. <doc xml:space="preserve">location to store the end pointer,
  28942. or %NULL</doc>
  28943. <type name="utf8" c:type="const gchar**"/>
  28944. </parameter>
  28945. <parameter name="app" transfer-ownership="none">
  28946. <doc xml:space="preserve">a pointer to a #va_list</doc>
  28947. <type name="va_list" c:type="va_list*"/>
  28948. </parameter>
  28949. </parameters>
  28950. </constructor>
  28951. <constructor name="new_variant"
  28952. c:identifier="g_variant_new_variant"
  28953. version="2.24">
  28954. <doc xml:space="preserve">Boxes @value. The result is a #GVariant instance representing a
  28955. variant containing the original value.
  28956. If @child is a floating reference (see g_variant_ref_sink()), the new
  28957. instance takes ownership of @child.</doc>
  28958. <return-value transfer-ownership="none">
  28959. <doc xml:space="preserve">a floating reference to a new variant #GVariant instance</doc>
  28960. <type name="Variant" c:type="GVariant*"/>
  28961. </return-value>
  28962. <parameters>
  28963. <parameter name="value" transfer-ownership="none">
  28964. <doc xml:space="preserve">a #GVariant instance</doc>
  28965. <type name="Variant" c:type="GVariant*"/>
  28966. </parameter>
  28967. </parameters>
  28968. </constructor>
  28969. <method name="byteswap" c:identifier="g_variant_byteswap" version="2.24">
  28970. <doc xml:space="preserve">Performs a byteswapping operation on the contents of @value. The
  28971. result is that all multi-byte numeric data contained in @value is
  28972. byteswapped. That includes 16, 32, and 64bit signed and unsigned
  28973. integers as well as file handles and double precision floating point
  28974. values.
  28975. This function is an identity mapping on any value that does not
  28976. contain multi-byte numeric data. That include strings, booleans,
  28977. bytes and containers containing only these things (recursively).
  28978. The returned value is always in normal form and is marked as trusted.</doc>
  28979. <return-value transfer-ownership="full">
  28980. <doc xml:space="preserve">the byteswapped form of @value</doc>
  28981. <type name="Variant" c:type="GVariant*"/>
  28982. </return-value>
  28983. <parameters>
  28984. <instance-parameter name="value" transfer-ownership="none">
  28985. <doc xml:space="preserve">a #GVariant</doc>
  28986. <type name="Variant" c:type="GVariant*"/>
  28987. </instance-parameter>
  28988. </parameters>
  28989. </method>
  28990. <method name="check_format_string"
  28991. c:identifier="g_variant_check_format_string"
  28992. version="2.34">
  28993. <doc xml:space="preserve">Checks if calling g_variant_get() with @format_string on @value would
  28994. be valid from a type-compatibility standpoint. @format_string is
  28995. assumed to be a valid format string (from a syntactic standpoint).
  28996. If @copy_only is %TRUE then this function additionally checks that it
  28997. would be safe to call g_variant_unref() on @value immediately after
  28998. the call to g_variant_get() without invalidating the result. This is
  28999. only possible if deep copies are made (ie: there are no pointers to
  29000. the data inside of the soon-to-be-freed #GVariant instance). If this
  29001. check fails then a g_critical() is printed and %FALSE is returned.
  29002. This function is meant to be used by functions that wish to provide
  29003. varargs accessors to #GVariant values of uncertain values (eg:
  29004. g_variant_lookup() or g_menu_model_get_item_attribute()).</doc>
  29005. <return-value transfer-ownership="none">
  29006. <doc xml:space="preserve">%TRUE if @format_string is safe to use</doc>
  29007. <type name="gboolean" c:type="gboolean"/>
  29008. </return-value>
  29009. <parameters>
  29010. <instance-parameter name="value" transfer-ownership="none">
  29011. <doc xml:space="preserve">a #GVariant</doc>
  29012. <type name="Variant" c:type="GVariant*"/>
  29013. </instance-parameter>
  29014. <parameter name="format_string" transfer-ownership="none">
  29015. <doc xml:space="preserve">a valid #GVariant format string</doc>
  29016. <type name="utf8" c:type="const gchar*"/>
  29017. </parameter>
  29018. <parameter name="copy_only" transfer-ownership="none">
  29019. <doc xml:space="preserve">%TRUE to ensure the format string makes deep copies</doc>
  29020. <type name="gboolean" c:type="gboolean"/>
  29021. </parameter>
  29022. </parameters>
  29023. </method>
  29024. <method name="classify" c:identifier="g_variant_classify" version="2.24">
  29025. <doc xml:space="preserve">Classifies @value according to its top-level type.</doc>
  29026. <return-value transfer-ownership="none">
  29027. <doc xml:space="preserve">the #GVariantClass of @value</doc>
  29028. <type name="VariantClass" c:type="GVariantClass"/>
  29029. </return-value>
  29030. <parameters>
  29031. <instance-parameter name="value" transfer-ownership="none">
  29032. <doc xml:space="preserve">a #GVariant</doc>
  29033. <type name="Variant" c:type="GVariant*"/>
  29034. </instance-parameter>
  29035. </parameters>
  29036. </method>
  29037. <method name="compare" c:identifier="g_variant_compare" version="2.26">
  29038. <doc xml:space="preserve">Compares @one and @two.
  29039. The types of @one and @two are #gconstpointer only to allow use of
  29040. this function with #GTree, #GPtrArray, etc. They must each be a
  29041. #GVariant.
  29042. Comparison is only defined for basic types (ie: booleans, numbers,
  29043. strings). For booleans, %FALSE is less than %TRUE. Numbers are
  29044. ordered in the usual way. Strings are in ASCII lexographical order.
  29045. It is a programmer error to attempt to compare container values or
  29046. two values that have types that are not exactly equal. For example,
  29047. you cannot compare a 32-bit signed integer with a 32-bit unsigned
  29048. integer. Also note that this function is not particularly
  29049. well-behaved when it comes to comparison of doubles; in particular,
  29050. the handling of incomparable values (ie: NaN) is undefined.
  29051. If you only require an equality comparison, g_variant_equal() is more
  29052. general.</doc>
  29053. <return-value transfer-ownership="none">
  29054. <doc xml:space="preserve">negative value if a &lt; b;
  29055. zero if a = b;
  29056. positive value if a &gt; b.</doc>
  29057. <type name="gint" c:type="gint"/>
  29058. </return-value>
  29059. <parameters>
  29060. <instance-parameter name="one" transfer-ownership="none">
  29061. <doc xml:space="preserve">a basic-typed #GVariant instance</doc>
  29062. <type name="Variant" c:type="gconstpointer"/>
  29063. </instance-parameter>
  29064. <parameter name="two" transfer-ownership="none">
  29065. <doc xml:space="preserve">a #GVariant instance of the same type</doc>
  29066. <type name="Variant" c:type="gconstpointer"/>
  29067. </parameter>
  29068. </parameters>
  29069. </method>
  29070. <method name="dup_bytestring"
  29071. c:identifier="g_variant_dup_bytestring"
  29072. version="2.26">
  29073. <doc xml:space="preserve">Similar to g_variant_get_bytestring() except that instead of
  29074. returning a constant string, the string is duplicated.
  29075. The return value must be freed using g_free().</doc>
  29076. <return-value transfer-ownership="full">
  29077. <doc xml:space="preserve">
  29078. a newly allocated string</doc>
  29079. <array length="0" zero-terminated="1" c:type="gchar*">
  29080. <type name="guint8"/>
  29081. </array>
  29082. </return-value>
  29083. <parameters>
  29084. <instance-parameter name="value" transfer-ownership="none">
  29085. <doc xml:space="preserve">an array-of-bytes #GVariant instance</doc>
  29086. <type name="Variant" c:type="GVariant*"/>
  29087. </instance-parameter>
  29088. <parameter name="length"
  29089. direction="out"
  29090. caller-allocates="0"
  29091. transfer-ownership="full"
  29092. optional="1"
  29093. allow-none="1">
  29094. <doc xml:space="preserve">a pointer to a #gsize, to store
  29095. the length (not including the nul terminator)</doc>
  29096. <type name="gsize" c:type="gsize*"/>
  29097. </parameter>
  29098. </parameters>
  29099. </method>
  29100. <method name="dup_bytestring_array"
  29101. c:identifier="g_variant_dup_bytestring_array"
  29102. version="2.26">
  29103. <doc xml:space="preserve">Gets the contents of an array of array of bytes #GVariant. This call
  29104. makes a deep copy; the return result should be released with
  29105. g_strfreev().
  29106. If @length is non-%NULL then the number of elements in the result is
  29107. stored there. In any case, the resulting array will be
  29108. %NULL-terminated.
  29109. For an empty array, @length will be set to 0 and a pointer to a
  29110. %NULL pointer will be returned.</doc>
  29111. <return-value transfer-ownership="full">
  29112. <doc xml:space="preserve">an array of strings</doc>
  29113. <array length="0" zero-terminated="0" c:type="gchar**">
  29114. <type name="utf8"/>
  29115. </array>
  29116. </return-value>
  29117. <parameters>
  29118. <instance-parameter name="value" transfer-ownership="none">
  29119. <doc xml:space="preserve">an array of array of bytes #GVariant ('aay')</doc>
  29120. <type name="Variant" c:type="GVariant*"/>
  29121. </instance-parameter>
  29122. <parameter name="length"
  29123. direction="out"
  29124. caller-allocates="0"
  29125. transfer-ownership="full"
  29126. optional="1"
  29127. allow-none="1">
  29128. <doc xml:space="preserve">the length of the result, or %NULL</doc>
  29129. <type name="gsize" c:type="gsize*"/>
  29130. </parameter>
  29131. </parameters>
  29132. </method>
  29133. <method name="dup_objv" c:identifier="g_variant_dup_objv" version="2.30">
  29134. <doc xml:space="preserve">Gets the contents of an array of object paths #GVariant. This call
  29135. makes a deep copy; the return result should be released with
  29136. g_strfreev().
  29137. If @length is non-%NULL then the number of elements in the result
  29138. is stored there. In any case, the resulting array will be
  29139. %NULL-terminated.
  29140. For an empty array, @length will be set to 0 and a pointer to a
  29141. %NULL pointer will be returned.</doc>
  29142. <return-value transfer-ownership="full">
  29143. <doc xml:space="preserve">an array of strings</doc>
  29144. <array length="0" zero-terminated="1" c:type="gchar**">
  29145. <type name="utf8"/>
  29146. </array>
  29147. </return-value>
  29148. <parameters>
  29149. <instance-parameter name="value" transfer-ownership="none">
  29150. <doc xml:space="preserve">an array of object paths #GVariant</doc>
  29151. <type name="Variant" c:type="GVariant*"/>
  29152. </instance-parameter>
  29153. <parameter name="length"
  29154. direction="out"
  29155. caller-allocates="0"
  29156. transfer-ownership="full"
  29157. optional="1"
  29158. allow-none="1">
  29159. <doc xml:space="preserve">the length of the result, or %NULL</doc>
  29160. <type name="gsize" c:type="gsize*"/>
  29161. </parameter>
  29162. </parameters>
  29163. </method>
  29164. <method name="dup_string"
  29165. c:identifier="g_variant_dup_string"
  29166. version="2.24">
  29167. <doc xml:space="preserve">Similar to g_variant_get_string() except that instead of returning
  29168. a constant string, the string is duplicated.
  29169. The string will always be UTF-8 encoded.
  29170. The return value must be freed using g_free().</doc>
  29171. <return-value transfer-ownership="full">
  29172. <doc xml:space="preserve">a newly allocated string, UTF-8 encoded</doc>
  29173. <type name="utf8" c:type="gchar*"/>
  29174. </return-value>
  29175. <parameters>
  29176. <instance-parameter name="value" transfer-ownership="none">
  29177. <doc xml:space="preserve">a string #GVariant instance</doc>
  29178. <type name="Variant" c:type="GVariant*"/>
  29179. </instance-parameter>
  29180. <parameter name="length"
  29181. direction="out"
  29182. caller-allocates="0"
  29183. transfer-ownership="full">
  29184. <doc xml:space="preserve">a pointer to a #gsize, to store the length</doc>
  29185. <type name="gsize" c:type="gsize*"/>
  29186. </parameter>
  29187. </parameters>
  29188. </method>
  29189. <method name="dup_strv" c:identifier="g_variant_dup_strv" version="2.24">
  29190. <doc xml:space="preserve">Gets the contents of an array of strings #GVariant. This call
  29191. makes a deep copy; the return result should be released with
  29192. g_strfreev().
  29193. If @length is non-%NULL then the number of elements in the result
  29194. is stored there. In any case, the resulting array will be
  29195. %NULL-terminated.
  29196. For an empty array, @length will be set to 0 and a pointer to a
  29197. %NULL pointer will be returned.</doc>
  29198. <return-value transfer-ownership="full">
  29199. <doc xml:space="preserve">an array of strings</doc>
  29200. <array length="0" zero-terminated="1" c:type="gchar**">
  29201. <type name="utf8"/>
  29202. </array>
  29203. </return-value>
  29204. <parameters>
  29205. <instance-parameter name="value" transfer-ownership="none">
  29206. <doc xml:space="preserve">an array of strings #GVariant</doc>
  29207. <type name="Variant" c:type="GVariant*"/>
  29208. </instance-parameter>
  29209. <parameter name="length"
  29210. direction="out"
  29211. caller-allocates="0"
  29212. transfer-ownership="full"
  29213. optional="1"
  29214. allow-none="1">
  29215. <doc xml:space="preserve">the length of the result, or %NULL</doc>
  29216. <type name="gsize" c:type="gsize*"/>
  29217. </parameter>
  29218. </parameters>
  29219. </method>
  29220. <method name="equal" c:identifier="g_variant_equal" version="2.24">
  29221. <doc xml:space="preserve">Checks if @one and @two have the same type and value.
  29222. The types of @one and @two are #gconstpointer only to allow use of
  29223. this function with #GHashTable. They must each be a #GVariant.</doc>
  29224. <return-value transfer-ownership="none">
  29225. <doc xml:space="preserve">%TRUE if @one and @two are equal</doc>
  29226. <type name="gboolean" c:type="gboolean"/>
  29227. </return-value>
  29228. <parameters>
  29229. <instance-parameter name="one" transfer-ownership="none">
  29230. <doc xml:space="preserve">a #GVariant instance</doc>
  29231. <type name="Variant" c:type="gconstpointer"/>
  29232. </instance-parameter>
  29233. <parameter name="two" transfer-ownership="none">
  29234. <doc xml:space="preserve">a #GVariant instance</doc>
  29235. <type name="Variant" c:type="gconstpointer"/>
  29236. </parameter>
  29237. </parameters>
  29238. </method>
  29239. <method name="get"
  29240. c:identifier="g_variant_get"
  29241. version="2.24"
  29242. introspectable="0">
  29243. <doc xml:space="preserve">Deconstructs a #GVariant instance.
  29244. Think of this function as an analogue to scanf().
  29245. The arguments that are expected by this function are entirely
  29246. determined by @format_string. @format_string also restricts the
  29247. permissible types of @value. It is an error to give a value with
  29248. an incompatible type. See the section on
  29249. [GVariant format strings][gvariant-format-strings].
  29250. Please note that the syntax of the format string is very likely to be
  29251. extended in the future.
  29252. @format_string determines the C types that are used for unpacking
  29253. the values and also determines if the values are copied or borrowed,
  29254. see the section on
  29255. [GVariant format strings][gvariant-format-strings-pointers].</doc>
  29256. <return-value transfer-ownership="none">
  29257. <type name="none" c:type="void"/>
  29258. </return-value>
  29259. <parameters>
  29260. <instance-parameter name="value" transfer-ownership="none">
  29261. <doc xml:space="preserve">a #GVariant instance</doc>
  29262. <type name="Variant" c:type="GVariant*"/>
  29263. </instance-parameter>
  29264. <parameter name="format_string" transfer-ownership="none">
  29265. <doc xml:space="preserve">a #GVariant format string</doc>
  29266. <type name="utf8" c:type="const gchar*"/>
  29267. </parameter>
  29268. <parameter name="..." transfer-ownership="none">
  29269. <doc xml:space="preserve">arguments, as per @format_string</doc>
  29270. <varargs/>
  29271. </parameter>
  29272. </parameters>
  29273. </method>
  29274. <method name="get_boolean"
  29275. c:identifier="g_variant_get_boolean"
  29276. version="2.24">
  29277. <doc xml:space="preserve">Returns the boolean value of @value.
  29278. It is an error to call this function with a @value of any type
  29279. other than %G_VARIANT_TYPE_BOOLEAN.</doc>
  29280. <return-value transfer-ownership="none">
  29281. <doc xml:space="preserve">%TRUE or %FALSE</doc>
  29282. <type name="gboolean" c:type="gboolean"/>
  29283. </return-value>
  29284. <parameters>
  29285. <instance-parameter name="value" transfer-ownership="none">
  29286. <doc xml:space="preserve">a boolean #GVariant instance</doc>
  29287. <type name="Variant" c:type="GVariant*"/>
  29288. </instance-parameter>
  29289. </parameters>
  29290. </method>
  29291. <method name="get_byte" c:identifier="g_variant_get_byte" version="2.24">
  29292. <doc xml:space="preserve">Returns the byte value of @value.
  29293. It is an error to call this function with a @value of any type
  29294. other than %G_VARIANT_TYPE_BYTE.</doc>
  29295. <return-value transfer-ownership="none">
  29296. <doc xml:space="preserve">a #guchar</doc>
  29297. <type name="guint8" c:type="guchar"/>
  29298. </return-value>
  29299. <parameters>
  29300. <instance-parameter name="value" transfer-ownership="none">
  29301. <doc xml:space="preserve">a byte #GVariant instance</doc>
  29302. <type name="Variant" c:type="GVariant*"/>
  29303. </instance-parameter>
  29304. </parameters>
  29305. </method>
  29306. <method name="get_bytestring"
  29307. c:identifier="g_variant_get_bytestring"
  29308. version="2.26">
  29309. <doc xml:space="preserve">Returns the string value of a #GVariant instance with an
  29310. array-of-bytes type. The string has no particular encoding.
  29311. If the array does not end with a nul terminator character, the empty
  29312. string is returned. For this reason, you can always trust that a
  29313. non-%NULL nul-terminated string will be returned by this function.
  29314. If the array contains a nul terminator character somewhere other than
  29315. the last byte then the returned string is the string, up to the first
  29316. such nul character.
  29317. It is an error to call this function with a @value that is not an
  29318. array of bytes.
  29319. The return value remains valid as long as @value exists.</doc>
  29320. <return-value transfer-ownership="none">
  29321. <doc xml:space="preserve">
  29322. the constant string</doc>
  29323. <array c:type="gchar*">
  29324. <type name="guint8"/>
  29325. </array>
  29326. </return-value>
  29327. <parameters>
  29328. <instance-parameter name="value" transfer-ownership="none">
  29329. <doc xml:space="preserve">an array-of-bytes #GVariant instance</doc>
  29330. <type name="Variant" c:type="GVariant*"/>
  29331. </instance-parameter>
  29332. </parameters>
  29333. </method>
  29334. <method name="get_bytestring_array"
  29335. c:identifier="g_variant_get_bytestring_array"
  29336. version="2.26">
  29337. <doc xml:space="preserve">Gets the contents of an array of array of bytes #GVariant. This call
  29338. makes a shallow copy; the return result should be released with
  29339. g_free(), but the individual strings must not be modified.
  29340. If @length is non-%NULL then the number of elements in the result is
  29341. stored there. In any case, the resulting array will be
  29342. %NULL-terminated.
  29343. For an empty array, @length will be set to 0 and a pointer to a
  29344. %NULL pointer will be returned.</doc>
  29345. <return-value transfer-ownership="container">
  29346. <doc xml:space="preserve">an array of constant strings</doc>
  29347. <array length="0" zero-terminated="0" c:type="gchar**">
  29348. <type name="utf8"/>
  29349. </array>
  29350. </return-value>
  29351. <parameters>
  29352. <instance-parameter name="value" transfer-ownership="none">
  29353. <doc xml:space="preserve">an array of array of bytes #GVariant ('aay')</doc>
  29354. <type name="Variant" c:type="GVariant*"/>
  29355. </instance-parameter>
  29356. <parameter name="length"
  29357. direction="out"
  29358. caller-allocates="0"
  29359. transfer-ownership="full"
  29360. optional="1"
  29361. allow-none="1">
  29362. <doc xml:space="preserve">the length of the result, or %NULL</doc>
  29363. <type name="gsize" c:type="gsize*"/>
  29364. </parameter>
  29365. </parameters>
  29366. </method>
  29367. <method name="get_child"
  29368. c:identifier="g_variant_get_child"
  29369. version="2.24"
  29370. introspectable="0">
  29371. <doc xml:space="preserve">Reads a child item out of a container #GVariant instance and
  29372. deconstructs it according to @format_string. This call is
  29373. essentially a combination of g_variant_get_child_value() and
  29374. g_variant_get().
  29375. @format_string determines the C types that are used for unpacking
  29376. the values and also determines if the values are copied or borrowed,
  29377. see the section on
  29378. [GVariant format strings][gvariant-format-strings-pointers].</doc>
  29379. <return-value transfer-ownership="none">
  29380. <type name="none" c:type="void"/>
  29381. </return-value>
  29382. <parameters>
  29383. <instance-parameter name="value" transfer-ownership="none">
  29384. <doc xml:space="preserve">a container #GVariant</doc>
  29385. <type name="Variant" c:type="GVariant*"/>
  29386. </instance-parameter>
  29387. <parameter name="index_" transfer-ownership="none">
  29388. <doc xml:space="preserve">the index of the child to deconstruct</doc>
  29389. <type name="gsize" c:type="gsize"/>
  29390. </parameter>
  29391. <parameter name="format_string" transfer-ownership="none">
  29392. <doc xml:space="preserve">a #GVariant format string</doc>
  29393. <type name="utf8" c:type="const gchar*"/>
  29394. </parameter>
  29395. <parameter name="..." transfer-ownership="none">
  29396. <doc xml:space="preserve">arguments, as per @format_string</doc>
  29397. <varargs/>
  29398. </parameter>
  29399. </parameters>
  29400. </method>
  29401. <method name="get_child_value"
  29402. c:identifier="g_variant_get_child_value"
  29403. version="2.24">
  29404. <doc xml:space="preserve">Reads a child item out of a container #GVariant instance. This
  29405. includes variants, maybes, arrays, tuples and dictionary
  29406. entries. It is an error to call this function on any other type of
  29407. #GVariant.
  29408. It is an error if @index_ is greater than the number of child items
  29409. in the container. See g_variant_n_children().
  29410. The returned value is never floating. You should free it with
  29411. g_variant_unref() when you're done with it.
  29412. This function is O(1).</doc>
  29413. <return-value transfer-ownership="full">
  29414. <doc xml:space="preserve">the child at the specified index</doc>
  29415. <type name="Variant" c:type="GVariant*"/>
  29416. </return-value>
  29417. <parameters>
  29418. <instance-parameter name="value" transfer-ownership="none">
  29419. <doc xml:space="preserve">a container #GVariant</doc>
  29420. <type name="Variant" c:type="GVariant*"/>
  29421. </instance-parameter>
  29422. <parameter name="index_" transfer-ownership="none">
  29423. <doc xml:space="preserve">the index of the child to fetch</doc>
  29424. <type name="gsize" c:type="gsize"/>
  29425. </parameter>
  29426. </parameters>
  29427. </method>
  29428. <method name="get_data" c:identifier="g_variant_get_data" version="2.24">
  29429. <doc xml:space="preserve">Returns a pointer to the serialised form of a #GVariant instance.
  29430. The returned data may not be in fully-normalised form if read from an
  29431. untrusted source. The returned data must not be freed; it remains
  29432. valid for as long as @value exists.
  29433. If @value is a fixed-sized value that was deserialised from a
  29434. corrupted serialised container then %NULL may be returned. In this
  29435. case, the proper thing to do is typically to use the appropriate
  29436. number of nul bytes in place of @value. If @value is not fixed-sized
  29437. then %NULL is never returned.
  29438. In the case that @value is already in serialised form, this function
  29439. is O(1). If the value is not already in serialised form,
  29440. serialisation occurs implicitly and is approximately O(n) in the size
  29441. of the result.
  29442. To deserialise the data returned by this function, in addition to the
  29443. serialised data, you must know the type of the #GVariant, and (if the
  29444. machine might be different) the endianness of the machine that stored
  29445. it. As a result, file formats or network messages that incorporate
  29446. serialised #GVariants must include this information either
  29447. implicitly (for instance "the file always contains a
  29448. %G_VARIANT_TYPE_VARIANT and it is always in little-endian order") or
  29449. explicitly (by storing the type and/or endianness in addition to the
  29450. serialised data).</doc>
  29451. <return-value transfer-ownership="none" nullable="1">
  29452. <doc xml:space="preserve">the serialised form of @value, or %NULL</doc>
  29453. <type name="gpointer" c:type="gconstpointer"/>
  29454. </return-value>
  29455. <parameters>
  29456. <instance-parameter name="value" transfer-ownership="none">
  29457. <doc xml:space="preserve">a #GVariant instance</doc>
  29458. <type name="Variant" c:type="GVariant*"/>
  29459. </instance-parameter>
  29460. </parameters>
  29461. </method>
  29462. <method name="get_data_as_bytes"
  29463. c:identifier="g_variant_get_data_as_bytes"
  29464. version="2.36">
  29465. <doc xml:space="preserve">Returns a pointer to the serialised form of a #GVariant instance.
  29466. The semantics of this function are exactly the same as
  29467. g_variant_get_data(), except that the returned #GBytes holds
  29468. a reference to the variant data.</doc>
  29469. <return-value transfer-ownership="full">
  29470. <doc xml:space="preserve">A new #GBytes representing the variant data</doc>
  29471. <type name="Bytes" c:type="GBytes*"/>
  29472. </return-value>
  29473. <parameters>
  29474. <instance-parameter name="value" transfer-ownership="none">
  29475. <doc xml:space="preserve">a #GVariant</doc>
  29476. <type name="Variant" c:type="GVariant*"/>
  29477. </instance-parameter>
  29478. </parameters>
  29479. </method>
  29480. <method name="get_double"
  29481. c:identifier="g_variant_get_double"
  29482. version="2.24">
  29483. <doc xml:space="preserve">Returns the double precision floating point value of @value.
  29484. It is an error to call this function with a @value of any type
  29485. other than %G_VARIANT_TYPE_DOUBLE.</doc>
  29486. <return-value transfer-ownership="none">
  29487. <doc xml:space="preserve">a #gdouble</doc>
  29488. <type name="gdouble" c:type="gdouble"/>
  29489. </return-value>
  29490. <parameters>
  29491. <instance-parameter name="value" transfer-ownership="none">
  29492. <doc xml:space="preserve">a double #GVariant instance</doc>
  29493. <type name="Variant" c:type="GVariant*"/>
  29494. </instance-parameter>
  29495. </parameters>
  29496. </method>
  29497. <method name="get_fixed_array"
  29498. c:identifier="g_variant_get_fixed_array"
  29499. version="2.24"
  29500. introspectable="0">
  29501. <doc xml:space="preserve">Provides access to the serialised data for an array of fixed-sized
  29502. items.
  29503. @value must be an array with fixed-sized elements. Numeric types are
  29504. fixed-size, as are tuples containing only other fixed-sized types.
  29505. @element_size must be the size of a single element in the array,
  29506. as given by the section on
  29507. [serialized data memory][gvariant-serialised-data-memory].
  29508. In particular, arrays of these fixed-sized types can be interpreted
  29509. as an array of the given C type, with @element_size set to the size
  29510. the appropriate type:
  29511. - %G_VARIANT_TYPE_INT16 (etc.): #gint16 (etc.)
  29512. - %G_VARIANT_TYPE_BOOLEAN: #guchar (not #gboolean!)
  29513. - %G_VARIANT_TYPE_BYTE: #guchar
  29514. - %G_VARIANT_TYPE_HANDLE: #guint32
  29515. - %G_VARIANT_TYPE_DOUBLE: #gdouble
  29516. For example, if calling this function for an array of 32-bit integers,
  29517. you might say sizeof(gint32). This value isn't used except for the purpose
  29518. of a double-check that the form of the serialised data matches the caller's
  29519. expectation.
  29520. @n_elements, which must be non-%NULL is set equal to the number of
  29521. items in the array.</doc>
  29522. <return-value transfer-ownership="none">
  29523. <doc xml:space="preserve">a pointer to
  29524. the fixed array</doc>
  29525. <array length="0" zero-terminated="0" c:type="gconstpointer">
  29526. <type name="gpointer" c:type="gconstpointer"/>
  29527. </array>
  29528. </return-value>
  29529. <parameters>
  29530. <instance-parameter name="value" transfer-ownership="none">
  29531. <doc xml:space="preserve">a #GVariant array with fixed-sized elements</doc>
  29532. <type name="Variant" c:type="GVariant*"/>
  29533. </instance-parameter>
  29534. <parameter name="n_elements"
  29535. direction="out"
  29536. caller-allocates="0"
  29537. transfer-ownership="full">
  29538. <doc xml:space="preserve">a pointer to the location to store the number of items</doc>
  29539. <type name="gsize" c:type="gsize*"/>
  29540. </parameter>
  29541. <parameter name="element_size" transfer-ownership="none">
  29542. <doc xml:space="preserve">the size of each element</doc>
  29543. <type name="gsize" c:type="gsize"/>
  29544. </parameter>
  29545. </parameters>
  29546. </method>
  29547. <method name="get_handle"
  29548. c:identifier="g_variant_get_handle"
  29549. version="2.24">
  29550. <doc xml:space="preserve">Returns the 32-bit signed integer value of @value.
  29551. It is an error to call this function with a @value of any type other
  29552. than %G_VARIANT_TYPE_HANDLE.
  29553. By convention, handles are indexes into an array of file descriptors
  29554. that are sent alongside a D-Bus message. If you're not interacting
  29555. with D-Bus, you probably don't need them.</doc>
  29556. <return-value transfer-ownership="none">
  29557. <doc xml:space="preserve">a #gint32</doc>
  29558. <type name="gint32" c:type="gint32"/>
  29559. </return-value>
  29560. <parameters>
  29561. <instance-parameter name="value" transfer-ownership="none">
  29562. <doc xml:space="preserve">a handle #GVariant instance</doc>
  29563. <type name="Variant" c:type="GVariant*"/>
  29564. </instance-parameter>
  29565. </parameters>
  29566. </method>
  29567. <method name="get_int16"
  29568. c:identifier="g_variant_get_int16"
  29569. version="2.24">
  29570. <doc xml:space="preserve">Returns the 16-bit signed integer value of @value.
  29571. It is an error to call this function with a @value of any type
  29572. other than %G_VARIANT_TYPE_INT16.</doc>
  29573. <return-value transfer-ownership="none">
  29574. <doc xml:space="preserve">a #gint16</doc>
  29575. <type name="gint16" c:type="gint16"/>
  29576. </return-value>
  29577. <parameters>
  29578. <instance-parameter name="value" transfer-ownership="none">
  29579. <doc xml:space="preserve">a int16 #GVariant instance</doc>
  29580. <type name="Variant" c:type="GVariant*"/>
  29581. </instance-parameter>
  29582. </parameters>
  29583. </method>
  29584. <method name="get_int32"
  29585. c:identifier="g_variant_get_int32"
  29586. version="2.24">
  29587. <doc xml:space="preserve">Returns the 32-bit signed integer value of @value.
  29588. It is an error to call this function with a @value of any type
  29589. other than %G_VARIANT_TYPE_INT32.</doc>
  29590. <return-value transfer-ownership="none">
  29591. <doc xml:space="preserve">a #gint32</doc>
  29592. <type name="gint32" c:type="gint32"/>
  29593. </return-value>
  29594. <parameters>
  29595. <instance-parameter name="value" transfer-ownership="none">
  29596. <doc xml:space="preserve">a int32 #GVariant instance</doc>
  29597. <type name="Variant" c:type="GVariant*"/>
  29598. </instance-parameter>
  29599. </parameters>
  29600. </method>
  29601. <method name="get_int64"
  29602. c:identifier="g_variant_get_int64"
  29603. version="2.24">
  29604. <doc xml:space="preserve">Returns the 64-bit signed integer value of @value.
  29605. It is an error to call this function with a @value of any type
  29606. other than %G_VARIANT_TYPE_INT64.</doc>
  29607. <return-value transfer-ownership="none">
  29608. <doc xml:space="preserve">a #gint64</doc>
  29609. <type name="gint64" c:type="gint64"/>
  29610. </return-value>
  29611. <parameters>
  29612. <instance-parameter name="value" transfer-ownership="none">
  29613. <doc xml:space="preserve">a int64 #GVariant instance</doc>
  29614. <type name="Variant" c:type="GVariant*"/>
  29615. </instance-parameter>
  29616. </parameters>
  29617. </method>
  29618. <method name="get_maybe"
  29619. c:identifier="g_variant_get_maybe"
  29620. version="2.24">
  29621. <doc xml:space="preserve">Given a maybe-typed #GVariant instance, extract its value. If the
  29622. value is Nothing, then this function returns %NULL.</doc>
  29623. <return-value transfer-ownership="full" nullable="1">
  29624. <doc xml:space="preserve">the contents of @value, or %NULL</doc>
  29625. <type name="Variant" c:type="GVariant*"/>
  29626. </return-value>
  29627. <parameters>
  29628. <instance-parameter name="value" transfer-ownership="none">
  29629. <doc xml:space="preserve">a maybe-typed value</doc>
  29630. <type name="Variant" c:type="GVariant*"/>
  29631. </instance-parameter>
  29632. </parameters>
  29633. </method>
  29634. <method name="get_normal_form"
  29635. c:identifier="g_variant_get_normal_form"
  29636. version="2.24">
  29637. <doc xml:space="preserve">Gets a #GVariant instance that has the same value as @value and is
  29638. trusted to be in normal form.
  29639. If @value is already trusted to be in normal form then a new
  29640. reference to @value is returned.
  29641. If @value is not already trusted, then it is scanned to check if it
  29642. is in normal form. If it is found to be in normal form then it is
  29643. marked as trusted and a new reference to it is returned.
  29644. If @value is found not to be in normal form then a new trusted
  29645. #GVariant is created with the same value as @value.
  29646. It makes sense to call this function if you've received #GVariant
  29647. data from untrusted sources and you want to ensure your serialised
  29648. output is definitely in normal form.</doc>
  29649. <return-value transfer-ownership="full">
  29650. <doc xml:space="preserve">a trusted #GVariant</doc>
  29651. <type name="Variant" c:type="GVariant*"/>
  29652. </return-value>
  29653. <parameters>
  29654. <instance-parameter name="value" transfer-ownership="none">
  29655. <doc xml:space="preserve">a #GVariant</doc>
  29656. <type name="Variant" c:type="GVariant*"/>
  29657. </instance-parameter>
  29658. </parameters>
  29659. </method>
  29660. <method name="get_objv" c:identifier="g_variant_get_objv" version="2.30">
  29661. <doc xml:space="preserve">Gets the contents of an array of object paths #GVariant. This call
  29662. makes a shallow copy; the return result should be released with
  29663. g_free(), but the individual strings must not be modified.
  29664. If @length is non-%NULL then the number of elements in the result
  29665. is stored there. In any case, the resulting array will be
  29666. %NULL-terminated.
  29667. For an empty array, @length will be set to 0 and a pointer to a
  29668. %NULL pointer will be returned.</doc>
  29669. <return-value transfer-ownership="container">
  29670. <doc xml:space="preserve">an array of constant strings</doc>
  29671. <array length="0" zero-terminated="1" c:type="gchar**">
  29672. <type name="utf8"/>
  29673. </array>
  29674. </return-value>
  29675. <parameters>
  29676. <instance-parameter name="value" transfer-ownership="none">
  29677. <doc xml:space="preserve">an array of object paths #GVariant</doc>
  29678. <type name="Variant" c:type="GVariant*"/>
  29679. </instance-parameter>
  29680. <parameter name="length"
  29681. direction="out"
  29682. caller-allocates="0"
  29683. transfer-ownership="full"
  29684. optional="1"
  29685. allow-none="1">
  29686. <doc xml:space="preserve">the length of the result, or %NULL</doc>
  29687. <type name="gsize" c:type="gsize*"/>
  29688. </parameter>
  29689. </parameters>
  29690. </method>
  29691. <method name="get_size" c:identifier="g_variant_get_size" version="2.24">
  29692. <doc xml:space="preserve">Determines the number of bytes that would be required to store @value
  29693. with g_variant_store().
  29694. If @value has a fixed-sized type then this function always returned
  29695. that fixed size.
  29696. In the case that @value is already in serialised form or the size has
  29697. already been calculated (ie: this function has been called before)
  29698. then this function is O(1). Otherwise, the size is calculated, an
  29699. operation which is approximately O(n) in the number of values
  29700. involved.</doc>
  29701. <return-value transfer-ownership="none">
  29702. <doc xml:space="preserve">the serialised size of @value</doc>
  29703. <type name="gsize" c:type="gsize"/>
  29704. </return-value>
  29705. <parameters>
  29706. <instance-parameter name="value" transfer-ownership="none">
  29707. <doc xml:space="preserve">a #GVariant instance</doc>
  29708. <type name="Variant" c:type="GVariant*"/>
  29709. </instance-parameter>
  29710. </parameters>
  29711. </method>
  29712. <method name="get_string"
  29713. c:identifier="g_variant_get_string"
  29714. version="2.24">
  29715. <doc xml:space="preserve">Returns the string value of a #GVariant instance with a string
  29716. type. This includes the types %G_VARIANT_TYPE_STRING,
  29717. %G_VARIANT_TYPE_OBJECT_PATH and %G_VARIANT_TYPE_SIGNATURE.
  29718. The string will always be UTF-8 encoded, and will never be %NULL.
  29719. If @length is non-%NULL then the length of the string (in bytes) is
  29720. returned there. For trusted values, this information is already
  29721. known. For untrusted values, a strlen() will be performed.
  29722. It is an error to call this function with a @value of any type
  29723. other than those three.
  29724. The return value remains valid as long as @value exists.</doc>
  29725. <return-value transfer-ownership="none">
  29726. <doc xml:space="preserve">the constant string, UTF-8 encoded</doc>
  29727. <type name="utf8" c:type="const gchar*"/>
  29728. </return-value>
  29729. <parameters>
  29730. <instance-parameter name="value" transfer-ownership="none">
  29731. <doc xml:space="preserve">a string #GVariant instance</doc>
  29732. <type name="Variant" c:type="GVariant*"/>
  29733. </instance-parameter>
  29734. <parameter name="length"
  29735. direction="out"
  29736. caller-allocates="0"
  29737. transfer-ownership="full"
  29738. optional="1"
  29739. allow-none="1">
  29740. <doc xml:space="preserve">a pointer to a #gsize,
  29741. to store the length</doc>
  29742. <type name="gsize" c:type="gsize*"/>
  29743. </parameter>
  29744. </parameters>
  29745. </method>
  29746. <method name="get_strv" c:identifier="g_variant_get_strv" version="2.24">
  29747. <doc xml:space="preserve">Gets the contents of an array of strings #GVariant. This call
  29748. makes a shallow copy; the return result should be released with
  29749. g_free(), but the individual strings must not be modified.
  29750. If @length is non-%NULL then the number of elements in the result
  29751. is stored there. In any case, the resulting array will be
  29752. %NULL-terminated.
  29753. For an empty array, @length will be set to 0 and a pointer to a
  29754. %NULL pointer will be returned.</doc>
  29755. <return-value transfer-ownership="container">
  29756. <doc xml:space="preserve">an array of constant strings</doc>
  29757. <array length="0" zero-terminated="1" c:type="gchar**">
  29758. <type name="utf8"/>
  29759. </array>
  29760. </return-value>
  29761. <parameters>
  29762. <instance-parameter name="value" transfer-ownership="none">
  29763. <doc xml:space="preserve">an array of strings #GVariant</doc>
  29764. <type name="Variant" c:type="GVariant*"/>
  29765. </instance-parameter>
  29766. <parameter name="length"
  29767. direction="out"
  29768. caller-allocates="0"
  29769. transfer-ownership="full"
  29770. optional="1"
  29771. allow-none="1">
  29772. <doc xml:space="preserve">the length of the result, or %NULL</doc>
  29773. <type name="gsize" c:type="gsize*"/>
  29774. </parameter>
  29775. </parameters>
  29776. </method>
  29777. <method name="get_type" c:identifier="g_variant_get_type" version="2.24">
  29778. <doc xml:space="preserve">Determines the type of @value.
  29779. The return value is valid for the lifetime of @value and must not
  29780. be freed.</doc>
  29781. <return-value transfer-ownership="none">
  29782. <doc xml:space="preserve">a #GVariantType</doc>
  29783. <type name="VariantType" c:type="const GVariantType*"/>
  29784. </return-value>
  29785. <parameters>
  29786. <instance-parameter name="value" transfer-ownership="none">
  29787. <doc xml:space="preserve">a #GVariant</doc>
  29788. <type name="Variant" c:type="GVariant*"/>
  29789. </instance-parameter>
  29790. </parameters>
  29791. </method>
  29792. <method name="get_type_string"
  29793. c:identifier="g_variant_get_type_string"
  29794. version="2.24">
  29795. <doc xml:space="preserve">Returns the type string of @value. Unlike the result of calling
  29796. g_variant_type_peek_string(), this string is nul-terminated. This
  29797. string belongs to #GVariant and must not be freed.</doc>
  29798. <return-value transfer-ownership="none">
  29799. <doc xml:space="preserve">the type string for the type of @value</doc>
  29800. <type name="utf8" c:type="const gchar*"/>
  29801. </return-value>
  29802. <parameters>
  29803. <instance-parameter name="value" transfer-ownership="none">
  29804. <doc xml:space="preserve">a #GVariant</doc>
  29805. <type name="Variant" c:type="GVariant*"/>
  29806. </instance-parameter>
  29807. </parameters>
  29808. </method>
  29809. <method name="get_uint16"
  29810. c:identifier="g_variant_get_uint16"
  29811. version="2.24">
  29812. <doc xml:space="preserve">Returns the 16-bit unsigned integer value of @value.
  29813. It is an error to call this function with a @value of any type
  29814. other than %G_VARIANT_TYPE_UINT16.</doc>
  29815. <return-value transfer-ownership="none">
  29816. <doc xml:space="preserve">a #guint16</doc>
  29817. <type name="guint16" c:type="guint16"/>
  29818. </return-value>
  29819. <parameters>
  29820. <instance-parameter name="value" transfer-ownership="none">
  29821. <doc xml:space="preserve">a uint16 #GVariant instance</doc>
  29822. <type name="Variant" c:type="GVariant*"/>
  29823. </instance-parameter>
  29824. </parameters>
  29825. </method>
  29826. <method name="get_uint32"
  29827. c:identifier="g_variant_get_uint32"
  29828. version="2.24">
  29829. <doc xml:space="preserve">Returns the 32-bit unsigned integer value of @value.
  29830. It is an error to call this function with a @value of any type
  29831. other than %G_VARIANT_TYPE_UINT32.</doc>
  29832. <return-value transfer-ownership="none">
  29833. <doc xml:space="preserve">a #guint32</doc>
  29834. <type name="guint32" c:type="guint32"/>
  29835. </return-value>
  29836. <parameters>
  29837. <instance-parameter name="value" transfer-ownership="none">
  29838. <doc xml:space="preserve">a uint32 #GVariant instance</doc>
  29839. <type name="Variant" c:type="GVariant*"/>
  29840. </instance-parameter>
  29841. </parameters>
  29842. </method>
  29843. <method name="get_uint64"
  29844. c:identifier="g_variant_get_uint64"
  29845. version="2.24">
  29846. <doc xml:space="preserve">Returns the 64-bit unsigned integer value of @value.
  29847. It is an error to call this function with a @value of any type
  29848. other than %G_VARIANT_TYPE_UINT64.</doc>
  29849. <return-value transfer-ownership="none">
  29850. <doc xml:space="preserve">a #guint64</doc>
  29851. <type name="guint64" c:type="guint64"/>
  29852. </return-value>
  29853. <parameters>
  29854. <instance-parameter name="value" transfer-ownership="none">
  29855. <doc xml:space="preserve">a uint64 #GVariant instance</doc>
  29856. <type name="Variant" c:type="GVariant*"/>
  29857. </instance-parameter>
  29858. </parameters>
  29859. </method>
  29860. <method name="get_va"
  29861. c:identifier="g_variant_get_va"
  29862. version="2.24"
  29863. introspectable="0">
  29864. <doc xml:space="preserve">This function is intended to be used by libraries based on #GVariant
  29865. that want to provide g_variant_get()-like functionality to their
  29866. users.
  29867. The API is more general than g_variant_get() to allow a wider range
  29868. of possible uses.
  29869. @format_string must still point to a valid format string, but it only
  29870. need to be nul-terminated if @endptr is %NULL. If @endptr is
  29871. non-%NULL then it is updated to point to the first character past the
  29872. end of the format string.
  29873. @app is a pointer to a #va_list. The arguments, according to
  29874. @format_string, are collected from this #va_list and the list is left
  29875. pointing to the argument following the last.
  29876. These two generalisations allow mixing of multiple calls to
  29877. g_variant_new_va() and g_variant_get_va() within a single actual
  29878. varargs call by the user.
  29879. @format_string determines the C types that are used for unpacking
  29880. the values and also determines if the values are copied or borrowed,
  29881. see the section on
  29882. [GVariant format strings][gvariant-format-strings-pointers].</doc>
  29883. <return-value transfer-ownership="none">
  29884. <type name="none" c:type="void"/>
  29885. </return-value>
  29886. <parameters>
  29887. <instance-parameter name="value" transfer-ownership="none">
  29888. <doc xml:space="preserve">a #GVariant</doc>
  29889. <type name="Variant" c:type="GVariant*"/>
  29890. </instance-parameter>
  29891. <parameter name="format_string" transfer-ownership="none">
  29892. <doc xml:space="preserve">a string that is prefixed with a format string</doc>
  29893. <type name="utf8" c:type="const gchar*"/>
  29894. </parameter>
  29895. <parameter name="endptr"
  29896. transfer-ownership="none"
  29897. nullable="1"
  29898. allow-none="1">
  29899. <doc xml:space="preserve">location to store the end pointer,
  29900. or %NULL</doc>
  29901. <type name="utf8" c:type="const gchar**"/>
  29902. </parameter>
  29903. <parameter name="app" transfer-ownership="none">
  29904. <doc xml:space="preserve">a pointer to a #va_list</doc>
  29905. <type name="va_list" c:type="va_list*"/>
  29906. </parameter>
  29907. </parameters>
  29908. </method>
  29909. <method name="get_variant"
  29910. c:identifier="g_variant_get_variant"
  29911. version="2.24">
  29912. <doc xml:space="preserve">Unboxes @value. The result is the #GVariant instance that was
  29913. contained in @value.</doc>
  29914. <return-value transfer-ownership="full">
  29915. <doc xml:space="preserve">the item contained in the variant</doc>
  29916. <type name="Variant" c:type="GVariant*"/>
  29917. </return-value>
  29918. <parameters>
  29919. <instance-parameter name="value" transfer-ownership="none">
  29920. <doc xml:space="preserve">a variant #GVariant instance</doc>
  29921. <type name="Variant" c:type="GVariant*"/>
  29922. </instance-parameter>
  29923. </parameters>
  29924. </method>
  29925. <method name="hash" c:identifier="g_variant_hash" version="2.24">
  29926. <doc xml:space="preserve">Generates a hash value for a #GVariant instance.
  29927. The output of this function is guaranteed to be the same for a given
  29928. value only per-process. It may change between different processor
  29929. architectures or even different versions of GLib. Do not use this
  29930. function as a basis for building protocols or file formats.
  29931. The type of @value is #gconstpointer only to allow use of this
  29932. function with #GHashTable. @value must be a #GVariant.</doc>
  29933. <return-value transfer-ownership="none">
  29934. <doc xml:space="preserve">a hash value corresponding to @value</doc>
  29935. <type name="guint" c:type="guint"/>
  29936. </return-value>
  29937. <parameters>
  29938. <instance-parameter name="value" transfer-ownership="none">
  29939. <doc xml:space="preserve">a basic #GVariant value as a #gconstpointer</doc>
  29940. <type name="Variant" c:type="gconstpointer"/>
  29941. </instance-parameter>
  29942. </parameters>
  29943. </method>
  29944. <method name="is_container"
  29945. c:identifier="g_variant_is_container"
  29946. version="2.24">
  29947. <doc xml:space="preserve">Checks if @value is a container.</doc>
  29948. <return-value transfer-ownership="none">
  29949. <doc xml:space="preserve">%TRUE if @value is a container</doc>
  29950. <type name="gboolean" c:type="gboolean"/>
  29951. </return-value>
  29952. <parameters>
  29953. <instance-parameter name="value" transfer-ownership="none">
  29954. <doc xml:space="preserve">a #GVariant instance</doc>
  29955. <type name="Variant" c:type="GVariant*"/>
  29956. </instance-parameter>
  29957. </parameters>
  29958. </method>
  29959. <method name="is_floating"
  29960. c:identifier="g_variant_is_floating"
  29961. version="2.26">
  29962. <doc xml:space="preserve">Checks whether @value has a floating reference count.
  29963. This function should only ever be used to assert that a given variant
  29964. is or is not floating, or for debug purposes. To acquire a reference
  29965. to a variant that might be floating, always use g_variant_ref_sink()
  29966. or g_variant_take_ref().
  29967. See g_variant_ref_sink() for more information about floating reference
  29968. counts.</doc>
  29969. <return-value transfer-ownership="none">
  29970. <doc xml:space="preserve">whether @value is floating</doc>
  29971. <type name="gboolean" c:type="gboolean"/>
  29972. </return-value>
  29973. <parameters>
  29974. <instance-parameter name="value" transfer-ownership="none">
  29975. <doc xml:space="preserve">a #GVariant</doc>
  29976. <type name="Variant" c:type="GVariant*"/>
  29977. </instance-parameter>
  29978. </parameters>
  29979. </method>
  29980. <method name="is_normal_form"
  29981. c:identifier="g_variant_is_normal_form"
  29982. version="2.24">
  29983. <doc xml:space="preserve">Checks if @value is in normal form.
  29984. The main reason to do this is to detect if a given chunk of
  29985. serialised data is in normal form: load the data into a #GVariant
  29986. using g_variant_new_from_data() and then use this function to
  29987. check.
  29988. If @value is found to be in normal form then it will be marked as
  29989. being trusted. If the value was already marked as being trusted then
  29990. this function will immediately return %TRUE.</doc>
  29991. <return-value transfer-ownership="none">
  29992. <doc xml:space="preserve">%TRUE if @value is in normal form</doc>
  29993. <type name="gboolean" c:type="gboolean"/>
  29994. </return-value>
  29995. <parameters>
  29996. <instance-parameter name="value" transfer-ownership="none">
  29997. <doc xml:space="preserve">a #GVariant instance</doc>
  29998. <type name="Variant" c:type="GVariant*"/>
  29999. </instance-parameter>
  30000. </parameters>
  30001. </method>
  30002. <method name="is_of_type"
  30003. c:identifier="g_variant_is_of_type"
  30004. version="2.24">
  30005. <doc xml:space="preserve">Checks if a value has a type matching the provided type.</doc>
  30006. <return-value transfer-ownership="none">
  30007. <doc xml:space="preserve">%TRUE if the type of @value matches @type</doc>
  30008. <type name="gboolean" c:type="gboolean"/>
  30009. </return-value>
  30010. <parameters>
  30011. <instance-parameter name="value" transfer-ownership="none">
  30012. <doc xml:space="preserve">a #GVariant instance</doc>
  30013. <type name="Variant" c:type="GVariant*"/>
  30014. </instance-parameter>
  30015. <parameter name="type" transfer-ownership="none">
  30016. <doc xml:space="preserve">a #GVariantType</doc>
  30017. <type name="VariantType" c:type="const GVariantType*"/>
  30018. </parameter>
  30019. </parameters>
  30020. </method>
  30021. <method name="iter_new"
  30022. c:identifier="g_variant_iter_new"
  30023. version="2.24"
  30024. introspectable="0">
  30025. <doc xml:space="preserve">Creates a heap-allocated #GVariantIter for iterating over the items
  30026. in @value.
  30027. Use g_variant_iter_free() to free the return value when you no longer
  30028. need it.
  30029. A reference is taken to @value and will be released only when
  30030. g_variant_iter_free() is called.</doc>
  30031. <return-value transfer-ownership="full">
  30032. <doc xml:space="preserve">a new heap-allocated #GVariantIter</doc>
  30033. <type name="VariantIter" c:type="GVariantIter*"/>
  30034. </return-value>
  30035. <parameters>
  30036. <instance-parameter name="value" transfer-ownership="none">
  30037. <doc xml:space="preserve">a container #GVariant</doc>
  30038. <type name="Variant" c:type="GVariant*"/>
  30039. </instance-parameter>
  30040. </parameters>
  30041. </method>
  30042. <method name="lookup"
  30043. c:identifier="g_variant_lookup"
  30044. version="2.28"
  30045. introspectable="0">
  30046. <doc xml:space="preserve">Looks up a value in a dictionary #GVariant.
  30047. This function is a wrapper around g_variant_lookup_value() and
  30048. g_variant_get(). In the case that %NULL would have been returned,
  30049. this function returns %FALSE. Otherwise, it unpacks the returned
  30050. value and returns %TRUE.
  30051. @format_string determines the C types that are used for unpacking
  30052. the values and also determines if the values are copied or borrowed,
  30053. see the section on
  30054. [GVariant format strings][gvariant-format-strings-pointers].
  30055. This function is currently implemented with a linear scan. If you
  30056. plan to do many lookups then #GVariantDict may be more efficient.</doc>
  30057. <return-value transfer-ownership="none">
  30058. <doc xml:space="preserve">%TRUE if a value was unpacked</doc>
  30059. <type name="gboolean" c:type="gboolean"/>
  30060. </return-value>
  30061. <parameters>
  30062. <instance-parameter name="dictionary" transfer-ownership="none">
  30063. <doc xml:space="preserve">a dictionary #GVariant</doc>
  30064. <type name="Variant" c:type="GVariant*"/>
  30065. </instance-parameter>
  30066. <parameter name="key" transfer-ownership="none">
  30067. <doc xml:space="preserve">the key to lookup in the dictionary</doc>
  30068. <type name="utf8" c:type="const gchar*"/>
  30069. </parameter>
  30070. <parameter name="format_string" transfer-ownership="none">
  30071. <doc xml:space="preserve">a GVariant format string</doc>
  30072. <type name="utf8" c:type="const gchar*"/>
  30073. </parameter>
  30074. <parameter name="..." transfer-ownership="none">
  30075. <doc xml:space="preserve">the arguments to unpack the value into</doc>
  30076. <varargs/>
  30077. </parameter>
  30078. </parameters>
  30079. </method>
  30080. <method name="lookup_value"
  30081. c:identifier="g_variant_lookup_value"
  30082. version="2.28">
  30083. <doc xml:space="preserve">Looks up a value in a dictionary #GVariant.
  30084. This function works with dictionaries of the type a{s*} (and equally
  30085. well with type a{o*}, but we only further discuss the string case
  30086. for sake of clarity).
  30087. In the event that @dictionary has the type a{sv}, the @expected_type
  30088. string specifies what type of value is expected to be inside of the
  30089. variant. If the value inside the variant has a different type then
  30090. %NULL is returned. In the event that @dictionary has a value type other
  30091. than v then @expected_type must directly match the key type and it is
  30092. used to unpack the value directly or an error occurs.
  30093. In either case, if @key is not found in @dictionary, %NULL is returned.
  30094. If the key is found and the value has the correct type, it is
  30095. returned. If @expected_type was specified then any non-%NULL return
  30096. value will have this type.
  30097. This function is currently implemented with a linear scan. If you
  30098. plan to do many lookups then #GVariantDict may be more efficient.</doc>
  30099. <return-value transfer-ownership="full">
  30100. <doc xml:space="preserve">the value of the dictionary key, or %NULL</doc>
  30101. <type name="Variant" c:type="GVariant*"/>
  30102. </return-value>
  30103. <parameters>
  30104. <instance-parameter name="dictionary" transfer-ownership="none">
  30105. <doc xml:space="preserve">a dictionary #GVariant</doc>
  30106. <type name="Variant" c:type="GVariant*"/>
  30107. </instance-parameter>
  30108. <parameter name="key" transfer-ownership="none">
  30109. <doc xml:space="preserve">the key to lookup in the dictionary</doc>
  30110. <type name="utf8" c:type="const gchar*"/>
  30111. </parameter>
  30112. <parameter name="expected_type"
  30113. transfer-ownership="none"
  30114. nullable="1"
  30115. allow-none="1">
  30116. <doc xml:space="preserve">a #GVariantType, or %NULL</doc>
  30117. <type name="VariantType" c:type="const GVariantType*"/>
  30118. </parameter>
  30119. </parameters>
  30120. </method>
  30121. <method name="n_children"
  30122. c:identifier="g_variant_n_children"
  30123. version="2.24">
  30124. <doc xml:space="preserve">Determines the number of children in a container #GVariant instance.
  30125. This includes variants, maybes, arrays, tuples and dictionary
  30126. entries. It is an error to call this function on any other type of
  30127. #GVariant.
  30128. For variants, the return value is always 1. For values with maybe
  30129. types, it is always zero or one. For arrays, it is the length of the
  30130. array. For tuples it is the number of tuple items (which depends
  30131. only on the type). For dictionary entries, it is always 2
  30132. This function is O(1).</doc>
  30133. <return-value transfer-ownership="none">
  30134. <doc xml:space="preserve">the number of children in the container</doc>
  30135. <type name="gsize" c:type="gsize"/>
  30136. </return-value>
  30137. <parameters>
  30138. <instance-parameter name="value" transfer-ownership="none">
  30139. <doc xml:space="preserve">a container #GVariant</doc>
  30140. <type name="Variant" c:type="GVariant*"/>
  30141. </instance-parameter>
  30142. </parameters>
  30143. </method>
  30144. <method name="print" c:identifier="g_variant_print" version="2.24">
  30145. <doc xml:space="preserve">Pretty-prints @value in the format understood by g_variant_parse().
  30146. The format is described [here][gvariant-text].
  30147. If @type_annotate is %TRUE, then type information is included in
  30148. the output.</doc>
  30149. <return-value transfer-ownership="full">
  30150. <doc xml:space="preserve">a newly-allocated string holding the result.</doc>
  30151. <type name="utf8" c:type="gchar*"/>
  30152. </return-value>
  30153. <parameters>
  30154. <instance-parameter name="value" transfer-ownership="none">
  30155. <doc xml:space="preserve">a #GVariant</doc>
  30156. <type name="Variant" c:type="GVariant*"/>
  30157. </instance-parameter>
  30158. <parameter name="type_annotate" transfer-ownership="none">
  30159. <doc xml:space="preserve">%TRUE if type information should be included in
  30160. the output</doc>
  30161. <type name="gboolean" c:type="gboolean"/>
  30162. </parameter>
  30163. </parameters>
  30164. </method>
  30165. <method name="print_string"
  30166. c:identifier="g_variant_print_string"
  30167. version="2.24"
  30168. introspectable="0">
  30169. <doc xml:space="preserve">Behaves as g_variant_print(), but operates on a #GString.
  30170. If @string is non-%NULL then it is appended to and returned. Else,
  30171. a new empty #GString is allocated and it is returned.</doc>
  30172. <return-value transfer-ownership="full">
  30173. <doc xml:space="preserve">a #GString containing the string</doc>
  30174. <type name="String" c:type="GString*"/>
  30175. </return-value>
  30176. <parameters>
  30177. <instance-parameter name="value" transfer-ownership="none">
  30178. <doc xml:space="preserve">a #GVariant</doc>
  30179. <type name="Variant" c:type="GVariant*"/>
  30180. </instance-parameter>
  30181. <parameter name="string"
  30182. transfer-ownership="none"
  30183. nullable="1"
  30184. allow-none="1">
  30185. <doc xml:space="preserve">a #GString, or %NULL</doc>
  30186. <type name="String" c:type="GString*"/>
  30187. </parameter>
  30188. <parameter name="type_annotate" transfer-ownership="none">
  30189. <doc xml:space="preserve">%TRUE if type information should be included in
  30190. the output</doc>
  30191. <type name="gboolean" c:type="gboolean"/>
  30192. </parameter>
  30193. </parameters>
  30194. </method>
  30195. <method name="ref" c:identifier="g_variant_ref" version="2.24">
  30196. <doc xml:space="preserve">Increases the reference count of @value.</doc>
  30197. <return-value transfer-ownership="full">
  30198. <doc xml:space="preserve">the same @value</doc>
  30199. <type name="Variant" c:type="GVariant*"/>
  30200. </return-value>
  30201. <parameters>
  30202. <instance-parameter name="value" transfer-ownership="none">
  30203. <doc xml:space="preserve">a #GVariant</doc>
  30204. <type name="Variant" c:type="GVariant*"/>
  30205. </instance-parameter>
  30206. </parameters>
  30207. </method>
  30208. <method name="ref_sink" c:identifier="g_variant_ref_sink" version="2.24">
  30209. <doc xml:space="preserve">#GVariant uses a floating reference count system. All functions with
  30210. names starting with `g_variant_new_` return floating
  30211. references.
  30212. Calling g_variant_ref_sink() on a #GVariant with a floating reference
  30213. will convert the floating reference into a full reference. Calling
  30214. g_variant_ref_sink() on a non-floating #GVariant results in an
  30215. additional normal reference being added.
  30216. In other words, if the @value is floating, then this call "assumes
  30217. ownership" of the floating reference, converting it to a normal
  30218. reference. If the @value is not floating, then this call adds a
  30219. new normal reference increasing the reference count by one.
  30220. All calls that result in a #GVariant instance being inserted into a
  30221. container will call g_variant_ref_sink() on the instance. This means
  30222. that if the value was just created (and has only its floating
  30223. reference) then the container will assume sole ownership of the value
  30224. at that point and the caller will not need to unreference it. This
  30225. makes certain common styles of programming much easier while still
  30226. maintaining normal refcounting semantics in situations where values
  30227. are not floating.</doc>
  30228. <return-value transfer-ownership="full">
  30229. <doc xml:space="preserve">the same @value</doc>
  30230. <type name="Variant" c:type="GVariant*"/>
  30231. </return-value>
  30232. <parameters>
  30233. <instance-parameter name="value" transfer-ownership="none">
  30234. <doc xml:space="preserve">a #GVariant</doc>
  30235. <type name="Variant" c:type="GVariant*"/>
  30236. </instance-parameter>
  30237. </parameters>
  30238. </method>
  30239. <method name="store" c:identifier="g_variant_store" version="2.24">
  30240. <doc xml:space="preserve">Stores the serialised form of @value at @data. @data should be
  30241. large enough. See g_variant_get_size().
  30242. The stored data is in machine native byte order but may not be in
  30243. fully-normalised form if read from an untrusted source. See
  30244. g_variant_get_normal_form() for a solution.
  30245. As with g_variant_get_data(), to be able to deserialise the
  30246. serialised variant successfully, its type and (if the destination
  30247. machine might be different) its endianness must also be available.
  30248. This function is approximately O(n) in the size of @data.</doc>
  30249. <return-value transfer-ownership="none">
  30250. <type name="none" c:type="void"/>
  30251. </return-value>
  30252. <parameters>
  30253. <instance-parameter name="value" transfer-ownership="none">
  30254. <doc xml:space="preserve">the #GVariant to store</doc>
  30255. <type name="Variant" c:type="GVariant*"/>
  30256. </instance-parameter>
  30257. <parameter name="data" transfer-ownership="none">
  30258. <doc xml:space="preserve">the location to store the serialised data at</doc>
  30259. <type name="gpointer" c:type="gpointer"/>
  30260. </parameter>
  30261. </parameters>
  30262. </method>
  30263. <method name="take_ref" c:identifier="g_variant_take_ref">
  30264. <doc xml:space="preserve">If @value is floating, sink it. Otherwise, do nothing.
  30265. Typically you want to use g_variant_ref_sink() in order to
  30266. automatically do the correct thing with respect to floating or
  30267. non-floating references, but there is one specific scenario where
  30268. this function is helpful.
  30269. The situation where this function is helpful is when creating an API
  30270. that allows the user to provide a callback function that returns a
  30271. #GVariant. We certainly want to allow the user the flexibility to
  30272. return a non-floating reference from this callback (for the case
  30273. where the value that is being returned already exists).
  30274. At the same time, the style of the #GVariant API makes it likely that
  30275. for newly-created #GVariant instances, the user can be saved some
  30276. typing if they are allowed to return a #GVariant with a floating
  30277. reference.
  30278. Using this function on the return value of the user's callback allows
  30279. the user to do whichever is more convenient for them. The caller
  30280. will alway receives exactly one full reference to the value: either
  30281. the one that was returned in the first place, or a floating reference
  30282. that has been converted to a full reference.
  30283. This function has an odd interaction when combined with
  30284. g_variant_ref_sink() running at the same time in another thread on
  30285. the same #GVariant instance. If g_variant_ref_sink() runs first then
  30286. the result will be that the floating reference is converted to a hard
  30287. reference. If g_variant_take_ref() runs first then the result will
  30288. be that the floating reference is converted to a hard reference and
  30289. an additional reference on top of that one is added. It is best to
  30290. avoid this situation.</doc>
  30291. <return-value transfer-ownership="full">
  30292. <doc xml:space="preserve">the same @value</doc>
  30293. <type name="Variant" c:type="GVariant*"/>
  30294. </return-value>
  30295. <parameters>
  30296. <instance-parameter name="value" transfer-ownership="none">
  30297. <doc xml:space="preserve">a #GVariant</doc>
  30298. <type name="Variant" c:type="GVariant*"/>
  30299. </instance-parameter>
  30300. </parameters>
  30301. </method>
  30302. <method name="unref" c:identifier="g_variant_unref" version="2.24">
  30303. <doc xml:space="preserve">Decreases the reference count of @value. When its reference count
  30304. drops to 0, the memory used by the variant is freed.</doc>
  30305. <return-value transfer-ownership="none">
  30306. <type name="none" c:type="void"/>
  30307. </return-value>
  30308. <parameters>
  30309. <instance-parameter name="value" transfer-ownership="none">
  30310. <doc xml:space="preserve">a #GVariant</doc>
  30311. <type name="Variant" c:type="GVariant*"/>
  30312. </instance-parameter>
  30313. </parameters>
  30314. </method>
  30315. <function name="is_object_path"
  30316. c:identifier="g_variant_is_object_path"
  30317. version="2.24">
  30318. <doc xml:space="preserve">Determines if a given string is a valid D-Bus object path. You
  30319. should ensure that a string is a valid D-Bus object path before
  30320. passing it to g_variant_new_object_path().
  30321. A valid object path starts with '/' followed by zero or more
  30322. sequences of characters separated by '/' characters. Each sequence
  30323. must contain only the characters "[A-Z][a-z][0-9]_". No sequence
  30324. (including the one following the final '/' character) may be empty.</doc>
  30325. <return-value transfer-ownership="none">
  30326. <doc xml:space="preserve">%TRUE if @string is a D-Bus object path</doc>
  30327. <type name="gboolean" c:type="gboolean"/>
  30328. </return-value>
  30329. <parameters>
  30330. <parameter name="string" transfer-ownership="none">
  30331. <doc xml:space="preserve">a normal C nul-terminated string</doc>
  30332. <type name="utf8" c:type="const gchar*"/>
  30333. </parameter>
  30334. </parameters>
  30335. </function>
  30336. <function name="is_signature"
  30337. c:identifier="g_variant_is_signature"
  30338. version="2.24">
  30339. <doc xml:space="preserve">Determines if a given string is a valid D-Bus type signature. You
  30340. should ensure that a string is a valid D-Bus type signature before
  30341. passing it to g_variant_new_signature().
  30342. D-Bus type signatures consist of zero or more definite #GVariantType
  30343. strings in sequence.</doc>
  30344. <return-value transfer-ownership="none">
  30345. <doc xml:space="preserve">%TRUE if @string is a D-Bus type signature</doc>
  30346. <type name="gboolean" c:type="gboolean"/>
  30347. </return-value>
  30348. <parameters>
  30349. <parameter name="string" transfer-ownership="none">
  30350. <doc xml:space="preserve">a normal C nul-terminated string</doc>
  30351. <type name="utf8" c:type="const gchar*"/>
  30352. </parameter>
  30353. </parameters>
  30354. </function>
  30355. <function name="parse" c:identifier="g_variant_parse" throws="1">
  30356. <doc xml:space="preserve">Parses a #GVariant from a text representation.
  30357. A single #GVariant is parsed from the content of @text.
  30358. The format is described [here][gvariant-text].
  30359. The memory at @limit will never be accessed and the parser behaves as
  30360. if the character at @limit is the nul terminator. This has the
  30361. effect of bounding @text.
  30362. If @endptr is non-%NULL then @text is permitted to contain data
  30363. following the value that this function parses and @endptr will be
  30364. updated to point to the first character past the end of the text
  30365. parsed by this function. If @endptr is %NULL and there is extra data
  30366. then an error is returned.
  30367. If @type is non-%NULL then the value will be parsed to have that
  30368. type. This may result in additional parse errors (in the case that
  30369. the parsed value doesn't fit the type) but may also result in fewer
  30370. errors (in the case that the type would have been ambiguous, such as
  30371. with empty arrays).
  30372. In the event that the parsing is successful, the resulting #GVariant
  30373. is returned. It is never floating, and must be freed with
  30374. g_variant_unref().
  30375. In case of any error, %NULL will be returned. If @error is non-%NULL
  30376. then it will be set to reflect the error that occurred.
  30377. Officially, the language understood by the parser is "any string
  30378. produced by g_variant_print()".</doc>
  30379. <return-value transfer-ownership="full">
  30380. <doc xml:space="preserve">a non-floating reference to a #GVariant, or %NULL</doc>
  30381. <type name="Variant" c:type="GVariant*"/>
  30382. </return-value>
  30383. <parameters>
  30384. <parameter name="type"
  30385. transfer-ownership="none"
  30386. nullable="1"
  30387. allow-none="1">
  30388. <doc xml:space="preserve">a #GVariantType, or %NULL</doc>
  30389. <type name="VariantType" c:type="const GVariantType*"/>
  30390. </parameter>
  30391. <parameter name="text" transfer-ownership="none">
  30392. <doc xml:space="preserve">a string containing a GVariant in text form</doc>
  30393. <type name="utf8" c:type="const gchar*"/>
  30394. </parameter>
  30395. <parameter name="limit"
  30396. transfer-ownership="none"
  30397. nullable="1"
  30398. allow-none="1">
  30399. <doc xml:space="preserve">a pointer to the end of @text, or %NULL</doc>
  30400. <type name="utf8" c:type="const gchar*"/>
  30401. </parameter>
  30402. <parameter name="endptr"
  30403. transfer-ownership="none"
  30404. nullable="1"
  30405. allow-none="1">
  30406. <doc xml:space="preserve">a location to store the end pointer, or %NULL</doc>
  30407. <type name="utf8" c:type="const gchar**"/>
  30408. </parameter>
  30409. </parameters>
  30410. </function>
  30411. <function name="parse_error_print_context"
  30412. c:identifier="g_variant_parse_error_print_context"
  30413. version="2.40">
  30414. <doc xml:space="preserve">Pretty-prints a message showing the context of a #GVariant parse
  30415. error within the string for which parsing was attempted.
  30416. The resulting string is suitable for output to the console or other
  30417. monospace media where newlines are treated in the usual way.
  30418. The message will typically look something like one of the following:
  30419. |[
  30420. unterminated string constant:
  30421. (1, 2, 3, 'abc
  30422. ^^^^
  30423. ]|
  30424. or
  30425. |[
  30426. unable to find a common type:
  30427. [1, 2, 3, 'str']
  30428. ^ ^^^^^
  30429. ]|
  30430. The format of the message may change in a future version.
  30431. @error must have come from a failed attempt to g_variant_parse() and
  30432. @source_str must be exactly the same string that caused the error.
  30433. If @source_str was not nul-terminated when you passed it to
  30434. g_variant_parse() then you must add nul termination before using this
  30435. function.</doc>
  30436. <return-value transfer-ownership="full">
  30437. <doc xml:space="preserve">the printed message</doc>
  30438. <type name="utf8" c:type="gchar*"/>
  30439. </return-value>
  30440. <parameters>
  30441. <parameter name="error" transfer-ownership="none">
  30442. <doc xml:space="preserve">a #GError from the #GVariantParseError domain</doc>
  30443. <type name="Error" c:type="GError*"/>
  30444. </parameter>
  30445. <parameter name="source_str" transfer-ownership="none">
  30446. <doc xml:space="preserve">the string that was given to the parser</doc>
  30447. <type name="utf8" c:type="const gchar*"/>
  30448. </parameter>
  30449. </parameters>
  30450. </function>
  30451. <function name="parse_error_quark"
  30452. c:identifier="g_variant_parse_error_quark">
  30453. <return-value transfer-ownership="none">
  30454. <type name="Quark" c:type="GQuark"/>
  30455. </return-value>
  30456. </function>
  30457. <function name="parser_get_error_quark"
  30458. c:identifier="g_variant_parser_get_error_quark"
  30459. deprecated="1">
  30460. <doc xml:space="preserve">Same as g_variant_error_quark().</doc>
  30461. <doc-deprecated xml:space="preserve">Use g_variant_parse_error_quark() instead.</doc-deprecated>
  30462. <return-value transfer-ownership="none">
  30463. <type name="Quark" c:type="GQuark"/>
  30464. </return-value>
  30465. </function>
  30466. </record>
  30467. <record name="VariantBuilder"
  30468. c:type="GVariantBuilder"
  30469. glib:type-name="GVariantBuilder"
  30470. glib:get-type="g_variant_builder_get_type"
  30471. c:symbol-prefix="variant_builder">
  30472. <doc xml:space="preserve">A utility type for constructing container-type #GVariant instances.
  30473. This is an opaque structure and may only be accessed using the
  30474. following functions.
  30475. #GVariantBuilder is not threadsafe in any way. Do not attempt to
  30476. access it from more than one thread.</doc>
  30477. <field name="x" readable="0" private="1">
  30478. <array zero-terminated="0" c:type="gsize" fixed-size="16">
  30479. <type name="gsize" c:type="gsize"/>
  30480. </array>
  30481. </field>
  30482. <constructor name="new"
  30483. c:identifier="g_variant_builder_new"
  30484. version="2.24">
  30485. <doc xml:space="preserve">Allocates and initialises a new #GVariantBuilder.
  30486. You should call g_variant_builder_unref() on the return value when it
  30487. is no longer needed. The memory will not be automatically freed by
  30488. any other call.
  30489. In most cases it is easier to place a #GVariantBuilder directly on
  30490. the stack of the calling function and initialise it with
  30491. g_variant_builder_init().</doc>
  30492. <return-value transfer-ownership="full">
  30493. <doc xml:space="preserve">a #GVariantBuilder</doc>
  30494. <type name="VariantBuilder" c:type="GVariantBuilder*"/>
  30495. </return-value>
  30496. <parameters>
  30497. <parameter name="type" transfer-ownership="none">
  30498. <doc xml:space="preserve">a container type</doc>
  30499. <type name="VariantType" c:type="const GVariantType*"/>
  30500. </parameter>
  30501. </parameters>
  30502. </constructor>
  30503. <method name="add"
  30504. c:identifier="g_variant_builder_add"
  30505. version="2.24"
  30506. introspectable="0">
  30507. <doc xml:space="preserve">Adds to a #GVariantBuilder.
  30508. This call is a convenience wrapper that is exactly equivalent to
  30509. calling g_variant_new() followed by g_variant_builder_add_value().
  30510. Note that the arguments must be of the correct width for their types
  30511. specified in @format_string. This can be achieved by casting them. See
  30512. the [GVariant varargs documentation][gvariant-varargs].
  30513. This function might be used as follows:
  30514. |[&lt;!-- language="C" --&gt;
  30515. GVariant *
  30516. make_pointless_dictionary (void)
  30517. {
  30518. GVariantBuilder builder;
  30519. int i;
  30520. g_variant_builder_init (&amp;builder, G_VARIANT_TYPE_ARRAY);
  30521. for (i = 0; i &lt; 16; i++)
  30522. {
  30523. gchar buf[3];
  30524. sprintf (buf, "%d", i);
  30525. g_variant_builder_add (&amp;builder, "{is}", i, buf);
  30526. }
  30527. return g_variant_builder_end (&amp;builder);
  30528. }
  30529. ]|</doc>
  30530. <return-value transfer-ownership="none">
  30531. <type name="none" c:type="void"/>
  30532. </return-value>
  30533. <parameters>
  30534. <instance-parameter name="builder" transfer-ownership="none">
  30535. <doc xml:space="preserve">a #GVariantBuilder</doc>
  30536. <type name="VariantBuilder" c:type="GVariantBuilder*"/>
  30537. </instance-parameter>
  30538. <parameter name="format_string" transfer-ownership="none">
  30539. <doc xml:space="preserve">a #GVariant varargs format string</doc>
  30540. <type name="utf8" c:type="const gchar*"/>
  30541. </parameter>
  30542. <parameter name="..." transfer-ownership="none">
  30543. <doc xml:space="preserve">arguments, as per @format_string</doc>
  30544. <varargs/>
  30545. </parameter>
  30546. </parameters>
  30547. </method>
  30548. <method name="add_parsed"
  30549. c:identifier="g_variant_builder_add_parsed"
  30550. version="2.26"
  30551. introspectable="0">
  30552. <doc xml:space="preserve">Adds to a #GVariantBuilder.
  30553. This call is a convenience wrapper that is exactly equivalent to
  30554. calling g_variant_new_parsed() followed by
  30555. g_variant_builder_add_value().
  30556. Note that the arguments must be of the correct width for their types
  30557. specified in @format_string. This can be achieved by casting them. See
  30558. the [GVariant varargs documentation][gvariant-varargs].
  30559. This function might be used as follows:
  30560. |[&lt;!-- language="C" --&gt;
  30561. GVariant *
  30562. make_pointless_dictionary (void)
  30563. {
  30564. GVariantBuilder builder;
  30565. int i;
  30566. g_variant_builder_init (&amp;builder, G_VARIANT_TYPE_ARRAY);
  30567. g_variant_builder_add_parsed (&amp;builder, "{'width', &lt;%i&gt;}", 600);
  30568. g_variant_builder_add_parsed (&amp;builder, "{'title', &lt;%s&gt;}", "foo");
  30569. g_variant_builder_add_parsed (&amp;builder, "{'transparency', &lt;0.5&gt;}");
  30570. return g_variant_builder_end (&amp;builder);
  30571. }
  30572. ]|</doc>
  30573. <return-value transfer-ownership="none">
  30574. <type name="none" c:type="void"/>
  30575. </return-value>
  30576. <parameters>
  30577. <instance-parameter name="builder" transfer-ownership="none">
  30578. <doc xml:space="preserve">a #GVariantBuilder</doc>
  30579. <type name="VariantBuilder" c:type="GVariantBuilder*"/>
  30580. </instance-parameter>
  30581. <parameter name="format" transfer-ownership="none">
  30582. <doc xml:space="preserve">a text format #GVariant</doc>
  30583. <type name="utf8" c:type="const gchar*"/>
  30584. </parameter>
  30585. <parameter name="..." transfer-ownership="none">
  30586. <doc xml:space="preserve">arguments as per @format</doc>
  30587. <varargs/>
  30588. </parameter>
  30589. </parameters>
  30590. </method>
  30591. <method name="add_value"
  30592. c:identifier="g_variant_builder_add_value"
  30593. version="2.24">
  30594. <doc xml:space="preserve">Adds @value to @builder.
  30595. It is an error to call this function in any way that would create an
  30596. inconsistent value to be constructed. Some examples of this are
  30597. putting different types of items into an array, putting the wrong
  30598. types or number of items in a tuple, putting more than one value into
  30599. a variant, etc.
  30600. If @value is a floating reference (see g_variant_ref_sink()),
  30601. the @builder instance takes ownership of @value.</doc>
  30602. <return-value transfer-ownership="none">
  30603. <type name="none" c:type="void"/>
  30604. </return-value>
  30605. <parameters>
  30606. <instance-parameter name="builder" transfer-ownership="none">
  30607. <doc xml:space="preserve">a #GVariantBuilder</doc>
  30608. <type name="VariantBuilder" c:type="GVariantBuilder*"/>
  30609. </instance-parameter>
  30610. <parameter name="value" transfer-ownership="none">
  30611. <doc xml:space="preserve">a #GVariant</doc>
  30612. <type name="Variant" c:type="GVariant*"/>
  30613. </parameter>
  30614. </parameters>
  30615. </method>
  30616. <method name="clear"
  30617. c:identifier="g_variant_builder_clear"
  30618. version="2.24"
  30619. introspectable="0">
  30620. <doc xml:space="preserve">Releases all memory associated with a #GVariantBuilder without
  30621. freeing the #GVariantBuilder structure itself.
  30622. It typically only makes sense to do this on a stack-allocated
  30623. #GVariantBuilder if you want to abort building the value part-way
  30624. through. This function need not be called if you call
  30625. g_variant_builder_end() and it also doesn't need to be called on
  30626. builders allocated with g_variant_builder_new (see
  30627. g_variant_builder_unref() for that).
  30628. This function leaves the #GVariantBuilder structure set to all-zeros.
  30629. It is valid to call this function on either an initialised
  30630. #GVariantBuilder or one that is set to all-zeros but it is not valid
  30631. to call this function on uninitialised memory.</doc>
  30632. <return-value transfer-ownership="none">
  30633. <type name="none" c:type="void"/>
  30634. </return-value>
  30635. <parameters>
  30636. <instance-parameter name="builder" transfer-ownership="none">
  30637. <doc xml:space="preserve">a #GVariantBuilder</doc>
  30638. <type name="VariantBuilder" c:type="GVariantBuilder*"/>
  30639. </instance-parameter>
  30640. </parameters>
  30641. </method>
  30642. <method name="close"
  30643. c:identifier="g_variant_builder_close"
  30644. version="2.24">
  30645. <doc xml:space="preserve">Closes the subcontainer inside the given @builder that was opened by
  30646. the most recent call to g_variant_builder_open().
  30647. It is an error to call this function in any way that would create an
  30648. inconsistent value to be constructed (ie: too few values added to the
  30649. subcontainer).</doc>
  30650. <return-value transfer-ownership="none">
  30651. <type name="none" c:type="void"/>
  30652. </return-value>
  30653. <parameters>
  30654. <instance-parameter name="builder" transfer-ownership="none">
  30655. <doc xml:space="preserve">a #GVariantBuilder</doc>
  30656. <type name="VariantBuilder" c:type="GVariantBuilder*"/>
  30657. </instance-parameter>
  30658. </parameters>
  30659. </method>
  30660. <method name="end" c:identifier="g_variant_builder_end" version="2.24">
  30661. <doc xml:space="preserve">Ends the builder process and returns the constructed value.
  30662. It is not permissible to use @builder in any way after this call
  30663. except for reference counting operations (in the case of a
  30664. heap-allocated #GVariantBuilder) or by reinitialising it with
  30665. g_variant_builder_init() (in the case of stack-allocated).
  30666. It is an error to call this function in any way that would create an
  30667. inconsistent value to be constructed (ie: insufficient number of
  30668. items added to a container with a specific number of children
  30669. required). It is also an error to call this function if the builder
  30670. was created with an indefinite array or maybe type and no children
  30671. have been added; in this case it is impossible to infer the type of
  30672. the empty array.</doc>
  30673. <return-value transfer-ownership="none">
  30674. <doc xml:space="preserve">a new, floating, #GVariant</doc>
  30675. <type name="Variant" c:type="GVariant*"/>
  30676. </return-value>
  30677. <parameters>
  30678. <instance-parameter name="builder" transfer-ownership="none">
  30679. <doc xml:space="preserve">a #GVariantBuilder</doc>
  30680. <type name="VariantBuilder" c:type="GVariantBuilder*"/>
  30681. </instance-parameter>
  30682. </parameters>
  30683. </method>
  30684. <method name="init"
  30685. c:identifier="g_variant_builder_init"
  30686. version="2.24"
  30687. introspectable="0">
  30688. <doc xml:space="preserve">Initialises a #GVariantBuilder structure.
  30689. @type must be non-%NULL. It specifies the type of container to
  30690. construct. It can be an indefinite type such as
  30691. %G_VARIANT_TYPE_ARRAY or a definite type such as "as" or "(ii)".
  30692. Maybe, array, tuple, dictionary entry and variant-typed values may be
  30693. constructed.
  30694. After the builder is initialised, values are added using
  30695. g_variant_builder_add_value() or g_variant_builder_add().
  30696. After all the child values are added, g_variant_builder_end() frees
  30697. the memory associated with the builder and returns the #GVariant that
  30698. was created.
  30699. This function completely ignores the previous contents of @builder.
  30700. On one hand this means that it is valid to pass in completely
  30701. uninitialised memory. On the other hand, this means that if you are
  30702. initialising over top of an existing #GVariantBuilder you need to
  30703. first call g_variant_builder_clear() in order to avoid leaking
  30704. memory.
  30705. You must not call g_variant_builder_ref() or
  30706. g_variant_builder_unref() on a #GVariantBuilder that was initialised
  30707. with this function. If you ever pass a reference to a
  30708. #GVariantBuilder outside of the control of your own code then you
  30709. should assume that the person receiving that reference may try to use
  30710. reference counting; you should use g_variant_builder_new() instead of
  30711. this function.</doc>
  30712. <return-value transfer-ownership="none">
  30713. <type name="none" c:type="void"/>
  30714. </return-value>
  30715. <parameters>
  30716. <instance-parameter name="builder" transfer-ownership="none">
  30717. <doc xml:space="preserve">a #GVariantBuilder</doc>
  30718. <type name="VariantBuilder" c:type="GVariantBuilder*"/>
  30719. </instance-parameter>
  30720. <parameter name="type" transfer-ownership="none">
  30721. <doc xml:space="preserve">a container type</doc>
  30722. <type name="VariantType" c:type="const GVariantType*"/>
  30723. </parameter>
  30724. </parameters>
  30725. </method>
  30726. <method name="open" c:identifier="g_variant_builder_open" version="2.24">
  30727. <doc xml:space="preserve">Opens a subcontainer inside the given @builder. When done adding
  30728. items to the subcontainer, g_variant_builder_close() must be called.
  30729. It is an error to call this function in any way that would cause an
  30730. inconsistent value to be constructed (ie: adding too many values or
  30731. a value of an incorrect type).</doc>
  30732. <return-value transfer-ownership="none">
  30733. <type name="none" c:type="void"/>
  30734. </return-value>
  30735. <parameters>
  30736. <instance-parameter name="builder" transfer-ownership="none">
  30737. <doc xml:space="preserve">a #GVariantBuilder</doc>
  30738. <type name="VariantBuilder" c:type="GVariantBuilder*"/>
  30739. </instance-parameter>
  30740. <parameter name="type" transfer-ownership="none">
  30741. <doc xml:space="preserve">a #GVariantType</doc>
  30742. <type name="VariantType" c:type="const GVariantType*"/>
  30743. </parameter>
  30744. </parameters>
  30745. </method>
  30746. <method name="ref" c:identifier="g_variant_builder_ref" version="2.24">
  30747. <doc xml:space="preserve">Increases the reference count on @builder.
  30748. Don't call this on stack-allocated #GVariantBuilder instances or bad
  30749. things will happen.</doc>
  30750. <return-value transfer-ownership="full">
  30751. <doc xml:space="preserve">a new reference to @builder</doc>
  30752. <type name="VariantBuilder" c:type="GVariantBuilder*"/>
  30753. </return-value>
  30754. <parameters>
  30755. <instance-parameter name="builder" transfer-ownership="none">
  30756. <doc xml:space="preserve">a #GVariantBuilder allocated by g_variant_builder_new()</doc>
  30757. <type name="VariantBuilder" c:type="GVariantBuilder*"/>
  30758. </instance-parameter>
  30759. </parameters>
  30760. </method>
  30761. <method name="unref"
  30762. c:identifier="g_variant_builder_unref"
  30763. version="2.24">
  30764. <doc xml:space="preserve">Decreases the reference count on @builder.
  30765. In the event that there are no more references, releases all memory
  30766. associated with the #GVariantBuilder.
  30767. Don't call this on stack-allocated #GVariantBuilder instances or bad
  30768. things will happen.</doc>
  30769. <return-value transfer-ownership="none">
  30770. <type name="none" c:type="void"/>
  30771. </return-value>
  30772. <parameters>
  30773. <instance-parameter name="builder" transfer-ownership="full">
  30774. <doc xml:space="preserve">a #GVariantBuilder allocated by g_variant_builder_new()</doc>
  30775. <type name="VariantBuilder" c:type="GVariantBuilder*"/>
  30776. </instance-parameter>
  30777. </parameters>
  30778. </method>
  30779. </record>
  30780. <enumeration name="VariantClass" version="2.24" c:type="GVariantClass">
  30781. <doc xml:space="preserve">The range of possible top-level types of #GVariant instances.</doc>
  30782. <member name="boolean" value="98" c:identifier="G_VARIANT_CLASS_BOOLEAN">
  30783. <doc xml:space="preserve">The #GVariant is a boolean.</doc>
  30784. </member>
  30785. <member name="byte" value="121" c:identifier="G_VARIANT_CLASS_BYTE">
  30786. <doc xml:space="preserve">The #GVariant is a byte.</doc>
  30787. </member>
  30788. <member name="int16" value="110" c:identifier="G_VARIANT_CLASS_INT16">
  30789. <doc xml:space="preserve">The #GVariant is a signed 16 bit integer.</doc>
  30790. </member>
  30791. <member name="uint16" value="113" c:identifier="G_VARIANT_CLASS_UINT16">
  30792. <doc xml:space="preserve">The #GVariant is an unsigned 16 bit integer.</doc>
  30793. </member>
  30794. <member name="int32" value="105" c:identifier="G_VARIANT_CLASS_INT32">
  30795. <doc xml:space="preserve">The #GVariant is a signed 32 bit integer.</doc>
  30796. </member>
  30797. <member name="uint32" value="117" c:identifier="G_VARIANT_CLASS_UINT32">
  30798. <doc xml:space="preserve">The #GVariant is an unsigned 32 bit integer.</doc>
  30799. </member>
  30800. <member name="int64" value="120" c:identifier="G_VARIANT_CLASS_INT64">
  30801. <doc xml:space="preserve">The #GVariant is a signed 64 bit integer.</doc>
  30802. </member>
  30803. <member name="uint64" value="116" c:identifier="G_VARIANT_CLASS_UINT64">
  30804. <doc xml:space="preserve">The #GVariant is an unsigned 64 bit integer.</doc>
  30805. </member>
  30806. <member name="handle" value="104" c:identifier="G_VARIANT_CLASS_HANDLE">
  30807. <doc xml:space="preserve">The #GVariant is a file handle index.</doc>
  30808. </member>
  30809. <member name="double" value="100" c:identifier="G_VARIANT_CLASS_DOUBLE">
  30810. <doc xml:space="preserve">The #GVariant is a double precision floating
  30811. point value.</doc>
  30812. </member>
  30813. <member name="string" value="115" c:identifier="G_VARIANT_CLASS_STRING">
  30814. <doc xml:space="preserve">The #GVariant is a normal string.</doc>
  30815. </member>
  30816. <member name="object_path"
  30817. value="111"
  30818. c:identifier="G_VARIANT_CLASS_OBJECT_PATH">
  30819. <doc xml:space="preserve">The #GVariant is a D-Bus object path
  30820. string.</doc>
  30821. </member>
  30822. <member name="signature"
  30823. value="103"
  30824. c:identifier="G_VARIANT_CLASS_SIGNATURE">
  30825. <doc xml:space="preserve">The #GVariant is a D-Bus signature string.</doc>
  30826. </member>
  30827. <member name="variant"
  30828. value="118"
  30829. c:identifier="G_VARIANT_CLASS_VARIANT">
  30830. <doc xml:space="preserve">The #GVariant is a variant.</doc>
  30831. </member>
  30832. <member name="maybe" value="109" c:identifier="G_VARIANT_CLASS_MAYBE">
  30833. <doc xml:space="preserve">The #GVariant is a maybe-typed value.</doc>
  30834. </member>
  30835. <member name="array" value="97" c:identifier="G_VARIANT_CLASS_ARRAY">
  30836. <doc xml:space="preserve">The #GVariant is an array.</doc>
  30837. </member>
  30838. <member name="tuple" value="40" c:identifier="G_VARIANT_CLASS_TUPLE">
  30839. <doc xml:space="preserve">The #GVariant is a tuple.</doc>
  30840. </member>
  30841. <member name="dict_entry"
  30842. value="123"
  30843. c:identifier="G_VARIANT_CLASS_DICT_ENTRY">
  30844. <doc xml:space="preserve">The #GVariant is a dictionary entry.</doc>
  30845. </member>
  30846. </enumeration>
  30847. <record name="VariantDict"
  30848. c:type="GVariantDict"
  30849. version="2.40"
  30850. glib:type-name="GVariantDict"
  30851. glib:get-type="g_variant_dict_get_type"
  30852. c:symbol-prefix="variant_dict">
  30853. <doc xml:space="preserve">#GVariantDict is a mutable interface to #GVariant dictionaries.
  30854. It can be used for doing a sequence of dictionary lookups in an
  30855. efficient way on an existing #GVariant dictionary or it can be used
  30856. to construct new dictionaries with a hashtable-like interface. It
  30857. can also be used for taking existing dictionaries and modifying them
  30858. in order to create new ones.
  30859. #GVariantDict can only be used with %G_VARIANT_TYPE_VARDICT
  30860. dictionaries.
  30861. It is possible to use #GVariantDict allocated on the stack or on the
  30862. heap. When using a stack-allocated #GVariantDict, you begin with a
  30863. call to g_variant_dict_init() and free the resources with a call to
  30864. g_variant_dict_clear().
  30865. Heap-allocated #GVariantDict follows normal refcounting rules: you
  30866. allocate it with g_variant_dict_new() and use g_variant_dict_ref()
  30867. and g_variant_dict_unref().
  30868. g_variant_dict_end() is used to convert the #GVariantDict back into a
  30869. dictionary-type #GVariant. When used with stack-allocated instances,
  30870. this also implicitly frees all associated memory, but for
  30871. heap-allocated instances, you must still call g_variant_dict_unref()
  30872. afterwards.
  30873. You will typically want to use a heap-allocated #GVariantDict when
  30874. you expose it as part of an API. For most other uses, the
  30875. stack-allocated form will be more convenient.
  30876. Consider the following two examples that do the same thing in each
  30877. style: take an existing dictionary and look up the "count" uint32
  30878. key, adding 1 to it if it is found, or returning an error if the
  30879. key is not found. Each returns the new dictionary as a floating
  30880. #GVariant.
  30881. ## Using a stack-allocated GVariantDict
  30882. |[&lt;!-- language="C" --&gt;
  30883. GVariant *
  30884. add_to_count (GVariant *orig,
  30885. GError **error)
  30886. {
  30887. GVariantDict dict;
  30888. guint32 count;
  30889. g_variant_dict_init (&amp;dict, orig);
  30890. if (!g_variant_dict_lookup (&amp;dict, "count", "u", &amp;count))
  30891. {
  30892. g_set_error (...);
  30893. g_variant_dict_clear (&amp;dict);
  30894. return NULL;
  30895. }
  30896. g_variant_dict_insert (&amp;dict, "count", "u", count + 1);
  30897. return g_variant_dict_end (&amp;dict);
  30898. }
  30899. ]|
  30900. ## Using heap-allocated GVariantDict
  30901. |[&lt;!-- language="C" --&gt;
  30902. GVariant *
  30903. add_to_count (GVariant *orig,
  30904. GError **error)
  30905. {
  30906. GVariantDict *dict;
  30907. GVariant *result;
  30908. guint32 count;
  30909. dict = g_variant_dict_new (orig);
  30910. if (g_variant_dict_lookup (dict, "count", "u", &amp;count))
  30911. {
  30912. g_variant_dict_insert (dict, "count", "u", count + 1);
  30913. result = g_variant_dict_end (dict);
  30914. }
  30915. else
  30916. {
  30917. g_set_error (...);
  30918. result = NULL;
  30919. }
  30920. g_variant_dict_unref (dict);
  30921. return result;
  30922. }
  30923. ]|</doc>
  30924. <field name="x" readable="0" private="1">
  30925. <array zero-terminated="0" c:type="gsize" fixed-size="16">
  30926. <type name="gsize" c:type="gsize"/>
  30927. </array>
  30928. </field>
  30929. <constructor name="new" c:identifier="g_variant_dict_new" version="2.40">
  30930. <doc xml:space="preserve">Allocates and initialises a new #GVariantDict.
  30931. You should call g_variant_dict_unref() on the return value when it
  30932. is no longer needed. The memory will not be automatically freed by
  30933. any other call.
  30934. In some cases it may be easier to place a #GVariantDict directly on
  30935. the stack of the calling function and initialise it with
  30936. g_variant_dict_init(). This is particularly useful when you are
  30937. using #GVariantDict to construct a #GVariant.</doc>
  30938. <return-value transfer-ownership="full">
  30939. <doc xml:space="preserve">a #GVariantDict</doc>
  30940. <type name="VariantDict" c:type="GVariantDict*"/>
  30941. </return-value>
  30942. <parameters>
  30943. <parameter name="from_asv"
  30944. transfer-ownership="none"
  30945. nullable="1"
  30946. allow-none="1">
  30947. <doc xml:space="preserve">the #GVariant with which to initialise the
  30948. dictionary</doc>
  30949. <type name="Variant" c:type="GVariant*"/>
  30950. </parameter>
  30951. </parameters>
  30952. </constructor>
  30953. <method name="clear" c:identifier="g_variant_dict_clear" version="2.40">
  30954. <doc xml:space="preserve">Releases all memory associated with a #GVariantDict without freeing
  30955. the #GVariantDict structure itself.
  30956. It typically only makes sense to do this on a stack-allocated
  30957. #GVariantDict if you want to abort building the value part-way
  30958. through. This function need not be called if you call
  30959. g_variant_dict_end() and it also doesn't need to be called on dicts
  30960. allocated with g_variant_dict_new (see g_variant_dict_unref() for
  30961. that).
  30962. It is valid to call this function on either an initialised
  30963. #GVariantDict or one that was previously cleared by an earlier call
  30964. to g_variant_dict_clear() but it is not valid to call this function
  30965. on uninitialised memory.</doc>
  30966. <return-value transfer-ownership="none">
  30967. <type name="none" c:type="void"/>
  30968. </return-value>
  30969. <parameters>
  30970. <instance-parameter name="dict" transfer-ownership="none">
  30971. <doc xml:space="preserve">a #GVariantDict</doc>
  30972. <type name="VariantDict" c:type="GVariantDict*"/>
  30973. </instance-parameter>
  30974. </parameters>
  30975. </method>
  30976. <method name="contains"
  30977. c:identifier="g_variant_dict_contains"
  30978. version="2.40">
  30979. <doc xml:space="preserve">Checks if @key exists in @dict.</doc>
  30980. <return-value transfer-ownership="none">
  30981. <doc xml:space="preserve">%TRUE if @key is in @dict</doc>
  30982. <type name="gboolean" c:type="gboolean"/>
  30983. </return-value>
  30984. <parameters>
  30985. <instance-parameter name="dict" transfer-ownership="none">
  30986. <doc xml:space="preserve">a #GVariantDict</doc>
  30987. <type name="VariantDict" c:type="GVariantDict*"/>
  30988. </instance-parameter>
  30989. <parameter name="key" transfer-ownership="none">
  30990. <doc xml:space="preserve">the key to lookup in the dictionary</doc>
  30991. <type name="utf8" c:type="const gchar*"/>
  30992. </parameter>
  30993. </parameters>
  30994. </method>
  30995. <method name="end" c:identifier="g_variant_dict_end" version="2.40">
  30996. <doc xml:space="preserve">Returns the current value of @dict as a #GVariant of type
  30997. %G_VARIANT_TYPE_VARDICT, clearing it in the process.
  30998. It is not permissible to use @dict in any way after this call except
  30999. for reference counting operations (in the case of a heap-allocated
  31000. #GVariantDict) or by reinitialising it with g_variant_dict_init() (in
  31001. the case of stack-allocated).</doc>
  31002. <return-value transfer-ownership="none">
  31003. <doc xml:space="preserve">a new, floating, #GVariant</doc>
  31004. <type name="Variant" c:type="GVariant*"/>
  31005. </return-value>
  31006. <parameters>
  31007. <instance-parameter name="dict" transfer-ownership="none">
  31008. <doc xml:space="preserve">a #GVariantDict</doc>
  31009. <type name="VariantDict" c:type="GVariantDict*"/>
  31010. </instance-parameter>
  31011. </parameters>
  31012. </method>
  31013. <method name="init"
  31014. c:identifier="g_variant_dict_init"
  31015. version="2.40"
  31016. introspectable="0">
  31017. <doc xml:space="preserve">Initialises a #GVariantDict structure.
  31018. If @from_asv is given, it is used to initialise the dictionary.
  31019. This function completely ignores the previous contents of @dict. On
  31020. one hand this means that it is valid to pass in completely
  31021. uninitialised memory. On the other hand, this means that if you are
  31022. initialising over top of an existing #GVariantDict you need to first
  31023. call g_variant_dict_clear() in order to avoid leaking memory.
  31024. You must not call g_variant_dict_ref() or g_variant_dict_unref() on a
  31025. #GVariantDict that was initialised with this function. If you ever
  31026. pass a reference to a #GVariantDict outside of the control of your
  31027. own code then you should assume that the person receiving that
  31028. reference may try to use reference counting; you should use
  31029. g_variant_dict_new() instead of this function.</doc>
  31030. <return-value transfer-ownership="none">
  31031. <type name="none" c:type="void"/>
  31032. </return-value>
  31033. <parameters>
  31034. <instance-parameter name="dict" transfer-ownership="none">
  31035. <doc xml:space="preserve">a #GVariantDict</doc>
  31036. <type name="VariantDict" c:type="GVariantDict*"/>
  31037. </instance-parameter>
  31038. <parameter name="from_asv"
  31039. transfer-ownership="none"
  31040. nullable="1"
  31041. allow-none="1">
  31042. <doc xml:space="preserve">the initial value for @dict</doc>
  31043. <type name="Variant" c:type="GVariant*"/>
  31044. </parameter>
  31045. </parameters>
  31046. </method>
  31047. <method name="insert"
  31048. c:identifier="g_variant_dict_insert"
  31049. version="2.40"
  31050. introspectable="0">
  31051. <doc xml:space="preserve">Inserts a value into a #GVariantDict.
  31052. This call is a convenience wrapper that is exactly equivalent to
  31053. calling g_variant_new() followed by g_variant_dict_insert_value().</doc>
  31054. <return-value transfer-ownership="none">
  31055. <type name="none" c:type="void"/>
  31056. </return-value>
  31057. <parameters>
  31058. <instance-parameter name="dict" transfer-ownership="none">
  31059. <doc xml:space="preserve">a #GVariantDict</doc>
  31060. <type name="VariantDict" c:type="GVariantDict*"/>
  31061. </instance-parameter>
  31062. <parameter name="key" transfer-ownership="none">
  31063. <doc xml:space="preserve">the key to insert a value for</doc>
  31064. <type name="utf8" c:type="const gchar*"/>
  31065. </parameter>
  31066. <parameter name="format_string" transfer-ownership="none">
  31067. <doc xml:space="preserve">a #GVariant varargs format string</doc>
  31068. <type name="utf8" c:type="const gchar*"/>
  31069. </parameter>
  31070. <parameter name="..." transfer-ownership="none">
  31071. <doc xml:space="preserve">arguments, as per @format_string</doc>
  31072. <varargs/>
  31073. </parameter>
  31074. </parameters>
  31075. </method>
  31076. <method name="insert_value"
  31077. c:identifier="g_variant_dict_insert_value"
  31078. version="2.40">
  31079. <doc xml:space="preserve">Inserts (or replaces) a key in a #GVariantDict.
  31080. @value is consumed if it is floating.</doc>
  31081. <return-value transfer-ownership="none">
  31082. <type name="none" c:type="void"/>
  31083. </return-value>
  31084. <parameters>
  31085. <instance-parameter name="dict" transfer-ownership="none">
  31086. <doc xml:space="preserve">a #GVariantDict</doc>
  31087. <type name="VariantDict" c:type="GVariantDict*"/>
  31088. </instance-parameter>
  31089. <parameter name="key" transfer-ownership="none">
  31090. <doc xml:space="preserve">the key to insert a value for</doc>
  31091. <type name="utf8" c:type="const gchar*"/>
  31092. </parameter>
  31093. <parameter name="value" transfer-ownership="none">
  31094. <doc xml:space="preserve">the value to insert</doc>
  31095. <type name="Variant" c:type="GVariant*"/>
  31096. </parameter>
  31097. </parameters>
  31098. </method>
  31099. <method name="lookup"
  31100. c:identifier="g_variant_dict_lookup"
  31101. version="2.40"
  31102. introspectable="0">
  31103. <doc xml:space="preserve">Looks up a value in a #GVariantDict.
  31104. This function is a wrapper around g_variant_dict_lookup_value() and
  31105. g_variant_get(). In the case that %NULL would have been returned,
  31106. this function returns %FALSE. Otherwise, it unpacks the returned
  31107. value and returns %TRUE.
  31108. @format_string determines the C types that are used for unpacking the
  31109. values and also determines if the values are copied or borrowed, see the
  31110. section on [GVariant format strings][gvariant-format-strings-pointers].</doc>
  31111. <return-value transfer-ownership="none">
  31112. <doc xml:space="preserve">%TRUE if a value was unpacked</doc>
  31113. <type name="gboolean" c:type="gboolean"/>
  31114. </return-value>
  31115. <parameters>
  31116. <instance-parameter name="dict" transfer-ownership="none">
  31117. <doc xml:space="preserve">a #GVariantDict</doc>
  31118. <type name="VariantDict" c:type="GVariantDict*"/>
  31119. </instance-parameter>
  31120. <parameter name="key" transfer-ownership="none">
  31121. <doc xml:space="preserve">the key to lookup in the dictionary</doc>
  31122. <type name="utf8" c:type="const gchar*"/>
  31123. </parameter>
  31124. <parameter name="format_string" transfer-ownership="none">
  31125. <doc xml:space="preserve">a GVariant format string</doc>
  31126. <type name="utf8" c:type="const gchar*"/>
  31127. </parameter>
  31128. <parameter name="..." transfer-ownership="none">
  31129. <doc xml:space="preserve">the arguments to unpack the value into</doc>
  31130. <varargs/>
  31131. </parameter>
  31132. </parameters>
  31133. </method>
  31134. <method name="lookup_value"
  31135. c:identifier="g_variant_dict_lookup_value"
  31136. version="2.40">
  31137. <doc xml:space="preserve">Looks up a value in a #GVariantDict.
  31138. If @key is not found in @dictionary, %NULL is returned.
  31139. The @expected_type string specifies what type of value is expected.
  31140. If the value associated with @key has a different type then %NULL is
  31141. returned.
  31142. If the key is found and the value has the correct type, it is
  31143. returned. If @expected_type was specified then any non-%NULL return
  31144. value will have this type.</doc>
  31145. <return-value transfer-ownership="full">
  31146. <doc xml:space="preserve">the value of the dictionary key, or %NULL</doc>
  31147. <type name="Variant" c:type="GVariant*"/>
  31148. </return-value>
  31149. <parameters>
  31150. <instance-parameter name="dict" transfer-ownership="none">
  31151. <doc xml:space="preserve">a #GVariantDict</doc>
  31152. <type name="VariantDict" c:type="GVariantDict*"/>
  31153. </instance-parameter>
  31154. <parameter name="key" transfer-ownership="none">
  31155. <doc xml:space="preserve">the key to lookup in the dictionary</doc>
  31156. <type name="utf8" c:type="const gchar*"/>
  31157. </parameter>
  31158. <parameter name="expected_type"
  31159. transfer-ownership="none"
  31160. nullable="1"
  31161. allow-none="1">
  31162. <doc xml:space="preserve">a #GVariantType, or %NULL</doc>
  31163. <type name="VariantType" c:type="const GVariantType*"/>
  31164. </parameter>
  31165. </parameters>
  31166. </method>
  31167. <method name="ref" c:identifier="g_variant_dict_ref" version="2.40">
  31168. <doc xml:space="preserve">Increases the reference count on @dict.
  31169. Don't call this on stack-allocated #GVariantDict instances or bad
  31170. things will happen.</doc>
  31171. <return-value transfer-ownership="full">
  31172. <doc xml:space="preserve">a new reference to @dict</doc>
  31173. <type name="VariantDict" c:type="GVariantDict*"/>
  31174. </return-value>
  31175. <parameters>
  31176. <instance-parameter name="dict" transfer-ownership="none">
  31177. <doc xml:space="preserve">a heap-allocated #GVariantDict</doc>
  31178. <type name="VariantDict" c:type="GVariantDict*"/>
  31179. </instance-parameter>
  31180. </parameters>
  31181. </method>
  31182. <method name="remove"
  31183. c:identifier="g_variant_dict_remove"
  31184. version="2.40">
  31185. <doc xml:space="preserve">Removes a key and its associated value from a #GVariantDict.</doc>
  31186. <return-value transfer-ownership="none">
  31187. <doc xml:space="preserve">%TRUE if the key was found and removed</doc>
  31188. <type name="gboolean" c:type="gboolean"/>
  31189. </return-value>
  31190. <parameters>
  31191. <instance-parameter name="dict" transfer-ownership="none">
  31192. <doc xml:space="preserve">a #GVariantDict</doc>
  31193. <type name="VariantDict" c:type="GVariantDict*"/>
  31194. </instance-parameter>
  31195. <parameter name="key" transfer-ownership="none">
  31196. <doc xml:space="preserve">the key to remove</doc>
  31197. <type name="utf8" c:type="const gchar*"/>
  31198. </parameter>
  31199. </parameters>
  31200. </method>
  31201. <method name="unref" c:identifier="g_variant_dict_unref" version="2.40">
  31202. <doc xml:space="preserve">Decreases the reference count on @dict.
  31203. In the event that there are no more references, releases all memory
  31204. associated with the #GVariantDict.
  31205. Don't call this on stack-allocated #GVariantDict instances or bad
  31206. things will happen.</doc>
  31207. <return-value transfer-ownership="none">
  31208. <type name="none" c:type="void"/>
  31209. </return-value>
  31210. <parameters>
  31211. <instance-parameter name="dict" transfer-ownership="full">
  31212. <doc xml:space="preserve">a heap-allocated #GVariantDict</doc>
  31213. <type name="VariantDict" c:type="GVariantDict*"/>
  31214. </instance-parameter>
  31215. </parameters>
  31216. </method>
  31217. </record>
  31218. <record name="VariantIter" c:type="GVariantIter" introspectable="0">
  31219. <doc xml:space="preserve">#GVariantIter is an opaque data structure and can only be accessed
  31220. using the following functions.</doc>
  31221. <field name="x" readable="0" private="1">
  31222. <array zero-terminated="0" c:type="gsize" fixed-size="16">
  31223. <type name="gsize" c:type="gsize"/>
  31224. </array>
  31225. </field>
  31226. <method name="copy"
  31227. c:identifier="g_variant_iter_copy"
  31228. version="2.24"
  31229. introspectable="0">
  31230. <doc xml:space="preserve">Creates a new heap-allocated #GVariantIter to iterate over the
  31231. container that was being iterated over by @iter. Iteration begins on
  31232. the new iterator from the current position of the old iterator but
  31233. the two copies are independent past that point.
  31234. Use g_variant_iter_free() to free the return value when you no longer
  31235. need it.
  31236. A reference is taken to the container that @iter is iterating over
  31237. and will be releated only when g_variant_iter_free() is called.</doc>
  31238. <return-value transfer-ownership="full">
  31239. <doc xml:space="preserve">a new heap-allocated #GVariantIter</doc>
  31240. <type name="VariantIter" c:type="GVariantIter*"/>
  31241. </return-value>
  31242. <parameters>
  31243. <instance-parameter name="iter" transfer-ownership="none">
  31244. <doc xml:space="preserve">a #GVariantIter</doc>
  31245. <type name="VariantIter" c:type="GVariantIter*"/>
  31246. </instance-parameter>
  31247. </parameters>
  31248. </method>
  31249. <method name="free" c:identifier="g_variant_iter_free" version="2.24">
  31250. <doc xml:space="preserve">Frees a heap-allocated #GVariantIter. Only call this function on
  31251. iterators that were returned by g_variant_iter_new() or
  31252. g_variant_iter_copy().</doc>
  31253. <return-value transfer-ownership="none">
  31254. <type name="none" c:type="void"/>
  31255. </return-value>
  31256. <parameters>
  31257. <instance-parameter name="iter" transfer-ownership="full">
  31258. <doc xml:space="preserve">a heap-allocated #GVariantIter</doc>
  31259. <type name="VariantIter" c:type="GVariantIter*"/>
  31260. </instance-parameter>
  31261. </parameters>
  31262. </method>
  31263. <method name="init"
  31264. c:identifier="g_variant_iter_init"
  31265. version="2.24"
  31266. introspectable="0">
  31267. <doc xml:space="preserve">Initialises (without allocating) a #GVariantIter. @iter may be
  31268. completely uninitialised prior to this call; its old value is
  31269. ignored.
  31270. The iterator remains valid for as long as @value exists, and need not
  31271. be freed in any way.</doc>
  31272. <return-value transfer-ownership="none">
  31273. <doc xml:space="preserve">the number of items in @value</doc>
  31274. <type name="gsize" c:type="gsize"/>
  31275. </return-value>
  31276. <parameters>
  31277. <instance-parameter name="iter" transfer-ownership="none">
  31278. <doc xml:space="preserve">a pointer to a #GVariantIter</doc>
  31279. <type name="VariantIter" c:type="GVariantIter*"/>
  31280. </instance-parameter>
  31281. <parameter name="value" transfer-ownership="none">
  31282. <doc xml:space="preserve">a container #GVariant</doc>
  31283. <type name="Variant" c:type="GVariant*"/>
  31284. </parameter>
  31285. </parameters>
  31286. </method>
  31287. <method name="loop"
  31288. c:identifier="g_variant_iter_loop"
  31289. version="2.24"
  31290. introspectable="0">
  31291. <doc xml:space="preserve">Gets the next item in the container and unpacks it into the variable
  31292. argument list according to @format_string, returning %TRUE.
  31293. If no more items remain then %FALSE is returned.
  31294. On the first call to this function, the pointers appearing on the
  31295. variable argument list are assumed to point at uninitialised memory.
  31296. On the second and later calls, it is assumed that the same pointers
  31297. will be given and that they will point to the memory as set by the
  31298. previous call to this function. This allows the previous values to
  31299. be freed, as appropriate.
  31300. This function is intended to be used with a while loop as
  31301. demonstrated in the following example. This function can only be
  31302. used when iterating over an array. It is only valid to call this
  31303. function with a string constant for the format string and the same
  31304. string constant must be used each time. Mixing calls to this
  31305. function and g_variant_iter_next() or g_variant_iter_next_value() on
  31306. the same iterator causes undefined behavior.
  31307. If you break out of a such a while loop using g_variant_iter_loop() then
  31308. you must free or unreference all the unpacked values as you would with
  31309. g_variant_get(). Failure to do so will cause a memory leak.
  31310. Here is an example for memory management with g_variant_iter_loop():
  31311. |[&lt;!-- language="C" --&gt;
  31312. // Iterates a dictionary of type 'a{sv}'
  31313. void
  31314. iterate_dictionary (GVariant *dictionary)
  31315. {
  31316. GVariantIter iter;
  31317. GVariant *value;
  31318. gchar *key;
  31319. g_variant_iter_init (&amp;iter, dictionary);
  31320. while (g_variant_iter_loop (&amp;iter, "{sv}", &amp;key, &amp;value))
  31321. {
  31322. g_print ("Item '%s' has type '%s'\n", key,
  31323. g_variant_get_type_string (value));
  31324. // no need to free 'key' and 'value' here
  31325. // unless breaking out of this loop
  31326. }
  31327. }
  31328. ]|
  31329. For most cases you should use g_variant_iter_next().
  31330. This function is really only useful when unpacking into #GVariant or
  31331. #GVariantIter in order to allow you to skip the call to
  31332. g_variant_unref() or g_variant_iter_free().
  31333. For example, if you are only looping over simple integer and string
  31334. types, g_variant_iter_next() is definitely preferred. For string
  31335. types, use the '&amp;' prefix to avoid allocating any memory at all (and
  31336. thereby avoiding the need to free anything as well).
  31337. @format_string determines the C types that are used for unpacking
  31338. the values and also determines if the values are copied or borrowed.
  31339. See the section on
  31340. [GVariant format strings][gvariant-format-strings-pointers].</doc>
  31341. <return-value transfer-ownership="none">
  31342. <doc xml:space="preserve">%TRUE if a value was unpacked, or %FALSE if there was no
  31343. value</doc>
  31344. <type name="gboolean" c:type="gboolean"/>
  31345. </return-value>
  31346. <parameters>
  31347. <instance-parameter name="iter" transfer-ownership="none">
  31348. <doc xml:space="preserve">a #GVariantIter</doc>
  31349. <type name="VariantIter" c:type="GVariantIter*"/>
  31350. </instance-parameter>
  31351. <parameter name="format_string" transfer-ownership="none">
  31352. <doc xml:space="preserve">a GVariant format string</doc>
  31353. <type name="utf8" c:type="const gchar*"/>
  31354. </parameter>
  31355. <parameter name="..." transfer-ownership="none">
  31356. <doc xml:space="preserve">the arguments to unpack the value into</doc>
  31357. <varargs/>
  31358. </parameter>
  31359. </parameters>
  31360. </method>
  31361. <method name="n_children"
  31362. c:identifier="g_variant_iter_n_children"
  31363. version="2.24">
  31364. <doc xml:space="preserve">Queries the number of child items in the container that we are
  31365. iterating over. This is the total number of items -- not the number
  31366. of items remaining.
  31367. This function might be useful for preallocation of arrays.</doc>
  31368. <return-value transfer-ownership="none">
  31369. <doc xml:space="preserve">the number of children in the container</doc>
  31370. <type name="gsize" c:type="gsize"/>
  31371. </return-value>
  31372. <parameters>
  31373. <instance-parameter name="iter" transfer-ownership="none">
  31374. <doc xml:space="preserve">a #GVariantIter</doc>
  31375. <type name="VariantIter" c:type="GVariantIter*"/>
  31376. </instance-parameter>
  31377. </parameters>
  31378. </method>
  31379. <method name="next"
  31380. c:identifier="g_variant_iter_next"
  31381. version="2.24"
  31382. introspectable="0">
  31383. <doc xml:space="preserve">Gets the next item in the container and unpacks it into the variable
  31384. argument list according to @format_string, returning %TRUE.
  31385. If no more items remain then %FALSE is returned.
  31386. All of the pointers given on the variable arguments list of this
  31387. function are assumed to point at uninitialised memory. It is the
  31388. responsibility of the caller to free all of the values returned by
  31389. the unpacking process.
  31390. Here is an example for memory management with g_variant_iter_next():
  31391. |[&lt;!-- language="C" --&gt;
  31392. // Iterates a dictionary of type 'a{sv}'
  31393. void
  31394. iterate_dictionary (GVariant *dictionary)
  31395. {
  31396. GVariantIter iter;
  31397. GVariant *value;
  31398. gchar *key;
  31399. g_variant_iter_init (&amp;iter, dictionary);
  31400. while (g_variant_iter_next (&amp;iter, "{sv}", &amp;key, &amp;value))
  31401. {
  31402. g_print ("Item '%s' has type '%s'\n", key,
  31403. g_variant_get_type_string (value));
  31404. // must free data for ourselves
  31405. g_variant_unref (value);
  31406. g_free (key);
  31407. }
  31408. }
  31409. ]|
  31410. For a solution that is likely to be more convenient to C programmers
  31411. when dealing with loops, see g_variant_iter_loop().
  31412. @format_string determines the C types that are used for unpacking
  31413. the values and also determines if the values are copied or borrowed.
  31414. See the section on
  31415. [GVariant format strings][gvariant-format-strings-pointers].</doc>
  31416. <return-value transfer-ownership="none">
  31417. <doc xml:space="preserve">%TRUE if a value was unpacked, or %FALSE if there as no value</doc>
  31418. <type name="gboolean" c:type="gboolean"/>
  31419. </return-value>
  31420. <parameters>
  31421. <instance-parameter name="iter" transfer-ownership="none">
  31422. <doc xml:space="preserve">a #GVariantIter</doc>
  31423. <type name="VariantIter" c:type="GVariantIter*"/>
  31424. </instance-parameter>
  31425. <parameter name="format_string" transfer-ownership="none">
  31426. <doc xml:space="preserve">a GVariant format string</doc>
  31427. <type name="utf8" c:type="const gchar*"/>
  31428. </parameter>
  31429. <parameter name="..." transfer-ownership="none">
  31430. <doc xml:space="preserve">the arguments to unpack the value into</doc>
  31431. <varargs/>
  31432. </parameter>
  31433. </parameters>
  31434. </method>
  31435. <method name="next_value"
  31436. c:identifier="g_variant_iter_next_value"
  31437. version="2.24">
  31438. <doc xml:space="preserve">Gets the next item in the container. If no more items remain then
  31439. %NULL is returned.
  31440. Use g_variant_unref() to drop your reference on the return value when
  31441. you no longer need it.
  31442. Here is an example for iterating with g_variant_iter_next_value():
  31443. |[&lt;!-- language="C" --&gt;
  31444. // recursively iterate a container
  31445. void
  31446. iterate_container_recursive (GVariant *container)
  31447. {
  31448. GVariantIter iter;
  31449. GVariant *child;
  31450. g_variant_iter_init (&amp;iter, container);
  31451. while ((child = g_variant_iter_next_value (&amp;iter)))
  31452. {
  31453. g_print ("type '%s'\n", g_variant_get_type_string (child));
  31454. if (g_variant_is_container (child))
  31455. iterate_container_recursive (child);
  31456. g_variant_unref (child);
  31457. }
  31458. }
  31459. ]|</doc>
  31460. <return-value transfer-ownership="full" nullable="1">
  31461. <doc xml:space="preserve">a #GVariant, or %NULL</doc>
  31462. <type name="Variant" c:type="GVariant*"/>
  31463. </return-value>
  31464. <parameters>
  31465. <instance-parameter name="iter" transfer-ownership="none">
  31466. <doc xml:space="preserve">a #GVariantIter</doc>
  31467. <type name="VariantIter" c:type="GVariantIter*"/>
  31468. </instance-parameter>
  31469. </parameters>
  31470. </method>
  31471. </record>
  31472. <enumeration name="VariantParseError"
  31473. c:type="GVariantParseError"
  31474. glib:error-domain="g-variant-parse-error-quark">
  31475. <doc xml:space="preserve">Error codes returned by parsing text-format GVariants.</doc>
  31476. <member name="failed"
  31477. value="0"
  31478. c:identifier="G_VARIANT_PARSE_ERROR_FAILED">
  31479. <doc xml:space="preserve">generic error (unused)</doc>
  31480. </member>
  31481. <member name="basic_type_expected"
  31482. value="1"
  31483. c:identifier="G_VARIANT_PARSE_ERROR_BASIC_TYPE_EXPECTED">
  31484. <doc xml:space="preserve">a non-basic #GVariantType was given where a basic type was expected</doc>
  31485. </member>
  31486. <member name="cannot_infer_type"
  31487. value="2"
  31488. c:identifier="G_VARIANT_PARSE_ERROR_CANNOT_INFER_TYPE">
  31489. <doc xml:space="preserve">cannot infer the #GVariantType</doc>
  31490. </member>
  31491. <member name="definite_type_expected"
  31492. value="3"
  31493. c:identifier="G_VARIANT_PARSE_ERROR_DEFINITE_TYPE_EXPECTED">
  31494. <doc xml:space="preserve">an indefinite #GVariantType was given where a definite type was expected</doc>
  31495. </member>
  31496. <member name="input_not_at_end"
  31497. value="4"
  31498. c:identifier="G_VARIANT_PARSE_ERROR_INPUT_NOT_AT_END">
  31499. <doc xml:space="preserve">extra data after parsing finished</doc>
  31500. </member>
  31501. <member name="invalid_character"
  31502. value="5"
  31503. c:identifier="G_VARIANT_PARSE_ERROR_INVALID_CHARACTER">
  31504. <doc xml:space="preserve">invalid character in number or unicode escape</doc>
  31505. </member>
  31506. <member name="invalid_format_string"
  31507. value="6"
  31508. c:identifier="G_VARIANT_PARSE_ERROR_INVALID_FORMAT_STRING">
  31509. <doc xml:space="preserve">not a valid #GVariant format string</doc>
  31510. </member>
  31511. <member name="invalid_object_path"
  31512. value="7"
  31513. c:identifier="G_VARIANT_PARSE_ERROR_INVALID_OBJECT_PATH">
  31514. <doc xml:space="preserve">not a valid object path</doc>
  31515. </member>
  31516. <member name="invalid_signature"
  31517. value="8"
  31518. c:identifier="G_VARIANT_PARSE_ERROR_INVALID_SIGNATURE">
  31519. <doc xml:space="preserve">not a valid type signature</doc>
  31520. </member>
  31521. <member name="invalid_type_string"
  31522. value="9"
  31523. c:identifier="G_VARIANT_PARSE_ERROR_INVALID_TYPE_STRING">
  31524. <doc xml:space="preserve">not a valid #GVariant type string</doc>
  31525. </member>
  31526. <member name="no_common_type"
  31527. value="10"
  31528. c:identifier="G_VARIANT_PARSE_ERROR_NO_COMMON_TYPE">
  31529. <doc xml:space="preserve">could not find a common type for array entries</doc>
  31530. </member>
  31531. <member name="number_out_of_range"
  31532. value="11"
  31533. c:identifier="G_VARIANT_PARSE_ERROR_NUMBER_OUT_OF_RANGE">
  31534. <doc xml:space="preserve">the numerical value is out of range of the given type</doc>
  31535. </member>
  31536. <member name="number_too_big"
  31537. value="12"
  31538. c:identifier="G_VARIANT_PARSE_ERROR_NUMBER_TOO_BIG">
  31539. <doc xml:space="preserve">the numerical value is out of range for any type</doc>
  31540. </member>
  31541. <member name="type_error"
  31542. value="13"
  31543. c:identifier="G_VARIANT_PARSE_ERROR_TYPE_ERROR">
  31544. <doc xml:space="preserve">cannot parse as variant of the specified type</doc>
  31545. </member>
  31546. <member name="unexpected_token"
  31547. value="14"
  31548. c:identifier="G_VARIANT_PARSE_ERROR_UNEXPECTED_TOKEN">
  31549. <doc xml:space="preserve">an unexpected token was encountered</doc>
  31550. </member>
  31551. <member name="unknown_keyword"
  31552. value="15"
  31553. c:identifier="G_VARIANT_PARSE_ERROR_UNKNOWN_KEYWORD">
  31554. <doc xml:space="preserve">an unknown keyword was encountered</doc>
  31555. </member>
  31556. <member name="unterminated_string_constant"
  31557. value="16"
  31558. c:identifier="G_VARIANT_PARSE_ERROR_UNTERMINATED_STRING_CONSTANT">
  31559. <doc xml:space="preserve">unterminated string constant</doc>
  31560. </member>
  31561. <member name="value_expected"
  31562. value="17"
  31563. c:identifier="G_VARIANT_PARSE_ERROR_VALUE_EXPECTED">
  31564. <doc xml:space="preserve">no value given</doc>
  31565. </member>
  31566. </enumeration>
  31567. <record name="VariantType"
  31568. c:type="GVariantType"
  31569. glib:type-name="GVariantType"
  31570. glib:get-type="g_variant_type_get_gtype"
  31571. c:symbol-prefix="variant_type">
  31572. <doc xml:space="preserve">This section introduces the GVariant type system. It is based, in
  31573. large part, on the D-Bus type system, with two major changes and
  31574. some minor lifting of restrictions. The
  31575. [D-Bus specification](http://dbus.freedesktop.org/doc/dbus-specification.html),
  31576. therefore, provides a significant amount of
  31577. information that is useful when working with GVariant.
  31578. The first major change with respect to the D-Bus type system is the
  31579. introduction of maybe (or "nullable") types. Any type in GVariant can be
  31580. converted to a maybe type, in which case, "nothing" (or "null") becomes a
  31581. valid value. Maybe types have been added by introducing the
  31582. character "m" to type strings.
  31583. The second major change is that the GVariant type system supports the
  31584. concept of "indefinite types" -- types that are less specific than
  31585. the normal types found in D-Bus. For example, it is possible to speak
  31586. of "an array of any type" in GVariant, where the D-Bus type system
  31587. would require you to speak of "an array of integers" or "an array of
  31588. strings". Indefinite types have been added by introducing the
  31589. characters "*", "?" and "r" to type strings.
  31590. Finally, all arbitrary restrictions relating to the complexity of
  31591. types are lifted along with the restriction that dictionary entries
  31592. may only appear nested inside of arrays.
  31593. Just as in D-Bus, GVariant types are described with strings ("type
  31594. strings"). Subject to the differences mentioned above, these strings
  31595. are of the same form as those found in DBus. Note, however: D-Bus
  31596. always works in terms of messages and therefore individual type
  31597. strings appear nowhere in its interface. Instead, "signatures"
  31598. are a concatenation of the strings of the type of each argument in a
  31599. message. GVariant deals with single values directly so GVariant type
  31600. strings always describe the type of exactly one value. This means
  31601. that a D-Bus signature string is generally not a valid GVariant type
  31602. string -- except in the case that it is the signature of a message
  31603. containing exactly one argument.
  31604. An indefinite type is similar in spirit to what may be called an
  31605. abstract type in other type systems. No value can exist that has an
  31606. indefinite type as its type, but values can exist that have types
  31607. that are subtypes of indefinite types. That is to say,
  31608. g_variant_get_type() will never return an indefinite type, but
  31609. calling g_variant_is_of_type() with an indefinite type may return
  31610. %TRUE. For example, you cannot have a value that represents "an
  31611. array of no particular type", but you can have an "array of integers"
  31612. which certainly matches the type of "an array of no particular type",
  31613. since "array of integers" is a subtype of "array of no particular
  31614. type".
  31615. This is similar to how instances of abstract classes may not
  31616. directly exist in other type systems, but instances of their
  31617. non-abstract subtypes may. For example, in GTK, no object that has
  31618. the type of #GtkBin can exist (since #GtkBin is an abstract class),
  31619. but a #GtkWindow can certainly be instantiated, and you would say
  31620. that the #GtkWindow is a #GtkBin (since #GtkWindow is a subclass of
  31621. #GtkBin).
  31622. ## GVariant Type Strings
  31623. A GVariant type string can be any of the following:
  31624. - any basic type string (listed below)
  31625. - "v", "r" or "*"
  31626. - one of the characters 'a' or 'm', followed by another type string
  31627. - the character '(', followed by a concatenation of zero or more other
  31628. type strings, followed by the character ')'
  31629. - the character '{', followed by a basic type string (see below),
  31630. followed by another type string, followed by the character '}'
  31631. A basic type string describes a basic type (as per
  31632. g_variant_type_is_basic()) and is always a single character in length.
  31633. The valid basic type strings are "b", "y", "n", "q", "i", "u", "x", "t",
  31634. "h", "d", "s", "o", "g" and "?".
  31635. The above definition is recursive to arbitrary depth. "aaaaai" and
  31636. "(ui(nq((y)))s)" are both valid type strings, as is
  31637. "a(aa(ui)(qna{ya(yd)}))".
  31638. The meaning of each of the characters is as follows:
  31639. - `b`: the type string of %G_VARIANT_TYPE_BOOLEAN; a boolean value.
  31640. - `y`: the type string of %G_VARIANT_TYPE_BYTE; a byte.
  31641. - `n`: the type string of %G_VARIANT_TYPE_INT16; a signed 16 bit integer.
  31642. - `q`: the type string of %G_VARIANT_TYPE_UINT16; an unsigned 16 bit integer.
  31643. - `i`: the type string of %G_VARIANT_TYPE_INT32; a signed 32 bit integer.
  31644. - `u`: the type string of %G_VARIANT_TYPE_UINT32; an unsigned 32 bit integer.
  31645. - `x`: the type string of %G_VARIANT_TYPE_INT64; a signed 64 bit integer.
  31646. - `t`: the type string of %G_VARIANT_TYPE_UINT64; an unsigned 64 bit integer.
  31647. - `h`: the type string of %G_VARIANT_TYPE_HANDLE; a signed 32 bit value
  31648. that, by convention, is used as an index into an array of file
  31649. descriptors that are sent alongside a D-Bus message.
  31650. - `d`: the type string of %G_VARIANT_TYPE_DOUBLE; a double precision
  31651. floating point value.
  31652. - `s`: the type string of %G_VARIANT_TYPE_STRING; a string.
  31653. - `o`: the type string of %G_VARIANT_TYPE_OBJECT_PATH; a string in the form
  31654. of a D-Bus object path.
  31655. - `g`: the type string of %G_VARIANT_TYPE_STRING; a string in the form of
  31656. a D-Bus type signature.
  31657. - `?`: the type string of %G_VARIANT_TYPE_BASIC; an indefinite type that
  31658. is a supertype of any of the basic types.
  31659. - `v`: the type string of %G_VARIANT_TYPE_VARIANT; a container type that
  31660. contain any other type of value.
  31661. - `a`: used as a prefix on another type string to mean an array of that
  31662. type; the type string "ai", for example, is the type of an array of
  31663. signed 32-bit integers.
  31664. - `m`: used as a prefix on another type string to mean a "maybe", or
  31665. "nullable", version of that type; the type string "ms", for example,
  31666. is the type of a value that maybe contains a string, or maybe contains
  31667. nothing.
  31668. - `()`: used to enclose zero or more other concatenated type strings to
  31669. create a tuple type; the type string "(is)", for example, is the type of
  31670. a pair of an integer and a string.
  31671. - `r`: the type string of %G_VARIANT_TYPE_TUPLE; an indefinite type that is
  31672. a supertype of any tuple type, regardless of the number of items.
  31673. - `{}`: used to enclose a basic type string concatenated with another type
  31674. string to create a dictionary entry type, which usually appears inside of
  31675. an array to form a dictionary; the type string "a{sd}", for example, is
  31676. the type of a dictionary that maps strings to double precision floating
  31677. point values.
  31678. The first type (the basic type) is the key type and the second type is
  31679. the value type. The reason that the first type is restricted to being a
  31680. basic type is so that it can easily be hashed.
  31681. - `*`: the type string of %G_VARIANT_TYPE_ANY; the indefinite type that is
  31682. a supertype of all types. Note that, as with all type strings, this
  31683. character represents exactly one type. It cannot be used inside of tuples
  31684. to mean "any number of items".
  31685. Any type string of a container that contains an indefinite type is,
  31686. itself, an indefinite type. For example, the type string "a*"
  31687. (corresponding to %G_VARIANT_TYPE_ARRAY) is an indefinite type
  31688. that is a supertype of every array type. "(*s)" is a supertype
  31689. of all tuples that contain exactly two items where the second
  31690. item is a string.
  31691. "a{?*}" is an indefinite type that is a supertype of all arrays
  31692. containing dictionary entries where the key is any basic type and
  31693. the value is any type at all. This is, by definition, a dictionary,
  31694. so this type string corresponds to %G_VARIANT_TYPE_DICTIONARY. Note
  31695. that, due to the restriction that the key of a dictionary entry must
  31696. be a basic type, "{**}" is not a valid type string.</doc>
  31697. <constructor name="new" c:identifier="g_variant_type_new" version="2.24">
  31698. <doc xml:space="preserve">Creates a new #GVariantType corresponding to the type string given
  31699. by @type_string. It is appropriate to call g_variant_type_free() on
  31700. the return value.
  31701. It is a programmer error to call this function with an invalid type
  31702. string. Use g_variant_type_string_is_valid() if you are unsure.</doc>
  31703. <return-value transfer-ownership="full">
  31704. <doc xml:space="preserve">a new #GVariantType</doc>
  31705. <type name="VariantType" c:type="GVariantType*"/>
  31706. </return-value>
  31707. <parameters>
  31708. <parameter name="type_string" transfer-ownership="none">
  31709. <doc xml:space="preserve">a valid GVariant type string</doc>
  31710. <type name="utf8" c:type="const gchar*"/>
  31711. </parameter>
  31712. </parameters>
  31713. </constructor>
  31714. <constructor name="new_array" c:identifier="g_variant_type_new_array">
  31715. <doc xml:space="preserve">Constructs the type corresponding to an array of elements of the
  31716. type @type.
  31717. It is appropriate to call g_variant_type_free() on the return value.</doc>
  31718. <return-value transfer-ownership="full">
  31719. <doc xml:space="preserve">a new array #GVariantType
  31720. Since 2.24</doc>
  31721. <type name="VariantType" c:type="GVariantType*"/>
  31722. </return-value>
  31723. <parameters>
  31724. <parameter name="element" transfer-ownership="none">
  31725. <doc xml:space="preserve">a #GVariantType</doc>
  31726. <type name="VariantType" c:type="const GVariantType*"/>
  31727. </parameter>
  31728. </parameters>
  31729. </constructor>
  31730. <constructor name="new_dict_entry"
  31731. c:identifier="g_variant_type_new_dict_entry">
  31732. <doc xml:space="preserve">Constructs the type corresponding to a dictionary entry with a key
  31733. of type @key and a value of type @value.
  31734. It is appropriate to call g_variant_type_free() on the return value.</doc>
  31735. <return-value transfer-ownership="full">
  31736. <doc xml:space="preserve">a new dictionary entry #GVariantType
  31737. Since 2.24</doc>
  31738. <type name="VariantType" c:type="GVariantType*"/>
  31739. </return-value>
  31740. <parameters>
  31741. <parameter name="key" transfer-ownership="none">
  31742. <doc xml:space="preserve">a basic #GVariantType</doc>
  31743. <type name="VariantType" c:type="const GVariantType*"/>
  31744. </parameter>
  31745. <parameter name="value" transfer-ownership="none">
  31746. <doc xml:space="preserve">a #GVariantType</doc>
  31747. <type name="VariantType" c:type="const GVariantType*"/>
  31748. </parameter>
  31749. </parameters>
  31750. </constructor>
  31751. <constructor name="new_maybe" c:identifier="g_variant_type_new_maybe">
  31752. <doc xml:space="preserve">Constructs the type corresponding to a maybe instance containing
  31753. type @type or Nothing.
  31754. It is appropriate to call g_variant_type_free() on the return value.</doc>
  31755. <return-value transfer-ownership="full">
  31756. <doc xml:space="preserve">a new maybe #GVariantType
  31757. Since 2.24</doc>
  31758. <type name="VariantType" c:type="GVariantType*"/>
  31759. </return-value>
  31760. <parameters>
  31761. <parameter name="element" transfer-ownership="none">
  31762. <doc xml:space="preserve">a #GVariantType</doc>
  31763. <type name="VariantType" c:type="const GVariantType*"/>
  31764. </parameter>
  31765. </parameters>
  31766. </constructor>
  31767. <constructor name="new_tuple" c:identifier="g_variant_type_new_tuple">
  31768. <doc xml:space="preserve">Constructs a new tuple type, from @items.
  31769. @length is the number of items in @items, or -1 to indicate that
  31770. @items is %NULL-terminated.
  31771. It is appropriate to call g_variant_type_free() on the return value.</doc>
  31772. <return-value transfer-ownership="full">
  31773. <doc xml:space="preserve">a new tuple #GVariantType
  31774. Since 2.24</doc>
  31775. <type name="VariantType" c:type="GVariantType*"/>
  31776. </return-value>
  31777. <parameters>
  31778. <parameter name="items" transfer-ownership="none">
  31779. <doc xml:space="preserve">an array of #GVariantTypes, one for each item</doc>
  31780. <array length="1" zero-terminated="0" c:type="GVariantType**">
  31781. <type name="VariantType" c:type="GVariantType*"/>
  31782. </array>
  31783. </parameter>
  31784. <parameter name="length" transfer-ownership="none">
  31785. <doc xml:space="preserve">the length of @items, or -1</doc>
  31786. <type name="gint" c:type="gint"/>
  31787. </parameter>
  31788. </parameters>
  31789. </constructor>
  31790. <method name="copy" c:identifier="g_variant_type_copy">
  31791. <doc xml:space="preserve">Makes a copy of a #GVariantType. It is appropriate to call
  31792. g_variant_type_free() on the return value. @type may not be %NULL.</doc>
  31793. <return-value transfer-ownership="full">
  31794. <doc xml:space="preserve">a new #GVariantType
  31795. Since 2.24</doc>
  31796. <type name="VariantType" c:type="GVariantType*"/>
  31797. </return-value>
  31798. <parameters>
  31799. <instance-parameter name="type" transfer-ownership="none">
  31800. <doc xml:space="preserve">a #GVariantType</doc>
  31801. <type name="VariantType" c:type="const GVariantType*"/>
  31802. </instance-parameter>
  31803. </parameters>
  31804. </method>
  31805. <method name="dup_string" c:identifier="g_variant_type_dup_string">
  31806. <doc xml:space="preserve">Returns a newly-allocated copy of the type string corresponding to
  31807. @type. The returned string is nul-terminated. It is appropriate to
  31808. call g_free() on the return value.</doc>
  31809. <return-value transfer-ownership="full">
  31810. <doc xml:space="preserve">the corresponding type string
  31811. Since 2.24</doc>
  31812. <type name="utf8" c:type="gchar*"/>
  31813. </return-value>
  31814. <parameters>
  31815. <instance-parameter name="type" transfer-ownership="none">
  31816. <doc xml:space="preserve">a #GVariantType</doc>
  31817. <type name="VariantType" c:type="const GVariantType*"/>
  31818. </instance-parameter>
  31819. </parameters>
  31820. </method>
  31821. <method name="element" c:identifier="g_variant_type_element">
  31822. <doc xml:space="preserve">Determines the element type of an array or maybe type.
  31823. This function may only be used with array or maybe types.</doc>
  31824. <return-value transfer-ownership="none">
  31825. <doc xml:space="preserve">the element type of @type
  31826. Since 2.24</doc>
  31827. <type name="VariantType" c:type="const GVariantType*"/>
  31828. </return-value>
  31829. <parameters>
  31830. <instance-parameter name="type" transfer-ownership="none">
  31831. <doc xml:space="preserve">an array or maybe #GVariantType</doc>
  31832. <type name="VariantType" c:type="const GVariantType*"/>
  31833. </instance-parameter>
  31834. </parameters>
  31835. </method>
  31836. <method name="equal" c:identifier="g_variant_type_equal">
  31837. <doc xml:space="preserve">Compares @type1 and @type2 for equality.
  31838. Only returns %TRUE if the types are exactly equal. Even if one type
  31839. is an indefinite type and the other is a subtype of it, %FALSE will
  31840. be returned if they are not exactly equal. If you want to check for
  31841. subtypes, use g_variant_type_is_subtype_of().
  31842. The argument types of @type1 and @type2 are only #gconstpointer to
  31843. allow use with #GHashTable without function pointer casting. For
  31844. both arguments, a valid #GVariantType must be provided.</doc>
  31845. <return-value transfer-ownership="none">
  31846. <doc xml:space="preserve">%TRUE if @type1 and @type2 are exactly equal
  31847. Since 2.24</doc>
  31848. <type name="gboolean" c:type="gboolean"/>
  31849. </return-value>
  31850. <parameters>
  31851. <instance-parameter name="type1" transfer-ownership="none">
  31852. <doc xml:space="preserve">a #GVariantType</doc>
  31853. <type name="VariantType" c:type="gconstpointer"/>
  31854. </instance-parameter>
  31855. <parameter name="type2" transfer-ownership="none">
  31856. <doc xml:space="preserve">a #GVariantType</doc>
  31857. <type name="VariantType" c:type="gconstpointer"/>
  31858. </parameter>
  31859. </parameters>
  31860. </method>
  31861. <method name="first" c:identifier="g_variant_type_first">
  31862. <doc xml:space="preserve">Determines the first item type of a tuple or dictionary entry
  31863. type.
  31864. This function may only be used with tuple or dictionary entry types,
  31865. but must not be used with the generic tuple type
  31866. %G_VARIANT_TYPE_TUPLE.
  31867. In the case of a dictionary entry type, this returns the type of
  31868. the key.
  31869. %NULL is returned in case of @type being %G_VARIANT_TYPE_UNIT.
  31870. This call, together with g_variant_type_next() provides an iterator
  31871. interface over tuple and dictionary entry types.</doc>
  31872. <return-value transfer-ownership="none">
  31873. <doc xml:space="preserve">the first item type of @type, or %NULL
  31874. Since 2.24</doc>
  31875. <type name="VariantType" c:type="const GVariantType*"/>
  31876. </return-value>
  31877. <parameters>
  31878. <instance-parameter name="type" transfer-ownership="none">
  31879. <doc xml:space="preserve">a tuple or dictionary entry #GVariantType</doc>
  31880. <type name="VariantType" c:type="const GVariantType*"/>
  31881. </instance-parameter>
  31882. </parameters>
  31883. </method>
  31884. <method name="free" c:identifier="g_variant_type_free">
  31885. <doc xml:space="preserve">Frees a #GVariantType that was allocated with
  31886. g_variant_type_copy(), g_variant_type_new() or one of the container
  31887. type constructor functions.
  31888. In the case that @type is %NULL, this function does nothing.
  31889. Since 2.24</doc>
  31890. <return-value transfer-ownership="none">
  31891. <type name="none" c:type="void"/>
  31892. </return-value>
  31893. <parameters>
  31894. <instance-parameter name="type"
  31895. transfer-ownership="none"
  31896. nullable="1"
  31897. allow-none="1">
  31898. <doc xml:space="preserve">a #GVariantType, or %NULL</doc>
  31899. <type name="VariantType" c:type="GVariantType*"/>
  31900. </instance-parameter>
  31901. </parameters>
  31902. </method>
  31903. <method name="get_string_length"
  31904. c:identifier="g_variant_type_get_string_length">
  31905. <doc xml:space="preserve">Returns the length of the type string corresponding to the given
  31906. @type. This function must be used to determine the valid extent of
  31907. the memory region returned by g_variant_type_peek_string().</doc>
  31908. <return-value transfer-ownership="none">
  31909. <doc xml:space="preserve">the length of the corresponding type string
  31910. Since 2.24</doc>
  31911. <type name="gsize" c:type="gsize"/>
  31912. </return-value>
  31913. <parameters>
  31914. <instance-parameter name="type" transfer-ownership="none">
  31915. <doc xml:space="preserve">a #GVariantType</doc>
  31916. <type name="VariantType" c:type="const GVariantType*"/>
  31917. </instance-parameter>
  31918. </parameters>
  31919. </method>
  31920. <method name="hash" c:identifier="g_variant_type_hash">
  31921. <doc xml:space="preserve">Hashes @type.
  31922. The argument type of @type is only #gconstpointer to allow use with
  31923. #GHashTable without function pointer casting. A valid
  31924. #GVariantType must be provided.</doc>
  31925. <return-value transfer-ownership="none">
  31926. <doc xml:space="preserve">the hash value
  31927. Since 2.24</doc>
  31928. <type name="guint" c:type="guint"/>
  31929. </return-value>
  31930. <parameters>
  31931. <instance-parameter name="type" transfer-ownership="none">
  31932. <doc xml:space="preserve">a #GVariantType</doc>
  31933. <type name="VariantType" c:type="gconstpointer"/>
  31934. </instance-parameter>
  31935. </parameters>
  31936. </method>
  31937. <method name="is_array" c:identifier="g_variant_type_is_array">
  31938. <doc xml:space="preserve">Determines if the given @type is an array type. This is true if the
  31939. type string for @type starts with an 'a'.
  31940. This function returns %TRUE for any indefinite type for which every
  31941. definite subtype is an array type -- %G_VARIANT_TYPE_ARRAY, for
  31942. example.</doc>
  31943. <return-value transfer-ownership="none">
  31944. <doc xml:space="preserve">%TRUE if @type is an array type
  31945. Since 2.24</doc>
  31946. <type name="gboolean" c:type="gboolean"/>
  31947. </return-value>
  31948. <parameters>
  31949. <instance-parameter name="type" transfer-ownership="none">
  31950. <doc xml:space="preserve">a #GVariantType</doc>
  31951. <type name="VariantType" c:type="const GVariantType*"/>
  31952. </instance-parameter>
  31953. </parameters>
  31954. </method>
  31955. <method name="is_basic" c:identifier="g_variant_type_is_basic">
  31956. <doc xml:space="preserve">Determines if the given @type is a basic type.
  31957. Basic types are booleans, bytes, integers, doubles, strings, object
  31958. paths and signatures.
  31959. Only a basic type may be used as the key of a dictionary entry.
  31960. This function returns %FALSE for all indefinite types except
  31961. %G_VARIANT_TYPE_BASIC.</doc>
  31962. <return-value transfer-ownership="none">
  31963. <doc xml:space="preserve">%TRUE if @type is a basic type
  31964. Since 2.24</doc>
  31965. <type name="gboolean" c:type="gboolean"/>
  31966. </return-value>
  31967. <parameters>
  31968. <instance-parameter name="type" transfer-ownership="none">
  31969. <doc xml:space="preserve">a #GVariantType</doc>
  31970. <type name="VariantType" c:type="const GVariantType*"/>
  31971. </instance-parameter>
  31972. </parameters>
  31973. </method>
  31974. <method name="is_container" c:identifier="g_variant_type_is_container">
  31975. <doc xml:space="preserve">Determines if the given @type is a container type.
  31976. Container types are any array, maybe, tuple, or dictionary
  31977. entry types plus the variant type.
  31978. This function returns %TRUE for any indefinite type for which every
  31979. definite subtype is a container -- %G_VARIANT_TYPE_ARRAY, for
  31980. example.</doc>
  31981. <return-value transfer-ownership="none">
  31982. <doc xml:space="preserve">%TRUE if @type is a container type
  31983. Since 2.24</doc>
  31984. <type name="gboolean" c:type="gboolean"/>
  31985. </return-value>
  31986. <parameters>
  31987. <instance-parameter name="type" transfer-ownership="none">
  31988. <doc xml:space="preserve">a #GVariantType</doc>
  31989. <type name="VariantType" c:type="const GVariantType*"/>
  31990. </instance-parameter>
  31991. </parameters>
  31992. </method>
  31993. <method name="is_definite" c:identifier="g_variant_type_is_definite">
  31994. <doc xml:space="preserve">Determines if the given @type is definite (ie: not indefinite).
  31995. A type is definite if its type string does not contain any indefinite
  31996. type characters ('*', '?', or 'r').
  31997. A #GVariant instance may not have an indefinite type, so calling
  31998. this function on the result of g_variant_get_type() will always
  31999. result in %TRUE being returned. Calling this function on an
  32000. indefinite type like %G_VARIANT_TYPE_ARRAY, however, will result in
  32001. %FALSE being returned.</doc>
  32002. <return-value transfer-ownership="none">
  32003. <doc xml:space="preserve">%TRUE if @type is definite
  32004. Since 2.24</doc>
  32005. <type name="gboolean" c:type="gboolean"/>
  32006. </return-value>
  32007. <parameters>
  32008. <instance-parameter name="type" transfer-ownership="none">
  32009. <doc xml:space="preserve">a #GVariantType</doc>
  32010. <type name="VariantType" c:type="const GVariantType*"/>
  32011. </instance-parameter>
  32012. </parameters>
  32013. </method>
  32014. <method name="is_dict_entry" c:identifier="g_variant_type_is_dict_entry">
  32015. <doc xml:space="preserve">Determines if the given @type is a dictionary entry type. This is
  32016. true if the type string for @type starts with a '{'.
  32017. This function returns %TRUE for any indefinite type for which every
  32018. definite subtype is a dictionary entry type --
  32019. %G_VARIANT_TYPE_DICT_ENTRY, for example.</doc>
  32020. <return-value transfer-ownership="none">
  32021. <doc xml:space="preserve">%TRUE if @type is a dictionary entry type
  32022. Since 2.24</doc>
  32023. <type name="gboolean" c:type="gboolean"/>
  32024. </return-value>
  32025. <parameters>
  32026. <instance-parameter name="type" transfer-ownership="none">
  32027. <doc xml:space="preserve">a #GVariantType</doc>
  32028. <type name="VariantType" c:type="const GVariantType*"/>
  32029. </instance-parameter>
  32030. </parameters>
  32031. </method>
  32032. <method name="is_maybe" c:identifier="g_variant_type_is_maybe">
  32033. <doc xml:space="preserve">Determines if the given @type is a maybe type. This is true if the
  32034. type string for @type starts with an 'm'.
  32035. This function returns %TRUE for any indefinite type for which every
  32036. definite subtype is a maybe type -- %G_VARIANT_TYPE_MAYBE, for
  32037. example.</doc>
  32038. <return-value transfer-ownership="none">
  32039. <doc xml:space="preserve">%TRUE if @type is a maybe type
  32040. Since 2.24</doc>
  32041. <type name="gboolean" c:type="gboolean"/>
  32042. </return-value>
  32043. <parameters>
  32044. <instance-parameter name="type" transfer-ownership="none">
  32045. <doc xml:space="preserve">a #GVariantType</doc>
  32046. <type name="VariantType" c:type="const GVariantType*"/>
  32047. </instance-parameter>
  32048. </parameters>
  32049. </method>
  32050. <method name="is_subtype_of" c:identifier="g_variant_type_is_subtype_of">
  32051. <doc xml:space="preserve">Checks if @type is a subtype of @supertype.
  32052. This function returns %TRUE if @type is a subtype of @supertype. All
  32053. types are considered to be subtypes of themselves. Aside from that,
  32054. only indefinite types can have subtypes.</doc>
  32055. <return-value transfer-ownership="none">
  32056. <doc xml:space="preserve">%TRUE if @type is a subtype of @supertype
  32057. Since 2.24</doc>
  32058. <type name="gboolean" c:type="gboolean"/>
  32059. </return-value>
  32060. <parameters>
  32061. <instance-parameter name="type" transfer-ownership="none">
  32062. <doc xml:space="preserve">a #GVariantType</doc>
  32063. <type name="VariantType" c:type="const GVariantType*"/>
  32064. </instance-parameter>
  32065. <parameter name="supertype" transfer-ownership="none">
  32066. <doc xml:space="preserve">a #GVariantType</doc>
  32067. <type name="VariantType" c:type="const GVariantType*"/>
  32068. </parameter>
  32069. </parameters>
  32070. </method>
  32071. <method name="is_tuple" c:identifier="g_variant_type_is_tuple">
  32072. <doc xml:space="preserve">Determines if the given @type is a tuple type. This is true if the
  32073. type string for @type starts with a '(' or if @type is
  32074. %G_VARIANT_TYPE_TUPLE.
  32075. This function returns %TRUE for any indefinite type for which every
  32076. definite subtype is a tuple type -- %G_VARIANT_TYPE_TUPLE, for
  32077. example.</doc>
  32078. <return-value transfer-ownership="none">
  32079. <doc xml:space="preserve">%TRUE if @type is a tuple type
  32080. Since 2.24</doc>
  32081. <type name="gboolean" c:type="gboolean"/>
  32082. </return-value>
  32083. <parameters>
  32084. <instance-parameter name="type" transfer-ownership="none">
  32085. <doc xml:space="preserve">a #GVariantType</doc>
  32086. <type name="VariantType" c:type="const GVariantType*"/>
  32087. </instance-parameter>
  32088. </parameters>
  32089. </method>
  32090. <method name="is_variant" c:identifier="g_variant_type_is_variant">
  32091. <doc xml:space="preserve">Determines if the given @type is the variant type.</doc>
  32092. <return-value transfer-ownership="none">
  32093. <doc xml:space="preserve">%TRUE if @type is the variant type
  32094. Since 2.24</doc>
  32095. <type name="gboolean" c:type="gboolean"/>
  32096. </return-value>
  32097. <parameters>
  32098. <instance-parameter name="type" transfer-ownership="none">
  32099. <doc xml:space="preserve">a #GVariantType</doc>
  32100. <type name="VariantType" c:type="const GVariantType*"/>
  32101. </instance-parameter>
  32102. </parameters>
  32103. </method>
  32104. <method name="key" c:identifier="g_variant_type_key">
  32105. <doc xml:space="preserve">Determines the key type of a dictionary entry type.
  32106. This function may only be used with a dictionary entry type. Other
  32107. than the additional restriction, this call is equivalent to
  32108. g_variant_type_first().</doc>
  32109. <return-value transfer-ownership="none">
  32110. <doc xml:space="preserve">the key type of the dictionary entry
  32111. Since 2.24</doc>
  32112. <type name="VariantType" c:type="const GVariantType*"/>
  32113. </return-value>
  32114. <parameters>
  32115. <instance-parameter name="type" transfer-ownership="none">
  32116. <doc xml:space="preserve">a dictionary entry #GVariantType</doc>
  32117. <type name="VariantType" c:type="const GVariantType*"/>
  32118. </instance-parameter>
  32119. </parameters>
  32120. </method>
  32121. <method name="n_items" c:identifier="g_variant_type_n_items">
  32122. <doc xml:space="preserve">Determines the number of items contained in a tuple or
  32123. dictionary entry type.
  32124. This function may only be used with tuple or dictionary entry types,
  32125. but must not be used with the generic tuple type
  32126. %G_VARIANT_TYPE_TUPLE.
  32127. In the case of a dictionary entry type, this function will always
  32128. return 2.</doc>
  32129. <return-value transfer-ownership="none">
  32130. <doc xml:space="preserve">the number of items in @type
  32131. Since 2.24</doc>
  32132. <type name="gsize" c:type="gsize"/>
  32133. </return-value>
  32134. <parameters>
  32135. <instance-parameter name="type" transfer-ownership="none">
  32136. <doc xml:space="preserve">a tuple or dictionary entry #GVariantType</doc>
  32137. <type name="VariantType" c:type="const GVariantType*"/>
  32138. </instance-parameter>
  32139. </parameters>
  32140. </method>
  32141. <method name="next" c:identifier="g_variant_type_next">
  32142. <doc xml:space="preserve">Determines the next item type of a tuple or dictionary entry
  32143. type.
  32144. @type must be the result of a previous call to
  32145. g_variant_type_first() or g_variant_type_next().
  32146. If called on the key type of a dictionary entry then this call
  32147. returns the value type. If called on the value type of a dictionary
  32148. entry then this call returns %NULL.
  32149. For tuples, %NULL is returned when @type is the last item in a tuple.</doc>
  32150. <return-value transfer-ownership="none">
  32151. <doc xml:space="preserve">the next #GVariantType after @type, or %NULL
  32152. Since 2.24</doc>
  32153. <type name="VariantType" c:type="const GVariantType*"/>
  32154. </return-value>
  32155. <parameters>
  32156. <instance-parameter name="type" transfer-ownership="none">
  32157. <doc xml:space="preserve">a #GVariantType from a previous call</doc>
  32158. <type name="VariantType" c:type="const GVariantType*"/>
  32159. </instance-parameter>
  32160. </parameters>
  32161. </method>
  32162. <method name="peek_string"
  32163. c:identifier="g_variant_type_peek_string"
  32164. introspectable="0">
  32165. <doc xml:space="preserve">Returns the type string corresponding to the given @type. The
  32166. result is not nul-terminated; in order to determine its length you
  32167. must call g_variant_type_get_string_length().
  32168. To get a nul-terminated string, see g_variant_type_dup_string().</doc>
  32169. <return-value transfer-ownership="none">
  32170. <doc xml:space="preserve">the corresponding type string (not nul-terminated)
  32171. Since 2.24</doc>
  32172. <type name="utf8" c:type="const gchar*"/>
  32173. </return-value>
  32174. <parameters>
  32175. <instance-parameter name="type" transfer-ownership="none">
  32176. <doc xml:space="preserve">a #GVariantType</doc>
  32177. <type name="VariantType" c:type="const GVariantType*"/>
  32178. </instance-parameter>
  32179. </parameters>
  32180. </method>
  32181. <method name="value" c:identifier="g_variant_type_value">
  32182. <doc xml:space="preserve">Determines the value type of a dictionary entry type.
  32183. This function may only be used with a dictionary entry type.</doc>
  32184. <return-value transfer-ownership="none">
  32185. <doc xml:space="preserve">the value type of the dictionary entry
  32186. Since 2.24</doc>
  32187. <type name="VariantType" c:type="const GVariantType*"/>
  32188. </return-value>
  32189. <parameters>
  32190. <instance-parameter name="type" transfer-ownership="none">
  32191. <doc xml:space="preserve">a dictionary entry #GVariantType</doc>
  32192. <type name="VariantType" c:type="const GVariantType*"/>
  32193. </instance-parameter>
  32194. </parameters>
  32195. </method>
  32196. <function name="checked_" c:identifier="g_variant_type_checked_">
  32197. <return-value transfer-ownership="none">
  32198. <type name="VariantType" c:type="const GVariantType*"/>
  32199. </return-value>
  32200. <parameters>
  32201. <parameter name="arg0" transfer-ownership="none">
  32202. <type name="utf8" c:type="const gchar*"/>
  32203. </parameter>
  32204. </parameters>
  32205. </function>
  32206. <function name="string_is_valid"
  32207. c:identifier="g_variant_type_string_is_valid">
  32208. <doc xml:space="preserve">Checks if @type_string is a valid GVariant type string. This call is
  32209. equivalent to calling g_variant_type_string_scan() and confirming
  32210. that the following character is a nul terminator.</doc>
  32211. <return-value transfer-ownership="none">
  32212. <doc xml:space="preserve">%TRUE if @type_string is exactly one valid type string
  32213. Since 2.24</doc>
  32214. <type name="gboolean" c:type="gboolean"/>
  32215. </return-value>
  32216. <parameters>
  32217. <parameter name="type_string" transfer-ownership="none">
  32218. <doc xml:space="preserve">a pointer to any string</doc>
  32219. <type name="utf8" c:type="const gchar*"/>
  32220. </parameter>
  32221. </parameters>
  32222. </function>
  32223. <function name="string_scan"
  32224. c:identifier="g_variant_type_string_scan"
  32225. version="2.24">
  32226. <doc xml:space="preserve">Scan for a single complete and valid GVariant type string in @string.
  32227. The memory pointed to by @limit (or bytes beyond it) is never
  32228. accessed.
  32229. If a valid type string is found, @endptr is updated to point to the
  32230. first character past the end of the string that was found and %TRUE
  32231. is returned.
  32232. If there is no valid type string starting at @string, or if the type
  32233. string does not end before @limit then %FALSE is returned.
  32234. For the simple case of checking if a string is a valid type string,
  32235. see g_variant_type_string_is_valid().</doc>
  32236. <return-value transfer-ownership="none">
  32237. <doc xml:space="preserve">%TRUE if a valid type string was found</doc>
  32238. <type name="gboolean" c:type="gboolean"/>
  32239. </return-value>
  32240. <parameters>
  32241. <parameter name="string" transfer-ownership="none">
  32242. <doc xml:space="preserve">a pointer to any string</doc>
  32243. <type name="utf8" c:type="const gchar*"/>
  32244. </parameter>
  32245. <parameter name="limit"
  32246. transfer-ownership="none"
  32247. nullable="1"
  32248. allow-none="1">
  32249. <doc xml:space="preserve">the end of @string, or %NULL</doc>
  32250. <type name="utf8" c:type="const gchar*"/>
  32251. </parameter>
  32252. <parameter name="endptr"
  32253. direction="out"
  32254. caller-allocates="0"
  32255. transfer-ownership="full"
  32256. optional="1"
  32257. allow-none="1">
  32258. <doc xml:space="preserve">location to store the end pointer, or %NULL</doc>
  32259. <type name="utf8" c:type="const gchar**"/>
  32260. </parameter>
  32261. </parameters>
  32262. </function>
  32263. </record>
  32264. <callback name="VoidFunc" c:type="GVoidFunc">
  32265. <doc xml:space="preserve">Declares a type of function which takes no arguments
  32266. and has no return value. It is used to specify the type
  32267. function passed to g_atexit().</doc>
  32268. <return-value transfer-ownership="none">
  32269. <type name="none" c:type="void"/>
  32270. </return-value>
  32271. </callback>
  32272. <constant name="WIN32_MSG_HANDLE"
  32273. value="19981206"
  32274. c:type="G_WIN32_MSG_HANDLE">
  32275. <type name="gint" c:type="gint"/>
  32276. </constant>
  32277. <function name="access" c:identifier="g_access" version="2.8">
  32278. <doc xml:space="preserve">A wrapper for the POSIX access() function. This function is used to
  32279. test a pathname for one or several of read, write or execute
  32280. permissions, or just existence.
  32281. On Windows, the file protection mechanism is not at all POSIX-like,
  32282. and the underlying function in the C library only checks the
  32283. FAT-style READONLY attribute, and does not look at the ACL of a
  32284. file at all. This function is this in practise almost useless on
  32285. Windows. Software that needs to handle file permissions on Windows
  32286. more exactly should use the Win32 API.
  32287. See your C library manual for more details about access().</doc>
  32288. <return-value transfer-ownership="none">
  32289. <doc xml:space="preserve">zero if the pathname refers to an existing file system
  32290. object that has all the tested permissions, or -1 otherwise
  32291. or on error.</doc>
  32292. <type name="gint" c:type="int"/>
  32293. </return-value>
  32294. <parameters>
  32295. <parameter name="filename" transfer-ownership="none">
  32296. <doc xml:space="preserve">a pathname in the GLib file name encoding (UTF-8 on Windows)</doc>
  32297. <type name="utf8" c:type="const gchar*"/>
  32298. </parameter>
  32299. <parameter name="mode" transfer-ownership="none">
  32300. <doc xml:space="preserve">as in access()</doc>
  32301. <type name="gint" c:type="int"/>
  32302. </parameter>
  32303. </parameters>
  32304. </function>
  32305. <function name="ascii_digit_value" c:identifier="g_ascii_digit_value">
  32306. <doc xml:space="preserve">Determines the numeric value of a character as a decimal digit.
  32307. Differs from g_unichar_digit_value() because it takes a char, so
  32308. there's no worry about sign extension if characters are signed.</doc>
  32309. <return-value transfer-ownership="none">
  32310. <doc xml:space="preserve">If @c is a decimal digit (according to g_ascii_isdigit()),
  32311. its numeric value. Otherwise, -1.</doc>
  32312. <type name="gint" c:type="gint"/>
  32313. </return-value>
  32314. <parameters>
  32315. <parameter name="c" transfer-ownership="none">
  32316. <doc xml:space="preserve">an ASCII character</doc>
  32317. <type name="gchar" c:type="gchar"/>
  32318. </parameter>
  32319. </parameters>
  32320. </function>
  32321. <function name="ascii_dtostr" c:identifier="g_ascii_dtostr">
  32322. <doc xml:space="preserve">Converts a #gdouble to a string, using the '.' as
  32323. decimal point.
  32324. This function generates enough precision that converting
  32325. the string back using g_ascii_strtod() gives the same machine-number
  32326. (on machines with IEEE compatible 64bit doubles). It is
  32327. guaranteed that the size of the resulting string will never
  32328. be larger than @G_ASCII_DTOSTR_BUF_SIZE bytes, including the terminating
  32329. nul character, which is always added.</doc>
  32330. <return-value transfer-ownership="full">
  32331. <doc xml:space="preserve">The pointer to the buffer with the converted string.</doc>
  32332. <type name="utf8" c:type="gchar*"/>
  32333. </return-value>
  32334. <parameters>
  32335. <parameter name="buffer" transfer-ownership="none">
  32336. <doc xml:space="preserve">A buffer to place the resulting string in</doc>
  32337. <type name="utf8" c:type="gchar*"/>
  32338. </parameter>
  32339. <parameter name="buf_len" transfer-ownership="none">
  32340. <doc xml:space="preserve">The length of the buffer.</doc>
  32341. <type name="gint" c:type="gint"/>
  32342. </parameter>
  32343. <parameter name="d" transfer-ownership="none">
  32344. <doc xml:space="preserve">The #gdouble to convert</doc>
  32345. <type name="gdouble" c:type="gdouble"/>
  32346. </parameter>
  32347. </parameters>
  32348. </function>
  32349. <function name="ascii_formatd" c:identifier="g_ascii_formatd">
  32350. <doc xml:space="preserve">Converts a #gdouble to a string, using the '.' as
  32351. decimal point. To format the number you pass in
  32352. a printf()-style format string. Allowed conversion
  32353. specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'.
  32354. The returned buffer is guaranteed to be nul-terminated.
  32355. If you just want to want to serialize the value into a
  32356. string, use g_ascii_dtostr().</doc>
  32357. <return-value transfer-ownership="full">
  32358. <doc xml:space="preserve">The pointer to the buffer with the converted string.</doc>
  32359. <type name="utf8" c:type="gchar*"/>
  32360. </return-value>
  32361. <parameters>
  32362. <parameter name="buffer" transfer-ownership="none">
  32363. <doc xml:space="preserve">A buffer to place the resulting string in</doc>
  32364. <type name="utf8" c:type="gchar*"/>
  32365. </parameter>
  32366. <parameter name="buf_len" transfer-ownership="none">
  32367. <doc xml:space="preserve">The length of the buffer.</doc>
  32368. <type name="gint" c:type="gint"/>
  32369. </parameter>
  32370. <parameter name="format" transfer-ownership="none">
  32371. <doc xml:space="preserve">The printf()-style format to use for the
  32372. code to use for converting.</doc>
  32373. <type name="utf8" c:type="const gchar*"/>
  32374. </parameter>
  32375. <parameter name="d" transfer-ownership="none">
  32376. <doc xml:space="preserve">The #gdouble to convert</doc>
  32377. <type name="gdouble" c:type="gdouble"/>
  32378. </parameter>
  32379. </parameters>
  32380. </function>
  32381. <function name="ascii_strcasecmp" c:identifier="g_ascii_strcasecmp">
  32382. <doc xml:space="preserve">Compare two strings, ignoring the case of ASCII characters.
  32383. Unlike the BSD strcasecmp() function, this only recognizes standard
  32384. ASCII letters and ignores the locale, treating all non-ASCII
  32385. bytes as if they are not letters.
  32386. This function should be used only on strings that are known to be
  32387. in encodings where the bytes corresponding to ASCII letters always
  32388. represent themselves. This includes UTF-8 and the ISO-8859-*
  32389. charsets, but not for instance double-byte encodings like the
  32390. Windows Codepage 932, where the trailing bytes of double-byte
  32391. characters include all ASCII letters. If you compare two CP932
  32392. strings using this function, you will get false matches.
  32393. Both @s1 and @s2 must be non-%NULL.</doc>
  32394. <return-value transfer-ownership="none">
  32395. <doc xml:space="preserve">0 if the strings match, a negative value if @s1 &lt; @s2,
  32396. or a positive value if @s1 &gt; @s2.</doc>
  32397. <type name="gint" c:type="gint"/>
  32398. </return-value>
  32399. <parameters>
  32400. <parameter name="s1" transfer-ownership="none">
  32401. <doc xml:space="preserve">string to compare with @s2</doc>
  32402. <type name="utf8" c:type="const gchar*"/>
  32403. </parameter>
  32404. <parameter name="s2" transfer-ownership="none">
  32405. <doc xml:space="preserve">string to compare with @s1</doc>
  32406. <type name="utf8" c:type="const gchar*"/>
  32407. </parameter>
  32408. </parameters>
  32409. </function>
  32410. <function name="ascii_strdown" c:identifier="g_ascii_strdown">
  32411. <doc xml:space="preserve">Converts all upper case ASCII letters to lower case ASCII letters.</doc>
  32412. <return-value transfer-ownership="full">
  32413. <doc xml:space="preserve">a newly-allocated string, with all the upper case
  32414. characters in @str converted to lower case, with semantics that
  32415. exactly match g_ascii_tolower(). (Note that this is unlike the
  32416. old g_strdown(), which modified the string in place.)</doc>
  32417. <type name="utf8" c:type="gchar*"/>
  32418. </return-value>
  32419. <parameters>
  32420. <parameter name="str" transfer-ownership="none">
  32421. <doc xml:space="preserve">a string</doc>
  32422. <type name="utf8" c:type="const gchar*"/>
  32423. </parameter>
  32424. <parameter name="len" transfer-ownership="none">
  32425. <doc xml:space="preserve">length of @str in bytes, or -1 if @str is nul-terminated</doc>
  32426. <type name="gssize" c:type="gssize"/>
  32427. </parameter>
  32428. </parameters>
  32429. </function>
  32430. <function name="ascii_strncasecmp" c:identifier="g_ascii_strncasecmp">
  32431. <doc xml:space="preserve">Compare @s1 and @s2, ignoring the case of ASCII characters and any
  32432. characters after the first @n in each string.
  32433. Unlike the BSD strcasecmp() function, this only recognizes standard
  32434. ASCII letters and ignores the locale, treating all non-ASCII
  32435. characters as if they are not letters.
  32436. The same warning as in g_ascii_strcasecmp() applies: Use this
  32437. function only on strings known to be in encodings where bytes
  32438. corresponding to ASCII letters always represent themselves.</doc>
  32439. <return-value transfer-ownership="none">
  32440. <doc xml:space="preserve">0 if the strings match, a negative value if @s1 &lt; @s2,
  32441. or a positive value if @s1 &gt; @s2.</doc>
  32442. <type name="gint" c:type="gint"/>
  32443. </return-value>
  32444. <parameters>
  32445. <parameter name="s1" transfer-ownership="none">
  32446. <doc xml:space="preserve">string to compare with @s2</doc>
  32447. <type name="utf8" c:type="const gchar*"/>
  32448. </parameter>
  32449. <parameter name="s2" transfer-ownership="none">
  32450. <doc xml:space="preserve">string to compare with @s1</doc>
  32451. <type name="utf8" c:type="const gchar*"/>
  32452. </parameter>
  32453. <parameter name="n" transfer-ownership="none">
  32454. <doc xml:space="preserve">number of characters to compare</doc>
  32455. <type name="gsize" c:type="gsize"/>
  32456. </parameter>
  32457. </parameters>
  32458. </function>
  32459. <function name="ascii_strtod" c:identifier="g_ascii_strtod">
  32460. <doc xml:space="preserve">Converts a string to a #gdouble value.
  32461. This function behaves like the standard strtod() function
  32462. does in the C locale. It does this without actually changing
  32463. the current locale, since that would not be thread-safe.
  32464. A limitation of the implementation is that this function
  32465. will still accept localized versions of infinities and NANs.
  32466. This function is typically used when reading configuration
  32467. files or other non-user input that should be locale independent.
  32468. To handle input from the user you should normally use the
  32469. locale-sensitive system strtod() function.
  32470. To convert from a #gdouble to a string in a locale-insensitive
  32471. way, use g_ascii_dtostr().
  32472. If the correct value would cause overflow, plus or minus %HUGE_VAL
  32473. is returned (according to the sign of the value), and %ERANGE is
  32474. stored in %errno. If the correct value would cause underflow,
  32475. zero is returned and %ERANGE is stored in %errno.
  32476. This function resets %errno before calling strtod() so that
  32477. you can reliably detect overflow and underflow.</doc>
  32478. <return-value transfer-ownership="none">
  32479. <doc xml:space="preserve">the #gdouble value.</doc>
  32480. <type name="gdouble" c:type="gdouble"/>
  32481. </return-value>
  32482. <parameters>
  32483. <parameter name="nptr" transfer-ownership="none">
  32484. <doc xml:space="preserve">the string to convert to a numeric value.</doc>
  32485. <type name="utf8" c:type="const gchar*"/>
  32486. </parameter>
  32487. <parameter name="endptr"
  32488. direction="out"
  32489. caller-allocates="0"
  32490. transfer-ownership="none"
  32491. optional="1"
  32492. allow-none="1">
  32493. <doc xml:space="preserve">if non-%NULL, it returns the
  32494. character after the last character used in the conversion.</doc>
  32495. <type name="utf8" c:type="gchar**"/>
  32496. </parameter>
  32497. </parameters>
  32498. </function>
  32499. <function name="ascii_strtoll"
  32500. c:identifier="g_ascii_strtoll"
  32501. version="2.12">
  32502. <doc xml:space="preserve">Converts a string to a #gint64 value.
  32503. This function behaves like the standard strtoll() function
  32504. does in the C locale. It does this without actually
  32505. changing the current locale, since that would not be
  32506. thread-safe.
  32507. This function is typically used when reading configuration
  32508. files or other non-user input that should be locale independent.
  32509. To handle input from the user you should normally use the
  32510. locale-sensitive system strtoll() function.
  32511. If the correct value would cause overflow, %G_MAXINT64 or %G_MININT64
  32512. is returned, and `ERANGE` is stored in `errno`.
  32513. If the base is outside the valid range, zero is returned, and
  32514. `EINVAL` is stored in `errno`. If the
  32515. string conversion fails, zero is returned, and @endptr returns @nptr
  32516. (if @endptr is non-%NULL).</doc>
  32517. <return-value transfer-ownership="none">
  32518. <doc xml:space="preserve">the #gint64 value or zero on error.</doc>
  32519. <type name="gint64" c:type="gint64"/>
  32520. </return-value>
  32521. <parameters>
  32522. <parameter name="nptr" transfer-ownership="none">
  32523. <doc xml:space="preserve">the string to convert to a numeric value.</doc>
  32524. <type name="utf8" c:type="const gchar*"/>
  32525. </parameter>
  32526. <parameter name="endptr"
  32527. direction="out"
  32528. caller-allocates="0"
  32529. transfer-ownership="none"
  32530. optional="1"
  32531. allow-none="1">
  32532. <doc xml:space="preserve">if non-%NULL, it returns the
  32533. character after the last character used in the conversion.</doc>
  32534. <type name="utf8" c:type="gchar**"/>
  32535. </parameter>
  32536. <parameter name="base" transfer-ownership="none">
  32537. <doc xml:space="preserve">to be used for the conversion, 2..36 or 0</doc>
  32538. <type name="guint" c:type="guint"/>
  32539. </parameter>
  32540. </parameters>
  32541. </function>
  32542. <function name="ascii_strtoull"
  32543. c:identifier="g_ascii_strtoull"
  32544. version="2.2">
  32545. <doc xml:space="preserve">Converts a string to a #guint64 value.
  32546. This function behaves like the standard strtoull() function
  32547. does in the C locale. It does this without actually
  32548. changing the current locale, since that would not be
  32549. thread-safe.
  32550. This function is typically used when reading configuration
  32551. files or other non-user input that should be locale independent.
  32552. To handle input from the user you should normally use the
  32553. locale-sensitive system strtoull() function.
  32554. If the correct value would cause overflow, %G_MAXUINT64
  32555. is returned, and `ERANGE` is stored in `errno`.
  32556. If the base is outside the valid range, zero is returned, and
  32557. `EINVAL` is stored in `errno`.
  32558. If the string conversion fails, zero is returned, and @endptr returns
  32559. @nptr (if @endptr is non-%NULL).</doc>
  32560. <return-value transfer-ownership="none">
  32561. <doc xml:space="preserve">the #guint64 value or zero on error.</doc>
  32562. <type name="guint64" c:type="guint64"/>
  32563. </return-value>
  32564. <parameters>
  32565. <parameter name="nptr" transfer-ownership="none">
  32566. <doc xml:space="preserve">the string to convert to a numeric value.</doc>
  32567. <type name="utf8" c:type="const gchar*"/>
  32568. </parameter>
  32569. <parameter name="endptr"
  32570. direction="out"
  32571. caller-allocates="0"
  32572. transfer-ownership="none"
  32573. optional="1"
  32574. allow-none="1">
  32575. <doc xml:space="preserve">if non-%NULL, it returns the
  32576. character after the last character used in the conversion.</doc>
  32577. <type name="utf8" c:type="gchar**"/>
  32578. </parameter>
  32579. <parameter name="base" transfer-ownership="none">
  32580. <doc xml:space="preserve">to be used for the conversion, 2..36 or 0</doc>
  32581. <type name="guint" c:type="guint"/>
  32582. </parameter>
  32583. </parameters>
  32584. </function>
  32585. <function name="ascii_strup" c:identifier="g_ascii_strup">
  32586. <doc xml:space="preserve">Converts all lower case ASCII letters to upper case ASCII letters.</doc>
  32587. <return-value transfer-ownership="full">
  32588. <doc xml:space="preserve">a newly allocated string, with all the lower case
  32589. characters in @str converted to upper case, with semantics that
  32590. exactly match g_ascii_toupper(). (Note that this is unlike the
  32591. old g_strup(), which modified the string in place.)</doc>
  32592. <type name="utf8" c:type="gchar*"/>
  32593. </return-value>
  32594. <parameters>
  32595. <parameter name="str" transfer-ownership="none">
  32596. <doc xml:space="preserve">a string</doc>
  32597. <type name="utf8" c:type="const gchar*"/>
  32598. </parameter>
  32599. <parameter name="len" transfer-ownership="none">
  32600. <doc xml:space="preserve">length of @str in bytes, or -1 if @str is nul-terminated</doc>
  32601. <type name="gssize" c:type="gssize"/>
  32602. </parameter>
  32603. </parameters>
  32604. </function>
  32605. <function name="ascii_tolower" c:identifier="g_ascii_tolower">
  32606. <doc xml:space="preserve">Convert a character to ASCII lower case.
  32607. Unlike the standard C library tolower() function, this only
  32608. recognizes standard ASCII letters and ignores the locale, returning
  32609. all non-ASCII characters unchanged, even if they are lower case
  32610. letters in a particular character set. Also unlike the standard
  32611. library function, this takes and returns a char, not an int, so
  32612. don't call it on %EOF but no need to worry about casting to #guchar
  32613. before passing a possibly non-ASCII character in.</doc>
  32614. <return-value transfer-ownership="none">
  32615. <doc xml:space="preserve">the result of converting @c to lower case. If @c is
  32616. not an ASCII upper case letter, @c is returned unchanged.</doc>
  32617. <type name="gchar" c:type="gchar"/>
  32618. </return-value>
  32619. <parameters>
  32620. <parameter name="c" transfer-ownership="none">
  32621. <doc xml:space="preserve">any character</doc>
  32622. <type name="gchar" c:type="gchar"/>
  32623. </parameter>
  32624. </parameters>
  32625. </function>
  32626. <function name="ascii_toupper" c:identifier="g_ascii_toupper">
  32627. <doc xml:space="preserve">Convert a character to ASCII upper case.
  32628. Unlike the standard C library toupper() function, this only
  32629. recognizes standard ASCII letters and ignores the locale, returning
  32630. all non-ASCII characters unchanged, even if they are upper case
  32631. letters in a particular character set. Also unlike the standard
  32632. library function, this takes and returns a char, not an int, so
  32633. don't call it on %EOF but no need to worry about casting to #guchar
  32634. before passing a possibly non-ASCII character in.</doc>
  32635. <return-value transfer-ownership="none">
  32636. <doc xml:space="preserve">the result of converting @c to upper case. If @c is not
  32637. an ASCII lower case letter, @c is returned unchanged.</doc>
  32638. <type name="gchar" c:type="gchar"/>
  32639. </return-value>
  32640. <parameters>
  32641. <parameter name="c" transfer-ownership="none">
  32642. <doc xml:space="preserve">any character</doc>
  32643. <type name="gchar" c:type="gchar"/>
  32644. </parameter>
  32645. </parameters>
  32646. </function>
  32647. <function name="ascii_xdigit_value" c:identifier="g_ascii_xdigit_value">
  32648. <doc xml:space="preserve">Determines the numeric value of a character as a hexidecimal
  32649. digit. Differs from g_unichar_xdigit_value() because it takes
  32650. a char, so there's no worry about sign extension if characters
  32651. are signed.</doc>
  32652. <return-value transfer-ownership="none">
  32653. <doc xml:space="preserve">If @c is a hex digit (according to g_ascii_isxdigit()),
  32654. its numeric value. Otherwise, -1.</doc>
  32655. <type name="gint" c:type="gint"/>
  32656. </return-value>
  32657. <parameters>
  32658. <parameter name="c" transfer-ownership="none">
  32659. <doc xml:space="preserve">an ASCII character.</doc>
  32660. <type name="gchar" c:type="gchar"/>
  32661. </parameter>
  32662. </parameters>
  32663. </function>
  32664. <function name="assert_warning" c:identifier="g_assert_warning">
  32665. <return-value transfer-ownership="none">
  32666. <type name="none" c:type="void"/>
  32667. </return-value>
  32668. <parameters>
  32669. <parameter name="log_domain" transfer-ownership="none">
  32670. <type name="utf8" c:type="const char*"/>
  32671. </parameter>
  32672. <parameter name="file" transfer-ownership="none">
  32673. <type name="utf8" c:type="const char*"/>
  32674. </parameter>
  32675. <parameter name="line" transfer-ownership="none">
  32676. <type name="gint" c:type="const int"/>
  32677. </parameter>
  32678. <parameter name="pretty_function" transfer-ownership="none">
  32679. <type name="utf8" c:type="const char*"/>
  32680. </parameter>
  32681. <parameter name="expression" transfer-ownership="none">
  32682. <type name="utf8" c:type="const char*"/>
  32683. </parameter>
  32684. </parameters>
  32685. </function>
  32686. <function name="assertion_message" c:identifier="g_assertion_message">
  32687. <return-value transfer-ownership="none">
  32688. <type name="none" c:type="void"/>
  32689. </return-value>
  32690. <parameters>
  32691. <parameter name="domain" transfer-ownership="none">
  32692. <type name="utf8" c:type="const char*"/>
  32693. </parameter>
  32694. <parameter name="file" transfer-ownership="none">
  32695. <type name="utf8" c:type="const char*"/>
  32696. </parameter>
  32697. <parameter name="line" transfer-ownership="none">
  32698. <type name="gint" c:type="int"/>
  32699. </parameter>
  32700. <parameter name="func" transfer-ownership="none">
  32701. <type name="utf8" c:type="const char*"/>
  32702. </parameter>
  32703. <parameter name="message" transfer-ownership="none">
  32704. <type name="utf8" c:type="const char*"/>
  32705. </parameter>
  32706. </parameters>
  32707. </function>
  32708. <function name="assertion_message_cmpnum"
  32709. c:identifier="g_assertion_message_cmpnum"
  32710. introspectable="0">
  32711. <return-value transfer-ownership="none">
  32712. <type name="none" c:type="void"/>
  32713. </return-value>
  32714. <parameters>
  32715. <parameter name="domain" transfer-ownership="none">
  32716. <type name="utf8" c:type="const char*"/>
  32717. </parameter>
  32718. <parameter name="file" transfer-ownership="none">
  32719. <type name="utf8" c:type="const char*"/>
  32720. </parameter>
  32721. <parameter name="line" transfer-ownership="none">
  32722. <type name="gint" c:type="int"/>
  32723. </parameter>
  32724. <parameter name="func" transfer-ownership="none">
  32725. <type name="utf8" c:type="const char*"/>
  32726. </parameter>
  32727. <parameter name="expr" transfer-ownership="none">
  32728. <type name="utf8" c:type="const char*"/>
  32729. </parameter>
  32730. <parameter name="arg1" transfer-ownership="none">
  32731. <type name="long double" c:type="long double"/>
  32732. </parameter>
  32733. <parameter name="cmp" transfer-ownership="none">
  32734. <type name="utf8" c:type="const char*"/>
  32735. </parameter>
  32736. <parameter name="arg2" transfer-ownership="none">
  32737. <type name="long double" c:type="long double"/>
  32738. </parameter>
  32739. <parameter name="numtype" transfer-ownership="none">
  32740. <type name="gchar" c:type="char"/>
  32741. </parameter>
  32742. </parameters>
  32743. </function>
  32744. <function name="assertion_message_cmpstr"
  32745. c:identifier="g_assertion_message_cmpstr">
  32746. <return-value transfer-ownership="none">
  32747. <type name="none" c:type="void"/>
  32748. </return-value>
  32749. <parameters>
  32750. <parameter name="domain" transfer-ownership="none">
  32751. <type name="utf8" c:type="const char*"/>
  32752. </parameter>
  32753. <parameter name="file" transfer-ownership="none">
  32754. <type name="utf8" c:type="const char*"/>
  32755. </parameter>
  32756. <parameter name="line" transfer-ownership="none">
  32757. <type name="gint" c:type="int"/>
  32758. </parameter>
  32759. <parameter name="func" transfer-ownership="none">
  32760. <type name="utf8" c:type="const char*"/>
  32761. </parameter>
  32762. <parameter name="expr" transfer-ownership="none">
  32763. <type name="utf8" c:type="const char*"/>
  32764. </parameter>
  32765. <parameter name="arg1" transfer-ownership="none">
  32766. <type name="utf8" c:type="const char*"/>
  32767. </parameter>
  32768. <parameter name="cmp" transfer-ownership="none">
  32769. <type name="utf8" c:type="const char*"/>
  32770. </parameter>
  32771. <parameter name="arg2" transfer-ownership="none">
  32772. <type name="utf8" c:type="const char*"/>
  32773. </parameter>
  32774. </parameters>
  32775. </function>
  32776. <function name="assertion_message_error"
  32777. c:identifier="g_assertion_message_error">
  32778. <return-value transfer-ownership="none">
  32779. <type name="none" c:type="void"/>
  32780. </return-value>
  32781. <parameters>
  32782. <parameter name="domain" transfer-ownership="none">
  32783. <type name="utf8" c:type="const char*"/>
  32784. </parameter>
  32785. <parameter name="file" transfer-ownership="none">
  32786. <type name="utf8" c:type="const char*"/>
  32787. </parameter>
  32788. <parameter name="line" transfer-ownership="none">
  32789. <type name="gint" c:type="int"/>
  32790. </parameter>
  32791. <parameter name="func" transfer-ownership="none">
  32792. <type name="utf8" c:type="const char*"/>
  32793. </parameter>
  32794. <parameter name="expr" transfer-ownership="none">
  32795. <type name="utf8" c:type="const char*"/>
  32796. </parameter>
  32797. <parameter name="error" transfer-ownership="none">
  32798. <type name="Error" c:type="const GError*"/>
  32799. </parameter>
  32800. <parameter name="error_domain" transfer-ownership="none">
  32801. <type name="Quark" c:type="GQuark"/>
  32802. </parameter>
  32803. <parameter name="error_code" transfer-ownership="none">
  32804. <type name="gint" c:type="int"/>
  32805. </parameter>
  32806. </parameters>
  32807. </function>
  32808. <function name="assertion_message_expr"
  32809. c:identifier="g_assertion_message_expr"
  32810. introspectable="0">
  32811. <return-value transfer-ownership="none">
  32812. <type name="none" c:type="void"/>
  32813. </return-value>
  32814. <parameters>
  32815. <parameter name="domain"
  32816. transfer-ownership="none"
  32817. nullable="1"
  32818. allow-none="1">
  32819. <type name="utf8" c:type="const char*"/>
  32820. </parameter>
  32821. <parameter name="file" transfer-ownership="none">
  32822. <type name="utf8" c:type="const char*"/>
  32823. </parameter>
  32824. <parameter name="line" transfer-ownership="none">
  32825. <type name="gint" c:type="int"/>
  32826. </parameter>
  32827. <parameter name="func" transfer-ownership="none">
  32828. <type name="utf8" c:type="const char*"/>
  32829. </parameter>
  32830. <parameter name="expr"
  32831. transfer-ownership="none"
  32832. nullable="1"
  32833. allow-none="1">
  32834. <type name="utf8" c:type="const char*"/>
  32835. </parameter>
  32836. </parameters>
  32837. </function>
  32838. <function name="atexit"
  32839. c:identifier="g_atexit"
  32840. deprecated="1"
  32841. deprecated-version="2.32">
  32842. <doc xml:space="preserve">Specifies a function to be called at normal program termination.
  32843. Since GLib 2.8.2, on Windows g_atexit() actually is a preprocessor
  32844. macro that maps to a call to the atexit() function in the C
  32845. library. This means that in case the code that calls g_atexit(),
  32846. i.e. atexit(), is in a DLL, the function will be called when the
  32847. DLL is detached from the program. This typically makes more sense
  32848. than that the function is called when the GLib DLL is detached,
  32849. which happened earlier when g_atexit() was a function in the GLib
  32850. DLL.
  32851. The behaviour of atexit() in the context of dynamically loaded
  32852. modules is not formally specified and varies wildly.
  32853. On POSIX systems, calling g_atexit() (or atexit()) in a dynamically
  32854. loaded module which is unloaded before the program terminates might
  32855. well cause a crash at program exit.
  32856. Some POSIX systems implement atexit() like Windows, and have each
  32857. dynamically loaded module maintain an own atexit chain that is
  32858. called when the module is unloaded.
  32859. On other POSIX systems, before a dynamically loaded module is
  32860. unloaded, the registered atexit functions (if any) residing in that
  32861. module are called, regardless where the code that registered them
  32862. resided. This is presumably the most robust approach.
  32863. As can be seen from the above, for portability it's best to avoid
  32864. calling g_atexit() (or atexit()) except in the main executable of a
  32865. program.</doc>
  32866. <doc-deprecated xml:space="preserve">It is best to avoid g_atexit().</doc-deprecated>
  32867. <return-value transfer-ownership="none">
  32868. <type name="none" c:type="void"/>
  32869. </return-value>
  32870. <parameters>
  32871. <parameter name="func" transfer-ownership="none" scope="async">
  32872. <doc xml:space="preserve">the function to call on normal program termination.</doc>
  32873. <type name="VoidFunc" c:type="GVoidFunc"/>
  32874. </parameter>
  32875. </parameters>
  32876. </function>
  32877. <function name="atomic_int_add"
  32878. c:identifier="g_atomic_int_add"
  32879. version="2.4">
  32880. <doc xml:space="preserve">Atomically adds @val to the value of @atomic.
  32881. Think of this operation as an atomic version of
  32882. `{ tmp = *atomic; *atomic += val; return tmp; }`.
  32883. This call acts as a full compiler and hardware memory barrier.
  32884. Before version 2.30, this function did not return a value
  32885. (but g_atomic_int_exchange_and_add() did, and had the same meaning).</doc>
  32886. <return-value transfer-ownership="none">
  32887. <doc xml:space="preserve">the value of @atomic before the add, signed</doc>
  32888. <type name="gint" c:type="gint"/>
  32889. </return-value>
  32890. <parameters>
  32891. <parameter name="atomic" transfer-ownership="none">
  32892. <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
  32893. <type name="gint" c:type="volatile gint*"/>
  32894. </parameter>
  32895. <parameter name="val" transfer-ownership="none">
  32896. <doc xml:space="preserve">the value to add</doc>
  32897. <type name="gint" c:type="gint"/>
  32898. </parameter>
  32899. </parameters>
  32900. </function>
  32901. <function name="atomic_int_and"
  32902. c:identifier="g_atomic_int_and"
  32903. version="2.30">
  32904. <doc xml:space="preserve">Performs an atomic bitwise 'and' of the value of @atomic and @val,
  32905. storing the result back in @atomic.
  32906. This call acts as a full compiler and hardware memory barrier.
  32907. Think of this operation as an atomic version of
  32908. `{ tmp = *atomic; *atomic &amp;= val; return tmp; }`.</doc>
  32909. <return-value transfer-ownership="none">
  32910. <doc xml:space="preserve">the value of @atomic before the operation, unsigned</doc>
  32911. <type name="guint" c:type="guint"/>
  32912. </return-value>
  32913. <parameters>
  32914. <parameter name="atomic" transfer-ownership="none">
  32915. <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
  32916. <type name="guint" c:type="volatile guint*"/>
  32917. </parameter>
  32918. <parameter name="val" transfer-ownership="none">
  32919. <doc xml:space="preserve">the value to 'and'</doc>
  32920. <type name="guint" c:type="guint"/>
  32921. </parameter>
  32922. </parameters>
  32923. </function>
  32924. <function name="atomic_int_compare_and_exchange"
  32925. c:identifier="g_atomic_int_compare_and_exchange"
  32926. version="2.4">
  32927. <doc xml:space="preserve">Compares @atomic to @oldval and, if equal, sets it to @newval.
  32928. If @atomic was not equal to @oldval then no change occurs.
  32929. This compare and exchange is done atomically.
  32930. Think of this operation as an atomic version of
  32931. `{ if (*atomic == oldval) { *atomic = newval; return TRUE; } else return FALSE; }`.
  32932. This call acts as a full compiler and hardware memory barrier.</doc>
  32933. <return-value transfer-ownership="none">
  32934. <doc xml:space="preserve">%TRUE if the exchange took place</doc>
  32935. <type name="gboolean" c:type="gboolean"/>
  32936. </return-value>
  32937. <parameters>
  32938. <parameter name="atomic" transfer-ownership="none">
  32939. <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
  32940. <type name="gint" c:type="volatile gint*"/>
  32941. </parameter>
  32942. <parameter name="oldval" transfer-ownership="none">
  32943. <doc xml:space="preserve">the value to compare with</doc>
  32944. <type name="gint" c:type="gint"/>
  32945. </parameter>
  32946. <parameter name="newval" transfer-ownership="none">
  32947. <doc xml:space="preserve">the value to conditionally replace with</doc>
  32948. <type name="gint" c:type="gint"/>
  32949. </parameter>
  32950. </parameters>
  32951. </function>
  32952. <function name="atomic_int_dec_and_test"
  32953. c:identifier="g_atomic_int_dec_and_test"
  32954. version="2.4">
  32955. <doc xml:space="preserve">Decrements the value of @atomic by 1.
  32956. Think of this operation as an atomic version of
  32957. `{ *atomic -= 1; return (*atomic == 0); }`.
  32958. This call acts as a full compiler and hardware memory barrier.</doc>
  32959. <return-value transfer-ownership="none">
  32960. <doc xml:space="preserve">%TRUE if the resultant value is zero</doc>
  32961. <type name="gboolean" c:type="gboolean"/>
  32962. </return-value>
  32963. <parameters>
  32964. <parameter name="atomic" transfer-ownership="none">
  32965. <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
  32966. <type name="gint" c:type="volatile gint*"/>
  32967. </parameter>
  32968. </parameters>
  32969. </function>
  32970. <function name="atomic_int_exchange_and_add"
  32971. c:identifier="g_atomic_int_exchange_and_add"
  32972. version="2.4"
  32973. deprecated="1"
  32974. deprecated-version="2.30">
  32975. <doc xml:space="preserve">This function existed before g_atomic_int_add() returned the prior
  32976. value of the integer (which it now does). It is retained only for
  32977. compatibility reasons. Don't use this function in new code.</doc>
  32978. <doc-deprecated xml:space="preserve">Use g_atomic_int_add() instead.</doc-deprecated>
  32979. <return-value transfer-ownership="none">
  32980. <doc xml:space="preserve">the value of @atomic before the add, signed</doc>
  32981. <type name="gint" c:type="gint"/>
  32982. </return-value>
  32983. <parameters>
  32984. <parameter name="atomic" transfer-ownership="none">
  32985. <doc xml:space="preserve">a pointer to a #gint</doc>
  32986. <type name="gint" c:type="volatile gint*"/>
  32987. </parameter>
  32988. <parameter name="val" transfer-ownership="none">
  32989. <doc xml:space="preserve">the value to add</doc>
  32990. <type name="gint" c:type="gint"/>
  32991. </parameter>
  32992. </parameters>
  32993. </function>
  32994. <function name="atomic_int_get"
  32995. c:identifier="g_atomic_int_get"
  32996. version="2.4">
  32997. <doc xml:space="preserve">Gets the current value of @atomic.
  32998. This call acts as a full compiler and hardware
  32999. memory barrier (before the get).</doc>
  33000. <return-value transfer-ownership="none">
  33001. <doc xml:space="preserve">the value of the integer</doc>
  33002. <type name="gint" c:type="gint"/>
  33003. </return-value>
  33004. <parameters>
  33005. <parameter name="atomic" transfer-ownership="none">
  33006. <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
  33007. <type name="gint" c:type="volatile const gint*"/>
  33008. </parameter>
  33009. </parameters>
  33010. </function>
  33011. <function name="atomic_int_inc"
  33012. c:identifier="g_atomic_int_inc"
  33013. version="2.4">
  33014. <doc xml:space="preserve">Increments the value of @atomic by 1.
  33015. Think of this operation as an atomic version of `{ *atomic += 1; }`.
  33016. This call acts as a full compiler and hardware memory barrier.</doc>
  33017. <return-value transfer-ownership="none">
  33018. <type name="none" c:type="void"/>
  33019. </return-value>
  33020. <parameters>
  33021. <parameter name="atomic" transfer-ownership="none">
  33022. <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
  33023. <type name="gint" c:type="volatile gint*"/>
  33024. </parameter>
  33025. </parameters>
  33026. </function>
  33027. <function name="atomic_int_or"
  33028. c:identifier="g_atomic_int_or"
  33029. version="2.30">
  33030. <doc xml:space="preserve">Performs an atomic bitwise 'or' of the value of @atomic and @val,
  33031. storing the result back in @atomic.
  33032. Think of this operation as an atomic version of
  33033. `{ tmp = *atomic; *atomic |= val; return tmp; }`.
  33034. This call acts as a full compiler and hardware memory barrier.</doc>
  33035. <return-value transfer-ownership="none">
  33036. <doc xml:space="preserve">the value of @atomic before the operation, unsigned</doc>
  33037. <type name="guint" c:type="guint"/>
  33038. </return-value>
  33039. <parameters>
  33040. <parameter name="atomic" transfer-ownership="none">
  33041. <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
  33042. <type name="guint" c:type="volatile guint*"/>
  33043. </parameter>
  33044. <parameter name="val" transfer-ownership="none">
  33045. <doc xml:space="preserve">the value to 'or'</doc>
  33046. <type name="guint" c:type="guint"/>
  33047. </parameter>
  33048. </parameters>
  33049. </function>
  33050. <function name="atomic_int_set"
  33051. c:identifier="g_atomic_int_set"
  33052. version="2.4">
  33053. <doc xml:space="preserve">Sets the value of @atomic to @newval.
  33054. This call acts as a full compiler and hardware
  33055. memory barrier (after the set).</doc>
  33056. <return-value transfer-ownership="none">
  33057. <type name="none" c:type="void"/>
  33058. </return-value>
  33059. <parameters>
  33060. <parameter name="atomic" transfer-ownership="none">
  33061. <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
  33062. <type name="gint" c:type="volatile gint*"/>
  33063. </parameter>
  33064. <parameter name="newval" transfer-ownership="none">
  33065. <doc xml:space="preserve">a new value to store</doc>
  33066. <type name="gint" c:type="gint"/>
  33067. </parameter>
  33068. </parameters>
  33069. </function>
  33070. <function name="atomic_int_xor"
  33071. c:identifier="g_atomic_int_xor"
  33072. version="2.30">
  33073. <doc xml:space="preserve">Performs an atomic bitwise 'xor' of the value of @atomic and @val,
  33074. storing the result back in @atomic.
  33075. Think of this operation as an atomic version of
  33076. `{ tmp = *atomic; *atomic ^= val; return tmp; }`.
  33077. This call acts as a full compiler and hardware memory barrier.</doc>
  33078. <return-value transfer-ownership="none">
  33079. <doc xml:space="preserve">the value of @atomic before the operation, unsigned</doc>
  33080. <type name="guint" c:type="guint"/>
  33081. </return-value>
  33082. <parameters>
  33083. <parameter name="atomic" transfer-ownership="none">
  33084. <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
  33085. <type name="guint" c:type="volatile guint*"/>
  33086. </parameter>
  33087. <parameter name="val" transfer-ownership="none">
  33088. <doc xml:space="preserve">the value to 'xor'</doc>
  33089. <type name="guint" c:type="guint"/>
  33090. </parameter>
  33091. </parameters>
  33092. </function>
  33093. <function name="atomic_pointer_add"
  33094. c:identifier="g_atomic_pointer_add"
  33095. version="2.30">
  33096. <doc xml:space="preserve">Atomically adds @val to the value of @atomic.
  33097. Think of this operation as an atomic version of
  33098. `{ tmp = *atomic; *atomic += val; return tmp; }`.
  33099. This call acts as a full compiler and hardware memory barrier.</doc>
  33100. <return-value transfer-ownership="none">
  33101. <doc xml:space="preserve">the value of @atomic before the add, signed</doc>
  33102. <type name="gssize" c:type="gssize"/>
  33103. </return-value>
  33104. <parameters>
  33105. <parameter name="atomic" transfer-ownership="none">
  33106. <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
  33107. <type name="gpointer" c:type="void*"/>
  33108. </parameter>
  33109. <parameter name="val" transfer-ownership="none">
  33110. <doc xml:space="preserve">the value to add</doc>
  33111. <type name="gssize" c:type="gssize"/>
  33112. </parameter>
  33113. </parameters>
  33114. </function>
  33115. <function name="atomic_pointer_and"
  33116. c:identifier="g_atomic_pointer_and"
  33117. version="2.30">
  33118. <doc xml:space="preserve">Performs an atomic bitwise 'and' of the value of @atomic and @val,
  33119. storing the result back in @atomic.
  33120. Think of this operation as an atomic version of
  33121. `{ tmp = *atomic; *atomic &amp;= val; return tmp; }`.
  33122. This call acts as a full compiler and hardware memory barrier.</doc>
  33123. <return-value transfer-ownership="none">
  33124. <doc xml:space="preserve">the value of @atomic before the operation, unsigned</doc>
  33125. <type name="gsize" c:type="gsize"/>
  33126. </return-value>
  33127. <parameters>
  33128. <parameter name="atomic" transfer-ownership="none">
  33129. <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
  33130. <type name="gpointer" c:type="void*"/>
  33131. </parameter>
  33132. <parameter name="val" transfer-ownership="none">
  33133. <doc xml:space="preserve">the value to 'and'</doc>
  33134. <type name="gsize" c:type="gsize"/>
  33135. </parameter>
  33136. </parameters>
  33137. </function>
  33138. <function name="atomic_pointer_compare_and_exchange"
  33139. c:identifier="g_atomic_pointer_compare_and_exchange"
  33140. version="2.4">
  33141. <doc xml:space="preserve">Compares @atomic to @oldval and, if equal, sets it to @newval.
  33142. If @atomic was not equal to @oldval then no change occurs.
  33143. This compare and exchange is done atomically.
  33144. Think of this operation as an atomic version of
  33145. `{ if (*atomic == oldval) { *atomic = newval; return TRUE; } else return FALSE; }`.
  33146. This call acts as a full compiler and hardware memory barrier.</doc>
  33147. <return-value transfer-ownership="none">
  33148. <doc xml:space="preserve">%TRUE if the exchange took place</doc>
  33149. <type name="gboolean" c:type="gboolean"/>
  33150. </return-value>
  33151. <parameters>
  33152. <parameter name="atomic" transfer-ownership="none">
  33153. <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
  33154. <type name="gpointer" c:type="void*"/>
  33155. </parameter>
  33156. <parameter name="oldval"
  33157. transfer-ownership="none"
  33158. nullable="1"
  33159. allow-none="1">
  33160. <doc xml:space="preserve">the value to compare with</doc>
  33161. <type name="gpointer" c:type="gpointer"/>
  33162. </parameter>
  33163. <parameter name="newval"
  33164. transfer-ownership="none"
  33165. nullable="1"
  33166. allow-none="1">
  33167. <doc xml:space="preserve">the value to conditionally replace with</doc>
  33168. <type name="gpointer" c:type="gpointer"/>
  33169. </parameter>
  33170. </parameters>
  33171. </function>
  33172. <function name="atomic_pointer_get"
  33173. c:identifier="g_atomic_pointer_get"
  33174. version="2.4">
  33175. <doc xml:space="preserve">Gets the current value of @atomic.
  33176. This call acts as a full compiler and hardware
  33177. memory barrier (before the get).</doc>
  33178. <return-value transfer-ownership="none" nullable="1">
  33179. <doc xml:space="preserve">the value of the pointer</doc>
  33180. <type name="gpointer" c:type="gpointer"/>
  33181. </return-value>
  33182. <parameters>
  33183. <parameter name="atomic" transfer-ownership="none">
  33184. <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
  33185. <type name="gpointer" c:type="void*"/>
  33186. </parameter>
  33187. </parameters>
  33188. </function>
  33189. <function name="atomic_pointer_or"
  33190. c:identifier="g_atomic_pointer_or"
  33191. version="2.30">
  33192. <doc xml:space="preserve">Performs an atomic bitwise 'or' of the value of @atomic and @val,
  33193. storing the result back in @atomic.
  33194. Think of this operation as an atomic version of
  33195. `{ tmp = *atomic; *atomic |= val; return tmp; }`.
  33196. This call acts as a full compiler and hardware memory barrier.</doc>
  33197. <return-value transfer-ownership="none">
  33198. <doc xml:space="preserve">the value of @atomic before the operation, unsigned</doc>
  33199. <type name="gsize" c:type="gsize"/>
  33200. </return-value>
  33201. <parameters>
  33202. <parameter name="atomic" transfer-ownership="none">
  33203. <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
  33204. <type name="gpointer" c:type="void*"/>
  33205. </parameter>
  33206. <parameter name="val" transfer-ownership="none">
  33207. <doc xml:space="preserve">the value to 'or'</doc>
  33208. <type name="gsize" c:type="gsize"/>
  33209. </parameter>
  33210. </parameters>
  33211. </function>
  33212. <function name="atomic_pointer_set"
  33213. c:identifier="g_atomic_pointer_set"
  33214. version="2.4">
  33215. <doc xml:space="preserve">Sets the value of @atomic to @newval.
  33216. This call acts as a full compiler and hardware
  33217. memory barrier (after the set).</doc>
  33218. <return-value transfer-ownership="none">
  33219. <type name="none" c:type="void"/>
  33220. </return-value>
  33221. <parameters>
  33222. <parameter name="atomic" transfer-ownership="none">
  33223. <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
  33224. <type name="gpointer" c:type="void*"/>
  33225. </parameter>
  33226. <parameter name="newval"
  33227. transfer-ownership="none"
  33228. nullable="1"
  33229. allow-none="1">
  33230. <doc xml:space="preserve">a new value to store</doc>
  33231. <type name="gpointer" c:type="gpointer"/>
  33232. </parameter>
  33233. </parameters>
  33234. </function>
  33235. <function name="atomic_pointer_xor"
  33236. c:identifier="g_atomic_pointer_xor"
  33237. version="2.30">
  33238. <doc xml:space="preserve">Performs an atomic bitwise 'xor' of the value of @atomic and @val,
  33239. storing the result back in @atomic.
  33240. Think of this operation as an atomic version of
  33241. `{ tmp = *atomic; *atomic ^= val; return tmp; }`.
  33242. This call acts as a full compiler and hardware memory barrier.</doc>
  33243. <return-value transfer-ownership="none">
  33244. <doc xml:space="preserve">the value of @atomic before the operation, unsigned</doc>
  33245. <type name="gsize" c:type="gsize"/>
  33246. </return-value>
  33247. <parameters>
  33248. <parameter name="atomic" transfer-ownership="none">
  33249. <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
  33250. <type name="gpointer" c:type="void*"/>
  33251. </parameter>
  33252. <parameter name="val" transfer-ownership="none">
  33253. <doc xml:space="preserve">the value to 'xor'</doc>
  33254. <type name="gsize" c:type="gsize"/>
  33255. </parameter>
  33256. </parameters>
  33257. </function>
  33258. <function name="base64_decode"
  33259. c:identifier="g_base64_decode"
  33260. version="2.12">
  33261. <doc xml:space="preserve">Decode a sequence of Base-64 encoded text into binary data. Note
  33262. that the returned binary data is not necessarily zero-terminated,
  33263. so it should not be used as a character string.</doc>
  33264. <return-value transfer-ownership="full">
  33265. <doc xml:space="preserve">
  33266. newly allocated buffer containing the binary data
  33267. that @text represents. The returned buffer must
  33268. be freed with g_free().</doc>
  33269. <array length="1" zero-terminated="0" c:type="guchar*">
  33270. <type name="guint8"/>
  33271. </array>
  33272. </return-value>
  33273. <parameters>
  33274. <parameter name="text" transfer-ownership="none">
  33275. <doc xml:space="preserve">zero-terminated string with base64 text to decode</doc>
  33276. <type name="utf8" c:type="const gchar*"/>
  33277. </parameter>
  33278. <parameter name="out_len"
  33279. direction="out"
  33280. caller-allocates="0"
  33281. transfer-ownership="full">
  33282. <doc xml:space="preserve">The length of the decoded data is written here</doc>
  33283. <type name="gsize" c:type="gsize*"/>
  33284. </parameter>
  33285. </parameters>
  33286. </function>
  33287. <function name="base64_decode_inplace"
  33288. c:identifier="g_base64_decode_inplace"
  33289. version="2.20">
  33290. <doc xml:space="preserve">Decode a sequence of Base-64 encoded text into binary data
  33291. by overwriting the input data.</doc>
  33292. <return-value transfer-ownership="none">
  33293. <doc xml:space="preserve">The binary data that @text responds. This pointer
  33294. is the same as the input @text.</doc>
  33295. <type name="guint8" c:type="guchar*"/>
  33296. </return-value>
  33297. <parameters>
  33298. <parameter name="text"
  33299. direction="inout"
  33300. caller-allocates="0"
  33301. transfer-ownership="full">
  33302. <doc xml:space="preserve">zero-terminated
  33303. string with base64 text to decode</doc>
  33304. <array length="1" zero-terminated="0" c:type="gchar*">
  33305. <type name="guint8"/>
  33306. </array>
  33307. </parameter>
  33308. <parameter name="out_len"
  33309. direction="inout"
  33310. caller-allocates="0"
  33311. transfer-ownership="none">
  33312. <doc xml:space="preserve">The length of the decoded data is written here</doc>
  33313. <type name="gsize" c:type="gsize*"/>
  33314. </parameter>
  33315. </parameters>
  33316. </function>
  33317. <function name="base64_decode_step"
  33318. c:identifier="g_base64_decode_step"
  33319. version="2.12">
  33320. <doc xml:space="preserve">Incrementally decode a sequence of binary data from its Base-64 stringified
  33321. representation. By calling this function multiple times you can convert
  33322. data in chunks to avoid having to have the full encoded data in memory.
  33323. The output buffer must be large enough to fit all the data that will
  33324. be written to it. Since base64 encodes 3 bytes in 4 chars you need
  33325. at least: (@len / 4) * 3 + 3 bytes (+ 3 may be needed in case of non-zero
  33326. state).</doc>
  33327. <return-value transfer-ownership="none">
  33328. <doc xml:space="preserve">The number of bytes of output that was written</doc>
  33329. <type name="gsize" c:type="gsize"/>
  33330. </return-value>
  33331. <parameters>
  33332. <parameter name="in" transfer-ownership="none">
  33333. <doc xml:space="preserve">binary input data</doc>
  33334. <array length="1" zero-terminated="0" c:type="gchar*">
  33335. <type name="guint8"/>
  33336. </array>
  33337. </parameter>
  33338. <parameter name="len" transfer-ownership="none">
  33339. <doc xml:space="preserve">max length of @in data to decode</doc>
  33340. <type name="gsize" c:type="gsize"/>
  33341. </parameter>
  33342. <parameter name="out"
  33343. direction="out"
  33344. caller-allocates="0"
  33345. transfer-ownership="full">
  33346. <doc xml:space="preserve">output buffer</doc>
  33347. <array zero-terminated="0" c:type="guchar*">
  33348. <type name="guint8"/>
  33349. </array>
  33350. </parameter>
  33351. <parameter name="state"
  33352. direction="inout"
  33353. caller-allocates="0"
  33354. transfer-ownership="full">
  33355. <doc xml:space="preserve">Saved state between steps, initialize to 0</doc>
  33356. <type name="gint" c:type="gint*"/>
  33357. </parameter>
  33358. <parameter name="save"
  33359. direction="inout"
  33360. caller-allocates="0"
  33361. transfer-ownership="full">
  33362. <doc xml:space="preserve">Saved state between steps, initialize to 0</doc>
  33363. <type name="guint" c:type="guint*"/>
  33364. </parameter>
  33365. </parameters>
  33366. </function>
  33367. <function name="base64_encode"
  33368. c:identifier="g_base64_encode"
  33369. version="2.12">
  33370. <doc xml:space="preserve">Encode a sequence of binary data into its Base-64 stringified
  33371. representation.</doc>
  33372. <return-value transfer-ownership="full">
  33373. <doc xml:space="preserve">a newly allocated, zero-terminated Base-64
  33374. encoded string representing @data. The returned string must
  33375. be freed with g_free().</doc>
  33376. <type name="utf8" c:type="gchar*"/>
  33377. </return-value>
  33378. <parameters>
  33379. <parameter name="data" transfer-ownership="none">
  33380. <doc xml:space="preserve">the binary data to encode</doc>
  33381. <array length="1" zero-terminated="0" c:type="guchar*">
  33382. <type name="guint8"/>
  33383. </array>
  33384. </parameter>
  33385. <parameter name="len" transfer-ownership="none">
  33386. <doc xml:space="preserve">the length of @data</doc>
  33387. <type name="gsize" c:type="gsize"/>
  33388. </parameter>
  33389. </parameters>
  33390. </function>
  33391. <function name="base64_encode_close"
  33392. c:identifier="g_base64_encode_close"
  33393. version="2.12">
  33394. <doc xml:space="preserve">Flush the status from a sequence of calls to g_base64_encode_step().
  33395. The output buffer must be large enough to fit all the data that will
  33396. be written to it. It will need up to 4 bytes, or up to 5 bytes if
  33397. line-breaking is enabled.</doc>
  33398. <return-value transfer-ownership="none">
  33399. <doc xml:space="preserve">The number of bytes of output that was written</doc>
  33400. <type name="gsize" c:type="gsize"/>
  33401. </return-value>
  33402. <parameters>
  33403. <parameter name="break_lines" transfer-ownership="none">
  33404. <doc xml:space="preserve">whether to break long lines</doc>
  33405. <type name="gboolean" c:type="gboolean"/>
  33406. </parameter>
  33407. <parameter name="out"
  33408. direction="out"
  33409. caller-allocates="0"
  33410. transfer-ownership="full">
  33411. <doc xml:space="preserve">pointer to destination buffer</doc>
  33412. <array zero-terminated="0" c:type="gchar*">
  33413. <type name="guint8"/>
  33414. </array>
  33415. </parameter>
  33416. <parameter name="state"
  33417. direction="inout"
  33418. caller-allocates="0"
  33419. transfer-ownership="full">
  33420. <doc xml:space="preserve">Saved state from g_base64_encode_step()</doc>
  33421. <type name="gint" c:type="gint*"/>
  33422. </parameter>
  33423. <parameter name="save"
  33424. direction="inout"
  33425. caller-allocates="0"
  33426. transfer-ownership="full">
  33427. <doc xml:space="preserve">Saved state from g_base64_encode_step()</doc>
  33428. <type name="gint" c:type="gint*"/>
  33429. </parameter>
  33430. </parameters>
  33431. </function>
  33432. <function name="base64_encode_step"
  33433. c:identifier="g_base64_encode_step"
  33434. version="2.12">
  33435. <doc xml:space="preserve">Incrementally encode a sequence of binary data into its Base-64 stringified
  33436. representation. By calling this function multiple times you can convert
  33437. data in chunks to avoid having to have the full encoded data in memory.
  33438. When all of the data has been converted you must call
  33439. g_base64_encode_close() to flush the saved state.
  33440. The output buffer must be large enough to fit all the data that will
  33441. be written to it. Due to the way base64 encodes you will need
  33442. at least: (@len / 3 + 1) * 4 + 4 bytes (+ 4 may be needed in case of
  33443. non-zero state). If you enable line-breaking you will need at least:
  33444. ((@len / 3 + 1) * 4 + 4) / 72 + 1 bytes of extra space.
  33445. @break_lines is typically used when putting base64-encoded data in emails.
  33446. It breaks the lines at 72 columns instead of putting all of the text on
  33447. the same line. This avoids problems with long lines in the email system.
  33448. Note however that it breaks the lines with `LF` characters, not
  33449. `CR LF` sequences, so the result cannot be passed directly to SMTP
  33450. or certain other protocols.</doc>
  33451. <return-value transfer-ownership="none">
  33452. <doc xml:space="preserve">The number of bytes of output that was written</doc>
  33453. <type name="gsize" c:type="gsize"/>
  33454. </return-value>
  33455. <parameters>
  33456. <parameter name="in" transfer-ownership="none">
  33457. <doc xml:space="preserve">the binary data to encode</doc>
  33458. <array length="1" zero-terminated="0" c:type="guchar*">
  33459. <type name="guint8"/>
  33460. </array>
  33461. </parameter>
  33462. <parameter name="len" transfer-ownership="none">
  33463. <doc xml:space="preserve">the length of @in</doc>
  33464. <type name="gsize" c:type="gsize"/>
  33465. </parameter>
  33466. <parameter name="break_lines" transfer-ownership="none">
  33467. <doc xml:space="preserve">whether to break long lines</doc>
  33468. <type name="gboolean" c:type="gboolean"/>
  33469. </parameter>
  33470. <parameter name="out"
  33471. direction="out"
  33472. caller-allocates="0"
  33473. transfer-ownership="full">
  33474. <doc xml:space="preserve">pointer to destination buffer</doc>
  33475. <array zero-terminated="0" c:type="gchar*">
  33476. <type name="guint8"/>
  33477. </array>
  33478. </parameter>
  33479. <parameter name="state"
  33480. direction="inout"
  33481. caller-allocates="0"
  33482. transfer-ownership="full">
  33483. <doc xml:space="preserve">Saved state between steps, initialize to 0</doc>
  33484. <type name="gint" c:type="gint*"/>
  33485. </parameter>
  33486. <parameter name="save"
  33487. direction="inout"
  33488. caller-allocates="0"
  33489. transfer-ownership="full">
  33490. <doc xml:space="preserve">Saved state between steps, initialize to 0</doc>
  33491. <type name="gint" c:type="gint*"/>
  33492. </parameter>
  33493. </parameters>
  33494. </function>
  33495. <function name="basename"
  33496. c:identifier="g_basename"
  33497. deprecated="1"
  33498. deprecated-version="2.2">
  33499. <doc xml:space="preserve">Gets the name of the file without any leading directory
  33500. components. It returns a pointer into the given file name
  33501. string.</doc>
  33502. <doc-deprecated xml:space="preserve">Use g_path_get_basename() instead, but notice
  33503. that g_path_get_basename() allocates new memory for the
  33504. returned string, unlike this function which returns a pointer
  33505. into the argument.</doc-deprecated>
  33506. <return-value transfer-ownership="none">
  33507. <doc xml:space="preserve">the name of the file without any leading
  33508. directory components</doc>
  33509. <type name="utf8" c:type="const gchar*"/>
  33510. </return-value>
  33511. <parameters>
  33512. <parameter name="file_name" transfer-ownership="none">
  33513. <doc xml:space="preserve">the name of the file</doc>
  33514. <type name="utf8" c:type="const gchar*"/>
  33515. </parameter>
  33516. </parameters>
  33517. </function>
  33518. <function name="bit_lock" c:identifier="g_bit_lock" version="2.24">
  33519. <doc xml:space="preserve">Sets the indicated @lock_bit in @address. If the bit is already
  33520. set, this call will block until g_bit_unlock() unsets the
  33521. corresponding bit.
  33522. Attempting to lock on two different bits within the same integer is
  33523. not supported and will very probably cause deadlocks.
  33524. The value of the bit that is set is (1u &lt;&lt; @bit). If @bit is not
  33525. between 0 and 31 then the result is undefined.
  33526. This function accesses @address atomically. All other accesses to
  33527. @address must be atomic in order for this function to work
  33528. reliably.</doc>
  33529. <return-value transfer-ownership="none">
  33530. <type name="none" c:type="void"/>
  33531. </return-value>
  33532. <parameters>
  33533. <parameter name="address" transfer-ownership="none">
  33534. <doc xml:space="preserve">a pointer to an integer</doc>
  33535. <type name="gint" c:type="volatile gint*"/>
  33536. </parameter>
  33537. <parameter name="lock_bit" transfer-ownership="none">
  33538. <doc xml:space="preserve">a bit value between 0 and 31</doc>
  33539. <type name="gint" c:type="gint"/>
  33540. </parameter>
  33541. </parameters>
  33542. </function>
  33543. <function name="bit_nth_lsf" c:identifier="g_bit_nth_lsf">
  33544. <doc xml:space="preserve">Find the position of the first bit set in @mask, searching
  33545. from (but not including) @nth_bit upwards. Bits are numbered
  33546. from 0 (least significant) to sizeof(#gulong) * 8 - 1 (31 or 63,
  33547. usually). To start searching from the 0th bit, set @nth_bit to -1.</doc>
  33548. <return-value transfer-ownership="none">
  33549. <doc xml:space="preserve">the index of the first bit set which is higher than @nth_bit, or -1
  33550. if no higher bits are set</doc>
  33551. <type name="gint" c:type="gint"/>
  33552. </return-value>
  33553. <parameters>
  33554. <parameter name="mask" transfer-ownership="none">
  33555. <doc xml:space="preserve">a #gulong containing flags</doc>
  33556. <type name="gulong" c:type="gulong"/>
  33557. </parameter>
  33558. <parameter name="nth_bit" transfer-ownership="none">
  33559. <doc xml:space="preserve">the index of the bit to start the search from</doc>
  33560. <type name="gint" c:type="gint"/>
  33561. </parameter>
  33562. </parameters>
  33563. </function>
  33564. <function name="bit_nth_msf" c:identifier="g_bit_nth_msf">
  33565. <doc xml:space="preserve">Find the position of the first bit set in @mask, searching
  33566. from (but not including) @nth_bit downwards. Bits are numbered
  33567. from 0 (least significant) to sizeof(#gulong) * 8 - 1 (31 or 63,
  33568. usually). To start searching from the last bit, set @nth_bit to
  33569. -1 or GLIB_SIZEOF_LONG * 8.</doc>
  33570. <return-value transfer-ownership="none">
  33571. <doc xml:space="preserve">the index of the first bit set which is lower than @nth_bit, or -1
  33572. if no lower bits are set</doc>
  33573. <type name="gint" c:type="gint"/>
  33574. </return-value>
  33575. <parameters>
  33576. <parameter name="mask" transfer-ownership="none">
  33577. <doc xml:space="preserve">a #gulong containing flags</doc>
  33578. <type name="gulong" c:type="gulong"/>
  33579. </parameter>
  33580. <parameter name="nth_bit" transfer-ownership="none">
  33581. <doc xml:space="preserve">the index of the bit to start the search from</doc>
  33582. <type name="gint" c:type="gint"/>
  33583. </parameter>
  33584. </parameters>
  33585. </function>
  33586. <function name="bit_storage" c:identifier="g_bit_storage">
  33587. <doc xml:space="preserve">Gets the number of bits used to hold @number,
  33588. e.g. if @number is 4, 3 bits are needed.</doc>
  33589. <return-value transfer-ownership="none">
  33590. <doc xml:space="preserve">the number of bits used to hold @number</doc>
  33591. <type name="guint" c:type="guint"/>
  33592. </return-value>
  33593. <parameters>
  33594. <parameter name="number" transfer-ownership="none">
  33595. <doc xml:space="preserve">a #guint</doc>
  33596. <type name="gulong" c:type="gulong"/>
  33597. </parameter>
  33598. </parameters>
  33599. </function>
  33600. <function name="bit_trylock" c:identifier="g_bit_trylock" version="2.24">
  33601. <doc xml:space="preserve">Sets the indicated @lock_bit in @address, returning %TRUE if
  33602. successful. If the bit is already set, returns %FALSE immediately.
  33603. Attempting to lock on two different bits within the same integer is
  33604. not supported.
  33605. The value of the bit that is set is (1u &lt;&lt; @bit). If @bit is not
  33606. between 0 and 31 then the result is undefined.
  33607. This function accesses @address atomically. All other accesses to
  33608. @address must be atomic in order for this function to work
  33609. reliably.</doc>
  33610. <return-value transfer-ownership="none">
  33611. <doc xml:space="preserve">%TRUE if the lock was acquired</doc>
  33612. <type name="gboolean" c:type="gboolean"/>
  33613. </return-value>
  33614. <parameters>
  33615. <parameter name="address" transfer-ownership="none">
  33616. <doc xml:space="preserve">a pointer to an integer</doc>
  33617. <type name="gint" c:type="volatile gint*"/>
  33618. </parameter>
  33619. <parameter name="lock_bit" transfer-ownership="none">
  33620. <doc xml:space="preserve">a bit value between 0 and 31</doc>
  33621. <type name="gint" c:type="gint"/>
  33622. </parameter>
  33623. </parameters>
  33624. </function>
  33625. <function name="bit_unlock" c:identifier="g_bit_unlock" version="2.24">
  33626. <doc xml:space="preserve">Clears the indicated @lock_bit in @address. If another thread is
  33627. currently blocked in g_bit_lock() on this same bit then it will be
  33628. woken up.
  33629. This function accesses @address atomically. All other accesses to
  33630. @address must be atomic in order for this function to work
  33631. reliably.</doc>
  33632. <return-value transfer-ownership="none">
  33633. <type name="none" c:type="void"/>
  33634. </return-value>
  33635. <parameters>
  33636. <parameter name="address" transfer-ownership="none">
  33637. <doc xml:space="preserve">a pointer to an integer</doc>
  33638. <type name="gint" c:type="volatile gint*"/>
  33639. </parameter>
  33640. <parameter name="lock_bit" transfer-ownership="none">
  33641. <doc xml:space="preserve">a bit value between 0 and 31</doc>
  33642. <type name="gint" c:type="gint"/>
  33643. </parameter>
  33644. </parameters>
  33645. </function>
  33646. <function name="bookmark_file_error_quark"
  33647. c:identifier="g_bookmark_file_error_quark"
  33648. moved-to="BookmarkFile.error_quark">
  33649. <return-value transfer-ownership="none">
  33650. <type name="Quark" c:type="GQuark"/>
  33651. </return-value>
  33652. </function>
  33653. <function name="build_filename"
  33654. c:identifier="g_build_filename"
  33655. introspectable="0">
  33656. <doc xml:space="preserve">Creates a filename from a series of elements using the correct
  33657. separator for filenames.
  33658. On Unix, this function behaves identically to `g_build_path
  33659. (G_DIR_SEPARATOR_S, first_element, ....)`.
  33660. On Windows, it takes into account that either the backslash
  33661. (`\` or slash (`/`) can be used as separator in filenames, but
  33662. otherwise behaves as on UNIX. When file pathname separators need
  33663. to be inserted, the one that last previously occurred in the
  33664. parameters (reading from left to right) is used.
  33665. No attempt is made to force the resulting filename to be an absolute
  33666. path. If the first element is a relative path, the result will
  33667. be a relative path.</doc>
  33668. <return-value transfer-ownership="full">
  33669. <doc xml:space="preserve">a newly-allocated string that must be freed with g_free().</doc>
  33670. <type name="utf8" c:type="gchar*"/>
  33671. </return-value>
  33672. <parameters>
  33673. <parameter name="first_element" transfer-ownership="none">
  33674. <doc xml:space="preserve">the first element in the path</doc>
  33675. <type name="utf8" c:type="const gchar*"/>
  33676. </parameter>
  33677. <parameter name="..." transfer-ownership="none">
  33678. <doc xml:space="preserve">remaining elements in path, terminated by %NULL</doc>
  33679. <varargs/>
  33680. </parameter>
  33681. </parameters>
  33682. </function>
  33683. <function name="build_filenamev"
  33684. c:identifier="g_build_filenamev"
  33685. version="2.8">
  33686. <doc xml:space="preserve">Behaves exactly like g_build_filename(), but takes the path elements
  33687. as a string array, instead of varargs. This function is mainly
  33688. meant for language bindings.</doc>
  33689. <return-value transfer-ownership="full">
  33690. <doc xml:space="preserve">a newly-allocated string that must be freed with g_free().</doc>
  33691. <type name="utf8" c:type="gchar*"/>
  33692. </return-value>
  33693. <parameters>
  33694. <parameter name="args" transfer-ownership="none">
  33695. <doc xml:space="preserve">%NULL-terminated array of strings containing the path elements.</doc>
  33696. <array c:type="gchar**">
  33697. <type name="utf8" c:type="gchar*"/>
  33698. </array>
  33699. </parameter>
  33700. </parameters>
  33701. </function>
  33702. <function name="build_path" c:identifier="g_build_path" introspectable="0">
  33703. <doc xml:space="preserve">Creates a path from a series of elements using @separator as the
  33704. separator between elements. At the boundary between two elements,
  33705. any trailing occurrences of separator in the first element, or
  33706. leading occurrences of separator in the second element are removed
  33707. and exactly one copy of the separator is inserted.
  33708. Empty elements are ignored.
  33709. The number of leading copies of the separator on the result is
  33710. the same as the number of leading copies of the separator on
  33711. the first non-empty element.
  33712. The number of trailing copies of the separator on the result is
  33713. the same as the number of trailing copies of the separator on
  33714. the last non-empty element. (Determination of the number of
  33715. trailing copies is done without stripping leading copies, so
  33716. if the separator is `ABA`, then `ABABA` has 1 trailing copy.)
  33717. However, if there is only a single non-empty element, and there
  33718. are no characters in that element not part of the leading or
  33719. trailing separators, then the result is exactly the original value
  33720. of that element.
  33721. Other than for determination of the number of leading and trailing
  33722. copies of the separator, elements consisting only of copies
  33723. of the separator are ignored.</doc>
  33724. <return-value transfer-ownership="full">
  33725. <doc xml:space="preserve">a newly-allocated string that must be freed with g_free().</doc>
  33726. <type name="utf8" c:type="gchar*"/>
  33727. </return-value>
  33728. <parameters>
  33729. <parameter name="separator" transfer-ownership="none">
  33730. <doc xml:space="preserve">a string used to separator the elements of the path.</doc>
  33731. <type name="utf8" c:type="const gchar*"/>
  33732. </parameter>
  33733. <parameter name="first_element" transfer-ownership="none">
  33734. <doc xml:space="preserve">the first element in the path</doc>
  33735. <type name="utf8" c:type="const gchar*"/>
  33736. </parameter>
  33737. <parameter name="..." transfer-ownership="none">
  33738. <doc xml:space="preserve">remaining elements in path, terminated by %NULL</doc>
  33739. <varargs/>
  33740. </parameter>
  33741. </parameters>
  33742. </function>
  33743. <function name="build_pathv" c:identifier="g_build_pathv" version="2.8">
  33744. <doc xml:space="preserve">Behaves exactly like g_build_path(), but takes the path elements
  33745. as a string array, instead of varargs. This function is mainly
  33746. meant for language bindings.</doc>
  33747. <return-value transfer-ownership="full">
  33748. <doc xml:space="preserve">a newly-allocated string that must be freed with g_free().</doc>
  33749. <type name="utf8" c:type="gchar*"/>
  33750. </return-value>
  33751. <parameters>
  33752. <parameter name="separator" transfer-ownership="none">
  33753. <doc xml:space="preserve">a string used to separator the elements of the path.</doc>
  33754. <type name="utf8" c:type="const gchar*"/>
  33755. </parameter>
  33756. <parameter name="args" transfer-ownership="none">
  33757. <doc xml:space="preserve">%NULL-terminated array of strings containing the path elements.</doc>
  33758. <array c:type="gchar**">
  33759. <type name="utf8" c:type="gchar*"/>
  33760. </array>
  33761. </parameter>
  33762. </parameters>
  33763. </function>
  33764. <function name="byte_array_free"
  33765. c:identifier="g_byte_array_free"
  33766. moved-to="ByteArray.free">
  33767. <doc xml:space="preserve">Frees the memory allocated by the #GByteArray. If @free_segment is
  33768. %TRUE it frees the actual byte data. If the reference count of
  33769. @array is greater than one, the #GByteArray wrapper is preserved but
  33770. the size of @array will be set to zero.</doc>
  33771. <return-value transfer-ownership="none">
  33772. <doc xml:space="preserve">the element data if @free_segment is %FALSE, otherwise
  33773. %NULL. The element data should be freed using g_free().</doc>
  33774. <type name="guint8" c:type="guint8*"/>
  33775. </return-value>
  33776. <parameters>
  33777. <parameter name="array" transfer-ownership="none">
  33778. <doc xml:space="preserve">a #GByteArray</doc>
  33779. <array name="GLib.ByteArray" c:type="GByteArray*">
  33780. <type name="guint8" c:type="guint8"/>
  33781. </array>
  33782. </parameter>
  33783. <parameter name="free_segment" transfer-ownership="none">
  33784. <doc xml:space="preserve">if %TRUE the actual byte data is freed as well</doc>
  33785. <type name="gboolean" c:type="gboolean"/>
  33786. </parameter>
  33787. </parameters>
  33788. </function>
  33789. <function name="byte_array_free_to_bytes"
  33790. c:identifier="g_byte_array_free_to_bytes"
  33791. moved-to="ByteArray.free_to_bytes"
  33792. version="2.32">
  33793. <doc xml:space="preserve">Transfers the data from the #GByteArray into a new immutable #GBytes.
  33794. The #GByteArray is freed unless the reference count of @array is greater
  33795. than one, the #GByteArray wrapper is preserved but the size of @array
  33796. will be set to zero.
  33797. This is identical to using g_bytes_new_take() and g_byte_array_free()
  33798. together.</doc>
  33799. <return-value transfer-ownership="full">
  33800. <doc xml:space="preserve">a new immutable #GBytes representing same
  33801. byte data that was in the array</doc>
  33802. <type name="Bytes" c:type="GBytes*"/>
  33803. </return-value>
  33804. <parameters>
  33805. <parameter name="array" transfer-ownership="full">
  33806. <doc xml:space="preserve">a #GByteArray</doc>
  33807. <array name="GLib.ByteArray" c:type="GByteArray*">
  33808. <type name="guint8" c:type="guint8"/>
  33809. </array>
  33810. </parameter>
  33811. </parameters>
  33812. </function>
  33813. <function name="byte_array_new"
  33814. c:identifier="g_byte_array_new"
  33815. moved-to="ByteArray.new">
  33816. <doc xml:space="preserve">Creates a new #GByteArray with a reference count of 1.</doc>
  33817. <return-value transfer-ownership="full">
  33818. <doc xml:space="preserve">the new #GByteArray</doc>
  33819. <array name="GLib.ByteArray" c:type="GByteArray*">
  33820. <type name="guint8" c:type="guint8"/>
  33821. </array>
  33822. </return-value>
  33823. </function>
  33824. <function name="byte_array_new_take"
  33825. c:identifier="g_byte_array_new_take"
  33826. moved-to="ByteArray.new_take"
  33827. version="2.32">
  33828. <doc xml:space="preserve">Create byte array containing the data. The data will be owned by the array
  33829. and will be freed with g_free(), i.e. it could be allocated using g_strdup().</doc>
  33830. <return-value transfer-ownership="full">
  33831. <doc xml:space="preserve">a new #GByteArray</doc>
  33832. <array name="GLib.ByteArray" c:type="GByteArray*">
  33833. <type name="guint8" c:type="guint8"/>
  33834. </array>
  33835. </return-value>
  33836. <parameters>
  33837. <parameter name="data" transfer-ownership="full">
  33838. <doc xml:space="preserve">byte data for the array</doc>
  33839. <array length="1" zero-terminated="0" c:type="guint8*">
  33840. <type name="guint8" c:type="guint8"/>
  33841. </array>
  33842. </parameter>
  33843. <parameter name="len" transfer-ownership="none">
  33844. <doc xml:space="preserve">length of @data</doc>
  33845. <type name="gsize" c:type="gsize"/>
  33846. </parameter>
  33847. </parameters>
  33848. </function>
  33849. <function name="byte_array_unref"
  33850. c:identifier="g_byte_array_unref"
  33851. moved-to="ByteArray.unref"
  33852. version="2.22">
  33853. <doc xml:space="preserve">Atomically decrements the reference count of @array by one. If the
  33854. reference count drops to 0, all memory allocated by the array is
  33855. released. This function is thread-safe and may be called from any
  33856. thread.</doc>
  33857. <return-value transfer-ownership="none">
  33858. <type name="none" c:type="void"/>
  33859. </return-value>
  33860. <parameters>
  33861. <parameter name="array" transfer-ownership="none">
  33862. <doc xml:space="preserve">A #GByteArray</doc>
  33863. <array name="GLib.ByteArray" c:type="GByteArray*">
  33864. <type name="guint8" c:type="guint8"/>
  33865. </array>
  33866. </parameter>
  33867. </parameters>
  33868. </function>
  33869. <function name="chdir" c:identifier="g_chdir" version="2.8">
  33870. <doc xml:space="preserve">A wrapper for the POSIX chdir() function. The function changes the
  33871. current directory of the process to @path.
  33872. See your C library manual for more details about chdir().</doc>
  33873. <return-value transfer-ownership="none">
  33874. <doc xml:space="preserve">0 on success, -1 if an error occurred.</doc>
  33875. <type name="gint" c:type="int"/>
  33876. </return-value>
  33877. <parameters>
  33878. <parameter name="path" transfer-ownership="none">
  33879. <doc xml:space="preserve">a pathname in the GLib file name encoding (UTF-8 on Windows)</doc>
  33880. <type name="utf8" c:type="const gchar*"/>
  33881. </parameter>
  33882. </parameters>
  33883. </function>
  33884. <function name="check_version"
  33885. c:identifier="glib_check_version"
  33886. version="2.6">
  33887. <doc xml:space="preserve">Checks that the GLib library in use is compatible with the
  33888. given version. Generally you would pass in the constants
  33889. #GLIB_MAJOR_VERSION, #GLIB_MINOR_VERSION, #GLIB_MICRO_VERSION
  33890. as the three arguments to this function; that produces
  33891. a check that the library in use is compatible with
  33892. the version of GLib the application or module was compiled
  33893. against.
  33894. Compatibility is defined by two things: first the version
  33895. of the running library is newer than the version
  33896. @required_major.required_minor.@required_micro. Second
  33897. the running library must be binary compatible with the
  33898. version @required_major.required_minor.@required_micro
  33899. (same major version.)</doc>
  33900. <return-value transfer-ownership="none">
  33901. <doc xml:space="preserve">%NULL if the GLib library is compatible with the
  33902. given version, or a string describing the version mismatch.
  33903. The returned string is owned by GLib and must not be modified
  33904. or freed.</doc>
  33905. <type name="utf8" c:type="const gchar*"/>
  33906. </return-value>
  33907. <parameters>
  33908. <parameter name="required_major" transfer-ownership="none">
  33909. <doc xml:space="preserve">the required major version</doc>
  33910. <type name="guint" c:type="guint"/>
  33911. </parameter>
  33912. <parameter name="required_minor" transfer-ownership="none">
  33913. <doc xml:space="preserve">the required minor version</doc>
  33914. <type name="guint" c:type="guint"/>
  33915. </parameter>
  33916. <parameter name="required_micro" transfer-ownership="none">
  33917. <doc xml:space="preserve">the required micro version</doc>
  33918. <type name="guint" c:type="guint"/>
  33919. </parameter>
  33920. </parameters>
  33921. </function>
  33922. <function name="checksum_type_get_length"
  33923. c:identifier="g_checksum_type_get_length"
  33924. moved-to="Checksum.type_get_length"
  33925. version="2.16">
  33926. <doc xml:space="preserve">Gets the length in bytes of digests of type @checksum_type</doc>
  33927. <return-value transfer-ownership="none">
  33928. <doc xml:space="preserve">the checksum length, or -1 if @checksum_type is
  33929. not supported.</doc>
  33930. <type name="gssize" c:type="gssize"/>
  33931. </return-value>
  33932. <parameters>
  33933. <parameter name="checksum_type" transfer-ownership="none">
  33934. <doc xml:space="preserve">a #GChecksumType</doc>
  33935. <type name="ChecksumType" c:type="GChecksumType"/>
  33936. </parameter>
  33937. </parameters>
  33938. </function>
  33939. <function name="child_watch_add"
  33940. c:identifier="g_child_watch_add"
  33941. shadowed-by="child_watch_add_full"
  33942. version="2.4"
  33943. introspectable="0">
  33944. <doc xml:space="preserve">Sets a function to be called when the child indicated by @pid
  33945. exits, at a default priority, #G_PRIORITY_DEFAULT.
  33946. If you obtain @pid from g_spawn_async() or g_spawn_async_with_pipes()
  33947. you will need to pass #G_SPAWN_DO_NOT_REAP_CHILD as flag to
  33948. the spawn function for the child watching to work.
  33949. Note that on platforms where #GPid must be explicitly closed
  33950. (see g_spawn_close_pid()) @pid must not be closed while the
  33951. source is still active. Typically, you will want to call
  33952. g_spawn_close_pid() in the callback function for the source.
  33953. GLib supports only a single callback per process id.
  33954. This internally creates a main loop source using
  33955. g_child_watch_source_new() and attaches it to the main loop context
  33956. using g_source_attach(). You can do these steps manually if you
  33957. need greater control.</doc>
  33958. <return-value transfer-ownership="none">
  33959. <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
  33960. <type name="guint" c:type="guint"/>
  33961. </return-value>
  33962. <parameters>
  33963. <parameter name="pid" transfer-ownership="none">
  33964. <doc xml:space="preserve">process id to watch. On POSIX the positive pid of a child
  33965. process. On Windows a handle for a process (which doesn't have to be
  33966. a child).</doc>
  33967. <type name="Pid" c:type="GPid"/>
  33968. </parameter>
  33969. <parameter name="function" transfer-ownership="none" closure="2">
  33970. <doc xml:space="preserve">function to call</doc>
  33971. <type name="ChildWatchFunc" c:type="GChildWatchFunc"/>
  33972. </parameter>
  33973. <parameter name="data"
  33974. transfer-ownership="none"
  33975. nullable="1"
  33976. allow-none="1">
  33977. <doc xml:space="preserve">data to pass to @function</doc>
  33978. <type name="gpointer" c:type="gpointer"/>
  33979. </parameter>
  33980. </parameters>
  33981. </function>
  33982. <function name="child_watch_add_full"
  33983. c:identifier="g_child_watch_add_full"
  33984. shadows="child_watch_add"
  33985. version="2.4">
  33986. <doc xml:space="preserve">Sets a function to be called when the child indicated by @pid
  33987. exits, at the priority @priority.
  33988. If you obtain @pid from g_spawn_async() or g_spawn_async_with_pipes()
  33989. you will need to pass #G_SPAWN_DO_NOT_REAP_CHILD as flag to
  33990. the spawn function for the child watching to work.
  33991. In many programs, you will want to call g_spawn_check_exit_status()
  33992. in the callback to determine whether or not the child exited
  33993. successfully.
  33994. Also, note that on platforms where #GPid must be explicitly closed
  33995. (see g_spawn_close_pid()) @pid must not be closed while the source
  33996. is still active. Typically, you should invoke g_spawn_close_pid()
  33997. in the callback function for the source.
  33998. GLib supports only a single callback per process id.
  33999. This internally creates a main loop source using
  34000. g_child_watch_source_new() and attaches it to the main loop context
  34001. using g_source_attach(). You can do these steps manually if you
  34002. need greater control.</doc>
  34003. <return-value transfer-ownership="none">
  34004. <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
  34005. <type name="guint" c:type="guint"/>
  34006. </return-value>
  34007. <parameters>
  34008. <parameter name="priority" transfer-ownership="none">
  34009. <doc xml:space="preserve">the priority of the idle source. Typically this will be in the
  34010. range between #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE.</doc>
  34011. <type name="gint" c:type="gint"/>
  34012. </parameter>
  34013. <parameter name="pid" transfer-ownership="none">
  34014. <doc xml:space="preserve">process to watch. On POSIX the positive pid of a child process. On
  34015. Windows a handle for a process (which doesn't have to be a child).</doc>
  34016. <type name="Pid" c:type="GPid"/>
  34017. </parameter>
  34018. <parameter name="function"
  34019. transfer-ownership="none"
  34020. scope="notified"
  34021. closure="3"
  34022. destroy="4">
  34023. <doc xml:space="preserve">function to call</doc>
  34024. <type name="ChildWatchFunc" c:type="GChildWatchFunc"/>
  34025. </parameter>
  34026. <parameter name="data"
  34027. transfer-ownership="none"
  34028. nullable="1"
  34029. allow-none="1">
  34030. <doc xml:space="preserve">data to pass to @function</doc>
  34031. <type name="gpointer" c:type="gpointer"/>
  34032. </parameter>
  34033. <parameter name="notify"
  34034. transfer-ownership="none"
  34035. nullable="1"
  34036. allow-none="1"
  34037. scope="async">
  34038. <doc xml:space="preserve">function to call when the idle is removed, or %NULL</doc>
  34039. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  34040. </parameter>
  34041. </parameters>
  34042. </function>
  34043. <function name="child_watch_source_new"
  34044. c:identifier="g_child_watch_source_new"
  34045. version="2.4">
  34046. <doc xml:space="preserve">Creates a new child_watch source.
  34047. The source will not initially be associated with any #GMainContext
  34048. and must be added to one with g_source_attach() before it will be
  34049. executed.
  34050. Note that child watch sources can only be used in conjunction with
  34051. `g_spawn...` when the %G_SPAWN_DO_NOT_REAP_CHILD flag is used.
  34052. Note that on platforms where #GPid must be explicitly closed
  34053. (see g_spawn_close_pid()) @pid must not be closed while the
  34054. source is still active. Typically, you will want to call
  34055. g_spawn_close_pid() in the callback function for the source.
  34056. Note further that using g_child_watch_source_new() is not
  34057. compatible with calling `waitpid` with a nonpositive first
  34058. argument in the application. Calling waitpid() for individual
  34059. pids will still work fine.
  34060. Similarly, on POSIX platforms, the @pid passed to this function must
  34061. be greater than 0 (i.e. this function must wait for a specific child,
  34062. and cannot wait for one of many children by using a nonpositive argument).</doc>
  34063. <return-value transfer-ownership="full">
  34064. <doc xml:space="preserve">the newly-created child watch source</doc>
  34065. <type name="Source" c:type="GSource*"/>
  34066. </return-value>
  34067. <parameters>
  34068. <parameter name="pid" transfer-ownership="none">
  34069. <doc xml:space="preserve">process to watch. On POSIX the positive pid of a child process. On
  34070. Windows a handle for a process (which doesn't have to be a child).</doc>
  34071. <type name="Pid" c:type="GPid"/>
  34072. </parameter>
  34073. </parameters>
  34074. </function>
  34075. <function name="clear_error" c:identifier="g_clear_error" throws="1">
  34076. <doc xml:space="preserve">If @err or *@err is %NULL, does nothing. Otherwise,
  34077. calls g_error_free() on *@err and sets *@err to %NULL.</doc>
  34078. <return-value transfer-ownership="none">
  34079. <type name="none" c:type="void"/>
  34080. </return-value>
  34081. </function>
  34082. <function name="clear_pointer"
  34083. c:identifier="g_clear_pointer"
  34084. version="2.34"
  34085. introspectable="0">
  34086. <doc xml:space="preserve">Clears a reference to a variable.
  34087. @pp must not be %NULL.
  34088. If the reference is %NULL then this function does nothing.
  34089. Otherwise, the variable is destroyed using @destroy and the
  34090. pointer is set to %NULL.
  34091. A macro is also included that allows this function to be used without
  34092. pointer casts.</doc>
  34093. <return-value transfer-ownership="none">
  34094. <type name="none" c:type="void"/>
  34095. </return-value>
  34096. <parameters>
  34097. <parameter name="pp" transfer-ownership="none">
  34098. <doc xml:space="preserve">a pointer to a variable, struct member etc. holding a
  34099. pointer</doc>
  34100. <type name="gpointer" c:type="gpointer*"/>
  34101. </parameter>
  34102. <parameter name="destroy" transfer-ownership="none" scope="async">
  34103. <doc xml:space="preserve">a function to which a gpointer can be passed, to destroy *@pp</doc>
  34104. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  34105. </parameter>
  34106. </parameters>
  34107. </function>
  34108. <function name="close" c:identifier="g_close" version="2.36" throws="1">
  34109. <doc xml:space="preserve">This wraps the close() call; in case of error, %errno will be
  34110. preserved, but the error will also be stored as a #GError in @error.
  34111. Besides using #GError, there is another major reason to prefer this
  34112. function over the call provided by the system; on Unix, it will
  34113. attempt to correctly handle %EINTR, which has platform-specific
  34114. semantics.</doc>
  34115. <return-value transfer-ownership="none">
  34116. <doc xml:space="preserve">%TRUE on success, %FALSE if there was an error.</doc>
  34117. <type name="gboolean" c:type="gboolean"/>
  34118. </return-value>
  34119. <parameters>
  34120. <parameter name="fd" transfer-ownership="none">
  34121. <doc xml:space="preserve">A file descriptor</doc>
  34122. <type name="gint" c:type="gint"/>
  34123. </parameter>
  34124. </parameters>
  34125. </function>
  34126. <function name="compute_checksum_for_bytes"
  34127. c:identifier="g_compute_checksum_for_bytes"
  34128. version="2.34">
  34129. <doc xml:space="preserve">Computes the checksum for a binary @data. This is a
  34130. convenience wrapper for g_checksum_new(), g_checksum_get_string()
  34131. and g_checksum_free().
  34132. The hexadecimal string returned will be in lower case.</doc>
  34133. <return-value transfer-ownership="full">
  34134. <doc xml:space="preserve">the digest of the binary data as a string in hexadecimal.
  34135. The returned string should be freed with g_free() when done using it.</doc>
  34136. <type name="utf8" c:type="gchar*"/>
  34137. </return-value>
  34138. <parameters>
  34139. <parameter name="checksum_type" transfer-ownership="none">
  34140. <doc xml:space="preserve">a #GChecksumType</doc>
  34141. <type name="ChecksumType" c:type="GChecksumType"/>
  34142. </parameter>
  34143. <parameter name="data" transfer-ownership="none">
  34144. <doc xml:space="preserve">binary blob to compute the digest of</doc>
  34145. <type name="Bytes" c:type="GBytes*"/>
  34146. </parameter>
  34147. </parameters>
  34148. </function>
  34149. <function name="compute_checksum_for_data"
  34150. c:identifier="g_compute_checksum_for_data"
  34151. version="2.16">
  34152. <doc xml:space="preserve">Computes the checksum for a binary @data of @length. This is a
  34153. convenience wrapper for g_checksum_new(), g_checksum_get_string()
  34154. and g_checksum_free().
  34155. The hexadecimal string returned will be in lower case.</doc>
  34156. <return-value transfer-ownership="full">
  34157. <doc xml:space="preserve">the digest of the binary data as a string in hexadecimal.
  34158. The returned string should be freed with g_free() when done using it.</doc>
  34159. <type name="utf8" c:type="gchar*"/>
  34160. </return-value>
  34161. <parameters>
  34162. <parameter name="checksum_type" transfer-ownership="none">
  34163. <doc xml:space="preserve">a #GChecksumType</doc>
  34164. <type name="ChecksumType" c:type="GChecksumType"/>
  34165. </parameter>
  34166. <parameter name="data" transfer-ownership="none">
  34167. <doc xml:space="preserve">binary blob to compute the digest of</doc>
  34168. <array length="2" zero-terminated="0" c:type="guchar*">
  34169. <type name="guint8"/>
  34170. </array>
  34171. </parameter>
  34172. <parameter name="length" transfer-ownership="none">
  34173. <doc xml:space="preserve">length of @data</doc>
  34174. <type name="gsize" c:type="gsize"/>
  34175. </parameter>
  34176. </parameters>
  34177. </function>
  34178. <function name="compute_checksum_for_string"
  34179. c:identifier="g_compute_checksum_for_string"
  34180. version="2.16">
  34181. <doc xml:space="preserve">Computes the checksum of a string.
  34182. The hexadecimal string returned will be in lower case.</doc>
  34183. <return-value transfer-ownership="full">
  34184. <doc xml:space="preserve">the checksum as a hexadecimal string. The returned string
  34185. should be freed with g_free() when done using it.</doc>
  34186. <type name="utf8" c:type="gchar*"/>
  34187. </return-value>
  34188. <parameters>
  34189. <parameter name="checksum_type" transfer-ownership="none">
  34190. <doc xml:space="preserve">a #GChecksumType</doc>
  34191. <type name="ChecksumType" c:type="GChecksumType"/>
  34192. </parameter>
  34193. <parameter name="str" transfer-ownership="none">
  34194. <doc xml:space="preserve">the string to compute the checksum of</doc>
  34195. <type name="utf8" c:type="const gchar*"/>
  34196. </parameter>
  34197. <parameter name="length" transfer-ownership="none">
  34198. <doc xml:space="preserve">the length of the string, or -1 if the string is null-terminated.</doc>
  34199. <type name="gssize" c:type="gssize"/>
  34200. </parameter>
  34201. </parameters>
  34202. </function>
  34203. <function name="compute_hmac_for_data"
  34204. c:identifier="g_compute_hmac_for_data"
  34205. version="2.30">
  34206. <doc xml:space="preserve">Computes the HMAC for a binary @data of @length. This is a
  34207. convenience wrapper for g_hmac_new(), g_hmac_get_string()
  34208. and g_hmac_unref().
  34209. The hexadecimal string returned will be in lower case.</doc>
  34210. <return-value transfer-ownership="full">
  34211. <doc xml:space="preserve">the HMAC of the binary data as a string in hexadecimal.
  34212. The returned string should be freed with g_free() when done using it.</doc>
  34213. <type name="utf8" c:type="gchar*"/>
  34214. </return-value>
  34215. <parameters>
  34216. <parameter name="digest_type" transfer-ownership="none">
  34217. <doc xml:space="preserve">a #GChecksumType to use for the HMAC</doc>
  34218. <type name="ChecksumType" c:type="GChecksumType"/>
  34219. </parameter>
  34220. <parameter name="key" transfer-ownership="none">
  34221. <doc xml:space="preserve">the key to use in the HMAC</doc>
  34222. <array length="2" zero-terminated="0" c:type="guchar*">
  34223. <type name="guint8" c:type="guchar"/>
  34224. </array>
  34225. </parameter>
  34226. <parameter name="key_len" transfer-ownership="none">
  34227. <doc xml:space="preserve">the length of the key</doc>
  34228. <type name="gsize" c:type="gsize"/>
  34229. </parameter>
  34230. <parameter name="data" transfer-ownership="none">
  34231. <doc xml:space="preserve">binary blob to compute the HMAC of</doc>
  34232. <type name="guint8" c:type="const guchar*"/>
  34233. </parameter>
  34234. <parameter name="length" transfer-ownership="none">
  34235. <doc xml:space="preserve">length of @data</doc>
  34236. <type name="gsize" c:type="gsize"/>
  34237. </parameter>
  34238. </parameters>
  34239. </function>
  34240. <function name="compute_hmac_for_string"
  34241. c:identifier="g_compute_hmac_for_string"
  34242. version="2.30">
  34243. <doc xml:space="preserve">Computes the HMAC for a string.
  34244. The hexadecimal string returned will be in lower case.</doc>
  34245. <return-value transfer-ownership="full">
  34246. <doc xml:space="preserve">the HMAC as a hexadecimal string.
  34247. The returned string should be freed with g_free()
  34248. when done using it.</doc>
  34249. <type name="utf8" c:type="gchar*"/>
  34250. </return-value>
  34251. <parameters>
  34252. <parameter name="digest_type" transfer-ownership="none">
  34253. <doc xml:space="preserve">a #GChecksumType to use for the HMAC</doc>
  34254. <type name="ChecksumType" c:type="GChecksumType"/>
  34255. </parameter>
  34256. <parameter name="key" transfer-ownership="none">
  34257. <doc xml:space="preserve">the key to use in the HMAC</doc>
  34258. <array length="2" zero-terminated="0" c:type="guchar*">
  34259. <type name="guint8" c:type="guchar"/>
  34260. </array>
  34261. </parameter>
  34262. <parameter name="key_len" transfer-ownership="none">
  34263. <doc xml:space="preserve">the length of the key</doc>
  34264. <type name="gsize" c:type="gsize"/>
  34265. </parameter>
  34266. <parameter name="str" transfer-ownership="none">
  34267. <doc xml:space="preserve">the string to compute the HMAC for</doc>
  34268. <type name="utf8" c:type="const gchar*"/>
  34269. </parameter>
  34270. <parameter name="length" transfer-ownership="none">
  34271. <doc xml:space="preserve">the length of the string, or -1 if the string is nul-terminated</doc>
  34272. <type name="gssize" c:type="gssize"/>
  34273. </parameter>
  34274. </parameters>
  34275. </function>
  34276. <function name="convert" c:identifier="g_convert" throws="1">
  34277. <doc xml:space="preserve">Converts a string from one character set to another.
  34278. Note that you should use g_iconv() for streaming conversions.
  34279. Despite the fact that @byes_read can return information about partial
  34280. characters, the g_convert_... functions are not generally suitable
  34281. for streaming. If the underlying converter maintains internal state,
  34282. then this won't be preserved across successive calls to g_convert(),
  34283. g_convert_with_iconv() or g_convert_with_fallback(). (An example of
  34284. this is the GNU C converter for CP1255 which does not emit a base
  34285. character until it knows that the next character is not a mark that
  34286. could combine with the base character.)
  34287. Using extensions such as "//TRANSLIT" may not work (or may not work
  34288. well) on many platforms. Consider using g_str_to_ascii() instead.</doc>
  34289. <return-value transfer-ownership="full">
  34290. <doc xml:space="preserve">If the conversion was successful, a newly allocated
  34291. nul-terminated string, which must be freed with
  34292. g_free(). Otherwise %NULL and @error will be set.</doc>
  34293. <type name="utf8" c:type="gchar*"/>
  34294. </return-value>
  34295. <parameters>
  34296. <parameter name="str" transfer-ownership="none">
  34297. <doc xml:space="preserve">the string to convert</doc>
  34298. <type name="utf8" c:type="const gchar*"/>
  34299. </parameter>
  34300. <parameter name="len" transfer-ownership="none">
  34301. <doc xml:space="preserve">the length of the string in bytes, or -1 if the string is
  34302. nul-terminated (Note that some encodings may allow nul
  34303. bytes to occur inside strings. In that case, using -1
  34304. for the @len parameter is unsafe)</doc>
  34305. <type name="gssize" c:type="gssize"/>
  34306. </parameter>
  34307. <parameter name="to_codeset" transfer-ownership="none">
  34308. <doc xml:space="preserve">name of character set into which to convert @str</doc>
  34309. <type name="utf8" c:type="const gchar*"/>
  34310. </parameter>
  34311. <parameter name="from_codeset" transfer-ownership="none">
  34312. <doc xml:space="preserve">character set of @str.</doc>
  34313. <type name="utf8" c:type="const gchar*"/>
  34314. </parameter>
  34315. <parameter name="bytes_read"
  34316. direction="out"
  34317. caller-allocates="0"
  34318. transfer-ownership="full">
  34319. <doc xml:space="preserve">location to store the number of bytes in the
  34320. input string that were successfully converted, or %NULL.
  34321. Even if the conversion was successful, this may be
  34322. less than @len if there were partial characters
  34323. at the end of the input. If the error
  34324. #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
  34325. stored will the byte offset after the last valid
  34326. input sequence.</doc>
  34327. <type name="gsize" c:type="gsize*"/>
  34328. </parameter>
  34329. <parameter name="bytes_written"
  34330. direction="out"
  34331. caller-allocates="0"
  34332. transfer-ownership="full">
  34333. <doc xml:space="preserve">the number of bytes stored in the output buffer (not
  34334. including the terminating nul).</doc>
  34335. <type name="gsize" c:type="gsize*"/>
  34336. </parameter>
  34337. </parameters>
  34338. </function>
  34339. <function name="convert_error_quark" c:identifier="g_convert_error_quark">
  34340. <return-value transfer-ownership="none">
  34341. <type name="Quark" c:type="GQuark"/>
  34342. </return-value>
  34343. </function>
  34344. <function name="convert_with_fallback"
  34345. c:identifier="g_convert_with_fallback"
  34346. throws="1">
  34347. <doc xml:space="preserve">Converts a string from one character set to another, possibly
  34348. including fallback sequences for characters not representable
  34349. in the output. Note that it is not guaranteed that the specification
  34350. for the fallback sequences in @fallback will be honored. Some
  34351. systems may do an approximate conversion from @from_codeset
  34352. to @to_codeset in their iconv() functions,
  34353. in which case GLib will simply return that approximate conversion.
  34354. Note that you should use g_iconv() for streaming conversions.
  34355. Despite the fact that @byes_read can return information about partial
  34356. characters, the g_convert_... functions are not generally suitable
  34357. for streaming. If the underlying converter maintains internal state,
  34358. then this won't be preserved across successive calls to g_convert(),
  34359. g_convert_with_iconv() or g_convert_with_fallback(). (An example of
  34360. this is the GNU C converter for CP1255 which does not emit a base
  34361. character until it knows that the next character is not a mark that
  34362. could combine with the base character.)</doc>
  34363. <return-value transfer-ownership="full">
  34364. <doc xml:space="preserve">If the conversion was successful, a newly allocated
  34365. nul-terminated string, which must be freed with
  34366. g_free(). Otherwise %NULL and @error will be set.</doc>
  34367. <type name="utf8" c:type="gchar*"/>
  34368. </return-value>
  34369. <parameters>
  34370. <parameter name="str" transfer-ownership="none">
  34371. <doc xml:space="preserve">the string to convert</doc>
  34372. <type name="utf8" c:type="const gchar*"/>
  34373. </parameter>
  34374. <parameter name="len" transfer-ownership="none">
  34375. <doc xml:space="preserve">the length of the string in bytes, or -1 if the string is
  34376. nul-terminated (Note that some encodings may allow nul
  34377. bytes to occur inside strings. In that case, using -1
  34378. for the @len parameter is unsafe)</doc>
  34379. <type name="gssize" c:type="gssize"/>
  34380. </parameter>
  34381. <parameter name="to_codeset" transfer-ownership="none">
  34382. <doc xml:space="preserve">name of character set into which to convert @str</doc>
  34383. <type name="utf8" c:type="const gchar*"/>
  34384. </parameter>
  34385. <parameter name="from_codeset" transfer-ownership="none">
  34386. <doc xml:space="preserve">character set of @str.</doc>
  34387. <type name="utf8" c:type="const gchar*"/>
  34388. </parameter>
  34389. <parameter name="fallback" transfer-ownership="none">
  34390. <doc xml:space="preserve">UTF-8 string to use in place of character not
  34391. present in the target encoding. (The string must be
  34392. representable in the target encoding).
  34393. If %NULL, characters not in the target encoding will
  34394. be represented as Unicode escapes \uxxxx or \Uxxxxyyyy.</doc>
  34395. <type name="utf8" c:type="const gchar*"/>
  34396. </parameter>
  34397. <parameter name="bytes_read" transfer-ownership="none">
  34398. <doc xml:space="preserve">location to store the number of bytes in the
  34399. input string that were successfully converted, or %NULL.
  34400. Even if the conversion was successful, this may be
  34401. less than @len if there were partial characters
  34402. at the end of the input.</doc>
  34403. <type name="gsize" c:type="gsize*"/>
  34404. </parameter>
  34405. <parameter name="bytes_written" transfer-ownership="none">
  34406. <doc xml:space="preserve">the number of bytes stored in the output buffer (not
  34407. including the terminating nul).</doc>
  34408. <type name="gsize" c:type="gsize*"/>
  34409. </parameter>
  34410. </parameters>
  34411. </function>
  34412. <function name="convert_with_iconv"
  34413. c:identifier="g_convert_with_iconv"
  34414. throws="1">
  34415. <doc xml:space="preserve">Converts a string from one character set to another.
  34416. Note that you should use g_iconv() for streaming conversions.
  34417. Despite the fact that @byes_read can return information about partial
  34418. characters, the g_convert_... functions are not generally suitable
  34419. for streaming. If the underlying converter maintains internal state,
  34420. then this won't be preserved across successive calls to g_convert(),
  34421. g_convert_with_iconv() or g_convert_with_fallback(). (An example of
  34422. this is the GNU C converter for CP1255 which does not emit a base
  34423. character until it knows that the next character is not a mark that
  34424. could combine with the base character.)</doc>
  34425. <return-value transfer-ownership="full">
  34426. <doc xml:space="preserve">If the conversion was successful, a newly allocated
  34427. nul-terminated string, which must be freed with
  34428. g_free(). Otherwise %NULL and @error will be set.</doc>
  34429. <type name="utf8" c:type="gchar*"/>
  34430. </return-value>
  34431. <parameters>
  34432. <parameter name="str" transfer-ownership="none">
  34433. <doc xml:space="preserve">the string to convert</doc>
  34434. <type name="utf8" c:type="const gchar*"/>
  34435. </parameter>
  34436. <parameter name="len" transfer-ownership="none">
  34437. <doc xml:space="preserve">the length of the string in bytes, or -1 if the string is
  34438. nul-terminated (Note that some encodings may allow nul
  34439. bytes to occur inside strings. In that case, using -1
  34440. for the @len parameter is unsafe)</doc>
  34441. <type name="gssize" c:type="gssize"/>
  34442. </parameter>
  34443. <parameter name="converter" transfer-ownership="none">
  34444. <doc xml:space="preserve">conversion descriptor from g_iconv_open()</doc>
  34445. <type name="IConv" c:type="GIConv"/>
  34446. </parameter>
  34447. <parameter name="bytes_read" transfer-ownership="none">
  34448. <doc xml:space="preserve">location to store the number of bytes in the
  34449. input string that were successfully converted, or %NULL.
  34450. Even if the conversion was successful, this may be
  34451. less than @len if there were partial characters
  34452. at the end of the input. If the error
  34453. #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
  34454. stored will the byte offset after the last valid
  34455. input sequence.</doc>
  34456. <type name="gsize" c:type="gsize*"/>
  34457. </parameter>
  34458. <parameter name="bytes_written" transfer-ownership="none">
  34459. <doc xml:space="preserve">the number of bytes stored in the output buffer (not
  34460. including the terminating nul).</doc>
  34461. <type name="gsize" c:type="gsize*"/>
  34462. </parameter>
  34463. </parameters>
  34464. </function>
  34465. <function name="datalist_clear" c:identifier="g_datalist_clear">
  34466. <doc xml:space="preserve">Frees all the data elements of the datalist.
  34467. The data elements' destroy functions are called
  34468. if they have been set.</doc>
  34469. <return-value transfer-ownership="none">
  34470. <type name="none" c:type="void"/>
  34471. </return-value>
  34472. <parameters>
  34473. <parameter name="datalist" transfer-ownership="none">
  34474. <doc xml:space="preserve">a datalist.</doc>
  34475. <type name="Data" c:type="GData**"/>
  34476. </parameter>
  34477. </parameters>
  34478. </function>
  34479. <function name="datalist_foreach"
  34480. c:identifier="g_datalist_foreach"
  34481. introspectable="0">
  34482. <doc xml:space="preserve">Calls the given function for each data element of the datalist. The
  34483. function is called with each data element's #GQuark id and data,
  34484. together with the given @user_data parameter. Note that this
  34485. function is NOT thread-safe. So unless @datalist can be protected
  34486. from any modifications during invocation of this function, it should
  34487. not be called.</doc>
  34488. <return-value transfer-ownership="none">
  34489. <type name="none" c:type="void"/>
  34490. </return-value>
  34491. <parameters>
  34492. <parameter name="datalist" transfer-ownership="none">
  34493. <doc xml:space="preserve">a datalist.</doc>
  34494. <type name="Data" c:type="GData**"/>
  34495. </parameter>
  34496. <parameter name="func" transfer-ownership="none" closure="2">
  34497. <doc xml:space="preserve">the function to call for each data element.</doc>
  34498. <type name="DataForeachFunc" c:type="GDataForeachFunc"/>
  34499. </parameter>
  34500. <parameter name="user_data"
  34501. transfer-ownership="none"
  34502. nullable="1"
  34503. allow-none="1">
  34504. <doc xml:space="preserve">user data to pass to the function.</doc>
  34505. <type name="gpointer" c:type="gpointer"/>
  34506. </parameter>
  34507. </parameters>
  34508. </function>
  34509. <function name="datalist_get_data" c:identifier="g_datalist_get_data">
  34510. <doc xml:space="preserve">Gets a data element, using its string identifier. This is slower than
  34511. g_datalist_id_get_data() because it compares strings.</doc>
  34512. <return-value transfer-ownership="none" nullable="1">
  34513. <doc xml:space="preserve">the data element, or %NULL if it is not found.</doc>
  34514. <type name="gpointer" c:type="gpointer"/>
  34515. </return-value>
  34516. <parameters>
  34517. <parameter name="datalist" transfer-ownership="none">
  34518. <doc xml:space="preserve">a datalist.</doc>
  34519. <type name="Data" c:type="GData**"/>
  34520. </parameter>
  34521. <parameter name="key" transfer-ownership="none">
  34522. <doc xml:space="preserve">the string identifying a data element.</doc>
  34523. <type name="utf8" c:type="const gchar*"/>
  34524. </parameter>
  34525. </parameters>
  34526. </function>
  34527. <function name="datalist_get_flags"
  34528. c:identifier="g_datalist_get_flags"
  34529. version="2.8">
  34530. <doc xml:space="preserve">Gets flags values packed in together with the datalist.
  34531. See g_datalist_set_flags().</doc>
  34532. <return-value transfer-ownership="none">
  34533. <doc xml:space="preserve">the flags of the datalist</doc>
  34534. <type name="guint" c:type="guint"/>
  34535. </return-value>
  34536. <parameters>
  34537. <parameter name="datalist" transfer-ownership="none">
  34538. <doc xml:space="preserve">pointer to the location that holds a list</doc>
  34539. <type name="Data" c:type="GData**"/>
  34540. </parameter>
  34541. </parameters>
  34542. </function>
  34543. <function name="datalist_id_dup_data"
  34544. c:identifier="g_datalist_id_dup_data"
  34545. version="2.34"
  34546. introspectable="0">
  34547. <doc xml:space="preserve">This is a variant of g_datalist_id_get_data() which
  34548. returns a 'duplicate' of the value. @dup_func defines the
  34549. meaning of 'duplicate' in this context, it could e.g.
  34550. take a reference on a ref-counted object.
  34551. If the @key_id is not set in the datalist then @dup_func
  34552. will be called with a %NULL argument.
  34553. Note that @dup_func is called while the datalist is locked, so it
  34554. is not allowed to read or modify the datalist.
  34555. This function can be useful to avoid races when multiple
  34556. threads are using the same datalist and the same key.</doc>
  34557. <return-value transfer-ownership="none" nullable="1">
  34558. <doc xml:space="preserve">the result of calling @dup_func on the value
  34559. associated with @key_id in @datalist, or %NULL if not set.
  34560. If @dup_func is %NULL, the value is returned unmodified.</doc>
  34561. <type name="gpointer" c:type="gpointer"/>
  34562. </return-value>
  34563. <parameters>
  34564. <parameter name="datalist" transfer-ownership="none">
  34565. <doc xml:space="preserve">location of a datalist</doc>
  34566. <type name="Data" c:type="GData**"/>
  34567. </parameter>
  34568. <parameter name="key_id" transfer-ownership="none">
  34569. <doc xml:space="preserve">the #GQuark identifying a data element</doc>
  34570. <type name="Quark" c:type="GQuark"/>
  34571. </parameter>
  34572. <parameter name="dup_func"
  34573. transfer-ownership="none"
  34574. nullable="1"
  34575. allow-none="1"
  34576. closure="3">
  34577. <doc xml:space="preserve">function to duplicate the old value</doc>
  34578. <type name="DuplicateFunc" c:type="GDuplicateFunc"/>
  34579. </parameter>
  34580. <parameter name="user_data"
  34581. transfer-ownership="none"
  34582. nullable="1"
  34583. allow-none="1">
  34584. <doc xml:space="preserve">passed as user_data to @dup_func</doc>
  34585. <type name="gpointer" c:type="gpointer"/>
  34586. </parameter>
  34587. </parameters>
  34588. </function>
  34589. <function name="datalist_id_get_data"
  34590. c:identifier="g_datalist_id_get_data">
  34591. <doc xml:space="preserve">Retrieves the data element corresponding to @key_id.</doc>
  34592. <return-value transfer-ownership="none" nullable="1">
  34593. <doc xml:space="preserve">the data element, or %NULL if it is not found.</doc>
  34594. <type name="gpointer" c:type="gpointer"/>
  34595. </return-value>
  34596. <parameters>
  34597. <parameter name="datalist" transfer-ownership="none">
  34598. <doc xml:space="preserve">a datalist.</doc>
  34599. <type name="Data" c:type="GData**"/>
  34600. </parameter>
  34601. <parameter name="key_id" transfer-ownership="none">
  34602. <doc xml:space="preserve">the #GQuark identifying a data element.</doc>
  34603. <type name="Quark" c:type="GQuark"/>
  34604. </parameter>
  34605. </parameters>
  34606. </function>
  34607. <function name="datalist_id_remove_no_notify"
  34608. c:identifier="g_datalist_id_remove_no_notify">
  34609. <doc xml:space="preserve">Removes an element, without calling its destroy notification
  34610. function.</doc>
  34611. <return-value transfer-ownership="none" nullable="1">
  34612. <doc xml:space="preserve">the data previously stored at @key_id, or %NULL if none.</doc>
  34613. <type name="gpointer" c:type="gpointer"/>
  34614. </return-value>
  34615. <parameters>
  34616. <parameter name="datalist" transfer-ownership="none">
  34617. <doc xml:space="preserve">a datalist.</doc>
  34618. <type name="Data" c:type="GData**"/>
  34619. </parameter>
  34620. <parameter name="key_id" transfer-ownership="none">
  34621. <doc xml:space="preserve">the #GQuark identifying a data element.</doc>
  34622. <type name="Quark" c:type="GQuark"/>
  34623. </parameter>
  34624. </parameters>
  34625. </function>
  34626. <function name="datalist_id_replace_data"
  34627. c:identifier="g_datalist_id_replace_data"
  34628. version="2.34">
  34629. <doc xml:space="preserve">Compares the member that is associated with @key_id in
  34630. @datalist to @oldval, and if they are the same, replace
  34631. @oldval with @newval.
  34632. This is like a typical atomic compare-and-exchange
  34633. operation, for a member of @datalist.
  34634. If the previous value was replaced then ownership of the
  34635. old value (@oldval) is passed to the caller, including
  34636. the registred destroy notify for it (passed out in @old_destroy).
  34637. Its up to the caller to free this as he wishes, which may
  34638. or may not include using @old_destroy as sometimes replacement
  34639. should not destroy the object in the normal way.</doc>
  34640. <return-value transfer-ownership="none">
  34641. <doc xml:space="preserve">%TRUE if the existing value for @key_id was replaced
  34642. by @newval, %FALSE otherwise.</doc>
  34643. <type name="gboolean" c:type="gboolean"/>
  34644. </return-value>
  34645. <parameters>
  34646. <parameter name="datalist" transfer-ownership="none">
  34647. <doc xml:space="preserve">location of a datalist</doc>
  34648. <type name="Data" c:type="GData**"/>
  34649. </parameter>
  34650. <parameter name="key_id" transfer-ownership="none">
  34651. <doc xml:space="preserve">the #GQuark identifying a data element</doc>
  34652. <type name="Quark" c:type="GQuark"/>
  34653. </parameter>
  34654. <parameter name="oldval"
  34655. transfer-ownership="none"
  34656. nullable="1"
  34657. allow-none="1">
  34658. <doc xml:space="preserve">the old value to compare against</doc>
  34659. <type name="gpointer" c:type="gpointer"/>
  34660. </parameter>
  34661. <parameter name="newval"
  34662. transfer-ownership="none"
  34663. nullable="1"
  34664. allow-none="1">
  34665. <doc xml:space="preserve">the new value to replace it with</doc>
  34666. <type name="gpointer" c:type="gpointer"/>
  34667. </parameter>
  34668. <parameter name="destroy"
  34669. transfer-ownership="none"
  34670. nullable="1"
  34671. allow-none="1"
  34672. scope="async">
  34673. <doc xml:space="preserve">destroy notify for the new value</doc>
  34674. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  34675. </parameter>
  34676. <parameter name="old_destroy"
  34677. transfer-ownership="none"
  34678. nullable="1"
  34679. allow-none="1"
  34680. scope="async">
  34681. <doc xml:space="preserve">destroy notify for the existing value</doc>
  34682. <type name="DestroyNotify" c:type="GDestroyNotify*"/>
  34683. </parameter>
  34684. </parameters>
  34685. </function>
  34686. <function name="datalist_id_set_data_full"
  34687. c:identifier="g_datalist_id_set_data_full">
  34688. <doc xml:space="preserve">Sets the data corresponding to the given #GQuark id, and the
  34689. function to be called when the element is removed from the datalist.
  34690. Any previous data with the same key is removed, and its destroy
  34691. function is called.</doc>
  34692. <return-value transfer-ownership="none">
  34693. <type name="none" c:type="void"/>
  34694. </return-value>
  34695. <parameters>
  34696. <parameter name="datalist" transfer-ownership="none">
  34697. <doc xml:space="preserve">a datalist.</doc>
  34698. <type name="Data" c:type="GData**"/>
  34699. </parameter>
  34700. <parameter name="key_id" transfer-ownership="none">
  34701. <doc xml:space="preserve">the #GQuark to identify the data element.</doc>
  34702. <type name="Quark" c:type="GQuark"/>
  34703. </parameter>
  34704. <parameter name="data"
  34705. transfer-ownership="none"
  34706. nullable="1"
  34707. allow-none="1">
  34708. <doc xml:space="preserve">the data element or %NULL to remove any previous element
  34709. corresponding to @key_id.</doc>
  34710. <type name="gpointer" c:type="gpointer"/>
  34711. </parameter>
  34712. <parameter name="destroy_func" transfer-ownership="none" scope="async">
  34713. <doc xml:space="preserve">the function to call when the data element is
  34714. removed. This function will be called with the data
  34715. element and can be used to free any memory allocated
  34716. for it. If @data is %NULL, then @destroy_func must
  34717. also be %NULL.</doc>
  34718. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  34719. </parameter>
  34720. </parameters>
  34721. </function>
  34722. <function name="datalist_init" c:identifier="g_datalist_init">
  34723. <doc xml:space="preserve">Resets the datalist to %NULL. It does not free any memory or call
  34724. any destroy functions.</doc>
  34725. <return-value transfer-ownership="none">
  34726. <type name="none" c:type="void"/>
  34727. </return-value>
  34728. <parameters>
  34729. <parameter name="datalist" transfer-ownership="none">
  34730. <doc xml:space="preserve">a pointer to a pointer to a datalist.</doc>
  34731. <type name="Data" c:type="GData**"/>
  34732. </parameter>
  34733. </parameters>
  34734. </function>
  34735. <function name="datalist_set_flags"
  34736. c:identifier="g_datalist_set_flags"
  34737. version="2.8">
  34738. <doc xml:space="preserve">Turns on flag values for a data list. This function is used
  34739. to keep a small number of boolean flags in an object with
  34740. a data list without using any additional space. It is
  34741. not generally useful except in circumstances where space
  34742. is very tight. (It is used in the base #GObject type, for
  34743. example.)</doc>
  34744. <return-value transfer-ownership="none">
  34745. <type name="none" c:type="void"/>
  34746. </return-value>
  34747. <parameters>
  34748. <parameter name="datalist" transfer-ownership="none">
  34749. <doc xml:space="preserve">pointer to the location that holds a list</doc>
  34750. <type name="Data" c:type="GData**"/>
  34751. </parameter>
  34752. <parameter name="flags" transfer-ownership="none">
  34753. <doc xml:space="preserve">the flags to turn on. The values of the flags are
  34754. restricted by %G_DATALIST_FLAGS_MASK (currently
  34755. 3; giving two possible boolean flags).
  34756. A value for @flags that doesn't fit within the mask is
  34757. an error.</doc>
  34758. <type name="guint" c:type="guint"/>
  34759. </parameter>
  34760. </parameters>
  34761. </function>
  34762. <function name="datalist_unset_flags"
  34763. c:identifier="g_datalist_unset_flags"
  34764. version="2.8">
  34765. <doc xml:space="preserve">Turns off flag values for a data list. See g_datalist_unset_flags()</doc>
  34766. <return-value transfer-ownership="none">
  34767. <type name="none" c:type="void"/>
  34768. </return-value>
  34769. <parameters>
  34770. <parameter name="datalist" transfer-ownership="none">
  34771. <doc xml:space="preserve">pointer to the location that holds a list</doc>
  34772. <type name="Data" c:type="GData**"/>
  34773. </parameter>
  34774. <parameter name="flags" transfer-ownership="none">
  34775. <doc xml:space="preserve">the flags to turn off. The values of the flags are
  34776. restricted by %G_DATALIST_FLAGS_MASK (currently
  34777. 3: giving two possible boolean flags).
  34778. A value for @flags that doesn't fit within the mask is
  34779. an error.</doc>
  34780. <type name="guint" c:type="guint"/>
  34781. </parameter>
  34782. </parameters>
  34783. </function>
  34784. <function name="dataset_destroy" c:identifier="g_dataset_destroy">
  34785. <doc xml:space="preserve">Destroys the dataset, freeing all memory allocated, and calling any
  34786. destroy functions set for data elements.</doc>
  34787. <return-value transfer-ownership="none">
  34788. <type name="none" c:type="void"/>
  34789. </return-value>
  34790. <parameters>
  34791. <parameter name="dataset_location" transfer-ownership="none">
  34792. <doc xml:space="preserve">the location identifying the dataset.</doc>
  34793. <type name="gpointer" c:type="gconstpointer"/>
  34794. </parameter>
  34795. </parameters>
  34796. </function>
  34797. <function name="dataset_foreach"
  34798. c:identifier="g_dataset_foreach"
  34799. introspectable="0">
  34800. <doc xml:space="preserve">Calls the given function for each data element which is associated
  34801. with the given location. Note that this function is NOT thread-safe.
  34802. So unless @datalist can be protected from any modifications during
  34803. invocation of this function, it should not be called.</doc>
  34804. <return-value transfer-ownership="none">
  34805. <type name="none" c:type="void"/>
  34806. </return-value>
  34807. <parameters>
  34808. <parameter name="dataset_location" transfer-ownership="none">
  34809. <doc xml:space="preserve">the location identifying the dataset.</doc>
  34810. <type name="gpointer" c:type="gconstpointer"/>
  34811. </parameter>
  34812. <parameter name="func" transfer-ownership="none" closure="2">
  34813. <doc xml:space="preserve">the function to call for each data element.</doc>
  34814. <type name="DataForeachFunc" c:type="GDataForeachFunc"/>
  34815. </parameter>
  34816. <parameter name="user_data"
  34817. transfer-ownership="none"
  34818. nullable="1"
  34819. allow-none="1">
  34820. <doc xml:space="preserve">user data to pass to the function.</doc>
  34821. <type name="gpointer" c:type="gpointer"/>
  34822. </parameter>
  34823. </parameters>
  34824. </function>
  34825. <function name="dataset_id_get_data" c:identifier="g_dataset_id_get_data">
  34826. <doc xml:space="preserve">Gets the data element corresponding to a #GQuark.</doc>
  34827. <return-value transfer-ownership="none" nullable="1">
  34828. <doc xml:space="preserve">the data element corresponding to the #GQuark, or %NULL if
  34829. it is not found.</doc>
  34830. <type name="gpointer" c:type="gpointer"/>
  34831. </return-value>
  34832. <parameters>
  34833. <parameter name="dataset_location" transfer-ownership="none">
  34834. <doc xml:space="preserve">the location identifying the dataset.</doc>
  34835. <type name="gpointer" c:type="gconstpointer"/>
  34836. </parameter>
  34837. <parameter name="key_id" transfer-ownership="none">
  34838. <doc xml:space="preserve">the #GQuark id to identify the data element.</doc>
  34839. <type name="Quark" c:type="GQuark"/>
  34840. </parameter>
  34841. </parameters>
  34842. </function>
  34843. <function name="dataset_id_remove_no_notify"
  34844. c:identifier="g_dataset_id_remove_no_notify">
  34845. <doc xml:space="preserve">Removes an element, without calling its destroy notification
  34846. function.</doc>
  34847. <return-value transfer-ownership="none" nullable="1">
  34848. <doc xml:space="preserve">the data previously stored at @key_id, or %NULL if none.</doc>
  34849. <type name="gpointer" c:type="gpointer"/>
  34850. </return-value>
  34851. <parameters>
  34852. <parameter name="dataset_location" transfer-ownership="none">
  34853. <doc xml:space="preserve">the location identifying the dataset.</doc>
  34854. <type name="gpointer" c:type="gconstpointer"/>
  34855. </parameter>
  34856. <parameter name="key_id" transfer-ownership="none">
  34857. <doc xml:space="preserve">the #GQuark ID identifying the data element.</doc>
  34858. <type name="Quark" c:type="GQuark"/>
  34859. </parameter>
  34860. </parameters>
  34861. </function>
  34862. <function name="dataset_id_set_data_full"
  34863. c:identifier="g_dataset_id_set_data_full">
  34864. <doc xml:space="preserve">Sets the data element associated with the given #GQuark id, and also
  34865. the function to call when the data element is destroyed. Any
  34866. previous data with the same key is removed, and its destroy function
  34867. is called.</doc>
  34868. <return-value transfer-ownership="none">
  34869. <type name="none" c:type="void"/>
  34870. </return-value>
  34871. <parameters>
  34872. <parameter name="dataset_location" transfer-ownership="none">
  34873. <doc xml:space="preserve">the location identifying the dataset.</doc>
  34874. <type name="gpointer" c:type="gconstpointer"/>
  34875. </parameter>
  34876. <parameter name="key_id" transfer-ownership="none">
  34877. <doc xml:space="preserve">the #GQuark id to identify the data element.</doc>
  34878. <type name="Quark" c:type="GQuark"/>
  34879. </parameter>
  34880. <parameter name="data"
  34881. transfer-ownership="none"
  34882. nullable="1"
  34883. allow-none="1">
  34884. <doc xml:space="preserve">the data element.</doc>
  34885. <type name="gpointer" c:type="gpointer"/>
  34886. </parameter>
  34887. <parameter name="destroy_func" transfer-ownership="none" scope="async">
  34888. <doc xml:space="preserve">the function to call when the data element is
  34889. removed. This function will be called with the data
  34890. element and can be used to free any memory allocated
  34891. for it.</doc>
  34892. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  34893. </parameter>
  34894. </parameters>
  34895. </function>
  34896. <function name="date_get_days_in_month"
  34897. c:identifier="g_date_get_days_in_month"
  34898. moved-to="Date.get_days_in_month">
  34899. <doc xml:space="preserve">Returns the number of days in a month, taking leap
  34900. years into account.</doc>
  34901. <return-value transfer-ownership="none">
  34902. <doc xml:space="preserve">number of days in @month during the @year</doc>
  34903. <type name="guint8" c:type="guint8"/>
  34904. </return-value>
  34905. <parameters>
  34906. <parameter name="month" transfer-ownership="none">
  34907. <doc xml:space="preserve">month</doc>
  34908. <type name="DateMonth" c:type="GDateMonth"/>
  34909. </parameter>
  34910. <parameter name="year" transfer-ownership="none">
  34911. <doc xml:space="preserve">year</doc>
  34912. <type name="DateYear" c:type="GDateYear"/>
  34913. </parameter>
  34914. </parameters>
  34915. </function>
  34916. <function name="date_get_monday_weeks_in_year"
  34917. c:identifier="g_date_get_monday_weeks_in_year"
  34918. moved-to="Date.get_monday_weeks_in_year">
  34919. <doc xml:space="preserve">Returns the number of weeks in the year, where weeks
  34920. are taken to start on Monday. Will be 52 or 53. The
  34921. date must be valid. (Years always have 52 7-day periods,
  34922. plus 1 or 2 extra days depending on whether it's a leap
  34923. year. This function is basically telling you how many
  34924. Mondays are in the year, i.e. there are 53 Mondays if
  34925. one of the extra days happens to be a Monday.)</doc>
  34926. <return-value transfer-ownership="none">
  34927. <doc xml:space="preserve">number of Mondays in the year</doc>
  34928. <type name="guint8" c:type="guint8"/>
  34929. </return-value>
  34930. <parameters>
  34931. <parameter name="year" transfer-ownership="none">
  34932. <doc xml:space="preserve">a year</doc>
  34933. <type name="DateYear" c:type="GDateYear"/>
  34934. </parameter>
  34935. </parameters>
  34936. </function>
  34937. <function name="date_get_sunday_weeks_in_year"
  34938. c:identifier="g_date_get_sunday_weeks_in_year"
  34939. moved-to="Date.get_sunday_weeks_in_year">
  34940. <doc xml:space="preserve">Returns the number of weeks in the year, where weeks
  34941. are taken to start on Sunday. Will be 52 or 53. The
  34942. date must be valid. (Years always have 52 7-day periods,
  34943. plus 1 or 2 extra days depending on whether it's a leap
  34944. year. This function is basically telling you how many
  34945. Sundays are in the year, i.e. there are 53 Sundays if
  34946. one of the extra days happens to be a Sunday.)</doc>
  34947. <return-value transfer-ownership="none">
  34948. <doc xml:space="preserve">the number of weeks in @year</doc>
  34949. <type name="guint8" c:type="guint8"/>
  34950. </return-value>
  34951. <parameters>
  34952. <parameter name="year" transfer-ownership="none">
  34953. <doc xml:space="preserve">year to count weeks in</doc>
  34954. <type name="DateYear" c:type="GDateYear"/>
  34955. </parameter>
  34956. </parameters>
  34957. </function>
  34958. <function name="date_is_leap_year"
  34959. c:identifier="g_date_is_leap_year"
  34960. moved-to="Date.is_leap_year">
  34961. <doc xml:space="preserve">Returns %TRUE if the year is a leap year.
  34962. For the purposes of this function, leap year is every year
  34963. divisible by 4 unless that year is divisible by 100. If it
  34964. is divisible by 100 it would be a leap year only if that year
  34965. is also divisible by 400.</doc>
  34966. <return-value transfer-ownership="none">
  34967. <doc xml:space="preserve">%TRUE if the year is a leap year</doc>
  34968. <type name="gboolean" c:type="gboolean"/>
  34969. </return-value>
  34970. <parameters>
  34971. <parameter name="year" transfer-ownership="none">
  34972. <doc xml:space="preserve">year to check</doc>
  34973. <type name="DateYear" c:type="GDateYear"/>
  34974. </parameter>
  34975. </parameters>
  34976. </function>
  34977. <function name="date_strftime"
  34978. c:identifier="g_date_strftime"
  34979. moved-to="Date.strftime">
  34980. <doc xml:space="preserve">Generates a printed representation of the date, in a
  34981. [locale][setlocale]-specific way.
  34982. Works just like the platform's C library strftime() function,
  34983. but only accepts date-related formats; time-related formats
  34984. give undefined results. Date must be valid. Unlike strftime()
  34985. (which uses the locale encoding), works on a UTF-8 format
  34986. string and stores a UTF-8 result.
  34987. This function does not provide any conversion specifiers in
  34988. addition to those implemented by the platform's C library.
  34989. For example, don't expect that using g_date_strftime() would
  34990. make the \%F provided by the C99 strftime() work on Windows
  34991. where the C library only complies to C89.</doc>
  34992. <return-value transfer-ownership="none">
  34993. <doc xml:space="preserve">number of characters written to the buffer, or 0 the buffer was too small</doc>
  34994. <type name="gsize" c:type="gsize"/>
  34995. </return-value>
  34996. <parameters>
  34997. <parameter name="s" transfer-ownership="none">
  34998. <doc xml:space="preserve">destination buffer</doc>
  34999. <type name="utf8" c:type="gchar*"/>
  35000. </parameter>
  35001. <parameter name="slen" transfer-ownership="none">
  35002. <doc xml:space="preserve">buffer size</doc>
  35003. <type name="gsize" c:type="gsize"/>
  35004. </parameter>
  35005. <parameter name="format" transfer-ownership="none">
  35006. <doc xml:space="preserve">format string</doc>
  35007. <type name="utf8" c:type="const gchar*"/>
  35008. </parameter>
  35009. <parameter name="date" transfer-ownership="none">
  35010. <doc xml:space="preserve">valid #GDate</doc>
  35011. <type name="Date" c:type="const GDate*"/>
  35012. </parameter>
  35013. </parameters>
  35014. </function>
  35015. <function name="date_time_compare"
  35016. c:identifier="g_date_time_compare"
  35017. moved-to="DateTime.compare"
  35018. version="2.26">
  35019. <doc xml:space="preserve">A comparison function for #GDateTimes that is suitable
  35020. as a #GCompareFunc. Both #GDateTimes must be non-%NULL.</doc>
  35021. <return-value transfer-ownership="none">
  35022. <doc xml:space="preserve">-1, 0 or 1 if @dt1 is less than, equal to or greater
  35023. than @dt2.</doc>
  35024. <type name="gint" c:type="gint"/>
  35025. </return-value>
  35026. <parameters>
  35027. <parameter name="dt1" transfer-ownership="none">
  35028. <doc xml:space="preserve">first #GDateTime to compare</doc>
  35029. <type name="gpointer" c:type="gconstpointer"/>
  35030. </parameter>
  35031. <parameter name="dt2" transfer-ownership="none">
  35032. <doc xml:space="preserve">second #GDateTime to compare</doc>
  35033. <type name="gpointer" c:type="gconstpointer"/>
  35034. </parameter>
  35035. </parameters>
  35036. </function>
  35037. <function name="date_time_equal"
  35038. c:identifier="g_date_time_equal"
  35039. moved-to="DateTime.equal"
  35040. version="2.26">
  35041. <doc xml:space="preserve">Checks to see if @dt1 and @dt2 are equal.
  35042. Equal here means that they represent the same moment after converting
  35043. them to the same time zone.</doc>
  35044. <return-value transfer-ownership="none">
  35045. <doc xml:space="preserve">%TRUE if @dt1 and @dt2 are equal</doc>
  35046. <type name="gboolean" c:type="gboolean"/>
  35047. </return-value>
  35048. <parameters>
  35049. <parameter name="dt1" transfer-ownership="none">
  35050. <doc xml:space="preserve">a #GDateTime</doc>
  35051. <type name="gpointer" c:type="gconstpointer"/>
  35052. </parameter>
  35053. <parameter name="dt2" transfer-ownership="none">
  35054. <doc xml:space="preserve">a #GDateTime</doc>
  35055. <type name="gpointer" c:type="gconstpointer"/>
  35056. </parameter>
  35057. </parameters>
  35058. </function>
  35059. <function name="date_time_hash"
  35060. c:identifier="g_date_time_hash"
  35061. moved-to="DateTime.hash"
  35062. version="2.26">
  35063. <doc xml:space="preserve">Hashes @datetime into a #guint, suitable for use within #GHashTable.</doc>
  35064. <return-value transfer-ownership="none">
  35065. <doc xml:space="preserve">a #guint containing the hash</doc>
  35066. <type name="guint" c:type="guint"/>
  35067. </return-value>
  35068. <parameters>
  35069. <parameter name="datetime" transfer-ownership="none">
  35070. <doc xml:space="preserve">a #GDateTime</doc>
  35071. <type name="gpointer" c:type="gconstpointer"/>
  35072. </parameter>
  35073. </parameters>
  35074. </function>
  35075. <function name="date_valid_day"
  35076. c:identifier="g_date_valid_day"
  35077. moved-to="Date.valid_day">
  35078. <doc xml:space="preserve">Returns %TRUE if the day of the month is valid (a day is valid if it's
  35079. between 1 and 31 inclusive).</doc>
  35080. <return-value transfer-ownership="none">
  35081. <doc xml:space="preserve">%TRUE if the day is valid</doc>
  35082. <type name="gboolean" c:type="gboolean"/>
  35083. </return-value>
  35084. <parameters>
  35085. <parameter name="day" transfer-ownership="none">
  35086. <doc xml:space="preserve">day to check</doc>
  35087. <type name="DateDay" c:type="GDateDay"/>
  35088. </parameter>
  35089. </parameters>
  35090. </function>
  35091. <function name="date_valid_dmy"
  35092. c:identifier="g_date_valid_dmy"
  35093. moved-to="Date.valid_dmy">
  35094. <doc xml:space="preserve">Returns %TRUE if the day-month-year triplet forms a valid, existing day
  35095. in the range of days #GDate understands (Year 1 or later, no more than
  35096. a few thousand years in the future).</doc>
  35097. <return-value transfer-ownership="none">
  35098. <doc xml:space="preserve">%TRUE if the date is a valid one</doc>
  35099. <type name="gboolean" c:type="gboolean"/>
  35100. </return-value>
  35101. <parameters>
  35102. <parameter name="day" transfer-ownership="none">
  35103. <doc xml:space="preserve">day</doc>
  35104. <type name="DateDay" c:type="GDateDay"/>
  35105. </parameter>
  35106. <parameter name="month" transfer-ownership="none">
  35107. <doc xml:space="preserve">month</doc>
  35108. <type name="DateMonth" c:type="GDateMonth"/>
  35109. </parameter>
  35110. <parameter name="year" transfer-ownership="none">
  35111. <doc xml:space="preserve">year</doc>
  35112. <type name="DateYear" c:type="GDateYear"/>
  35113. </parameter>
  35114. </parameters>
  35115. </function>
  35116. <function name="date_valid_julian"
  35117. c:identifier="g_date_valid_julian"
  35118. moved-to="Date.valid_julian">
  35119. <doc xml:space="preserve">Returns %TRUE if the Julian day is valid. Anything greater than zero
  35120. is basically a valid Julian, though there is a 32-bit limit.</doc>
  35121. <return-value transfer-ownership="none">
  35122. <doc xml:space="preserve">%TRUE if the Julian day is valid</doc>
  35123. <type name="gboolean" c:type="gboolean"/>
  35124. </return-value>
  35125. <parameters>
  35126. <parameter name="julian_date" transfer-ownership="none">
  35127. <doc xml:space="preserve">Julian day to check</doc>
  35128. <type name="guint32" c:type="guint32"/>
  35129. </parameter>
  35130. </parameters>
  35131. </function>
  35132. <function name="date_valid_month"
  35133. c:identifier="g_date_valid_month"
  35134. moved-to="Date.valid_month">
  35135. <doc xml:space="preserve">Returns %TRUE if the month value is valid. The 12 #GDateMonth
  35136. enumeration values are the only valid months.</doc>
  35137. <return-value transfer-ownership="none">
  35138. <doc xml:space="preserve">%TRUE if the month is valid</doc>
  35139. <type name="gboolean" c:type="gboolean"/>
  35140. </return-value>
  35141. <parameters>
  35142. <parameter name="month" transfer-ownership="none">
  35143. <doc xml:space="preserve">month</doc>
  35144. <type name="DateMonth" c:type="GDateMonth"/>
  35145. </parameter>
  35146. </parameters>
  35147. </function>
  35148. <function name="date_valid_weekday"
  35149. c:identifier="g_date_valid_weekday"
  35150. moved-to="Date.valid_weekday">
  35151. <doc xml:space="preserve">Returns %TRUE if the weekday is valid. The seven #GDateWeekday enumeration
  35152. values are the only valid weekdays.</doc>
  35153. <return-value transfer-ownership="none">
  35154. <doc xml:space="preserve">%TRUE if the weekday is valid</doc>
  35155. <type name="gboolean" c:type="gboolean"/>
  35156. </return-value>
  35157. <parameters>
  35158. <parameter name="weekday" transfer-ownership="none">
  35159. <doc xml:space="preserve">weekday</doc>
  35160. <type name="DateWeekday" c:type="GDateWeekday"/>
  35161. </parameter>
  35162. </parameters>
  35163. </function>
  35164. <function name="date_valid_year"
  35165. c:identifier="g_date_valid_year"
  35166. moved-to="Date.valid_year">
  35167. <doc xml:space="preserve">Returns %TRUE if the year is valid. Any year greater than 0 is valid,
  35168. though there is a 16-bit limit to what #GDate will understand.</doc>
  35169. <return-value transfer-ownership="none">
  35170. <doc xml:space="preserve">%TRUE if the year is valid</doc>
  35171. <type name="gboolean" c:type="gboolean"/>
  35172. </return-value>
  35173. <parameters>
  35174. <parameter name="year" transfer-ownership="none">
  35175. <doc xml:space="preserve">year</doc>
  35176. <type name="DateYear" c:type="GDateYear"/>
  35177. </parameter>
  35178. </parameters>
  35179. </function>
  35180. <function name="dcgettext" c:identifier="g_dcgettext" version="2.26">
  35181. <doc xml:space="preserve">This is a variant of g_dgettext() that allows specifying a locale
  35182. category instead of always using `LC_MESSAGES`. See g_dgettext() for
  35183. more information about how this functions differs from calling
  35184. dcgettext() directly.</doc>
  35185. <return-value transfer-ownership="none">
  35186. <doc xml:space="preserve">the translated string for the given locale category</doc>
  35187. <type name="utf8" c:type="const gchar*"/>
  35188. </return-value>
  35189. <parameters>
  35190. <parameter name="domain"
  35191. transfer-ownership="none"
  35192. nullable="1"
  35193. allow-none="1">
  35194. <doc xml:space="preserve">the translation domain to use, or %NULL to use
  35195. the domain set with textdomain()</doc>
  35196. <type name="utf8" c:type="const gchar*"/>
  35197. </parameter>
  35198. <parameter name="msgid" transfer-ownership="none">
  35199. <doc xml:space="preserve">message to translate</doc>
  35200. <type name="utf8" c:type="const gchar*"/>
  35201. </parameter>
  35202. <parameter name="category" transfer-ownership="none">
  35203. <doc xml:space="preserve">a locale category</doc>
  35204. <type name="gint" c:type="gint"/>
  35205. </parameter>
  35206. </parameters>
  35207. </function>
  35208. <function name="dgettext" c:identifier="g_dgettext" version="2.18">
  35209. <doc xml:space="preserve">This function is a wrapper of dgettext() which does not translate
  35210. the message if the default domain as set with textdomain() has no
  35211. translations for the current locale.
  35212. The advantage of using this function over dgettext() proper is that
  35213. libraries using this function (like GTK+) will not use translations
  35214. if the application using the library does not have translations for
  35215. the current locale. This results in a consistent English-only
  35216. interface instead of one having partial translations. For this
  35217. feature to work, the call to textdomain() and setlocale() should
  35218. precede any g_dgettext() invocations. For GTK+, it means calling
  35219. textdomain() before gtk_init or its variants.
  35220. This function disables translations if and only if upon its first
  35221. call all the following conditions hold:
  35222. - @domain is not %NULL
  35223. - textdomain() has been called to set a default text domain
  35224. - there is no translations available for the default text domain
  35225. and the current locale
  35226. - current locale is not "C" or any English locales (those
  35227. starting with "en_")
  35228. Note that this behavior may not be desired for example if an application
  35229. has its untranslated messages in a language other than English. In those
  35230. cases the application should call textdomain() after initializing GTK+.
  35231. Applications should normally not use this function directly,
  35232. but use the _() macro for translations.</doc>
  35233. <return-value transfer-ownership="none">
  35234. <doc xml:space="preserve">The translated string</doc>
  35235. <type name="utf8" c:type="const gchar*"/>
  35236. </return-value>
  35237. <parameters>
  35238. <parameter name="domain"
  35239. transfer-ownership="none"
  35240. nullable="1"
  35241. allow-none="1">
  35242. <doc xml:space="preserve">the translation domain to use, or %NULL to use
  35243. the domain set with textdomain()</doc>
  35244. <type name="utf8" c:type="const gchar*"/>
  35245. </parameter>
  35246. <parameter name="msgid" transfer-ownership="none">
  35247. <doc xml:space="preserve">message to translate</doc>
  35248. <type name="utf8" c:type="const gchar*"/>
  35249. </parameter>
  35250. </parameters>
  35251. </function>
  35252. <function name="dir_make_tmp"
  35253. c:identifier="g_dir_make_tmp"
  35254. moved-to="Dir.make_tmp"
  35255. version="2.30"
  35256. throws="1">
  35257. <doc xml:space="preserve">Creates a subdirectory in the preferred directory for temporary
  35258. files (as returned by g_get_tmp_dir()).
  35259. @tmpl should be a string in the GLib file name encoding containing
  35260. a sequence of six 'X' characters, as the parameter to g_mkstemp().
  35261. However, unlike these functions, the template should only be a
  35262. basename, no directory components are allowed. If template is
  35263. %NULL, a default template is used.
  35264. Note that in contrast to g_mkdtemp() (and mkdtemp()) @tmpl is not
  35265. modified, and might thus be a read-only literal string.</doc>
  35266. <return-value transfer-ownership="full">
  35267. <doc xml:space="preserve">The actual name used. This string
  35268. should be freed with g_free() when not needed any longer and is
  35269. is in the GLib file name encoding. In case of errors, %NULL is
  35270. returned and @error will be set.</doc>
  35271. <type name="filename" c:type="gchar*"/>
  35272. </return-value>
  35273. <parameters>
  35274. <parameter name="tmpl"
  35275. transfer-ownership="none"
  35276. nullable="1"
  35277. allow-none="1">
  35278. <doc xml:space="preserve">Template for directory name,
  35279. as in g_mkdtemp(), basename only, or %NULL for a default template</doc>
  35280. <type name="filename" c:type="gchar*"/>
  35281. </parameter>
  35282. </parameters>
  35283. </function>
  35284. <function name="direct_equal" c:identifier="g_direct_equal">
  35285. <doc xml:space="preserve">Compares two #gpointer arguments and returns %TRUE if they are equal.
  35286. It can be passed to g_hash_table_new() as the @key_equal_func
  35287. parameter, when using opaque pointers compared by pointer value as
  35288. keys in a #GHashTable.
  35289. This equality function is also appropriate for keys that are integers
  35290. stored in pointers, such as `GINT_TO_POINTER (n)`.</doc>
  35291. <return-value transfer-ownership="none">
  35292. <doc xml:space="preserve">%TRUE if the two keys match.</doc>
  35293. <type name="gboolean" c:type="gboolean"/>
  35294. </return-value>
  35295. <parameters>
  35296. <parameter name="v1"
  35297. transfer-ownership="none"
  35298. nullable="1"
  35299. allow-none="1">
  35300. <doc xml:space="preserve">a key</doc>
  35301. <type name="gpointer" c:type="gconstpointer"/>
  35302. </parameter>
  35303. <parameter name="v2"
  35304. transfer-ownership="none"
  35305. nullable="1"
  35306. allow-none="1">
  35307. <doc xml:space="preserve">a key to compare with @v1</doc>
  35308. <type name="gpointer" c:type="gconstpointer"/>
  35309. </parameter>
  35310. </parameters>
  35311. </function>
  35312. <function name="direct_hash" c:identifier="g_direct_hash">
  35313. <doc xml:space="preserve">Converts a gpointer to a hash value.
  35314. It can be passed to g_hash_table_new() as the @hash_func parameter,
  35315. when using opaque pointers compared by pointer value as keys in a
  35316. #GHashTable.
  35317. This hash function is also appropriate for keys that are integers
  35318. stored in pointers, such as `GINT_TO_POINTER (n)`.</doc>
  35319. <return-value transfer-ownership="none">
  35320. <doc xml:space="preserve">a hash value corresponding to the key.</doc>
  35321. <type name="guint" c:type="guint"/>
  35322. </return-value>
  35323. <parameters>
  35324. <parameter name="v"
  35325. transfer-ownership="none"
  35326. nullable="1"
  35327. allow-none="1">
  35328. <doc xml:space="preserve">a #gpointer key</doc>
  35329. <type name="gpointer" c:type="gconstpointer"/>
  35330. </parameter>
  35331. </parameters>
  35332. </function>
  35333. <function name="dngettext" c:identifier="g_dngettext" version="2.18">
  35334. <doc xml:space="preserve">This function is a wrapper of dngettext() which does not translate
  35335. the message if the default domain as set with textdomain() has no
  35336. translations for the current locale.
  35337. See g_dgettext() for details of how this differs from dngettext()
  35338. proper.</doc>
  35339. <return-value transfer-ownership="none">
  35340. <doc xml:space="preserve">The translated string</doc>
  35341. <type name="utf8" c:type="const gchar*"/>
  35342. </return-value>
  35343. <parameters>
  35344. <parameter name="domain"
  35345. transfer-ownership="none"
  35346. nullable="1"
  35347. allow-none="1">
  35348. <doc xml:space="preserve">the translation domain to use, or %NULL to use
  35349. the domain set with textdomain()</doc>
  35350. <type name="utf8" c:type="const gchar*"/>
  35351. </parameter>
  35352. <parameter name="msgid" transfer-ownership="none">
  35353. <doc xml:space="preserve">message to translate</doc>
  35354. <type name="utf8" c:type="const gchar*"/>
  35355. </parameter>
  35356. <parameter name="msgid_plural" transfer-ownership="none">
  35357. <doc xml:space="preserve">plural form of the message</doc>
  35358. <type name="utf8" c:type="const gchar*"/>
  35359. </parameter>
  35360. <parameter name="n" transfer-ownership="none">
  35361. <doc xml:space="preserve">the quantity for which translation is needed</doc>
  35362. <type name="gulong" c:type="gulong"/>
  35363. </parameter>
  35364. </parameters>
  35365. </function>
  35366. <function name="double_equal" c:identifier="g_double_equal" version="2.22">
  35367. <doc xml:space="preserve">Compares the two #gdouble values being pointed to and returns
  35368. %TRUE if they are equal.
  35369. It can be passed to g_hash_table_new() as the @key_equal_func
  35370. parameter, when using non-%NULL pointers to doubles as keys in a
  35371. #GHashTable.</doc>
  35372. <return-value transfer-ownership="none">
  35373. <doc xml:space="preserve">%TRUE if the two keys match.</doc>
  35374. <type name="gboolean" c:type="gboolean"/>
  35375. </return-value>
  35376. <parameters>
  35377. <parameter name="v1" transfer-ownership="none">
  35378. <doc xml:space="preserve">a pointer to a #gdouble key</doc>
  35379. <type name="gpointer" c:type="gconstpointer"/>
  35380. </parameter>
  35381. <parameter name="v2" transfer-ownership="none">
  35382. <doc xml:space="preserve">a pointer to a #gdouble key to compare with @v1</doc>
  35383. <type name="gpointer" c:type="gconstpointer"/>
  35384. </parameter>
  35385. </parameters>
  35386. </function>
  35387. <function name="double_hash" c:identifier="g_double_hash" version="2.22">
  35388. <doc xml:space="preserve">Converts a pointer to a #gdouble to a hash value.
  35389. It can be passed to g_hash_table_new() as the @hash_func parameter,
  35390. It can be passed to g_hash_table_new() as the @hash_func parameter,
  35391. when using non-%NULL pointers to doubles as keys in a #GHashTable.</doc>
  35392. <return-value transfer-ownership="none">
  35393. <doc xml:space="preserve">a hash value corresponding to the key.</doc>
  35394. <type name="guint" c:type="guint"/>
  35395. </return-value>
  35396. <parameters>
  35397. <parameter name="v" transfer-ownership="none">
  35398. <doc xml:space="preserve">a pointer to a #gdouble key</doc>
  35399. <type name="gpointer" c:type="gconstpointer"/>
  35400. </parameter>
  35401. </parameters>
  35402. </function>
  35403. <function name="dpgettext" c:identifier="g_dpgettext" version="2.16">
  35404. <doc xml:space="preserve">This function is a variant of g_dgettext() which supports
  35405. a disambiguating message context. GNU gettext uses the
  35406. '\004' character to separate the message context and
  35407. message id in @msgctxtid.
  35408. If 0 is passed as @msgidoffset, this function will fall back to
  35409. trying to use the deprecated convention of using "|" as a separation
  35410. character.
  35411. This uses g_dgettext() internally. See that functions for differences
  35412. with dgettext() proper.
  35413. Applications should normally not use this function directly,
  35414. but use the C_() macro for translations with context.</doc>
  35415. <return-value transfer-ownership="none">
  35416. <doc xml:space="preserve">The translated string</doc>
  35417. <type name="utf8" c:type="const gchar*"/>
  35418. </return-value>
  35419. <parameters>
  35420. <parameter name="domain"
  35421. transfer-ownership="none"
  35422. nullable="1"
  35423. allow-none="1">
  35424. <doc xml:space="preserve">the translation domain to use, or %NULL to use
  35425. the domain set with textdomain()</doc>
  35426. <type name="utf8" c:type="const gchar*"/>
  35427. </parameter>
  35428. <parameter name="msgctxtid" transfer-ownership="none">
  35429. <doc xml:space="preserve">a combined message context and message id, separated
  35430. by a \004 character</doc>
  35431. <type name="utf8" c:type="const gchar*"/>
  35432. </parameter>
  35433. <parameter name="msgidoffset" transfer-ownership="none">
  35434. <doc xml:space="preserve">the offset of the message id in @msgctxid</doc>
  35435. <type name="gsize" c:type="gsize"/>
  35436. </parameter>
  35437. </parameters>
  35438. </function>
  35439. <function name="dpgettext2" c:identifier="g_dpgettext2" version="2.18">
  35440. <doc xml:space="preserve">This function is a variant of g_dgettext() which supports
  35441. a disambiguating message context. GNU gettext uses the
  35442. '\004' character to separate the message context and
  35443. message id in @msgctxtid.
  35444. This uses g_dgettext() internally. See that functions for differences
  35445. with dgettext() proper.
  35446. This function differs from C_() in that it is not a macro and
  35447. thus you may use non-string-literals as context and msgid arguments.</doc>
  35448. <return-value transfer-ownership="none">
  35449. <doc xml:space="preserve">The translated string</doc>
  35450. <type name="utf8" c:type="const gchar*"/>
  35451. </return-value>
  35452. <parameters>
  35453. <parameter name="domain"
  35454. transfer-ownership="none"
  35455. nullable="1"
  35456. allow-none="1">
  35457. <doc xml:space="preserve">the translation domain to use, or %NULL to use
  35458. the domain set with textdomain()</doc>
  35459. <type name="utf8" c:type="const gchar*"/>
  35460. </parameter>
  35461. <parameter name="context" transfer-ownership="none">
  35462. <doc xml:space="preserve">the message context</doc>
  35463. <type name="utf8" c:type="const gchar*"/>
  35464. </parameter>
  35465. <parameter name="msgid" transfer-ownership="none">
  35466. <doc xml:space="preserve">the message</doc>
  35467. <type name="utf8" c:type="const gchar*"/>
  35468. </parameter>
  35469. </parameters>
  35470. </function>
  35471. <function name="environ_getenv"
  35472. c:identifier="g_environ_getenv"
  35473. version="2.32">
  35474. <doc xml:space="preserve">Returns the value of the environment variable @variable in the
  35475. provided list @envp.</doc>
  35476. <return-value transfer-ownership="none">
  35477. <doc xml:space="preserve">the value of the environment variable, or %NULL if
  35478. the environment variable is not set in @envp. The returned
  35479. string is owned by @envp, and will be freed if @variable is
  35480. set or unset again.</doc>
  35481. <type name="utf8" c:type="const gchar*"/>
  35482. </return-value>
  35483. <parameters>
  35484. <parameter name="envp"
  35485. transfer-ownership="none"
  35486. nullable="1"
  35487. allow-none="1">
  35488. <doc xml:space="preserve">an environment
  35489. list (eg, as returned from g_get_environ()), or %NULL
  35490. for an empty environment list</doc>
  35491. <array c:type="gchar**">
  35492. <type name="utf8" c:type="gchar*"/>
  35493. </array>
  35494. </parameter>
  35495. <parameter name="variable" transfer-ownership="none">
  35496. <doc xml:space="preserve">the environment variable to get</doc>
  35497. <type name="utf8" c:type="const gchar*"/>
  35498. </parameter>
  35499. </parameters>
  35500. </function>
  35501. <function name="environ_setenv"
  35502. c:identifier="g_environ_setenv"
  35503. version="2.32">
  35504. <doc xml:space="preserve">Sets the environment variable @variable in the provided list
  35505. @envp to @value.</doc>
  35506. <return-value transfer-ownership="full">
  35507. <doc xml:space="preserve">the
  35508. updated environment list. Free it using g_strfreev().</doc>
  35509. <array c:type="gchar**">
  35510. <type name="utf8"/>
  35511. </array>
  35512. </return-value>
  35513. <parameters>
  35514. <parameter name="envp"
  35515. transfer-ownership="full"
  35516. nullable="1"
  35517. allow-none="1">
  35518. <doc xml:space="preserve">an
  35519. environment list that can be freed using g_strfreev() (e.g., as
  35520. returned from g_get_environ()), or %NULL for an empty
  35521. environment list</doc>
  35522. <array c:type="gchar**">
  35523. <type name="utf8" c:type="gchar*"/>
  35524. </array>
  35525. </parameter>
  35526. <parameter name="variable" transfer-ownership="none">
  35527. <doc xml:space="preserve">the environment variable to set, must not contain '='</doc>
  35528. <type name="utf8" c:type="const gchar*"/>
  35529. </parameter>
  35530. <parameter name="value" transfer-ownership="none">
  35531. <doc xml:space="preserve">the value for to set the variable to</doc>
  35532. <type name="utf8" c:type="const gchar*"/>
  35533. </parameter>
  35534. <parameter name="overwrite" transfer-ownership="none">
  35535. <doc xml:space="preserve">whether to change the variable if it already exists</doc>
  35536. <type name="gboolean" c:type="gboolean"/>
  35537. </parameter>
  35538. </parameters>
  35539. </function>
  35540. <function name="environ_unsetenv"
  35541. c:identifier="g_environ_unsetenv"
  35542. version="2.32">
  35543. <doc xml:space="preserve">Removes the environment variable @variable from the provided
  35544. environment @envp.</doc>
  35545. <return-value transfer-ownership="full">
  35546. <doc xml:space="preserve">the
  35547. updated environment list. Free it using g_strfreev().</doc>
  35548. <array c:type="gchar**">
  35549. <type name="utf8"/>
  35550. </array>
  35551. </return-value>
  35552. <parameters>
  35553. <parameter name="envp"
  35554. transfer-ownership="full"
  35555. nullable="1"
  35556. allow-none="1">
  35557. <doc xml:space="preserve">an environment
  35558. list that can be freed using g_strfreev() (e.g., as returned from g_get_environ()),
  35559. or %NULL for an empty environment list</doc>
  35560. <array c:type="gchar**">
  35561. <type name="utf8" c:type="gchar*"/>
  35562. </array>
  35563. </parameter>
  35564. <parameter name="variable" transfer-ownership="none">
  35565. <doc xml:space="preserve">the environment variable to remove, must not contain '='</doc>
  35566. <type name="utf8" c:type="const gchar*"/>
  35567. </parameter>
  35568. </parameters>
  35569. </function>
  35570. <function name="file_error_from_errno"
  35571. c:identifier="g_file_error_from_errno">
  35572. <doc xml:space="preserve">Gets a #GFileError constant based on the passed-in @err_no.
  35573. For example, if you pass in `EEXIST` this function returns
  35574. #G_FILE_ERROR_EXIST. Unlike `errno` values, you can portably
  35575. assume that all #GFileError values will exist.
  35576. Normally a #GFileError value goes into a #GError returned
  35577. from a function that manipulates files. So you would use
  35578. g_file_error_from_errno() when constructing a #GError.</doc>
  35579. <return-value transfer-ownership="none">
  35580. <doc xml:space="preserve">#GFileError corresponding to the given @errno</doc>
  35581. <type name="FileError" c:type="GFileError"/>
  35582. </return-value>
  35583. <parameters>
  35584. <parameter name="err_no" transfer-ownership="none">
  35585. <doc xml:space="preserve">an "errno" value</doc>
  35586. <type name="gint" c:type="gint"/>
  35587. </parameter>
  35588. </parameters>
  35589. </function>
  35590. <function name="file_error_quark" c:identifier="g_file_error_quark">
  35591. <return-value transfer-ownership="none">
  35592. <type name="Quark" c:type="GQuark"/>
  35593. </return-value>
  35594. </function>
  35595. <function name="file_get_contents"
  35596. c:identifier="g_file_get_contents"
  35597. throws="1">
  35598. <doc xml:space="preserve">Reads an entire file into allocated memory, with good error
  35599. checking.
  35600. If the call was successful, it returns %TRUE and sets @contents to the file
  35601. contents and @length to the length of the file contents in bytes. The string
  35602. stored in @contents will be nul-terminated, so for text files you can pass
  35603. %NULL for the @length argument. If the call was not successful, it returns
  35604. %FALSE and sets @error. The error domain is #G_FILE_ERROR. Possible error
  35605. codes are those in the #GFileError enumeration. In the error case,
  35606. @contents is set to %NULL and @length is set to zero.</doc>
  35607. <return-value transfer-ownership="none">
  35608. <doc xml:space="preserve">%TRUE on success, %FALSE if an error occurred</doc>
  35609. <type name="gboolean" c:type="gboolean"/>
  35610. </return-value>
  35611. <parameters>
  35612. <parameter name="filename" transfer-ownership="none">
  35613. <doc xml:space="preserve">name of a file to read contents from, in the GLib file name encoding</doc>
  35614. <type name="filename" c:type="gchar*"/>
  35615. </parameter>
  35616. <parameter name="contents"
  35617. direction="out"
  35618. caller-allocates="0"
  35619. transfer-ownership="full">
  35620. <doc xml:space="preserve">location to store an allocated string, use g_free() to free
  35621. the returned string</doc>
  35622. <array length="2" zero-terminated="0" c:type="gchar**">
  35623. <type name="guint8"/>
  35624. </array>
  35625. </parameter>
  35626. <parameter name="length"
  35627. direction="out"
  35628. caller-allocates="0"
  35629. transfer-ownership="full"
  35630. optional="1"
  35631. allow-none="1">
  35632. <doc xml:space="preserve">location to store length in bytes of the contents, or %NULL</doc>
  35633. <type name="gsize" c:type="gsize*"/>
  35634. </parameter>
  35635. </parameters>
  35636. </function>
  35637. <function name="file_open_tmp" c:identifier="g_file_open_tmp" throws="1">
  35638. <doc xml:space="preserve">Opens a file for writing in the preferred directory for temporary
  35639. files (as returned by g_get_tmp_dir()).
  35640. @tmpl should be a string in the GLib file name encoding containing
  35641. a sequence of six 'X' characters, as the parameter to g_mkstemp().
  35642. However, unlike these functions, the template should only be a
  35643. basename, no directory components are allowed. If template is
  35644. %NULL, a default template is used.
  35645. Note that in contrast to g_mkstemp() (and mkstemp()) @tmpl is not
  35646. modified, and might thus be a read-only literal string.
  35647. Upon success, and if @name_used is non-%NULL, the actual name used
  35648. is returned in @name_used. This string should be freed with g_free()
  35649. when not needed any longer. The returned name is in the GLib file
  35650. name encoding.</doc>
  35651. <return-value transfer-ownership="none">
  35652. <doc xml:space="preserve">A file handle (as from open()) to the file opened for
  35653. reading and writing. The file is opened in binary mode on platforms
  35654. where there is a difference. The file handle should be closed with
  35655. close(). In case of errors, -1 is returned and @error will be set.</doc>
  35656. <type name="gint" c:type="gint"/>
  35657. </return-value>
  35658. <parameters>
  35659. <parameter name="tmpl"
  35660. transfer-ownership="none"
  35661. nullable="1"
  35662. allow-none="1">
  35663. <doc xml:space="preserve">Template for file name, as in
  35664. g_mkstemp(), basename only, or %NULL for a default template</doc>
  35665. <type name="filename" c:type="gchar*"/>
  35666. </parameter>
  35667. <parameter name="name_used"
  35668. direction="out"
  35669. caller-allocates="0"
  35670. transfer-ownership="full">
  35671. <doc xml:space="preserve">location to store actual name used,
  35672. or %NULL</doc>
  35673. <type name="filename" c:type="gchar**"/>
  35674. </parameter>
  35675. </parameters>
  35676. </function>
  35677. <function name="file_read_link"
  35678. c:identifier="g_file_read_link"
  35679. version="2.4"
  35680. throws="1">
  35681. <doc xml:space="preserve">Reads the contents of the symbolic link @filename like the POSIX
  35682. readlink() function. The returned string is in the encoding used
  35683. for filenames. Use g_filename_to_utf8() to convert it to UTF-8.</doc>
  35684. <return-value transfer-ownership="full">
  35685. <doc xml:space="preserve">A newly-allocated string with the contents of the symbolic link,
  35686. or %NULL if an error occurred.</doc>
  35687. <type name="utf8" c:type="gchar*"/>
  35688. </return-value>
  35689. <parameters>
  35690. <parameter name="filename" transfer-ownership="none">
  35691. <doc xml:space="preserve">the symbolic link</doc>
  35692. <type name="utf8" c:type="const gchar*"/>
  35693. </parameter>
  35694. </parameters>
  35695. </function>
  35696. <function name="file_set_contents"
  35697. c:identifier="g_file_set_contents"
  35698. version="2.8"
  35699. throws="1">
  35700. <doc xml:space="preserve">Writes all of @contents to a file named @filename, with good error checking.
  35701. If a file called @filename already exists it will be overwritten.
  35702. This write is atomic in the sense that it is first written to a temporary
  35703. file which is then renamed to the final name. Notes:
  35704. - On UNIX, if @filename already exists hard links to @filename will break.
  35705. Also since the file is recreated, existing permissions, access control
  35706. lists, metadata etc. may be lost. If @filename is a symbolic link,
  35707. the link itself will be replaced, not the linked file.
  35708. - On Windows renaming a file will not remove an existing file with the
  35709. new name, so on Windows there is a race condition between the existing
  35710. file being removed and the temporary file being renamed.
  35711. - On Windows there is no way to remove a file that is open to some
  35712. process, or mapped into memory. Thus, this function will fail if
  35713. @filename already exists and is open.
  35714. If the call was successful, it returns %TRUE. If the call was not successful,
  35715. it returns %FALSE and sets @error. The error domain is #G_FILE_ERROR.
  35716. Possible error codes are those in the #GFileError enumeration.
  35717. Note that the name for the temporary file is constructed by appending up
  35718. to 7 characters to @filename.</doc>
  35719. <return-value transfer-ownership="none">
  35720. <doc xml:space="preserve">%TRUE on success, %FALSE if an error occurred</doc>
  35721. <type name="gboolean" c:type="gboolean"/>
  35722. </return-value>
  35723. <parameters>
  35724. <parameter name="filename" transfer-ownership="none">
  35725. <doc xml:space="preserve">name of a file to write @contents to, in the GLib file name
  35726. encoding</doc>
  35727. <type name="filename" c:type="gchar*"/>
  35728. </parameter>
  35729. <parameter name="contents" transfer-ownership="none">
  35730. <doc xml:space="preserve">string to write to the file</doc>
  35731. <array length="2" zero-terminated="0" c:type="gchar*">
  35732. <type name="guint8"/>
  35733. </array>
  35734. </parameter>
  35735. <parameter name="length" transfer-ownership="none">
  35736. <doc xml:space="preserve">length of @contents, or -1 if @contents is a nul-terminated string</doc>
  35737. <type name="gssize" c:type="gssize"/>
  35738. </parameter>
  35739. </parameters>
  35740. </function>
  35741. <function name="file_test" c:identifier="g_file_test">
  35742. <doc xml:space="preserve">Returns %TRUE if any of the tests in the bitfield @test are
  35743. %TRUE. For example, `(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)`
  35744. will return %TRUE if the file exists; the check whether it's a
  35745. directory doesn't matter since the existence test is %TRUE. With
  35746. the current set of available tests, there's no point passing in
  35747. more than one test at a time.
  35748. Apart from %G_FILE_TEST_IS_SYMLINK all tests follow symbolic links,
  35749. so for a symbolic link to a regular file g_file_test() will return
  35750. %TRUE for both %G_FILE_TEST_IS_SYMLINK and %G_FILE_TEST_IS_REGULAR.
  35751. Note, that for a dangling symbolic link g_file_test() will return
  35752. %TRUE for %G_FILE_TEST_IS_SYMLINK and %FALSE for all other flags.
  35753. You should never use g_file_test() to test whether it is safe
  35754. to perform an operation, because there is always the possibility
  35755. of the condition changing before you actually perform the operation.
  35756. For example, you might think you could use %G_FILE_TEST_IS_SYMLINK
  35757. to know whether it is safe to write to a file without being
  35758. tricked into writing into a different location. It doesn't work!
  35759. |[&lt;!-- language="C" --&gt;
  35760. // DON'T DO THIS
  35761. if (!g_file_test (filename, G_FILE_TEST_IS_SYMLINK))
  35762. {
  35763. fd = g_open (filename, O_WRONLY);
  35764. // write to fd
  35765. }
  35766. ]|
  35767. Another thing to note is that %G_FILE_TEST_EXISTS and
  35768. %G_FILE_TEST_IS_EXECUTABLE are implemented using the access()
  35769. system call. This usually doesn't matter, but if your program
  35770. is setuid or setgid it means that these tests will give you
  35771. the answer for the real user ID and group ID, rather than the
  35772. effective user ID and group ID.
  35773. On Windows, there are no symlinks, so testing for
  35774. %G_FILE_TEST_IS_SYMLINK will always return %FALSE. Testing for
  35775. %G_FILE_TEST_IS_EXECUTABLE will just check that the file exists and
  35776. its name indicates that it is executable, checking for well-known
  35777. extensions and those listed in the `PATHEXT` environment variable.</doc>
  35778. <return-value transfer-ownership="none">
  35779. <doc xml:space="preserve">whether a test was %TRUE</doc>
  35780. <type name="gboolean" c:type="gboolean"/>
  35781. </return-value>
  35782. <parameters>
  35783. <parameter name="filename" transfer-ownership="none">
  35784. <doc xml:space="preserve">a filename to test in the GLib file name encoding</doc>
  35785. <type name="utf8" c:type="const gchar*"/>
  35786. </parameter>
  35787. <parameter name="test" transfer-ownership="none">
  35788. <doc xml:space="preserve">bitfield of #GFileTest flags</doc>
  35789. <type name="FileTest" c:type="GFileTest"/>
  35790. </parameter>
  35791. </parameters>
  35792. </function>
  35793. <function name="filename_display_basename"
  35794. c:identifier="g_filename_display_basename"
  35795. version="2.6">
  35796. <doc xml:space="preserve">Returns the display basename for the particular filename, guaranteed
  35797. to be valid UTF-8. The display name might not be identical to the filename,
  35798. for instance there might be problems converting it to UTF-8, and some files
  35799. can be translated in the display.
  35800. If GLib cannot make sense of the encoding of @filename, as a last resort it
  35801. replaces unknown characters with U+FFFD, the Unicode replacement character.
  35802. You can search the result for the UTF-8 encoding of this character (which is
  35803. "\357\277\275" in octal notation) to find out if @filename was in an invalid
  35804. encoding.
  35805. You must pass the whole absolute pathname to this functions so that
  35806. translation of well known locations can be done.
  35807. This function is preferred over g_filename_display_name() if you know the
  35808. whole path, as it allows translation.</doc>
  35809. <return-value transfer-ownership="full">
  35810. <doc xml:space="preserve">a newly allocated string containing
  35811. a rendition of the basename of the filename in valid UTF-8</doc>
  35812. <type name="utf8" c:type="gchar*"/>
  35813. </return-value>
  35814. <parameters>
  35815. <parameter name="filename" transfer-ownership="none">
  35816. <doc xml:space="preserve">an absolute pathname in the GLib file name encoding</doc>
  35817. <type name="utf8" c:type="const gchar*"/>
  35818. </parameter>
  35819. </parameters>
  35820. </function>
  35821. <function name="filename_display_name"
  35822. c:identifier="g_filename_display_name"
  35823. version="2.6">
  35824. <doc xml:space="preserve">Converts a filename into a valid UTF-8 string. The conversion is
  35825. not necessarily reversible, so you should keep the original around
  35826. and use the return value of this function only for display purposes.
  35827. Unlike g_filename_to_utf8(), the result is guaranteed to be non-%NULL
  35828. even if the filename actually isn't in the GLib file name encoding.
  35829. If GLib cannot make sense of the encoding of @filename, as a last resort it
  35830. replaces unknown characters with U+FFFD, the Unicode replacement character.
  35831. You can search the result for the UTF-8 encoding of this character (which is
  35832. "\357\277\275" in octal notation) to find out if @filename was in an invalid
  35833. encoding.
  35834. If you know the whole pathname of the file you should use
  35835. g_filename_display_basename(), since that allows location-based
  35836. translation of filenames.</doc>
  35837. <return-value transfer-ownership="full">
  35838. <doc xml:space="preserve">a newly allocated string containing
  35839. a rendition of the filename in valid UTF-8</doc>
  35840. <type name="utf8" c:type="gchar*"/>
  35841. </return-value>
  35842. <parameters>
  35843. <parameter name="filename" transfer-ownership="none">
  35844. <doc xml:space="preserve">a pathname hopefully in the GLib file name encoding</doc>
  35845. <type name="utf8" c:type="const gchar*"/>
  35846. </parameter>
  35847. </parameters>
  35848. </function>
  35849. <function name="filename_from_uri"
  35850. c:identifier="g_filename_from_uri"
  35851. throws="1">
  35852. <doc xml:space="preserve">Converts an escaped ASCII-encoded URI to a local filename in the
  35853. encoding used for filenames.</doc>
  35854. <return-value transfer-ownership="full">
  35855. <doc xml:space="preserve">a newly-allocated string holding
  35856. the resulting filename, or %NULL on an error.</doc>
  35857. <type name="filename" c:type="gchar*"/>
  35858. </return-value>
  35859. <parameters>
  35860. <parameter name="uri" transfer-ownership="none">
  35861. <doc xml:space="preserve">a uri describing a filename (escaped, encoded in ASCII).</doc>
  35862. <type name="utf8" c:type="const gchar*"/>
  35863. </parameter>
  35864. <parameter name="hostname"
  35865. direction="out"
  35866. caller-allocates="0"
  35867. transfer-ownership="full"
  35868. nullable="1"
  35869. optional="1"
  35870. allow-none="1">
  35871. <doc xml:space="preserve">Location to store hostname for the
  35872. URI.
  35873. If there is no hostname in the URI, %NULL will be
  35874. stored in this location.</doc>
  35875. <type name="utf8" c:type="gchar**"/>
  35876. </parameter>
  35877. </parameters>
  35878. </function>
  35879. <function name="filename_from_utf8"
  35880. c:identifier="g_filename_from_utf8"
  35881. throws="1">
  35882. <doc xml:space="preserve">Converts a string from UTF-8 to the encoding GLib uses for
  35883. filenames. Note that on Windows GLib uses UTF-8 for filenames;
  35884. on other platforms, this function indirectly depends on the
  35885. [current locale][setlocale].</doc>
  35886. <return-value transfer-ownership="full">
  35887. <doc xml:space="preserve">
  35888. The converted string, or %NULL on an error.</doc>
  35889. <array length="3" zero-terminated="0" c:type="gchar*">
  35890. <type name="guint8"/>
  35891. </array>
  35892. </return-value>
  35893. <parameters>
  35894. <parameter name="utf8string" transfer-ownership="none">
  35895. <doc xml:space="preserve">a UTF-8 encoded string.</doc>
  35896. <type name="utf8" c:type="const gchar*"/>
  35897. </parameter>
  35898. <parameter name="len" transfer-ownership="none">
  35899. <doc xml:space="preserve">the length of the string, or -1 if the string is
  35900. nul-terminated.</doc>
  35901. <type name="gssize" c:type="gssize"/>
  35902. </parameter>
  35903. <parameter name="bytes_read"
  35904. direction="out"
  35905. caller-allocates="0"
  35906. transfer-ownership="full"
  35907. optional="1"
  35908. allow-none="1">
  35909. <doc xml:space="preserve">location to store the number of bytes in
  35910. the input string that were successfully converted, or %NULL.
  35911. Even if the conversion was successful, this may be
  35912. less than @len if there were partial characters
  35913. at the end of the input. If the error
  35914. #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
  35915. stored will the byte offset after the last valid
  35916. input sequence.</doc>
  35917. <type name="gsize" c:type="gsize*"/>
  35918. </parameter>
  35919. <parameter name="bytes_written"
  35920. direction="out"
  35921. caller-allocates="0"
  35922. transfer-ownership="full">
  35923. <doc xml:space="preserve">the number of bytes stored in the output buffer (not
  35924. including the terminating nul).</doc>
  35925. <type name="gsize" c:type="gsize*"/>
  35926. </parameter>
  35927. </parameters>
  35928. </function>
  35929. <function name="filename_to_uri"
  35930. c:identifier="g_filename_to_uri"
  35931. throws="1">
  35932. <doc xml:space="preserve">Converts an absolute filename to an escaped ASCII-encoded URI, with the path
  35933. component following Section 3.3. of RFC 2396.</doc>
  35934. <return-value transfer-ownership="full">
  35935. <doc xml:space="preserve">a newly-allocated string holding the resulting
  35936. URI, or %NULL on an error.</doc>
  35937. <type name="utf8" c:type="gchar*"/>
  35938. </return-value>
  35939. <parameters>
  35940. <parameter name="filename" transfer-ownership="none">
  35941. <doc xml:space="preserve">an absolute filename specified in the GLib file name encoding,
  35942. which is the on-disk file name bytes on Unix, and UTF-8 on
  35943. Windows</doc>
  35944. <type name="utf8" c:type="const gchar*"/>
  35945. </parameter>
  35946. <parameter name="hostname"
  35947. transfer-ownership="none"
  35948. nullable="1"
  35949. allow-none="1">
  35950. <doc xml:space="preserve">A UTF-8 encoded hostname, or %NULL for none.</doc>
  35951. <type name="utf8" c:type="const gchar*"/>
  35952. </parameter>
  35953. </parameters>
  35954. </function>
  35955. <function name="filename_to_utf8"
  35956. c:identifier="g_filename_to_utf8"
  35957. throws="1">
  35958. <doc xml:space="preserve">Converts a string which is in the encoding used by GLib for
  35959. filenames into a UTF-8 string. Note that on Windows GLib uses UTF-8
  35960. for filenames; on other platforms, this function indirectly depends on
  35961. the [current locale][setlocale].</doc>
  35962. <return-value transfer-ownership="full">
  35963. <doc xml:space="preserve">The converted string, or %NULL on an error.</doc>
  35964. <type name="utf8" c:type="gchar*"/>
  35965. </return-value>
  35966. <parameters>
  35967. <parameter name="opsysstring" transfer-ownership="none">
  35968. <doc xml:space="preserve">a string in the encoding for filenames</doc>
  35969. <type name="utf8" c:type="const gchar*"/>
  35970. </parameter>
  35971. <parameter name="len" transfer-ownership="none">
  35972. <doc xml:space="preserve">the length of the string, or -1 if the string is
  35973. nul-terminated (Note that some encodings may allow nul
  35974. bytes to occur inside strings. In that case, using -1
  35975. for the @len parameter is unsafe)</doc>
  35976. <type name="gssize" c:type="gssize"/>
  35977. </parameter>
  35978. <parameter name="bytes_read"
  35979. direction="out"
  35980. caller-allocates="0"
  35981. transfer-ownership="full"
  35982. optional="1"
  35983. allow-none="1">
  35984. <doc xml:space="preserve">location to store the number of bytes in the
  35985. input string that were successfully converted, or %NULL.
  35986. Even if the conversion was successful, this may be
  35987. less than @len if there were partial characters
  35988. at the end of the input. If the error
  35989. #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
  35990. stored will the byte offset after the last valid
  35991. input sequence.</doc>
  35992. <type name="gsize" c:type="gsize*"/>
  35993. </parameter>
  35994. <parameter name="bytes_written"
  35995. direction="out"
  35996. caller-allocates="0"
  35997. transfer-ownership="full"
  35998. optional="1"
  35999. allow-none="1">
  36000. <doc xml:space="preserve">the number of bytes stored in the output
  36001. buffer (not including the terminating nul).</doc>
  36002. <type name="gsize" c:type="gsize*"/>
  36003. </parameter>
  36004. </parameters>
  36005. </function>
  36006. <function name="find_program_in_path"
  36007. c:identifier="g_find_program_in_path">
  36008. <doc xml:space="preserve">Locates the first executable named @program in the user's path, in the
  36009. same way that execvp() would locate it. Returns an allocated string
  36010. with the absolute path name, or %NULL if the program is not found in
  36011. the path. If @program is already an absolute path, returns a copy of
  36012. @program if @program exists and is executable, and %NULL otherwise.
  36013. On Windows, if @program does not have a file type suffix, tries
  36014. with the suffixes .exe, .cmd, .bat and .com, and the suffixes in
  36015. the `PATHEXT` environment variable.
  36016. On Windows, it looks for the file in the same way as CreateProcess()
  36017. would. This means first in the directory where the executing
  36018. program was loaded from, then in the current directory, then in the
  36019. Windows 32-bit system directory, then in the Windows directory, and
  36020. finally in the directories in the `PATH` environment variable. If
  36021. the program is found, the return value contains the full name
  36022. including the type suffix.</doc>
  36023. <return-value transfer-ownership="full">
  36024. <doc xml:space="preserve">a newly-allocated string with the absolute path, or %NULL</doc>
  36025. <type name="utf8" c:type="gchar*"/>
  36026. </return-value>
  36027. <parameters>
  36028. <parameter name="program" transfer-ownership="none">
  36029. <doc xml:space="preserve">a program name in the GLib file name encoding</doc>
  36030. <type name="utf8" c:type="const gchar*"/>
  36031. </parameter>
  36032. </parameters>
  36033. </function>
  36034. <function name="format_size" c:identifier="g_format_size" version="2.30">
  36035. <doc xml:space="preserve">Formats a size (for example the size of a file) into a human readable
  36036. string. Sizes are rounded to the nearest size prefix (kB, MB, GB)
  36037. and are displayed rounded to the nearest tenth. E.g. the file size
  36038. 3292528 bytes will be converted into the string "3.2 MB".
  36039. The prefix units base is 1000 (i.e. 1 kB is 1000 bytes).
  36040. This string should be freed with g_free() when not needed any longer.
  36041. See g_format_size_full() for more options about how the size might be
  36042. formatted.</doc>
  36043. <return-value transfer-ownership="full">
  36044. <doc xml:space="preserve">a newly-allocated formatted string containing a human readable
  36045. file size</doc>
  36046. <type name="utf8" c:type="gchar*"/>
  36047. </return-value>
  36048. <parameters>
  36049. <parameter name="size" transfer-ownership="none">
  36050. <doc xml:space="preserve">a size in bytes</doc>
  36051. <type name="guint64" c:type="guint64"/>
  36052. </parameter>
  36053. </parameters>
  36054. </function>
  36055. <function name="format_size_for_display"
  36056. c:identifier="g_format_size_for_display"
  36057. version="2.16"
  36058. deprecated="1"
  36059. deprecated-version="2.30">
  36060. <doc xml:space="preserve">Formats a size (for example the size of a file) into a human
  36061. readable string. Sizes are rounded to the nearest size prefix
  36062. (KB, MB, GB) and are displayed rounded to the nearest tenth.
  36063. E.g. the file size 3292528 bytes will be converted into the
  36064. string "3.1 MB".
  36065. The prefix units base is 1024 (i.e. 1 KB is 1024 bytes).
  36066. This string should be freed with g_free() when not needed any longer.</doc>
  36067. <doc-deprecated xml:space="preserve">This function is broken due to its use of SI
  36068. suffixes to denote IEC units. Use g_format_size() instead.</doc-deprecated>
  36069. <return-value transfer-ownership="full">
  36070. <doc xml:space="preserve">a newly-allocated formatted string containing a human
  36071. readable file size</doc>
  36072. <type name="utf8" c:type="gchar*"/>
  36073. </return-value>
  36074. <parameters>
  36075. <parameter name="size" transfer-ownership="none">
  36076. <doc xml:space="preserve">a size in bytes</doc>
  36077. <type name="gint64" c:type="goffset"/>
  36078. </parameter>
  36079. </parameters>
  36080. </function>
  36081. <function name="format_size_full"
  36082. c:identifier="g_format_size_full"
  36083. version="2.30">
  36084. <doc xml:space="preserve">Formats a size.
  36085. This function is similar to g_format_size() but allows for flags
  36086. that modify the output. See #GFormatSizeFlags.</doc>
  36087. <return-value transfer-ownership="full">
  36088. <doc xml:space="preserve">a newly-allocated formatted string containing a human
  36089. readable file size</doc>
  36090. <type name="utf8" c:type="gchar*"/>
  36091. </return-value>
  36092. <parameters>
  36093. <parameter name="size" transfer-ownership="none">
  36094. <doc xml:space="preserve">a size in bytes</doc>
  36095. <type name="guint64" c:type="guint64"/>
  36096. </parameter>
  36097. <parameter name="flags" transfer-ownership="none">
  36098. <doc xml:space="preserve">#GFormatSizeFlags to modify the output</doc>
  36099. <type name="FormatSizeFlags" c:type="GFormatSizeFlags"/>
  36100. </parameter>
  36101. </parameters>
  36102. </function>
  36103. <function name="fprintf"
  36104. c:identifier="g_fprintf"
  36105. version="2.2"
  36106. introspectable="0">
  36107. <doc xml:space="preserve">An implementation of the standard fprintf() function which supports
  36108. positional parameters, as specified in the Single Unix Specification.</doc>
  36109. <return-value transfer-ownership="none">
  36110. <doc xml:space="preserve">the number of bytes printed.</doc>
  36111. <type name="gint" c:type="gint"/>
  36112. </return-value>
  36113. <parameters>
  36114. <parameter name="file" transfer-ownership="none">
  36115. <doc xml:space="preserve">the stream to write to.</doc>
  36116. <type name="gpointer" c:type="FILE*"/>
  36117. </parameter>
  36118. <parameter name="format" transfer-ownership="none">
  36119. <doc xml:space="preserve">a standard printf() format string, but notice
  36120. [string precision pitfalls][string-precision]</doc>
  36121. <type name="utf8" c:type="gchar*"/>
  36122. </parameter>
  36123. <parameter name="..." transfer-ownership="none">
  36124. <doc xml:space="preserve">the arguments to insert in the output.</doc>
  36125. <varargs/>
  36126. </parameter>
  36127. </parameters>
  36128. </function>
  36129. <function name="free" c:identifier="g_free">
  36130. <doc xml:space="preserve">Frees the memory pointed to by @mem.
  36131. If @mem is %NULL it simply returns, so there is no need to check @mem
  36132. against %NULL before calling this function.</doc>
  36133. <return-value transfer-ownership="none">
  36134. <type name="none" c:type="void"/>
  36135. </return-value>
  36136. <parameters>
  36137. <parameter name="mem"
  36138. transfer-ownership="none"
  36139. nullable="1"
  36140. allow-none="1">
  36141. <doc xml:space="preserve">the memory to free</doc>
  36142. <type name="gpointer" c:type="gpointer"/>
  36143. </parameter>
  36144. </parameters>
  36145. </function>
  36146. <function name="get_application_name"
  36147. c:identifier="g_get_application_name"
  36148. version="2.2">
  36149. <doc xml:space="preserve">Gets a human-readable name for the application, as set by
  36150. g_set_application_name(). This name should be localized if
  36151. possible, and is intended for display to the user. Contrast with
  36152. g_get_prgname(), which gets a non-localized name. If
  36153. g_set_application_name() has not been called, returns the result of
  36154. g_get_prgname() (which may be %NULL if g_set_prgname() has also not
  36155. been called).</doc>
  36156. <return-value transfer-ownership="none">
  36157. <doc xml:space="preserve">human-readable application name. may return %NULL</doc>
  36158. <type name="utf8" c:type="const gchar*"/>
  36159. </return-value>
  36160. </function>
  36161. <function name="get_charset" c:identifier="g_get_charset">
  36162. <doc xml:space="preserve">Obtains the character set for the [current locale][setlocale]; you
  36163. might use this character set as an argument to g_convert(), to convert
  36164. from the current locale's encoding to some other encoding. (Frequently
  36165. g_locale_to_utf8() and g_locale_from_utf8() are nice shortcuts, though.)
  36166. On Windows the character set returned by this function is the
  36167. so-called system default ANSI code-page. That is the character set
  36168. used by the "narrow" versions of C library and Win32 functions that
  36169. handle file names. It might be different from the character set
  36170. used by the C library's current locale.
  36171. The return value is %TRUE if the locale's encoding is UTF-8, in that
  36172. case you can perhaps avoid calling g_convert().
  36173. The string returned in @charset is not allocated, and should not be
  36174. freed.</doc>
  36175. <return-value transfer-ownership="none">
  36176. <doc xml:space="preserve">%TRUE if the returned charset is UTF-8</doc>
  36177. <type name="gboolean" c:type="gboolean"/>
  36178. </return-value>
  36179. <parameters>
  36180. <parameter name="charset"
  36181. direction="out"
  36182. caller-allocates="0"
  36183. transfer-ownership="none"
  36184. optional="1"
  36185. allow-none="1">
  36186. <doc xml:space="preserve">return location for character set
  36187. name, or %NULL.</doc>
  36188. <type name="utf8" c:type="const char**"/>
  36189. </parameter>
  36190. </parameters>
  36191. </function>
  36192. <function name="get_codeset" c:identifier="g_get_codeset">
  36193. <doc xml:space="preserve">Gets the character set for the current locale.</doc>
  36194. <return-value transfer-ownership="full">
  36195. <doc xml:space="preserve">a newly allocated string containing the name
  36196. of the character set. This string must be freed with g_free().</doc>
  36197. <type name="utf8" c:type="gchar*"/>
  36198. </return-value>
  36199. </function>
  36200. <function name="get_current_dir" c:identifier="g_get_current_dir">
  36201. <doc xml:space="preserve">Gets the current directory.
  36202. The returned string should be freed when no longer needed.
  36203. The encoding of the returned string is system defined.
  36204. On Windows, it is always UTF-8.
  36205. Since GLib 2.40, this function will return the value of the "PWD"
  36206. environment variable if it is set and it happens to be the same as
  36207. the current directory. This can make a difference in the case that
  36208. the current directory is the target of a symbolic link.</doc>
  36209. <return-value transfer-ownership="full">
  36210. <doc xml:space="preserve">the current directory</doc>
  36211. <type name="utf8" c:type="gchar*"/>
  36212. </return-value>
  36213. </function>
  36214. <function name="get_current_time" c:identifier="g_get_current_time">
  36215. <doc xml:space="preserve">Equivalent to the UNIX gettimeofday() function, but portable.
  36216. You may find g_get_real_time() to be more convenient.</doc>
  36217. <return-value transfer-ownership="none">
  36218. <type name="none" c:type="void"/>
  36219. </return-value>
  36220. <parameters>
  36221. <parameter name="result" transfer-ownership="none">
  36222. <doc xml:space="preserve">#GTimeVal structure in which to store current time.</doc>
  36223. <type name="TimeVal" c:type="GTimeVal*"/>
  36224. </parameter>
  36225. </parameters>
  36226. </function>
  36227. <function name="get_environ" c:identifier="g_get_environ" version="2.28">
  36228. <doc xml:space="preserve">Gets the list of environment variables for the current process.
  36229. The list is %NULL terminated and each item in the list is of the
  36230. form 'NAME=VALUE'.
  36231. This is equivalent to direct access to the 'environ' global variable,
  36232. except portable.
  36233. The return value is freshly allocated and it should be freed with
  36234. g_strfreev() when it is no longer needed.</doc>
  36235. <return-value transfer-ownership="full">
  36236. <doc xml:space="preserve">the list of
  36237. environment variables</doc>
  36238. <array c:type="gchar**">
  36239. <type name="utf8"/>
  36240. </array>
  36241. </return-value>
  36242. </function>
  36243. <function name="get_filename_charsets"
  36244. c:identifier="g_get_filename_charsets"
  36245. version="2.6">
  36246. <doc xml:space="preserve">Determines the preferred character sets used for filenames.
  36247. The first character set from the @charsets is the filename encoding, the
  36248. subsequent character sets are used when trying to generate a displayable
  36249. representation of a filename, see g_filename_display_name().
  36250. On Unix, the character sets are determined by consulting the
  36251. environment variables `G_FILENAME_ENCODING` and `G_BROKEN_FILENAMES`.
  36252. On Windows, the character set used in the GLib API is always UTF-8
  36253. and said environment variables have no effect.
  36254. `G_FILENAME_ENCODING` may be set to a comma-separated list of
  36255. character set names. The special token "&amp;commat;locale" is taken
  36256. to mean the character set for the [current locale][setlocale].
  36257. If `G_FILENAME_ENCODING` is not set, but `G_BROKEN_FILENAMES` is,
  36258. the character set of the current locale is taken as the filename
  36259. encoding. If neither environment variable is set, UTF-8 is taken
  36260. as the filename encoding, but the character set of the current locale
  36261. is also put in the list of encodings.
  36262. The returned @charsets belong to GLib and must not be freed.
  36263. Note that on Unix, regardless of the locale character set or
  36264. `G_FILENAME_ENCODING` value, the actual file names present
  36265. on a system might be in any random encoding or just gibberish.</doc>
  36266. <return-value transfer-ownership="none">
  36267. <doc xml:space="preserve">%TRUE if the filename encoding is UTF-8.</doc>
  36268. <type name="gboolean" c:type="gboolean"/>
  36269. </return-value>
  36270. <parameters>
  36271. <parameter name="charsets" transfer-ownership="none">
  36272. <doc xml:space="preserve">return location for the %NULL-terminated list of encoding names</doc>
  36273. <type name="utf8" c:type="const gchar***"/>
  36274. </parameter>
  36275. </parameters>
  36276. </function>
  36277. <function name="get_home_dir" c:identifier="g_get_home_dir">
  36278. <doc xml:space="preserve">Gets the current user's home directory.
  36279. As with most UNIX tools, this function will return the value of the
  36280. `HOME` environment variable if it is set to an existing absolute path
  36281. name, falling back to the `passwd` file in the case that it is unset.
  36282. If the path given in `HOME` is non-absolute, does not exist, or is
  36283. not a directory, the result is undefined.
  36284. Before version 2.36 this function would ignore the `HOME` environment
  36285. variable, taking the value from the `passwd` database instead. This was
  36286. changed to increase the compatibility of GLib with other programs (and
  36287. the XDG basedir specification) and to increase testability of programs
  36288. based on GLib (by making it easier to run them from test frameworks).
  36289. If your program has a strong requirement for either the new or the
  36290. old behaviour (and if you don't wish to increase your GLib
  36291. dependency to ensure that the new behaviour is in effect) then you
  36292. should either directly check the `HOME` environment variable yourself
  36293. or unset it before calling any functions in GLib.</doc>
  36294. <return-value transfer-ownership="none">
  36295. <doc xml:space="preserve">the current user's home directory</doc>
  36296. <type name="utf8" c:type="const gchar*"/>
  36297. </return-value>
  36298. </function>
  36299. <function name="get_host_name"
  36300. c:identifier="g_get_host_name"
  36301. version="2.8">
  36302. <doc xml:space="preserve">Return a name for the machine.
  36303. The returned name is not necessarily a fully-qualified domain name,
  36304. or even present in DNS or some other name service at all. It need
  36305. not even be unique on your local network or site, but usually it
  36306. is. Callers should not rely on the return value having any specific
  36307. properties like uniqueness for security purposes. Even if the name
  36308. of the machine is changed while an application is running, the
  36309. return value from this function does not change. The returned
  36310. string is owned by GLib and should not be modified or freed. If no
  36311. name can be determined, a default fixed string "localhost" is
  36312. returned.</doc>
  36313. <return-value transfer-ownership="none">
  36314. <doc xml:space="preserve">the host name of the machine.</doc>
  36315. <type name="utf8" c:type="const gchar*"/>
  36316. </return-value>
  36317. </function>
  36318. <function name="get_language_names"
  36319. c:identifier="g_get_language_names"
  36320. version="2.6">
  36321. <doc xml:space="preserve">Computes a list of applicable locale names, which can be used to
  36322. e.g. construct locale-dependent filenames or search paths. The returned
  36323. list is sorted from most desirable to least desirable and always contains
  36324. the default locale "C".
  36325. For example, if LANGUAGE=de:en_US, then the returned list is
  36326. "de", "en_US", "en", "C".
  36327. This function consults the environment variables `LANGUAGE`, `LC_ALL`,
  36328. `LC_MESSAGES` and `LANG` to find the list of locales specified by the
  36329. user.</doc>
  36330. <return-value transfer-ownership="none">
  36331. <doc xml:space="preserve">a %NULL-terminated array of strings owned by GLib
  36332. that must not be modified or freed.</doc>
  36333. <array c:type="gchar**">
  36334. <type name="utf8"/>
  36335. </array>
  36336. </return-value>
  36337. </function>
  36338. <function name="get_locale_variants"
  36339. c:identifier="g_get_locale_variants"
  36340. version="2.28">
  36341. <doc xml:space="preserve">Returns a list of derived variants of @locale, which can be used to
  36342. e.g. construct locale-dependent filenames or search paths. The returned
  36343. list is sorted from most desirable to least desirable.
  36344. This function handles territory, charset and extra locale modifiers.
  36345. For example, if @locale is "fr_BE", then the returned list
  36346. is "fr_BE", "fr".
  36347. If you need the list of variants for the current locale,
  36348. use g_get_language_names().</doc>
  36349. <return-value transfer-ownership="full">
  36350. <doc xml:space="preserve">a newly
  36351. allocated array of newly allocated strings with the locale variants. Free with
  36352. g_strfreev().</doc>
  36353. <array c:type="gchar**">
  36354. <type name="utf8"/>
  36355. </array>
  36356. </return-value>
  36357. <parameters>
  36358. <parameter name="locale" transfer-ownership="none">
  36359. <doc xml:space="preserve">a locale identifier</doc>
  36360. <type name="utf8" c:type="const gchar*"/>
  36361. </parameter>
  36362. </parameters>
  36363. </function>
  36364. <function name="get_monotonic_time"
  36365. c:identifier="g_get_monotonic_time"
  36366. version="2.28">
  36367. <doc xml:space="preserve">Queries the system monotonic time.
  36368. The monotonic clock will always increase and doesn't suffer
  36369. discontinuities when the user (or NTP) changes the system time. It
  36370. may or may not continue to tick during times where the machine is
  36371. suspended.
  36372. We try to use the clock that corresponds as closely as possible to
  36373. the passage of time as measured by system calls such as poll() but it
  36374. may not always be possible to do this.</doc>
  36375. <return-value transfer-ownership="none">
  36376. <doc xml:space="preserve">the monotonic time, in microseconds</doc>
  36377. <type name="gint64" c:type="gint64"/>
  36378. </return-value>
  36379. </function>
  36380. <function name="get_num_processors"
  36381. c:identifier="g_get_num_processors"
  36382. version="2.36">
  36383. <doc xml:space="preserve">Determine the approximate number of threads that the system will
  36384. schedule simultaneously for this process. This is intended to be
  36385. used as a parameter to g_thread_pool_new() for CPU bound tasks and
  36386. similar cases.</doc>
  36387. <return-value transfer-ownership="none">
  36388. <doc xml:space="preserve">Number of schedulable threads, always greater than 0</doc>
  36389. <type name="guint" c:type="guint"/>
  36390. </return-value>
  36391. </function>
  36392. <function name="get_prgname" c:identifier="g_get_prgname">
  36393. <doc xml:space="preserve">Gets the name of the program. This name should not be localized,
  36394. in contrast to g_get_application_name().
  36395. If you are using GDK or GTK+ the program name is set in gdk_init(),
  36396. which is called by gtk_init(). The program name is found by taking
  36397. the last component of @argv[0].</doc>
  36398. <return-value transfer-ownership="none">
  36399. <doc xml:space="preserve">the name of the program. The returned string belongs
  36400. to GLib and must not be modified or freed.</doc>
  36401. <type name="utf8" c:type="const gchar*"/>
  36402. </return-value>
  36403. </function>
  36404. <function name="get_real_name" c:identifier="g_get_real_name">
  36405. <doc xml:space="preserve">Gets the real name of the user. This usually comes from the user's
  36406. entry in the `passwd` file. The encoding of the returned string is
  36407. system-defined. (On Windows, it is, however, always UTF-8.) If the
  36408. real user name cannot be determined, the string "Unknown" is
  36409. returned.</doc>
  36410. <return-value transfer-ownership="none">
  36411. <doc xml:space="preserve">the user's real name.</doc>
  36412. <type name="utf8" c:type="const gchar*"/>
  36413. </return-value>
  36414. </function>
  36415. <function name="get_real_time"
  36416. c:identifier="g_get_real_time"
  36417. version="2.28">
  36418. <doc xml:space="preserve">Queries the system wall-clock time.
  36419. This call is functionally equivalent to g_get_current_time() except
  36420. that the return value is often more convenient than dealing with a
  36421. #GTimeVal.
  36422. You should only use this call if you are actually interested in the real
  36423. wall-clock time. g_get_monotonic_time() is probably more useful for
  36424. measuring intervals.</doc>
  36425. <return-value transfer-ownership="none">
  36426. <doc xml:space="preserve">the number of microseconds since January 1, 1970 UTC.</doc>
  36427. <type name="gint64" c:type="gint64"/>
  36428. </return-value>
  36429. </function>
  36430. <function name="get_system_config_dirs"
  36431. c:identifier="g_get_system_config_dirs"
  36432. version="2.6">
  36433. <doc xml:space="preserve">Returns an ordered list of base directories in which to access
  36434. system-wide configuration information.
  36435. On UNIX platforms this is determined using the mechanisms described
  36436. in the
  36437. [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec).
  36438. In this case the list of directories retrieved will be `XDG_CONFIG_DIRS`.
  36439. On Windows is the directory that contains application data for all users.
  36440. A typical path is C:\Documents and Settings\All Users\Application Data.
  36441. This folder is used for application data that is not user specific.
  36442. For example, an application can store a spell-check dictionary, a database
  36443. of clip art, or a log file in the CSIDL_COMMON_APPDATA folder.
  36444. This information will not roam and is available to anyone using the computer.</doc>
  36445. <return-value transfer-ownership="none">
  36446. <doc xml:space="preserve">a %NULL-terminated array of strings owned by GLib that must
  36447. not be modified or freed.</doc>
  36448. <array c:type="gchar**">
  36449. <type name="utf8"/>
  36450. </array>
  36451. </return-value>
  36452. </function>
  36453. <function name="get_system_data_dirs"
  36454. c:identifier="g_get_system_data_dirs"
  36455. version="2.6">
  36456. <doc xml:space="preserve">Returns an ordered list of base directories in which to access
  36457. system-wide application data.
  36458. On UNIX platforms this is determined using the mechanisms described
  36459. in the
  36460. [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec)
  36461. In this case the list of directories retrieved will be XDG_DATA_DIRS.
  36462. On Windows the first elements in the list are the Application Data
  36463. and Documents folders for All Users. (These can be determined only
  36464. on Windows 2000 or later and are not present in the list on other
  36465. Windows versions.) See documentation for CSIDL_COMMON_APPDATA and
  36466. CSIDL_COMMON_DOCUMENTS.
  36467. Then follows the "share" subfolder in the installation folder for
  36468. the package containing the DLL that calls this function, if it can
  36469. be determined.
  36470. Finally the list contains the "share" subfolder in the installation
  36471. folder for GLib, and in the installation folder for the package the
  36472. application's .exe file belongs to.
  36473. The installation folders above are determined by looking up the
  36474. folder where the module (DLL or EXE) in question is located. If the
  36475. folder's name is "bin", its parent is used, otherwise the folder
  36476. itself.
  36477. Note that on Windows the returned list can vary depending on where
  36478. this function is called.</doc>
  36479. <return-value transfer-ownership="none">
  36480. <doc xml:space="preserve">a %NULL-terminated array of strings owned by GLib that must
  36481. not be modified or freed.</doc>
  36482. <array c:type="gchar**">
  36483. <type name="utf8"/>
  36484. </array>
  36485. </return-value>
  36486. </function>
  36487. <function name="get_tmp_dir" c:identifier="g_get_tmp_dir">
  36488. <doc xml:space="preserve">Gets the directory to use for temporary files.
  36489. On UNIX, this is taken from the `TMPDIR` environment variable.
  36490. If the variable is not set, `P_tmpdir` is
  36491. used, as defined by the system C library. Failing that, a
  36492. hard-coded default of "/tmp" is returned.
  36493. On Windows, the `TEMP` environment variable is used, with the
  36494. root directory of the Windows installation (eg: "C:\") used
  36495. as a default.
  36496. The encoding of the returned string is system-defined. On Windows,
  36497. it is always UTF-8. The return value is never %NULL or the empty
  36498. string.</doc>
  36499. <return-value transfer-ownership="none">
  36500. <doc xml:space="preserve">the directory to use for temporary files.</doc>
  36501. <type name="utf8" c:type="const gchar*"/>
  36502. </return-value>
  36503. </function>
  36504. <function name="get_user_cache_dir"
  36505. c:identifier="g_get_user_cache_dir"
  36506. version="2.6">
  36507. <doc xml:space="preserve">Returns a base directory in which to store non-essential, cached
  36508. data specific to particular user.
  36509. On UNIX platforms this is determined using the mechanisms described
  36510. in the
  36511. [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec).
  36512. In this case the directory retrieved will be XDG_CACHE_HOME.
  36513. On Windows is the directory that serves as a common repository for
  36514. temporary Internet files. A typical path is
  36515. C:\Documents and Settings\username\Local Settings\Temporary Internet Files.
  36516. See documentation for CSIDL_INTERNET_CACHE.</doc>
  36517. <return-value transfer-ownership="none">
  36518. <doc xml:space="preserve">a string owned by GLib that must not be modified
  36519. or freed.</doc>
  36520. <type name="utf8" c:type="const gchar*"/>
  36521. </return-value>
  36522. </function>
  36523. <function name="get_user_config_dir"
  36524. c:identifier="g_get_user_config_dir"
  36525. version="2.6">
  36526. <doc xml:space="preserve">Returns a base directory in which to store user-specific application
  36527. configuration information such as user preferences and settings.
  36528. On UNIX platforms this is determined using the mechanisms described
  36529. in the
  36530. [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec).
  36531. In this case the directory retrieved will be `XDG_CONFIG_HOME`.
  36532. On Windows this is the folder to use for local (as opposed to
  36533. roaming) application data. See documentation for
  36534. CSIDL_LOCAL_APPDATA. Note that on Windows it thus is the same as
  36535. what g_get_user_data_dir() returns.</doc>
  36536. <return-value transfer-ownership="none">
  36537. <doc xml:space="preserve">a string owned by GLib that must not be modified
  36538. or freed.</doc>
  36539. <type name="utf8" c:type="const gchar*"/>
  36540. </return-value>
  36541. </function>
  36542. <function name="get_user_data_dir"
  36543. c:identifier="g_get_user_data_dir"
  36544. version="2.6">
  36545. <doc xml:space="preserve">Returns a base directory in which to access application data such
  36546. as icons that is customized for a particular user.
  36547. On UNIX platforms this is determined using the mechanisms described
  36548. in the
  36549. [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec).
  36550. In this case the directory retrieved will be `XDG_DATA_HOME`.
  36551. On Windows this is the folder to use for local (as opposed to
  36552. roaming) application data. See documentation for
  36553. CSIDL_LOCAL_APPDATA. Note that on Windows it thus is the same as
  36554. what g_get_user_config_dir() returns.</doc>
  36555. <return-value transfer-ownership="none">
  36556. <doc xml:space="preserve">a string owned by GLib that must not be modified
  36557. or freed.</doc>
  36558. <type name="utf8" c:type="const gchar*"/>
  36559. </return-value>
  36560. </function>
  36561. <function name="get_user_name" c:identifier="g_get_user_name">
  36562. <doc xml:space="preserve">Gets the user name of the current user. The encoding of the returned
  36563. string is system-defined. On UNIX, it might be the preferred file name
  36564. encoding, or something else, and there is no guarantee that it is even
  36565. consistent on a machine. On Windows, it is always UTF-8.</doc>
  36566. <return-value transfer-ownership="none">
  36567. <doc xml:space="preserve">the user name of the current user.</doc>
  36568. <type name="utf8" c:type="const gchar*"/>
  36569. </return-value>
  36570. </function>
  36571. <function name="get_user_runtime_dir"
  36572. c:identifier="g_get_user_runtime_dir"
  36573. version="2.28">
  36574. <doc xml:space="preserve">Returns a directory that is unique to the current user on the local
  36575. system.
  36576. On UNIX platforms this is determined using the mechanisms described
  36577. in the
  36578. [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec).
  36579. This is the directory
  36580. specified in the `XDG_RUNTIME_DIR` environment variable.
  36581. In the case that this variable is not set, we return the value of
  36582. g_get_user_cache_dir(), after verifying that it exists.
  36583. On Windows this is the folder to use for local (as opposed to
  36584. roaming) application data. See documentation for
  36585. CSIDL_LOCAL_APPDATA. Note that on Windows it thus is the same as
  36586. what g_get_user_config_dir() returns.</doc>
  36587. <return-value transfer-ownership="none">
  36588. <doc xml:space="preserve">a string owned by GLib that must not be modified or freed.</doc>
  36589. <type name="utf8" c:type="const gchar*"/>
  36590. </return-value>
  36591. </function>
  36592. <function name="get_user_special_dir"
  36593. c:identifier="g_get_user_special_dir"
  36594. version="2.14">
  36595. <doc xml:space="preserve">Returns the full path of a special directory using its logical id.
  36596. On UNIX this is done using the XDG special user directories.
  36597. For compatibility with existing practise, %G_USER_DIRECTORY_DESKTOP
  36598. falls back to `$HOME/Desktop` when XDG special user directories have
  36599. not been set up.
  36600. Depending on the platform, the user might be able to change the path
  36601. of the special directory without requiring the session to restart; GLib
  36602. will not reflect any change once the special directories are loaded.</doc>
  36603. <return-value transfer-ownership="none">
  36604. <doc xml:space="preserve">the path to the specified special directory, or %NULL
  36605. if the logical id was not found. The returned string is owned by
  36606. GLib and should not be modified or freed.</doc>
  36607. <type name="utf8" c:type="const gchar*"/>
  36608. </return-value>
  36609. <parameters>
  36610. <parameter name="directory" transfer-ownership="none">
  36611. <doc xml:space="preserve">the logical id of special directory</doc>
  36612. <type name="UserDirectory" c:type="GUserDirectory"/>
  36613. </parameter>
  36614. </parameters>
  36615. </function>
  36616. <function name="getenv" c:identifier="g_getenv">
  36617. <doc xml:space="preserve">Returns the value of an environment variable.
  36618. On UNIX, the name and value are byte strings which might or might not
  36619. be in some consistent character set and encoding. On Windows, they are
  36620. in UTF-8.
  36621. On Windows, in case the environment variable's value contains
  36622. references to other environment variables, they are expanded.</doc>
  36623. <return-value transfer-ownership="none">
  36624. <doc xml:space="preserve">the value of the environment variable, or %NULL if
  36625. the environment variable is not found. The returned string
  36626. may be overwritten by the next call to g_getenv(), g_setenv()
  36627. or g_unsetenv().</doc>
  36628. <type name="utf8" c:type="const gchar*"/>
  36629. </return-value>
  36630. <parameters>
  36631. <parameter name="variable" transfer-ownership="none">
  36632. <doc xml:space="preserve">the environment variable to get</doc>
  36633. <type name="utf8" c:type="const gchar*"/>
  36634. </parameter>
  36635. </parameters>
  36636. </function>
  36637. <function name="hash_table_add"
  36638. c:identifier="g_hash_table_add"
  36639. moved-to="HashTable.add"
  36640. version="2.32">
  36641. <doc xml:space="preserve">This is a convenience function for using a #GHashTable as a set. It
  36642. is equivalent to calling g_hash_table_replace() with @key as both the
  36643. key and the value.
  36644. When a hash table only ever contains keys that have themselves as the
  36645. corresponding value it is able to be stored more efficiently. See
  36646. the discussion in the section description.</doc>
  36647. <return-value transfer-ownership="none">
  36648. <doc xml:space="preserve">%TRUE if the key did not exist yet</doc>
  36649. <type name="gboolean" c:type="gboolean"/>
  36650. </return-value>
  36651. <parameters>
  36652. <parameter name="hash_table" transfer-ownership="none">
  36653. <doc xml:space="preserve">a #GHashTable</doc>
  36654. <type name="GLib.HashTable" c:type="GHashTable*">
  36655. <type name="gpointer" c:type="gpointer"/>
  36656. <type name="gpointer" c:type="gpointer"/>
  36657. </type>
  36658. </parameter>
  36659. <parameter name="key"
  36660. transfer-ownership="none"
  36661. nullable="1"
  36662. allow-none="1">
  36663. <doc xml:space="preserve">a key to insert</doc>
  36664. <type name="gpointer" c:type="gpointer"/>
  36665. </parameter>
  36666. </parameters>
  36667. </function>
  36668. <function name="hash_table_contains"
  36669. c:identifier="g_hash_table_contains"
  36670. moved-to="HashTable.contains"
  36671. version="2.32">
  36672. <doc xml:space="preserve">Checks if @key is in @hash_table.</doc>
  36673. <return-value transfer-ownership="none">
  36674. <doc xml:space="preserve">%TRUE if @key is in @hash_table, %FALSE otherwise.</doc>
  36675. <type name="gboolean" c:type="gboolean"/>
  36676. </return-value>
  36677. <parameters>
  36678. <parameter name="hash_table" transfer-ownership="none">
  36679. <doc xml:space="preserve">a #GHashTable</doc>
  36680. <type name="GLib.HashTable" c:type="GHashTable*">
  36681. <type name="gpointer" c:type="gpointer"/>
  36682. <type name="gpointer" c:type="gpointer"/>
  36683. </type>
  36684. </parameter>
  36685. <parameter name="key"
  36686. transfer-ownership="none"
  36687. nullable="1"
  36688. allow-none="1">
  36689. <doc xml:space="preserve">a key to check</doc>
  36690. <type name="gpointer" c:type="gconstpointer"/>
  36691. </parameter>
  36692. </parameters>
  36693. </function>
  36694. <function name="hash_table_destroy"
  36695. c:identifier="g_hash_table_destroy"
  36696. moved-to="HashTable.destroy">
  36697. <doc xml:space="preserve">Destroys all keys and values in the #GHashTable and decrements its
  36698. reference count by 1. If keys and/or values are dynamically allocated,
  36699. you should either free them first or create the #GHashTable with destroy
  36700. notifiers using g_hash_table_new_full(). In the latter case the destroy
  36701. functions you supplied will be called on all keys and values during the
  36702. destruction phase.</doc>
  36703. <return-value transfer-ownership="none">
  36704. <type name="none" c:type="void"/>
  36705. </return-value>
  36706. <parameters>
  36707. <parameter name="hash_table" transfer-ownership="none">
  36708. <doc xml:space="preserve">a #GHashTable</doc>
  36709. <type name="GLib.HashTable" c:type="GHashTable*">
  36710. <type name="gpointer" c:type="gpointer"/>
  36711. <type name="gpointer" c:type="gpointer"/>
  36712. </type>
  36713. </parameter>
  36714. </parameters>
  36715. </function>
  36716. <function name="hash_table_insert"
  36717. c:identifier="g_hash_table_insert"
  36718. moved-to="HashTable.insert">
  36719. <doc xml:space="preserve">Inserts a new key and value into a #GHashTable.
  36720. If the key already exists in the #GHashTable its current
  36721. value is replaced with the new value. If you supplied a
  36722. @value_destroy_func when creating the #GHashTable, the old
  36723. value is freed using that function. If you supplied a
  36724. @key_destroy_func when creating the #GHashTable, the passed
  36725. key is freed using that function.</doc>
  36726. <return-value transfer-ownership="none">
  36727. <doc xml:space="preserve">%TRUE if the key did not exist yet</doc>
  36728. <type name="gboolean" c:type="gboolean"/>
  36729. </return-value>
  36730. <parameters>
  36731. <parameter name="hash_table" transfer-ownership="none">
  36732. <doc xml:space="preserve">a #GHashTable</doc>
  36733. <type name="GLib.HashTable" c:type="GHashTable*">
  36734. <type name="gpointer" c:type="gpointer"/>
  36735. <type name="gpointer" c:type="gpointer"/>
  36736. </type>
  36737. </parameter>
  36738. <parameter name="key"
  36739. transfer-ownership="none"
  36740. nullable="1"
  36741. allow-none="1">
  36742. <doc xml:space="preserve">a key to insert</doc>
  36743. <type name="gpointer" c:type="gpointer"/>
  36744. </parameter>
  36745. <parameter name="value"
  36746. transfer-ownership="none"
  36747. nullable="1"
  36748. allow-none="1">
  36749. <doc xml:space="preserve">the value to associate with the key</doc>
  36750. <type name="gpointer" c:type="gpointer"/>
  36751. </parameter>
  36752. </parameters>
  36753. </function>
  36754. <function name="hash_table_lookup"
  36755. c:identifier="g_hash_table_lookup"
  36756. moved-to="HashTable.lookup">
  36757. <doc xml:space="preserve">Looks up a key in a #GHashTable. Note that this function cannot
  36758. distinguish between a key that is not present and one which is present
  36759. and has the value %NULL. If you need this distinction, use
  36760. g_hash_table_lookup_extended().</doc>
  36761. <return-value transfer-ownership="none" nullable="1">
  36762. <doc xml:space="preserve">the associated value, or %NULL if the key is not found</doc>
  36763. <type name="gpointer" c:type="gpointer"/>
  36764. </return-value>
  36765. <parameters>
  36766. <parameter name="hash_table" transfer-ownership="none">
  36767. <doc xml:space="preserve">a #GHashTable</doc>
  36768. <type name="GLib.HashTable" c:type="GHashTable*">
  36769. <type name="gpointer" c:type="gpointer"/>
  36770. <type name="gpointer" c:type="gpointer"/>
  36771. </type>
  36772. </parameter>
  36773. <parameter name="key"
  36774. transfer-ownership="none"
  36775. nullable="1"
  36776. allow-none="1">
  36777. <doc xml:space="preserve">the key to look up</doc>
  36778. <type name="gpointer" c:type="gconstpointer"/>
  36779. </parameter>
  36780. </parameters>
  36781. </function>
  36782. <function name="hash_table_lookup_extended"
  36783. c:identifier="g_hash_table_lookup_extended"
  36784. moved-to="HashTable.lookup_extended">
  36785. <doc xml:space="preserve">Looks up a key in the #GHashTable, returning the original key and the
  36786. associated value and a #gboolean which is %TRUE if the key was found. This
  36787. is useful if you need to free the memory allocated for the original key,
  36788. for example before calling g_hash_table_remove().
  36789. You can actually pass %NULL for @lookup_key to test
  36790. whether the %NULL key exists, provided the hash and equal functions
  36791. of @hash_table are %NULL-safe.</doc>
  36792. <return-value transfer-ownership="none">
  36793. <doc xml:space="preserve">%TRUE if the key was found in the #GHashTable</doc>
  36794. <type name="gboolean" c:type="gboolean"/>
  36795. </return-value>
  36796. <parameters>
  36797. <parameter name="hash_table" transfer-ownership="none">
  36798. <doc xml:space="preserve">a #GHashTable</doc>
  36799. <type name="GLib.HashTable" c:type="GHashTable*">
  36800. <type name="gpointer" c:type="gpointer"/>
  36801. <type name="gpointer" c:type="gpointer"/>
  36802. </type>
  36803. </parameter>
  36804. <parameter name="lookup_key"
  36805. transfer-ownership="none"
  36806. nullable="1"
  36807. allow-none="1">
  36808. <doc xml:space="preserve">the key to look up</doc>
  36809. <type name="gpointer" c:type="gconstpointer"/>
  36810. </parameter>
  36811. <parameter name="orig_key"
  36812. direction="out"
  36813. caller-allocates="0"
  36814. transfer-ownership="full"
  36815. nullable="1"
  36816. optional="1"
  36817. allow-none="1">
  36818. <doc xml:space="preserve">return location for the original key</doc>
  36819. <type name="gpointer" c:type="gpointer*"/>
  36820. </parameter>
  36821. <parameter name="value"
  36822. direction="out"
  36823. caller-allocates="0"
  36824. transfer-ownership="full"
  36825. nullable="1"
  36826. optional="1"
  36827. allow-none="1">
  36828. <doc xml:space="preserve">return location for the value associated
  36829. with the key</doc>
  36830. <type name="gpointer" c:type="gpointer*"/>
  36831. </parameter>
  36832. </parameters>
  36833. </function>
  36834. <function name="hash_table_remove"
  36835. c:identifier="g_hash_table_remove"
  36836. moved-to="HashTable.remove">
  36837. <doc xml:space="preserve">Removes a key and its associated value from a #GHashTable.
  36838. If the #GHashTable was created using g_hash_table_new_full(), the
  36839. key and value are freed using the supplied destroy functions, otherwise
  36840. you have to make sure that any dynamically allocated values are freed
  36841. yourself.</doc>
  36842. <return-value transfer-ownership="none">
  36843. <doc xml:space="preserve">%TRUE if the key was found and removed from the #GHashTable</doc>
  36844. <type name="gboolean" c:type="gboolean"/>
  36845. </return-value>
  36846. <parameters>
  36847. <parameter name="hash_table" transfer-ownership="none">
  36848. <doc xml:space="preserve">a #GHashTable</doc>
  36849. <type name="GLib.HashTable" c:type="GHashTable*">
  36850. <type name="gpointer" c:type="gpointer"/>
  36851. <type name="gpointer" c:type="gpointer"/>
  36852. </type>
  36853. </parameter>
  36854. <parameter name="key"
  36855. transfer-ownership="none"
  36856. nullable="1"
  36857. allow-none="1">
  36858. <doc xml:space="preserve">the key to remove</doc>
  36859. <type name="gpointer" c:type="gconstpointer"/>
  36860. </parameter>
  36861. </parameters>
  36862. </function>
  36863. <function name="hash_table_remove_all"
  36864. c:identifier="g_hash_table_remove_all"
  36865. moved-to="HashTable.remove_all"
  36866. version="2.12">
  36867. <doc xml:space="preserve">Removes all keys and their associated values from a #GHashTable.
  36868. If the #GHashTable was created using g_hash_table_new_full(),
  36869. the keys and values are freed using the supplied destroy functions,
  36870. otherwise you have to make sure that any dynamically allocated
  36871. values are freed yourself.</doc>
  36872. <return-value transfer-ownership="none">
  36873. <type name="none" c:type="void"/>
  36874. </return-value>
  36875. <parameters>
  36876. <parameter name="hash_table" transfer-ownership="none">
  36877. <doc xml:space="preserve">a #GHashTable</doc>
  36878. <type name="GLib.HashTable" c:type="GHashTable*">
  36879. <type name="gpointer" c:type="gpointer"/>
  36880. <type name="gpointer" c:type="gpointer"/>
  36881. </type>
  36882. </parameter>
  36883. </parameters>
  36884. </function>
  36885. <function name="hash_table_replace"
  36886. c:identifier="g_hash_table_replace"
  36887. moved-to="HashTable.replace">
  36888. <doc xml:space="preserve">Inserts a new key and value into a #GHashTable similar to
  36889. g_hash_table_insert(). The difference is that if the key
  36890. already exists in the #GHashTable, it gets replaced by the
  36891. new key. If you supplied a @value_destroy_func when creating
  36892. the #GHashTable, the old value is freed using that function.
  36893. If you supplied a @key_destroy_func when creating the
  36894. #GHashTable, the old key is freed using that function.</doc>
  36895. <return-value transfer-ownership="none">
  36896. <doc xml:space="preserve">%TRUE if the key did not exist yet</doc>
  36897. <type name="gboolean" c:type="gboolean"/>
  36898. </return-value>
  36899. <parameters>
  36900. <parameter name="hash_table" transfer-ownership="none">
  36901. <doc xml:space="preserve">a #GHashTable</doc>
  36902. <type name="GLib.HashTable" c:type="GHashTable*">
  36903. <type name="gpointer" c:type="gpointer"/>
  36904. <type name="gpointer" c:type="gpointer"/>
  36905. </type>
  36906. </parameter>
  36907. <parameter name="key"
  36908. transfer-ownership="none"
  36909. nullable="1"
  36910. allow-none="1">
  36911. <doc xml:space="preserve">a key to insert</doc>
  36912. <type name="gpointer" c:type="gpointer"/>
  36913. </parameter>
  36914. <parameter name="value"
  36915. transfer-ownership="none"
  36916. nullable="1"
  36917. allow-none="1">
  36918. <doc xml:space="preserve">the value to associate with the key</doc>
  36919. <type name="gpointer" c:type="gpointer"/>
  36920. </parameter>
  36921. </parameters>
  36922. </function>
  36923. <function name="hash_table_size"
  36924. c:identifier="g_hash_table_size"
  36925. moved-to="HashTable.size">
  36926. <doc xml:space="preserve">Returns the number of elements contained in the #GHashTable.</doc>
  36927. <return-value transfer-ownership="none">
  36928. <doc xml:space="preserve">the number of key/value pairs in the #GHashTable.</doc>
  36929. <type name="guint" c:type="guint"/>
  36930. </return-value>
  36931. <parameters>
  36932. <parameter name="hash_table" transfer-ownership="none">
  36933. <doc xml:space="preserve">a #GHashTable</doc>
  36934. <type name="GLib.HashTable" c:type="GHashTable*">
  36935. <type name="gpointer" c:type="gpointer"/>
  36936. <type name="gpointer" c:type="gpointer"/>
  36937. </type>
  36938. </parameter>
  36939. </parameters>
  36940. </function>
  36941. <function name="hash_table_steal"
  36942. c:identifier="g_hash_table_steal"
  36943. moved-to="HashTable.steal">
  36944. <doc xml:space="preserve">Removes a key and its associated value from a #GHashTable without
  36945. calling the key and value destroy functions.</doc>
  36946. <return-value transfer-ownership="none">
  36947. <doc xml:space="preserve">%TRUE if the key was found and removed from the #GHashTable</doc>
  36948. <type name="gboolean" c:type="gboolean"/>
  36949. </return-value>
  36950. <parameters>
  36951. <parameter name="hash_table" transfer-ownership="none">
  36952. <doc xml:space="preserve">a #GHashTable</doc>
  36953. <type name="GLib.HashTable" c:type="GHashTable*">
  36954. <type name="gpointer" c:type="gpointer"/>
  36955. <type name="gpointer" c:type="gpointer"/>
  36956. </type>
  36957. </parameter>
  36958. <parameter name="key"
  36959. transfer-ownership="none"
  36960. nullable="1"
  36961. allow-none="1">
  36962. <doc xml:space="preserve">the key to remove</doc>
  36963. <type name="gpointer" c:type="gconstpointer"/>
  36964. </parameter>
  36965. </parameters>
  36966. </function>
  36967. <function name="hash_table_steal_all"
  36968. c:identifier="g_hash_table_steal_all"
  36969. moved-to="HashTable.steal_all"
  36970. version="2.12">
  36971. <doc xml:space="preserve">Removes all keys and their associated values from a #GHashTable
  36972. without calling the key and value destroy functions.</doc>
  36973. <return-value transfer-ownership="none">
  36974. <type name="none" c:type="void"/>
  36975. </return-value>
  36976. <parameters>
  36977. <parameter name="hash_table" transfer-ownership="none">
  36978. <doc xml:space="preserve">a #GHashTable</doc>
  36979. <type name="GLib.HashTable" c:type="GHashTable*">
  36980. <type name="gpointer" c:type="gpointer"/>
  36981. <type name="gpointer" c:type="gpointer"/>
  36982. </type>
  36983. </parameter>
  36984. </parameters>
  36985. </function>
  36986. <function name="hash_table_unref"
  36987. c:identifier="g_hash_table_unref"
  36988. moved-to="HashTable.unref"
  36989. version="2.10">
  36990. <doc xml:space="preserve">Atomically decrements the reference count of @hash_table by one.
  36991. If the reference count drops to 0, all keys and values will be
  36992. destroyed, and all memory allocated by the hash table is released.
  36993. This function is MT-safe and may be called from any thread.</doc>
  36994. <return-value transfer-ownership="none">
  36995. <type name="none" c:type="void"/>
  36996. </return-value>
  36997. <parameters>
  36998. <parameter name="hash_table" transfer-ownership="none">
  36999. <doc xml:space="preserve">a valid #GHashTable</doc>
  37000. <type name="GLib.HashTable" c:type="GHashTable*">
  37001. <type name="gpointer" c:type="gpointer"/>
  37002. <type name="gpointer" c:type="gpointer"/>
  37003. </type>
  37004. </parameter>
  37005. </parameters>
  37006. </function>
  37007. <function name="hook_destroy"
  37008. c:identifier="g_hook_destroy"
  37009. moved-to="Hook.destroy">
  37010. <doc xml:space="preserve">Destroys a #GHook, given its ID.</doc>
  37011. <return-value transfer-ownership="none">
  37012. <doc xml:space="preserve">%TRUE if the #GHook was found in the #GHookList and destroyed</doc>
  37013. <type name="gboolean" c:type="gboolean"/>
  37014. </return-value>
  37015. <parameters>
  37016. <parameter name="hook_list" transfer-ownership="none">
  37017. <doc xml:space="preserve">a #GHookList</doc>
  37018. <type name="HookList" c:type="GHookList*"/>
  37019. </parameter>
  37020. <parameter name="hook_id" transfer-ownership="none">
  37021. <doc xml:space="preserve">a hook ID</doc>
  37022. <type name="gulong" c:type="gulong"/>
  37023. </parameter>
  37024. </parameters>
  37025. </function>
  37026. <function name="hook_destroy_link"
  37027. c:identifier="g_hook_destroy_link"
  37028. moved-to="Hook.destroy_link">
  37029. <doc xml:space="preserve">Removes one #GHook from a #GHookList, marking it
  37030. inactive and calling g_hook_unref() on it.</doc>
  37031. <return-value transfer-ownership="none">
  37032. <type name="none" c:type="void"/>
  37033. </return-value>
  37034. <parameters>
  37035. <parameter name="hook_list" transfer-ownership="none">
  37036. <doc xml:space="preserve">a #GHookList</doc>
  37037. <type name="HookList" c:type="GHookList*"/>
  37038. </parameter>
  37039. <parameter name="hook" transfer-ownership="none">
  37040. <doc xml:space="preserve">the #GHook to remove</doc>
  37041. <type name="Hook" c:type="GHook*"/>
  37042. </parameter>
  37043. </parameters>
  37044. </function>
  37045. <function name="hook_free" c:identifier="g_hook_free" moved-to="Hook.free">
  37046. <doc xml:space="preserve">Calls the #GHookList @finalize_hook function if it exists,
  37047. and frees the memory allocated for the #GHook.</doc>
  37048. <return-value transfer-ownership="none">
  37049. <type name="none" c:type="void"/>
  37050. </return-value>
  37051. <parameters>
  37052. <parameter name="hook_list" transfer-ownership="none">
  37053. <doc xml:space="preserve">a #GHookList</doc>
  37054. <type name="HookList" c:type="GHookList*"/>
  37055. </parameter>
  37056. <parameter name="hook" transfer-ownership="none">
  37057. <doc xml:space="preserve">the #GHook to free</doc>
  37058. <type name="Hook" c:type="GHook*"/>
  37059. </parameter>
  37060. </parameters>
  37061. </function>
  37062. <function name="hook_insert_before"
  37063. c:identifier="g_hook_insert_before"
  37064. moved-to="Hook.insert_before">
  37065. <doc xml:space="preserve">Inserts a #GHook into a #GHookList, before a given #GHook.</doc>
  37066. <return-value transfer-ownership="none">
  37067. <type name="none" c:type="void"/>
  37068. </return-value>
  37069. <parameters>
  37070. <parameter name="hook_list" transfer-ownership="none">
  37071. <doc xml:space="preserve">a #GHookList</doc>
  37072. <type name="HookList" c:type="GHookList*"/>
  37073. </parameter>
  37074. <parameter name="sibling"
  37075. transfer-ownership="none"
  37076. nullable="1"
  37077. allow-none="1">
  37078. <doc xml:space="preserve">the #GHook to insert the new #GHook before</doc>
  37079. <type name="Hook" c:type="GHook*"/>
  37080. </parameter>
  37081. <parameter name="hook" transfer-ownership="none">
  37082. <doc xml:space="preserve">the #GHook to insert</doc>
  37083. <type name="Hook" c:type="GHook*"/>
  37084. </parameter>
  37085. </parameters>
  37086. </function>
  37087. <function name="hook_prepend"
  37088. c:identifier="g_hook_prepend"
  37089. moved-to="Hook.prepend">
  37090. <doc xml:space="preserve">Prepends a #GHook on the start of a #GHookList.</doc>
  37091. <return-value transfer-ownership="none">
  37092. <type name="none" c:type="void"/>
  37093. </return-value>
  37094. <parameters>
  37095. <parameter name="hook_list" transfer-ownership="none">
  37096. <doc xml:space="preserve">a #GHookList</doc>
  37097. <type name="HookList" c:type="GHookList*"/>
  37098. </parameter>
  37099. <parameter name="hook" transfer-ownership="none">
  37100. <doc xml:space="preserve">the #GHook to add to the start of @hook_list</doc>
  37101. <type name="Hook" c:type="GHook*"/>
  37102. </parameter>
  37103. </parameters>
  37104. </function>
  37105. <function name="hook_unref"
  37106. c:identifier="g_hook_unref"
  37107. moved-to="Hook.unref">
  37108. <doc xml:space="preserve">Decrements the reference count of a #GHook.
  37109. If the reference count falls to 0, the #GHook is removed
  37110. from the #GHookList and g_hook_free() is called to free it.</doc>
  37111. <return-value transfer-ownership="none">
  37112. <type name="none" c:type="void"/>
  37113. </return-value>
  37114. <parameters>
  37115. <parameter name="hook_list" transfer-ownership="none">
  37116. <doc xml:space="preserve">a #GHookList</doc>
  37117. <type name="HookList" c:type="GHookList*"/>
  37118. </parameter>
  37119. <parameter name="hook" transfer-ownership="none">
  37120. <doc xml:space="preserve">the #GHook to unref</doc>
  37121. <type name="Hook" c:type="GHook*"/>
  37122. </parameter>
  37123. </parameters>
  37124. </function>
  37125. <function name="hostname_is_ascii_encoded"
  37126. c:identifier="g_hostname_is_ascii_encoded"
  37127. version="2.22">
  37128. <doc xml:space="preserve">Tests if @hostname contains segments with an ASCII-compatible
  37129. encoding of an Internationalized Domain Name. If this returns
  37130. %TRUE, you should decode the hostname with g_hostname_to_unicode()
  37131. before displaying it to the user.
  37132. Note that a hostname might contain a mix of encoded and unencoded
  37133. segments, and so it is possible for g_hostname_is_non_ascii() and
  37134. g_hostname_is_ascii_encoded() to both return %TRUE for a name.</doc>
  37135. <return-value transfer-ownership="none">
  37136. <doc xml:space="preserve">%TRUE if @hostname contains any ASCII-encoded
  37137. segments.</doc>
  37138. <type name="gboolean" c:type="gboolean"/>
  37139. </return-value>
  37140. <parameters>
  37141. <parameter name="hostname" transfer-ownership="none">
  37142. <doc xml:space="preserve">a hostname</doc>
  37143. <type name="utf8" c:type="const gchar*"/>
  37144. </parameter>
  37145. </parameters>
  37146. </function>
  37147. <function name="hostname_is_ip_address"
  37148. c:identifier="g_hostname_is_ip_address"
  37149. version="2.22">
  37150. <doc xml:space="preserve">Tests if @hostname is the string form of an IPv4 or IPv6 address.
  37151. (Eg, "192.168.0.1".)</doc>
  37152. <return-value transfer-ownership="none">
  37153. <doc xml:space="preserve">%TRUE if @hostname is an IP address</doc>
  37154. <type name="gboolean" c:type="gboolean"/>
  37155. </return-value>
  37156. <parameters>
  37157. <parameter name="hostname" transfer-ownership="none">
  37158. <doc xml:space="preserve">a hostname (or IP address in string form)</doc>
  37159. <type name="utf8" c:type="const gchar*"/>
  37160. </parameter>
  37161. </parameters>
  37162. </function>
  37163. <function name="hostname_is_non_ascii"
  37164. c:identifier="g_hostname_is_non_ascii"
  37165. version="2.22">
  37166. <doc xml:space="preserve">Tests if @hostname contains Unicode characters. If this returns
  37167. %TRUE, you need to encode the hostname with g_hostname_to_ascii()
  37168. before using it in non-IDN-aware contexts.
  37169. Note that a hostname might contain a mix of encoded and unencoded
  37170. segments, and so it is possible for g_hostname_is_non_ascii() and
  37171. g_hostname_is_ascii_encoded() to both return %TRUE for a name.</doc>
  37172. <return-value transfer-ownership="none">
  37173. <doc xml:space="preserve">%TRUE if @hostname contains any non-ASCII characters</doc>
  37174. <type name="gboolean" c:type="gboolean"/>
  37175. </return-value>
  37176. <parameters>
  37177. <parameter name="hostname" transfer-ownership="none">
  37178. <doc xml:space="preserve">a hostname</doc>
  37179. <type name="utf8" c:type="const gchar*"/>
  37180. </parameter>
  37181. </parameters>
  37182. </function>
  37183. <function name="hostname_to_ascii"
  37184. c:identifier="g_hostname_to_ascii"
  37185. version="2.22">
  37186. <doc xml:space="preserve">Converts @hostname to its canonical ASCII form; an ASCII-only
  37187. string containing no uppercase letters and not ending with a
  37188. trailing dot.</doc>
  37189. <return-value transfer-ownership="full">
  37190. <doc xml:space="preserve">an ASCII hostname, which must be freed, or %NULL if
  37191. @hostname is in some way invalid.</doc>
  37192. <type name="utf8" c:type="gchar*"/>
  37193. </return-value>
  37194. <parameters>
  37195. <parameter name="hostname" transfer-ownership="none">
  37196. <doc xml:space="preserve">a valid UTF-8 or ASCII hostname</doc>
  37197. <type name="utf8" c:type="const gchar*"/>
  37198. </parameter>
  37199. </parameters>
  37200. </function>
  37201. <function name="hostname_to_unicode"
  37202. c:identifier="g_hostname_to_unicode"
  37203. version="2.22">
  37204. <doc xml:space="preserve">Converts @hostname to its canonical presentation form; a UTF-8
  37205. string in Unicode normalization form C, containing no uppercase
  37206. letters, no forbidden characters, and no ASCII-encoded segments,
  37207. and not ending with a trailing dot.
  37208. Of course if @hostname is not an internationalized hostname, then
  37209. the canonical presentation form will be entirely ASCII.</doc>
  37210. <return-value transfer-ownership="full">
  37211. <doc xml:space="preserve">a UTF-8 hostname, which must be freed, or %NULL if
  37212. @hostname is in some way invalid.</doc>
  37213. <type name="utf8" c:type="gchar*"/>
  37214. </return-value>
  37215. <parameters>
  37216. <parameter name="hostname" transfer-ownership="none">
  37217. <doc xml:space="preserve">a valid UTF-8 or ASCII hostname</doc>
  37218. <type name="utf8" c:type="const gchar*"/>
  37219. </parameter>
  37220. </parameters>
  37221. </function>
  37222. <function name="iconv" c:identifier="g_iconv">
  37223. <doc xml:space="preserve">Same as the standard UNIX routine iconv(), but
  37224. may be implemented via libiconv on UNIX flavors that lack
  37225. a native implementation.
  37226. GLib provides g_convert() and g_locale_to_utf8() which are likely
  37227. more convenient than the raw iconv wrappers.</doc>
  37228. <return-value transfer-ownership="none">
  37229. <doc xml:space="preserve">count of non-reversible conversions, or -1 on error</doc>
  37230. <type name="gsize" c:type="gsize"/>
  37231. </return-value>
  37232. <parameters>
  37233. <parameter name="converter" transfer-ownership="none">
  37234. <doc xml:space="preserve">conversion descriptor from g_iconv_open()</doc>
  37235. <type name="IConv" c:type="GIConv"/>
  37236. </parameter>
  37237. <parameter name="inbuf" transfer-ownership="none">
  37238. <doc xml:space="preserve">bytes to convert</doc>
  37239. <type name="utf8" c:type="gchar**"/>
  37240. </parameter>
  37241. <parameter name="inbytes_left" transfer-ownership="none">
  37242. <doc xml:space="preserve">inout parameter, bytes remaining to convert in @inbuf</doc>
  37243. <type name="gsize" c:type="gsize*"/>
  37244. </parameter>
  37245. <parameter name="outbuf" transfer-ownership="none">
  37246. <doc xml:space="preserve">converted output bytes</doc>
  37247. <type name="utf8" c:type="gchar**"/>
  37248. </parameter>
  37249. <parameter name="outbytes_left" transfer-ownership="none">
  37250. <doc xml:space="preserve">inout parameter, bytes available to fill in @outbuf</doc>
  37251. <type name="gsize" c:type="gsize*"/>
  37252. </parameter>
  37253. </parameters>
  37254. </function>
  37255. <function name="idle_add"
  37256. c:identifier="g_idle_add"
  37257. shadowed-by="idle_add_full"
  37258. introspectable="0">
  37259. <doc xml:space="preserve">Adds a function to be called whenever there are no higher priority
  37260. events pending to the default main loop. The function is given the
  37261. default idle priority, #G_PRIORITY_DEFAULT_IDLE. If the function
  37262. returns %FALSE it is automatically removed from the list of event
  37263. sources and will not be called again.
  37264. See [memory management of sources][mainloop-memory-management] for details
  37265. on how to handle the return value and memory management of @data.
  37266. This internally creates a main loop source using g_idle_source_new()
  37267. and attaches it to the global #GMainContext using g_source_attach(), so
  37268. the callback will be invoked in whichever thread is running that main
  37269. context. You can do these steps manually if you need greater control or to
  37270. use a custom main context.</doc>
  37271. <return-value transfer-ownership="none">
  37272. <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
  37273. <type name="guint" c:type="guint"/>
  37274. </return-value>
  37275. <parameters>
  37276. <parameter name="function" transfer-ownership="none" closure="1">
  37277. <doc xml:space="preserve">function to call</doc>
  37278. <type name="SourceFunc" c:type="GSourceFunc"/>
  37279. </parameter>
  37280. <parameter name="data"
  37281. transfer-ownership="none"
  37282. nullable="1"
  37283. allow-none="1">
  37284. <doc xml:space="preserve">data to pass to @function.</doc>
  37285. <type name="gpointer" c:type="gpointer"/>
  37286. </parameter>
  37287. </parameters>
  37288. </function>
  37289. <function name="idle_add_full"
  37290. c:identifier="g_idle_add_full"
  37291. shadows="idle_add">
  37292. <doc xml:space="preserve">Adds a function to be called whenever there are no higher priority
  37293. events pending. If the function returns %FALSE it is automatically
  37294. removed from the list of event sources and will not be called again.
  37295. See [memory management of sources][mainloop-memory-management] for details
  37296. on how to handle the return value and memory management of @data.
  37297. This internally creates a main loop source using g_idle_source_new()
  37298. and attaches it to the global #GMainContext using g_source_attach(), so
  37299. the callback will be invoked in whichever thread is running that main
  37300. context. You can do these steps manually if you need greater control or to
  37301. use a custom main context.</doc>
  37302. <return-value transfer-ownership="none">
  37303. <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
  37304. <type name="guint" c:type="guint"/>
  37305. </return-value>
  37306. <parameters>
  37307. <parameter name="priority" transfer-ownership="none">
  37308. <doc xml:space="preserve">the priority of the idle source. Typically this will be in the
  37309. range between #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE.</doc>
  37310. <type name="gint" c:type="gint"/>
  37311. </parameter>
  37312. <parameter name="function"
  37313. transfer-ownership="none"
  37314. scope="notified"
  37315. closure="2"
  37316. destroy="3">
  37317. <doc xml:space="preserve">function to call</doc>
  37318. <type name="SourceFunc" c:type="GSourceFunc"/>
  37319. </parameter>
  37320. <parameter name="data"
  37321. transfer-ownership="none"
  37322. nullable="1"
  37323. allow-none="1">
  37324. <doc xml:space="preserve">data to pass to @function</doc>
  37325. <type name="gpointer" c:type="gpointer"/>
  37326. </parameter>
  37327. <parameter name="notify"
  37328. transfer-ownership="none"
  37329. nullable="1"
  37330. allow-none="1"
  37331. scope="async">
  37332. <doc xml:space="preserve">function to call when the idle is removed, or %NULL</doc>
  37333. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  37334. </parameter>
  37335. </parameters>
  37336. </function>
  37337. <function name="idle_remove_by_data" c:identifier="g_idle_remove_by_data">
  37338. <doc xml:space="preserve">Removes the idle function with the given data.</doc>
  37339. <return-value transfer-ownership="none">
  37340. <doc xml:space="preserve">%TRUE if an idle source was found and removed.</doc>
  37341. <type name="gboolean" c:type="gboolean"/>
  37342. </return-value>
  37343. <parameters>
  37344. <parameter name="data"
  37345. transfer-ownership="none"
  37346. nullable="1"
  37347. allow-none="1">
  37348. <doc xml:space="preserve">the data for the idle source's callback.</doc>
  37349. <type name="gpointer" c:type="gpointer"/>
  37350. </parameter>
  37351. </parameters>
  37352. </function>
  37353. <function name="idle_source_new" c:identifier="g_idle_source_new">
  37354. <doc xml:space="preserve">Creates a new idle source.
  37355. The source will not initially be associated with any #GMainContext
  37356. and must be added to one with g_source_attach() before it will be
  37357. executed. Note that the default priority for idle sources is
  37358. %G_PRIORITY_DEFAULT_IDLE, as compared to other sources which
  37359. have a default priority of %G_PRIORITY_DEFAULT.</doc>
  37360. <return-value transfer-ownership="full">
  37361. <doc xml:space="preserve">the newly-created idle source</doc>
  37362. <type name="Source" c:type="GSource*"/>
  37363. </return-value>
  37364. </function>
  37365. <function name="int64_equal" c:identifier="g_int64_equal" version="2.22">
  37366. <doc xml:space="preserve">Compares the two #gint64 values being pointed to and returns
  37367. %TRUE if they are equal.
  37368. It can be passed to g_hash_table_new() as the @key_equal_func
  37369. parameter, when using non-%NULL pointers to 64-bit integers as keys in a
  37370. #GHashTable.</doc>
  37371. <return-value transfer-ownership="none">
  37372. <doc xml:space="preserve">%TRUE if the two keys match.</doc>
  37373. <type name="gboolean" c:type="gboolean"/>
  37374. </return-value>
  37375. <parameters>
  37376. <parameter name="v1" transfer-ownership="none">
  37377. <doc xml:space="preserve">a pointer to a #gint64 key</doc>
  37378. <type name="gpointer" c:type="gconstpointer"/>
  37379. </parameter>
  37380. <parameter name="v2" transfer-ownership="none">
  37381. <doc xml:space="preserve">a pointer to a #gint64 key to compare with @v1</doc>
  37382. <type name="gpointer" c:type="gconstpointer"/>
  37383. </parameter>
  37384. </parameters>
  37385. </function>
  37386. <function name="int64_hash" c:identifier="g_int64_hash" version="2.22">
  37387. <doc xml:space="preserve">Converts a pointer to a #gint64 to a hash value.
  37388. It can be passed to g_hash_table_new() as the @hash_func parameter,
  37389. when using non-%NULL pointers to 64-bit integer values as keys in a
  37390. #GHashTable.</doc>
  37391. <return-value transfer-ownership="none">
  37392. <doc xml:space="preserve">a hash value corresponding to the key.</doc>
  37393. <type name="guint" c:type="guint"/>
  37394. </return-value>
  37395. <parameters>
  37396. <parameter name="v" transfer-ownership="none">
  37397. <doc xml:space="preserve">a pointer to a #gint64 key</doc>
  37398. <type name="gpointer" c:type="gconstpointer"/>
  37399. </parameter>
  37400. </parameters>
  37401. </function>
  37402. <function name="int_equal" c:identifier="g_int_equal">
  37403. <doc xml:space="preserve">Compares the two #gint values being pointed to and returns
  37404. %TRUE if they are equal.
  37405. It can be passed to g_hash_table_new() as the @key_equal_func
  37406. parameter, when using non-%NULL pointers to integers as keys in a
  37407. #GHashTable.
  37408. Note that this function acts on pointers to #gint, not on #gint
  37409. directly: if your hash table's keys are of the form
  37410. `GINT_TO_POINTER (n)`, use g_direct_equal() instead.</doc>
  37411. <return-value transfer-ownership="none">
  37412. <doc xml:space="preserve">%TRUE if the two keys match.</doc>
  37413. <type name="gboolean" c:type="gboolean"/>
  37414. </return-value>
  37415. <parameters>
  37416. <parameter name="v1" transfer-ownership="none">
  37417. <doc xml:space="preserve">a pointer to a #gint key</doc>
  37418. <type name="gpointer" c:type="gconstpointer"/>
  37419. </parameter>
  37420. <parameter name="v2" transfer-ownership="none">
  37421. <doc xml:space="preserve">a pointer to a #gint key to compare with @v1</doc>
  37422. <type name="gpointer" c:type="gconstpointer"/>
  37423. </parameter>
  37424. </parameters>
  37425. </function>
  37426. <function name="int_hash" c:identifier="g_int_hash">
  37427. <doc xml:space="preserve">Converts a pointer to a #gint to a hash value.
  37428. It can be passed to g_hash_table_new() as the @hash_func parameter,
  37429. when using non-%NULL pointers to integer values as keys in a #GHashTable.
  37430. Note that this function acts on pointers to #gint, not on #gint
  37431. directly: if your hash table's keys are of the form
  37432. `GINT_TO_POINTER (n)`, use g_direct_hash() instead.</doc>
  37433. <return-value transfer-ownership="none">
  37434. <doc xml:space="preserve">a hash value corresponding to the key.</doc>
  37435. <type name="guint" c:type="guint"/>
  37436. </return-value>
  37437. <parameters>
  37438. <parameter name="v" transfer-ownership="none">
  37439. <doc xml:space="preserve">a pointer to a #gint key</doc>
  37440. <type name="gpointer" c:type="gconstpointer"/>
  37441. </parameter>
  37442. </parameters>
  37443. </function>
  37444. <function name="intern_static_string"
  37445. c:identifier="g_intern_static_string"
  37446. version="2.10">
  37447. <doc xml:space="preserve">Returns a canonical representation for @string. Interned strings
  37448. can be compared for equality by comparing the pointers, instead of
  37449. using strcmp(). g_intern_static_string() does not copy the string,
  37450. therefore @string must not be freed or modified.</doc>
  37451. <return-value transfer-ownership="none">
  37452. <doc xml:space="preserve">a canonical representation for the string</doc>
  37453. <type name="utf8" c:type="const gchar*"/>
  37454. </return-value>
  37455. <parameters>
  37456. <parameter name="string"
  37457. transfer-ownership="none"
  37458. nullable="1"
  37459. allow-none="1">
  37460. <doc xml:space="preserve">a static string</doc>
  37461. <type name="utf8" c:type="const gchar*"/>
  37462. </parameter>
  37463. </parameters>
  37464. </function>
  37465. <function name="intern_string"
  37466. c:identifier="g_intern_string"
  37467. version="2.10">
  37468. <doc xml:space="preserve">Returns a canonical representation for @string. Interned strings
  37469. can be compared for equality by comparing the pointers, instead of
  37470. using strcmp().</doc>
  37471. <return-value transfer-ownership="none">
  37472. <doc xml:space="preserve">a canonical representation for the string</doc>
  37473. <type name="utf8" c:type="const gchar*"/>
  37474. </return-value>
  37475. <parameters>
  37476. <parameter name="string"
  37477. transfer-ownership="none"
  37478. nullable="1"
  37479. allow-none="1">
  37480. <doc xml:space="preserve">a string</doc>
  37481. <type name="utf8" c:type="const gchar*"/>
  37482. </parameter>
  37483. </parameters>
  37484. </function>
  37485. <function name="io_add_watch"
  37486. c:identifier="g_io_add_watch"
  37487. shadowed-by="io_add_watch_full"
  37488. introspectable="0">
  37489. <doc xml:space="preserve">Adds the #GIOChannel into the default main loop context
  37490. with the default priority.</doc>
  37491. <return-value transfer-ownership="none">
  37492. <doc xml:space="preserve">the event source id</doc>
  37493. <type name="guint" c:type="guint"/>
  37494. </return-value>
  37495. <parameters>
  37496. <parameter name="channel" transfer-ownership="none">
  37497. <doc xml:space="preserve">a #GIOChannel</doc>
  37498. <type name="IOChannel" c:type="GIOChannel*"/>
  37499. </parameter>
  37500. <parameter name="condition" transfer-ownership="none">
  37501. <doc xml:space="preserve">the condition to watch for</doc>
  37502. <type name="IOCondition" c:type="GIOCondition"/>
  37503. </parameter>
  37504. <parameter name="func" transfer-ownership="none" closure="3">
  37505. <doc xml:space="preserve">the function to call when the condition is satisfied</doc>
  37506. <type name="IOFunc" c:type="GIOFunc"/>
  37507. </parameter>
  37508. <parameter name="user_data"
  37509. transfer-ownership="none"
  37510. nullable="1"
  37511. allow-none="1">
  37512. <doc xml:space="preserve">user data to pass to @func</doc>
  37513. <type name="gpointer" c:type="gpointer"/>
  37514. </parameter>
  37515. </parameters>
  37516. </function>
  37517. <function name="io_add_watch_full"
  37518. c:identifier="g_io_add_watch_full"
  37519. shadows="io_add_watch">
  37520. <doc xml:space="preserve">Adds the #GIOChannel into the default main loop context
  37521. with the given priority.
  37522. This internally creates a main loop source using g_io_create_watch()
  37523. and attaches it to the main loop context with g_source_attach().
  37524. You can do these steps manually if you need greater control.</doc>
  37525. <return-value transfer-ownership="none">
  37526. <doc xml:space="preserve">the event source id</doc>
  37527. <type name="guint" c:type="guint"/>
  37528. </return-value>
  37529. <parameters>
  37530. <parameter name="channel" transfer-ownership="none">
  37531. <doc xml:space="preserve">a #GIOChannel</doc>
  37532. <type name="IOChannel" c:type="GIOChannel*"/>
  37533. </parameter>
  37534. <parameter name="priority" transfer-ownership="none">
  37535. <doc xml:space="preserve">the priority of the #GIOChannel source</doc>
  37536. <type name="gint" c:type="gint"/>
  37537. </parameter>
  37538. <parameter name="condition" transfer-ownership="none">
  37539. <doc xml:space="preserve">the condition to watch for</doc>
  37540. <type name="IOCondition" c:type="GIOCondition"/>
  37541. </parameter>
  37542. <parameter name="func"
  37543. transfer-ownership="none"
  37544. scope="notified"
  37545. closure="4"
  37546. destroy="5">
  37547. <doc xml:space="preserve">the function to call when the condition is satisfied</doc>
  37548. <type name="IOFunc" c:type="GIOFunc"/>
  37549. </parameter>
  37550. <parameter name="user_data"
  37551. transfer-ownership="none"
  37552. nullable="1"
  37553. allow-none="1">
  37554. <doc xml:space="preserve">user data to pass to @func</doc>
  37555. <type name="gpointer" c:type="gpointer"/>
  37556. </parameter>
  37557. <parameter name="notify" transfer-ownership="none" scope="async">
  37558. <doc xml:space="preserve">the function to call when the source is removed</doc>
  37559. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  37560. </parameter>
  37561. </parameters>
  37562. </function>
  37563. <function name="io_channel_error_from_errno"
  37564. c:identifier="g_io_channel_error_from_errno"
  37565. moved-to="IOChannel.error_from_errno">
  37566. <doc xml:space="preserve">Converts an `errno` error number to a #GIOChannelError.</doc>
  37567. <return-value transfer-ownership="none">
  37568. <doc xml:space="preserve">a #GIOChannelError error number, e.g.
  37569. %G_IO_CHANNEL_ERROR_INVAL.</doc>
  37570. <type name="IOChannelError" c:type="GIOChannelError"/>
  37571. </return-value>
  37572. <parameters>
  37573. <parameter name="en" transfer-ownership="none">
  37574. <doc xml:space="preserve">an `errno` error number, e.g. `EINVAL`</doc>
  37575. <type name="gint" c:type="gint"/>
  37576. </parameter>
  37577. </parameters>
  37578. </function>
  37579. <function name="io_channel_error_quark"
  37580. c:identifier="g_io_channel_error_quark"
  37581. moved-to="IOChannel.error_quark">
  37582. <return-value transfer-ownership="none">
  37583. <type name="Quark" c:type="GQuark"/>
  37584. </return-value>
  37585. </function>
  37586. <function name="io_create_watch" c:identifier="g_io_create_watch">
  37587. <doc xml:space="preserve">Creates a #GSource that's dispatched when @condition is met for the
  37588. given @channel. For example, if condition is #G_IO_IN, the source will
  37589. be dispatched when there's data available for reading.
  37590. g_io_add_watch() is a simpler interface to this same functionality, for
  37591. the case where you want to add the source to the default main loop context
  37592. at the default priority.
  37593. On Windows, polling a #GSource created to watch a channel for a socket
  37594. puts the socket in non-blocking mode. This is a side-effect of the
  37595. implementation and unavoidable.</doc>
  37596. <return-value transfer-ownership="full">
  37597. <doc xml:space="preserve">a new #GSource</doc>
  37598. <type name="Source" c:type="GSource*"/>
  37599. </return-value>
  37600. <parameters>
  37601. <parameter name="channel" transfer-ownership="none">
  37602. <doc xml:space="preserve">a #GIOChannel to watch</doc>
  37603. <type name="IOChannel" c:type="GIOChannel*"/>
  37604. </parameter>
  37605. <parameter name="condition" transfer-ownership="none">
  37606. <doc xml:space="preserve">conditions to watch for</doc>
  37607. <type name="IOCondition" c:type="GIOCondition"/>
  37608. </parameter>
  37609. </parameters>
  37610. </function>
  37611. <function name="key_file_error_quark"
  37612. c:identifier="g_key_file_error_quark"
  37613. moved-to="KeyFile.error_quark">
  37614. <return-value transfer-ownership="none">
  37615. <type name="Quark" c:type="GQuark"/>
  37616. </return-value>
  37617. </function>
  37618. <function name="listenv" c:identifier="g_listenv" version="2.8">
  37619. <doc xml:space="preserve">Gets the names of all variables set in the environment.
  37620. Programs that want to be portable to Windows should typically use
  37621. this function and g_getenv() instead of using the environ array
  37622. from the C library directly. On Windows, the strings in the environ
  37623. array are in system codepage encoding, while in most of the typical
  37624. use cases for environment variables in GLib-using programs you want
  37625. the UTF-8 encoding that this function and g_getenv() provide.</doc>
  37626. <return-value transfer-ownership="full">
  37627. <doc xml:space="preserve">a %NULL-terminated
  37628. list of strings which must be freed with g_strfreev().</doc>
  37629. <array c:type="gchar**">
  37630. <type name="utf8"/>
  37631. </array>
  37632. </return-value>
  37633. </function>
  37634. <function name="locale_from_utf8"
  37635. c:identifier="g_locale_from_utf8"
  37636. throws="1">
  37637. <doc xml:space="preserve">Converts a string from UTF-8 to the encoding used for strings by
  37638. the C runtime (usually the same as that used by the operating
  37639. system) in the [current locale][setlocale]. On Windows this means
  37640. the system codepage.</doc>
  37641. <return-value transfer-ownership="full">
  37642. <doc xml:space="preserve">A newly-allocated buffer containing the converted string,
  37643. or %NULL on an error, and error will be set.</doc>
  37644. <type name="utf8" c:type="gchar*"/>
  37645. </return-value>
  37646. <parameters>
  37647. <parameter name="utf8string" transfer-ownership="none">
  37648. <doc xml:space="preserve">a UTF-8 encoded string</doc>
  37649. <type name="utf8" c:type="const gchar*"/>
  37650. </parameter>
  37651. <parameter name="len" transfer-ownership="none">
  37652. <doc xml:space="preserve">the length of the string, or -1 if the string is
  37653. nul-terminated (Note that some encodings may allow nul
  37654. bytes to occur inside strings. In that case, using -1
  37655. for the @len parameter is unsafe)</doc>
  37656. <type name="gssize" c:type="gssize"/>
  37657. </parameter>
  37658. <parameter name="bytes_read"
  37659. direction="out"
  37660. caller-allocates="0"
  37661. transfer-ownership="full"
  37662. optional="1"
  37663. allow-none="1">
  37664. <doc xml:space="preserve">location to store the number of bytes in the
  37665. input string that were successfully converted, or %NULL.
  37666. Even if the conversion was successful, this may be
  37667. less than @len if there were partial characters
  37668. at the end of the input. If the error
  37669. #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
  37670. stored will the byte offset after the last valid
  37671. input sequence.</doc>
  37672. <type name="gsize" c:type="gsize*"/>
  37673. </parameter>
  37674. <parameter name="bytes_written"
  37675. direction="out"
  37676. caller-allocates="0"
  37677. transfer-ownership="full"
  37678. optional="1"
  37679. allow-none="1">
  37680. <doc xml:space="preserve">the number of bytes stored in the output
  37681. buffer (not including the terminating nul).</doc>
  37682. <type name="gsize" c:type="gsize*"/>
  37683. </parameter>
  37684. </parameters>
  37685. </function>
  37686. <function name="locale_to_utf8" c:identifier="g_locale_to_utf8" throws="1">
  37687. <doc xml:space="preserve">Converts a string which is in the encoding used for strings by
  37688. the C runtime (usually the same as that used by the operating
  37689. system) in the [current locale][setlocale] into a UTF-8 string.</doc>
  37690. <return-value transfer-ownership="full">
  37691. <doc xml:space="preserve">A newly-allocated buffer containing the converted string,
  37692. or %NULL on an error, and error will be set.</doc>
  37693. <type name="utf8" c:type="gchar*"/>
  37694. </return-value>
  37695. <parameters>
  37696. <parameter name="opsysstring" transfer-ownership="none">
  37697. <doc xml:space="preserve">a string in the encoding of the current locale. On Windows
  37698. this means the system codepage.</doc>
  37699. <type name="utf8" c:type="const gchar*"/>
  37700. </parameter>
  37701. <parameter name="len" transfer-ownership="none">
  37702. <doc xml:space="preserve">the length of the string, or -1 if the string is
  37703. nul-terminated (Note that some encodings may allow nul
  37704. bytes to occur inside strings. In that case, using -1
  37705. for the @len parameter is unsafe)</doc>
  37706. <type name="gssize" c:type="gssize"/>
  37707. </parameter>
  37708. <parameter name="bytes_read"
  37709. direction="out"
  37710. caller-allocates="0"
  37711. transfer-ownership="full"
  37712. optional="1"
  37713. allow-none="1">
  37714. <doc xml:space="preserve">location to store the number of bytes in the
  37715. input string that were successfully converted, or %NULL.
  37716. Even if the conversion was successful, this may be
  37717. less than @len if there were partial characters
  37718. at the end of the input. If the error
  37719. #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
  37720. stored will the byte offset after the last valid
  37721. input sequence.</doc>
  37722. <type name="gsize" c:type="gsize*"/>
  37723. </parameter>
  37724. <parameter name="bytes_written"
  37725. direction="out"
  37726. caller-allocates="0"
  37727. transfer-ownership="full"
  37728. optional="1"
  37729. allow-none="1">
  37730. <doc xml:space="preserve">the number of bytes stored in the output
  37731. buffer (not including the terminating nul).</doc>
  37732. <type name="gsize" c:type="gsize*"/>
  37733. </parameter>
  37734. </parameters>
  37735. </function>
  37736. <function name="log" c:identifier="g_log" introspectable="0">
  37737. <doc xml:space="preserve">Logs an error or debugging message.
  37738. If the log level has been set as fatal, the abort()
  37739. function is called to terminate the program.
  37740. If g_log_default_handler() is used as the log handler function, a new-line
  37741. character will automatically be appended to @..., and need not be entered
  37742. manually.</doc>
  37743. <return-value transfer-ownership="none">
  37744. <type name="none" c:type="void"/>
  37745. </return-value>
  37746. <parameters>
  37747. <parameter name="log_domain"
  37748. transfer-ownership="none"
  37749. nullable="1"
  37750. allow-none="1">
  37751. <doc xml:space="preserve">the log domain, usually #G_LOG_DOMAIN, or %NULL
  37752. for the default</doc>
  37753. <type name="utf8" c:type="const gchar*"/>
  37754. </parameter>
  37755. <parameter name="log_level" transfer-ownership="none">
  37756. <doc xml:space="preserve">the log level, either from #GLogLevelFlags
  37757. or a user-defined level</doc>
  37758. <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
  37759. </parameter>
  37760. <parameter name="format" transfer-ownership="none">
  37761. <doc xml:space="preserve">the message format. See the printf() documentation</doc>
  37762. <type name="utf8" c:type="const gchar*"/>
  37763. </parameter>
  37764. <parameter name="..." transfer-ownership="none">
  37765. <doc xml:space="preserve">the parameters to insert into the format string</doc>
  37766. <varargs/>
  37767. </parameter>
  37768. </parameters>
  37769. </function>
  37770. <function name="log_default_handler" c:identifier="g_log_default_handler">
  37771. <doc xml:space="preserve">The default log handler set up by GLib; g_log_set_default_handler()
  37772. allows to install an alternate default log handler.
  37773. This is used if no log handler has been set for the particular log
  37774. domain and log level combination. It outputs the message to stderr
  37775. or stdout and if the log level is fatal it calls abort(). It automatically
  37776. prints a new-line character after the message, so one does not need to be
  37777. manually included in @message.
  37778. The behavior of this log handler can be influenced by a number of
  37779. environment variables:
  37780. - `G_MESSAGES_PREFIXED`: A :-separated list of log levels for which
  37781. messages should be prefixed by the program name and PID of the
  37782. aplication.
  37783. - `G_MESSAGES_DEBUG`: A space-separated list of log domains for
  37784. which debug and informational messages are printed. By default
  37785. these messages are not printed.
  37786. stderr is used for levels %G_LOG_LEVEL_ERROR, %G_LOG_LEVEL_CRITICAL,
  37787. %G_LOG_LEVEL_WARNING and %G_LOG_LEVEL_MESSAGE. stdout is used for
  37788. the rest.</doc>
  37789. <return-value transfer-ownership="none">
  37790. <type name="none" c:type="void"/>
  37791. </return-value>
  37792. <parameters>
  37793. <parameter name="log_domain"
  37794. transfer-ownership="none"
  37795. nullable="1"
  37796. allow-none="1">
  37797. <doc xml:space="preserve">the log domain of the message, or %NULL for the
  37798. default "" application domain</doc>
  37799. <type name="utf8" c:type="const gchar*"/>
  37800. </parameter>
  37801. <parameter name="log_level" transfer-ownership="none">
  37802. <doc xml:space="preserve">the level of the message</doc>
  37803. <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
  37804. </parameter>
  37805. <parameter name="message"
  37806. transfer-ownership="none"
  37807. nullable="1"
  37808. allow-none="1">
  37809. <doc xml:space="preserve">the message</doc>
  37810. <type name="utf8" c:type="const gchar*"/>
  37811. </parameter>
  37812. <parameter name="unused_data"
  37813. transfer-ownership="none"
  37814. nullable="1"
  37815. allow-none="1">
  37816. <doc xml:space="preserve">data passed from g_log() which is unused</doc>
  37817. <type name="gpointer" c:type="gpointer"/>
  37818. </parameter>
  37819. </parameters>
  37820. </function>
  37821. <function name="log_remove_handler" c:identifier="g_log_remove_handler">
  37822. <doc xml:space="preserve">Removes the log handler.</doc>
  37823. <return-value transfer-ownership="none">
  37824. <type name="none" c:type="void"/>
  37825. </return-value>
  37826. <parameters>
  37827. <parameter name="log_domain" transfer-ownership="none">
  37828. <doc xml:space="preserve">the log domain</doc>
  37829. <type name="utf8" c:type="const gchar*"/>
  37830. </parameter>
  37831. <parameter name="handler_id" transfer-ownership="none">
  37832. <doc xml:space="preserve">the id of the handler, which was returned
  37833. in g_log_set_handler()</doc>
  37834. <type name="guint" c:type="guint"/>
  37835. </parameter>
  37836. </parameters>
  37837. </function>
  37838. <function name="log_set_always_fatal"
  37839. c:identifier="g_log_set_always_fatal">
  37840. <doc xml:space="preserve">Sets the message levels which are always fatal, in any log domain.
  37841. When a message with any of these levels is logged the program terminates.
  37842. You can only set the levels defined by GLib to be fatal.
  37843. %G_LOG_LEVEL_ERROR is always fatal.
  37844. You can also make some message levels fatal at runtime by setting
  37845. the `G_DEBUG` environment variable (see
  37846. [Running GLib Applications](glib-running.html)).</doc>
  37847. <return-value transfer-ownership="none">
  37848. <doc xml:space="preserve">the old fatal mask</doc>
  37849. <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
  37850. </return-value>
  37851. <parameters>
  37852. <parameter name="fatal_mask" transfer-ownership="none">
  37853. <doc xml:space="preserve">the mask containing bits set for each level
  37854. of error which is to be fatal</doc>
  37855. <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
  37856. </parameter>
  37857. </parameters>
  37858. </function>
  37859. <function name="log_set_default_handler"
  37860. c:identifier="g_log_set_default_handler"
  37861. version="2.6"
  37862. introspectable="0">
  37863. <doc xml:space="preserve">Installs a default log handler which is used if no
  37864. log handler has been set for the particular log domain
  37865. and log level combination. By default, GLib uses
  37866. g_log_default_handler() as default log handler.</doc>
  37867. <return-value>
  37868. <doc xml:space="preserve">the previous default log handler</doc>
  37869. <type name="LogFunc" c:type="GLogFunc"/>
  37870. </return-value>
  37871. <parameters>
  37872. <parameter name="log_func" transfer-ownership="none" closure="1">
  37873. <doc xml:space="preserve">the log handler function</doc>
  37874. <type name="LogFunc" c:type="GLogFunc"/>
  37875. </parameter>
  37876. <parameter name="user_data"
  37877. transfer-ownership="none"
  37878. nullable="1"
  37879. allow-none="1">
  37880. <doc xml:space="preserve">data passed to the log handler</doc>
  37881. <type name="gpointer" c:type="gpointer"/>
  37882. </parameter>
  37883. </parameters>
  37884. </function>
  37885. <function name="log_set_fatal_mask" c:identifier="g_log_set_fatal_mask">
  37886. <doc xml:space="preserve">Sets the log levels which are fatal in the given domain.
  37887. %G_LOG_LEVEL_ERROR is always fatal.</doc>
  37888. <return-value transfer-ownership="none">
  37889. <doc xml:space="preserve">the old fatal mask for the log domain</doc>
  37890. <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
  37891. </return-value>
  37892. <parameters>
  37893. <parameter name="log_domain" transfer-ownership="none">
  37894. <doc xml:space="preserve">the log domain</doc>
  37895. <type name="utf8" c:type="const gchar*"/>
  37896. </parameter>
  37897. <parameter name="fatal_mask" transfer-ownership="none">
  37898. <doc xml:space="preserve">the new fatal mask</doc>
  37899. <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
  37900. </parameter>
  37901. </parameters>
  37902. </function>
  37903. <function name="log_set_handler"
  37904. c:identifier="g_log_set_handler"
  37905. shadowed-by="log_set_handler_full"
  37906. introspectable="0">
  37907. <doc xml:space="preserve">Sets the log handler for a domain and a set of log levels.
  37908. To handle fatal and recursive messages the @log_levels parameter
  37909. must be combined with the #G_LOG_FLAG_FATAL and #G_LOG_FLAG_RECURSION
  37910. bit flags.
  37911. Note that since the #G_LOG_LEVEL_ERROR log level is always fatal, if
  37912. you want to set a handler for this log level you must combine it with
  37913. #G_LOG_FLAG_FATAL.
  37914. Here is an example for adding a log handler for all warning messages
  37915. in the default domain:
  37916. |[&lt;!-- language="C" --&gt;
  37917. g_log_set_handler (NULL, G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL
  37918. | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
  37919. ]|
  37920. This example adds a log handler for all critical messages from GTK+:
  37921. |[&lt;!-- language="C" --&gt;
  37922. g_log_set_handler ("Gtk", G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL
  37923. | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
  37924. ]|
  37925. This example adds a log handler for all messages from GLib:
  37926. |[&lt;!-- language="C" --&gt;
  37927. g_log_set_handler ("GLib", G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL
  37928. | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
  37929. ]|</doc>
  37930. <return-value transfer-ownership="none">
  37931. <doc xml:space="preserve">the id of the new handler</doc>
  37932. <type name="guint" c:type="guint"/>
  37933. </return-value>
  37934. <parameters>
  37935. <parameter name="log_domain"
  37936. transfer-ownership="none"
  37937. nullable="1"
  37938. allow-none="1">
  37939. <doc xml:space="preserve">the log domain, or %NULL for the default ""
  37940. application domain</doc>
  37941. <type name="utf8" c:type="const gchar*"/>
  37942. </parameter>
  37943. <parameter name="log_levels" transfer-ownership="none">
  37944. <doc xml:space="preserve">the log levels to apply the log handler for.
  37945. To handle fatal and recursive messages as well, combine
  37946. the log levels with the #G_LOG_FLAG_FATAL and
  37947. #G_LOG_FLAG_RECURSION bit flags.</doc>
  37948. <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
  37949. </parameter>
  37950. <parameter name="log_func" transfer-ownership="none" closure="3">
  37951. <doc xml:space="preserve">the log handler function</doc>
  37952. <type name="LogFunc" c:type="GLogFunc"/>
  37953. </parameter>
  37954. <parameter name="user_data"
  37955. transfer-ownership="none"
  37956. nullable="1"
  37957. allow-none="1">
  37958. <doc xml:space="preserve">data passed to the log handler</doc>
  37959. <type name="gpointer" c:type="gpointer"/>
  37960. </parameter>
  37961. </parameters>
  37962. </function>
  37963. <function name="log_set_handler_full"
  37964. c:identifier="g_log_set_handler_full"
  37965. shadows="log_set_handler"
  37966. version="2.46">
  37967. <doc xml:space="preserve">Like g_log_sets_handler(), but takes a destroy notify for the @user_data.</doc>
  37968. <return-value transfer-ownership="none">
  37969. <doc xml:space="preserve">the id of the new handler</doc>
  37970. <type name="guint" c:type="guint"/>
  37971. </return-value>
  37972. <parameters>
  37973. <parameter name="log_domain"
  37974. transfer-ownership="none"
  37975. nullable="1"
  37976. allow-none="1">
  37977. <doc xml:space="preserve">the log domain, or %NULL for the default ""
  37978. application domain</doc>
  37979. <type name="utf8" c:type="const gchar*"/>
  37980. </parameter>
  37981. <parameter name="log_levels" transfer-ownership="none">
  37982. <doc xml:space="preserve">the log levels to apply the log handler for.
  37983. To handle fatal and recursive messages as well, combine
  37984. the log levels with the #G_LOG_FLAG_FATAL and
  37985. #G_LOG_FLAG_RECURSION bit flags.</doc>
  37986. <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
  37987. </parameter>
  37988. <parameter name="log_func"
  37989. transfer-ownership="none"
  37990. scope="notified"
  37991. closure="3"
  37992. destroy="4">
  37993. <doc xml:space="preserve">the log handler function</doc>
  37994. <type name="LogFunc" c:type="GLogFunc"/>
  37995. </parameter>
  37996. <parameter name="user_data"
  37997. transfer-ownership="none"
  37998. nullable="1"
  37999. allow-none="1">
  38000. <doc xml:space="preserve">data passed to the log handler</doc>
  38001. <type name="gpointer" c:type="gpointer"/>
  38002. </parameter>
  38003. <parameter name="destroy" transfer-ownership="none" scope="async">
  38004. <doc xml:space="preserve">destroy notify for @user_data, or %NULL</doc>
  38005. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  38006. </parameter>
  38007. </parameters>
  38008. </function>
  38009. <function name="logv" c:identifier="g_logv" introspectable="0">
  38010. <doc xml:space="preserve">Logs an error or debugging message.
  38011. If the log level has been set as fatal, the abort()
  38012. function is called to terminate the program.
  38013. If g_log_default_handler() is used as the log handler function, a new-line
  38014. character will automatically be appended to @..., and need not be entered
  38015. manually.</doc>
  38016. <return-value transfer-ownership="none">
  38017. <type name="none" c:type="void"/>
  38018. </return-value>
  38019. <parameters>
  38020. <parameter name="log_domain"
  38021. transfer-ownership="none"
  38022. nullable="1"
  38023. allow-none="1">
  38024. <doc xml:space="preserve">the log domain, or %NULL for the default ""
  38025. application domain</doc>
  38026. <type name="utf8" c:type="const gchar*"/>
  38027. </parameter>
  38028. <parameter name="log_level" transfer-ownership="none">
  38029. <doc xml:space="preserve">the log level</doc>
  38030. <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
  38031. </parameter>
  38032. <parameter name="format" transfer-ownership="none">
  38033. <doc xml:space="preserve">the message format. See the printf() documentation</doc>
  38034. <type name="utf8" c:type="const gchar*"/>
  38035. </parameter>
  38036. <parameter name="args" transfer-ownership="none">
  38037. <doc xml:space="preserve">the parameters to insert into the format string</doc>
  38038. <type name="va_list" c:type="va_list"/>
  38039. </parameter>
  38040. </parameters>
  38041. </function>
  38042. <function name="main_context_default"
  38043. c:identifier="g_main_context_default"
  38044. moved-to="MainContext.default">
  38045. <doc xml:space="preserve">Returns the global default main context. This is the main context
  38046. used for main loop functions when a main loop is not explicitly
  38047. specified, and corresponds to the "main" main loop. See also
  38048. g_main_context_get_thread_default().</doc>
  38049. <return-value transfer-ownership="none">
  38050. <doc xml:space="preserve">the global default main context.</doc>
  38051. <type name="MainContext" c:type="GMainContext*"/>
  38052. </return-value>
  38053. </function>
  38054. <function name="main_context_get_thread_default"
  38055. c:identifier="g_main_context_get_thread_default"
  38056. moved-to="MainContext.get_thread_default"
  38057. version="2.22">
  38058. <doc xml:space="preserve">Gets the thread-default #GMainContext for this thread. Asynchronous
  38059. operations that want to be able to be run in contexts other than
  38060. the default one should call this method or
  38061. g_main_context_ref_thread_default() to get a #GMainContext to add
  38062. their #GSources to. (Note that even in single-threaded
  38063. programs applications may sometimes want to temporarily push a
  38064. non-default context, so it is not safe to assume that this will
  38065. always return %NULL if you are running in the default thread.)
  38066. If you need to hold a reference on the context, use
  38067. g_main_context_ref_thread_default() instead.</doc>
  38068. <return-value transfer-ownership="none">
  38069. <doc xml:space="preserve">the thread-default #GMainContext, or
  38070. %NULL if the thread-default context is the global default context.</doc>
  38071. <type name="MainContext" c:type="GMainContext*"/>
  38072. </return-value>
  38073. </function>
  38074. <function name="main_context_ref_thread_default"
  38075. c:identifier="g_main_context_ref_thread_default"
  38076. moved-to="MainContext.ref_thread_default"
  38077. version="2.32">
  38078. <doc xml:space="preserve">Gets the thread-default #GMainContext for this thread, as with
  38079. g_main_context_get_thread_default(), but also adds a reference to
  38080. it with g_main_context_ref(). In addition, unlike
  38081. g_main_context_get_thread_default(), if the thread-default context
  38082. is the global default context, this will return that #GMainContext
  38083. (with a ref added to it) rather than returning %NULL.</doc>
  38084. <return-value transfer-ownership="full">
  38085. <doc xml:space="preserve">the thread-default #GMainContext. Unref
  38086. with g_main_context_unref() when you are done with it.</doc>
  38087. <type name="MainContext" c:type="GMainContext*"/>
  38088. </return-value>
  38089. </function>
  38090. <function name="main_current_source"
  38091. c:identifier="g_main_current_source"
  38092. version="2.12">
  38093. <doc xml:space="preserve">Returns the currently firing source for this thread.</doc>
  38094. <return-value transfer-ownership="none">
  38095. <doc xml:space="preserve">The currently firing source or %NULL.</doc>
  38096. <type name="Source" c:type="GSource*"/>
  38097. </return-value>
  38098. </function>
  38099. <function name="main_depth" c:identifier="g_main_depth">
  38100. <doc xml:space="preserve">Returns the depth of the stack of calls to
  38101. g_main_context_dispatch() on any #GMainContext in the current thread.
  38102. That is, when called from the toplevel, it gives 0. When
  38103. called from within a callback from g_main_context_iteration()
  38104. (or g_main_loop_run(), etc.) it returns 1. When called from within
  38105. a callback to a recursive call to g_main_context_iteration(),
  38106. it returns 2. And so forth.
  38107. This function is useful in a situation like the following:
  38108. Imagine an extremely simple "garbage collected" system.
  38109. |[&lt;!-- language="C" --&gt;
  38110. static GList *free_list;
  38111. gpointer
  38112. allocate_memory (gsize size)
  38113. {
  38114. gpointer result = g_malloc (size);
  38115. free_list = g_list_prepend (free_list, result);
  38116. return result;
  38117. }
  38118. void
  38119. free_allocated_memory (void)
  38120. {
  38121. GList *l;
  38122. for (l = free_list; l; l = l-&gt;next);
  38123. g_free (l-&gt;data);
  38124. g_list_free (free_list);
  38125. free_list = NULL;
  38126. }
  38127. [...]
  38128. while (TRUE);
  38129. {
  38130. g_main_context_iteration (NULL, TRUE);
  38131. free_allocated_memory();
  38132. }
  38133. ]|
  38134. This works from an application, however, if you want to do the same
  38135. thing from a library, it gets more difficult, since you no longer
  38136. control the main loop. You might think you can simply use an idle
  38137. function to make the call to free_allocated_memory(), but that
  38138. doesn't work, since the idle function could be called from a
  38139. recursive callback. This can be fixed by using g_main_depth()
  38140. |[&lt;!-- language="C" --&gt;
  38141. gpointer
  38142. allocate_memory (gsize size)
  38143. {
  38144. FreeListBlock *block = g_new (FreeListBlock, 1);
  38145. block-&gt;mem = g_malloc (size);
  38146. block-&gt;depth = g_main_depth ();
  38147. free_list = g_list_prepend (free_list, block);
  38148. return block-&gt;mem;
  38149. }
  38150. void
  38151. free_allocated_memory (void)
  38152. {
  38153. GList *l;
  38154. int depth = g_main_depth ();
  38155. for (l = free_list; l; );
  38156. {
  38157. GList *next = l-&gt;next;
  38158. FreeListBlock *block = l-&gt;data;
  38159. if (block-&gt;depth &gt; depth)
  38160. {
  38161. g_free (block-&gt;mem);
  38162. g_free (block);
  38163. free_list = g_list_delete_link (free_list, l);
  38164. }
  38165. l = next;
  38166. }
  38167. }
  38168. ]|
  38169. There is a temptation to use g_main_depth() to solve
  38170. problems with reentrancy. For instance, while waiting for data
  38171. to be received from the network in response to a menu item,
  38172. the menu item might be selected again. It might seem that
  38173. one could make the menu item's callback return immediately
  38174. and do nothing if g_main_depth() returns a value greater than 1.
  38175. However, this should be avoided since the user then sees selecting
  38176. the menu item do nothing. Furthermore, you'll find yourself adding
  38177. these checks all over your code, since there are doubtless many,
  38178. many things that the user could do. Instead, you can use the
  38179. following techniques:
  38180. 1. Use gtk_widget_set_sensitive() or modal dialogs to prevent
  38181. the user from interacting with elements while the main
  38182. loop is recursing.
  38183. 2. Avoid main loop recursion in situations where you can't handle
  38184. arbitrary callbacks. Instead, structure your code so that you
  38185. simply return to the main loop and then get called again when
  38186. there is more work to do.</doc>
  38187. <return-value transfer-ownership="none">
  38188. <doc xml:space="preserve">The main loop recursion level in the current thread</doc>
  38189. <type name="gint" c:type="gint"/>
  38190. </return-value>
  38191. </function>
  38192. <function name="malloc" c:identifier="g_malloc">
  38193. <doc xml:space="preserve">Allocates @n_bytes bytes of memory.
  38194. If @n_bytes is 0 it returns %NULL.</doc>
  38195. <return-value transfer-ownership="none" nullable="1">
  38196. <doc xml:space="preserve">a pointer to the allocated memory</doc>
  38197. <type name="gpointer" c:type="gpointer"/>
  38198. </return-value>
  38199. <parameters>
  38200. <parameter name="n_bytes" transfer-ownership="none">
  38201. <doc xml:space="preserve">the number of bytes to allocate</doc>
  38202. <type name="gsize" c:type="gsize"/>
  38203. </parameter>
  38204. </parameters>
  38205. </function>
  38206. <function name="malloc0" c:identifier="g_malloc0">
  38207. <doc xml:space="preserve">Allocates @n_bytes bytes of memory, initialized to 0's.
  38208. If @n_bytes is 0 it returns %NULL.</doc>
  38209. <return-value transfer-ownership="none" nullable="1">
  38210. <doc xml:space="preserve">a pointer to the allocated memory</doc>
  38211. <type name="gpointer" c:type="gpointer"/>
  38212. </return-value>
  38213. <parameters>
  38214. <parameter name="n_bytes" transfer-ownership="none">
  38215. <doc xml:space="preserve">the number of bytes to allocate</doc>
  38216. <type name="gsize" c:type="gsize"/>
  38217. </parameter>
  38218. </parameters>
  38219. </function>
  38220. <function name="malloc0_n" c:identifier="g_malloc0_n" version="2.24">
  38221. <doc xml:space="preserve">This function is similar to g_malloc0(), allocating (@n_blocks * @n_block_bytes) bytes,
  38222. but care is taken to detect possible overflow during multiplication.</doc>
  38223. <return-value transfer-ownership="none" nullable="1">
  38224. <doc xml:space="preserve">a pointer to the allocated memory</doc>
  38225. <type name="gpointer" c:type="gpointer"/>
  38226. </return-value>
  38227. <parameters>
  38228. <parameter name="n_blocks" transfer-ownership="none">
  38229. <doc xml:space="preserve">the number of blocks to allocate</doc>
  38230. <type name="gsize" c:type="gsize"/>
  38231. </parameter>
  38232. <parameter name="n_block_bytes" transfer-ownership="none">
  38233. <doc xml:space="preserve">the size of each block in bytes</doc>
  38234. <type name="gsize" c:type="gsize"/>
  38235. </parameter>
  38236. </parameters>
  38237. </function>
  38238. <function name="malloc_n" c:identifier="g_malloc_n" version="2.24">
  38239. <doc xml:space="preserve">This function is similar to g_malloc(), allocating (@n_blocks * @n_block_bytes) bytes,
  38240. but care is taken to detect possible overflow during multiplication.</doc>
  38241. <return-value transfer-ownership="none" nullable="1">
  38242. <doc xml:space="preserve">a pointer to the allocated memory</doc>
  38243. <type name="gpointer" c:type="gpointer"/>
  38244. </return-value>
  38245. <parameters>
  38246. <parameter name="n_blocks" transfer-ownership="none">
  38247. <doc xml:space="preserve">the number of blocks to allocate</doc>
  38248. <type name="gsize" c:type="gsize"/>
  38249. </parameter>
  38250. <parameter name="n_block_bytes" transfer-ownership="none">
  38251. <doc xml:space="preserve">the size of each block in bytes</doc>
  38252. <type name="gsize" c:type="gsize"/>
  38253. </parameter>
  38254. </parameters>
  38255. </function>
  38256. <function name="markup_collect_attributes"
  38257. c:identifier="g_markup_collect_attributes"
  38258. version="2.16"
  38259. introspectable="0">
  38260. <doc xml:space="preserve">Collects the attributes of the element from the data passed to the
  38261. #GMarkupParser start_element function, dealing with common error
  38262. conditions and supporting boolean values.
  38263. This utility function is not required to write a parser but can save
  38264. a lot of typing.
  38265. The @element_name, @attribute_names, @attribute_values and @error
  38266. parameters passed to the start_element callback should be passed
  38267. unmodified to this function.
  38268. Following these arguments is a list of "supported" attributes to collect.
  38269. It is an error to specify multiple attributes with the same name. If any
  38270. attribute not in the list appears in the @attribute_names array then an
  38271. unknown attribute error will result.
  38272. The #GMarkupCollectType field allows specifying the type of collection
  38273. to perform and if a given attribute must appear or is optional.
  38274. The attribute name is simply the name of the attribute to collect.
  38275. The pointer should be of the appropriate type (see the descriptions
  38276. under #GMarkupCollectType) and may be %NULL in case a particular
  38277. attribute is to be allowed but ignored.
  38278. This function deals with issuing errors for missing attributes
  38279. (of type %G_MARKUP_ERROR_MISSING_ATTRIBUTE), unknown attributes
  38280. (of type %G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE) and duplicate
  38281. attributes (of type %G_MARKUP_ERROR_INVALID_CONTENT) as well
  38282. as parse errors for boolean-valued attributes (again of type
  38283. %G_MARKUP_ERROR_INVALID_CONTENT). In all of these cases %FALSE
  38284. will be returned and @error will be set as appropriate.</doc>
  38285. <return-value transfer-ownership="none">
  38286. <doc xml:space="preserve">%TRUE if successful</doc>
  38287. <type name="gboolean" c:type="gboolean"/>
  38288. </return-value>
  38289. <parameters>
  38290. <parameter name="element_name" transfer-ownership="none">
  38291. <doc xml:space="preserve">the current tag name</doc>
  38292. <type name="utf8" c:type="const gchar*"/>
  38293. </parameter>
  38294. <parameter name="attribute_names" transfer-ownership="none">
  38295. <doc xml:space="preserve">the attribute names</doc>
  38296. <type name="utf8" c:type="const gchar**"/>
  38297. </parameter>
  38298. <parameter name="attribute_values" transfer-ownership="none">
  38299. <doc xml:space="preserve">the attribute values</doc>
  38300. <type name="utf8" c:type="const gchar**"/>
  38301. </parameter>
  38302. <parameter name="error" transfer-ownership="none">
  38303. <doc xml:space="preserve">a pointer to a #GError or %NULL</doc>
  38304. <type name="Error" c:type="GError**"/>
  38305. </parameter>
  38306. <parameter name="first_type" transfer-ownership="none">
  38307. <doc xml:space="preserve">the #GMarkupCollectType of the first attribute</doc>
  38308. <type name="MarkupCollectType" c:type="GMarkupCollectType"/>
  38309. </parameter>
  38310. <parameter name="first_attr" transfer-ownership="none">
  38311. <doc xml:space="preserve">the name of the first attribute</doc>
  38312. <type name="utf8" c:type="const gchar*"/>
  38313. </parameter>
  38314. <parameter name="..." transfer-ownership="none">
  38315. <doc xml:space="preserve">a pointer to the storage location of the first attribute
  38316. (or %NULL), followed by more types names and pointers, ending
  38317. with %G_MARKUP_COLLECT_INVALID</doc>
  38318. <varargs/>
  38319. </parameter>
  38320. </parameters>
  38321. </function>
  38322. <function name="markup_error_quark" c:identifier="g_markup_error_quark">
  38323. <return-value transfer-ownership="none">
  38324. <type name="Quark" c:type="GQuark"/>
  38325. </return-value>
  38326. </function>
  38327. <function name="markup_escape_text" c:identifier="g_markup_escape_text">
  38328. <doc xml:space="preserve">Escapes text so that the markup parser will parse it verbatim.
  38329. Less than, greater than, ampersand, etc. are replaced with the
  38330. corresponding entities. This function would typically be used
  38331. when writing out a file to be parsed with the markup parser.
  38332. Note that this function doesn't protect whitespace and line endings
  38333. from being processed according to the XML rules for normalization
  38334. of line endings and attribute values.
  38335. Note also that this function will produce character references in
  38336. the range of &amp;#x1; ... &amp;#x1f; for all control sequences
  38337. except for tabstop, newline and carriage return. The character
  38338. references in this range are not valid XML 1.0, but they are
  38339. valid XML 1.1 and will be accepted by the GMarkup parser.</doc>
  38340. <return-value transfer-ownership="full">
  38341. <doc xml:space="preserve">a newly allocated string with the escaped text</doc>
  38342. <type name="utf8" c:type="gchar*"/>
  38343. </return-value>
  38344. <parameters>
  38345. <parameter name="text" transfer-ownership="none">
  38346. <doc xml:space="preserve">some valid UTF-8 text</doc>
  38347. <type name="utf8" c:type="const gchar*"/>
  38348. </parameter>
  38349. <parameter name="length" transfer-ownership="none">
  38350. <doc xml:space="preserve">length of @text in bytes, or -1 if the text is nul-terminated</doc>
  38351. <type name="gssize" c:type="gssize"/>
  38352. </parameter>
  38353. </parameters>
  38354. </function>
  38355. <function name="markup_printf_escaped"
  38356. c:identifier="g_markup_printf_escaped"
  38357. version="2.4"
  38358. introspectable="0">
  38359. <doc xml:space="preserve">Formats arguments according to @format, escaping
  38360. all string and character arguments in the fashion
  38361. of g_markup_escape_text(). This is useful when you
  38362. want to insert literal strings into XML-style markup
  38363. output, without having to worry that the strings
  38364. might themselves contain markup.
  38365. |[&lt;!-- language="C" --&gt;
  38366. const char *store = "Fortnum &amp; Mason";
  38367. const char *item = "Tea";
  38368. char *output;
  38369. output = g_markup_printf_escaped ("&lt;purchase&gt;"
  38370. "&lt;store&gt;%s&lt;/store&gt;"
  38371. "&lt;item&gt;%s&lt;/item&gt;"
  38372. "&lt;/purchase&gt;",
  38373. store, item);
  38374. ]|</doc>
  38375. <return-value transfer-ownership="full">
  38376. <doc xml:space="preserve">newly allocated result from formatting
  38377. operation. Free with g_free().</doc>
  38378. <type name="utf8" c:type="gchar*"/>
  38379. </return-value>
  38380. <parameters>
  38381. <parameter name="format" transfer-ownership="none">
  38382. <doc xml:space="preserve">printf() style format string</doc>
  38383. <type name="utf8" c:type="const char*"/>
  38384. </parameter>
  38385. <parameter name="..." transfer-ownership="none">
  38386. <doc xml:space="preserve">the arguments to insert in the format string</doc>
  38387. <varargs/>
  38388. </parameter>
  38389. </parameters>
  38390. </function>
  38391. <function name="markup_vprintf_escaped"
  38392. c:identifier="g_markup_vprintf_escaped"
  38393. version="2.4"
  38394. introspectable="0">
  38395. <doc xml:space="preserve">Formats the data in @args according to @format, escaping
  38396. all string and character arguments in the fashion
  38397. of g_markup_escape_text(). See g_markup_printf_escaped().</doc>
  38398. <return-value transfer-ownership="full">
  38399. <doc xml:space="preserve">newly allocated result from formatting
  38400. operation. Free with g_free().</doc>
  38401. <type name="utf8" c:type="gchar*"/>
  38402. </return-value>
  38403. <parameters>
  38404. <parameter name="format" transfer-ownership="none">
  38405. <doc xml:space="preserve">printf() style format string</doc>
  38406. <type name="utf8" c:type="const char*"/>
  38407. </parameter>
  38408. <parameter name="args" transfer-ownership="none">
  38409. <doc xml:space="preserve">variable argument list, similar to vprintf()</doc>
  38410. <type name="va_list" c:type="va_list"/>
  38411. </parameter>
  38412. </parameters>
  38413. </function>
  38414. <function name="mem_is_system_malloc"
  38415. c:identifier="g_mem_is_system_malloc"
  38416. deprecated="1"
  38417. deprecated-version="2.46">
  38418. <doc xml:space="preserve">Checks whether the allocator used by g_malloc() is the system's
  38419. malloc implementation. If it returns %TRUE memory allocated with
  38420. malloc() can be used interchangeable with memory allocated using g_malloc().
  38421. This function is useful for avoiding an extra copy of allocated memory returned
  38422. by a non-GLib-based API.</doc>
  38423. <doc-deprecated xml:space="preserve">GLib always uses the system malloc, so this function always
  38424. returns %TRUE.</doc-deprecated>
  38425. <return-value transfer-ownership="none">
  38426. <doc xml:space="preserve">if %TRUE, malloc() and g_malloc() can be mixed.</doc>
  38427. <type name="gboolean" c:type="gboolean"/>
  38428. </return-value>
  38429. </function>
  38430. <function name="mem_profile"
  38431. c:identifier="g_mem_profile"
  38432. deprecated="1"
  38433. deprecated-version="2.46">
  38434. <doc xml:space="preserve">GLib used to support some tools for memory profiling, but this
  38435. no longer works. There are many other useful tools for memory
  38436. profiling these days which can be used instead.</doc>
  38437. <doc-deprecated xml:space="preserve">Use other memory profiling tools instead</doc-deprecated>
  38438. <return-value transfer-ownership="none">
  38439. <type name="none" c:type="void"/>
  38440. </return-value>
  38441. </function>
  38442. <function name="mem_set_vtable"
  38443. c:identifier="g_mem_set_vtable"
  38444. deprecated="1"
  38445. deprecated-version="2.46">
  38446. <doc xml:space="preserve">This function used to let you override the memory allocation function.
  38447. However, its use was incompatible with the use of global constructors
  38448. in GLib and GIO, because those use the GLib allocators before main is
  38449. reached. Therefore this function is now deprecated and is just a stub.</doc>
  38450. <doc-deprecated xml:space="preserve">Use other memory profiling tools instead</doc-deprecated>
  38451. <return-value transfer-ownership="none">
  38452. <type name="none" c:type="void"/>
  38453. </return-value>
  38454. <parameters>
  38455. <parameter name="vtable" transfer-ownership="none">
  38456. <doc xml:space="preserve">table of memory allocation routines.</doc>
  38457. <type name="MemVTable" c:type="GMemVTable*"/>
  38458. </parameter>
  38459. </parameters>
  38460. </function>
  38461. <function name="memdup" c:identifier="g_memdup">
  38462. <doc xml:space="preserve">Allocates @byte_size bytes of memory, and copies @byte_size bytes into it
  38463. from @mem. If @mem is %NULL it returns %NULL.</doc>
  38464. <return-value transfer-ownership="none" nullable="1">
  38465. <doc xml:space="preserve">a pointer to the newly-allocated copy of the memory, or %NULL if @mem
  38466. is %NULL.</doc>
  38467. <type name="gpointer" c:type="gpointer"/>
  38468. </return-value>
  38469. <parameters>
  38470. <parameter name="mem"
  38471. transfer-ownership="none"
  38472. nullable="1"
  38473. allow-none="1">
  38474. <doc xml:space="preserve">the memory to copy.</doc>
  38475. <type name="gpointer" c:type="gconstpointer"/>
  38476. </parameter>
  38477. <parameter name="byte_size" transfer-ownership="none">
  38478. <doc xml:space="preserve">the number of bytes to copy.</doc>
  38479. <type name="guint" c:type="guint"/>
  38480. </parameter>
  38481. </parameters>
  38482. </function>
  38483. <function name="mkdir_with_parents"
  38484. c:identifier="g_mkdir_with_parents"
  38485. version="2.8">
  38486. <doc xml:space="preserve">Create a directory if it doesn't already exist. Create intermediate
  38487. parent directories as needed, too.</doc>
  38488. <return-value transfer-ownership="none">
  38489. <doc xml:space="preserve">0 if the directory already exists, or was successfully
  38490. created. Returns -1 if an error occurred, with errno set.</doc>
  38491. <type name="gint" c:type="gint"/>
  38492. </return-value>
  38493. <parameters>
  38494. <parameter name="pathname" transfer-ownership="none">
  38495. <doc xml:space="preserve">a pathname in the GLib file name encoding</doc>
  38496. <type name="utf8" c:type="const gchar*"/>
  38497. </parameter>
  38498. <parameter name="mode" transfer-ownership="none">
  38499. <doc xml:space="preserve">permissions to use for newly created directories</doc>
  38500. <type name="gint" c:type="gint"/>
  38501. </parameter>
  38502. </parameters>
  38503. </function>
  38504. <function name="mkdtemp" c:identifier="g_mkdtemp" version="2.30">
  38505. <doc xml:space="preserve">Creates a temporary directory. See the mkdtemp() documentation
  38506. on most UNIX-like systems.
  38507. The parameter is a string that should follow the rules for
  38508. mkdtemp() templates, i.e. contain the string "XXXXXX".
  38509. g_mkdtemp() is slightly more flexible than mkdtemp() in that the
  38510. sequence does not have to occur at the very end of the template
  38511. and you can pass a @mode and additional @flags. The X string will
  38512. be modified to form the name of a directory that didn't exist.
  38513. The string should be in the GLib file name encoding. Most importantly,
  38514. on Windows it should be in UTF-8.</doc>
  38515. <return-value transfer-ownership="full">
  38516. <doc xml:space="preserve">A pointer to @tmpl, which has been modified
  38517. to hold the directory name. In case of errors, %NULL is
  38518. returned and %errno will be set.</doc>
  38519. <type name="utf8" c:type="gchar*"/>
  38520. </return-value>
  38521. <parameters>
  38522. <parameter name="tmpl" transfer-ownership="none">
  38523. <doc xml:space="preserve">template directory name</doc>
  38524. <type name="filename" c:type="gchar*"/>
  38525. </parameter>
  38526. </parameters>
  38527. </function>
  38528. <function name="mkdtemp_full" c:identifier="g_mkdtemp_full" version="2.30">
  38529. <doc xml:space="preserve">Creates a temporary directory. See the mkdtemp() documentation
  38530. on most UNIX-like systems.
  38531. The parameter is a string that should follow the rules for
  38532. mkdtemp() templates, i.e. contain the string "XXXXXX".
  38533. g_mkdtemp() is slightly more flexible than mkdtemp() in that the
  38534. sequence does not have to occur at the very end of the template
  38535. and you can pass a @mode. The X string will be modified to form
  38536. the name of a directory that didn't exist. The string should be
  38537. in the GLib file name encoding. Most importantly, on Windows it
  38538. should be in UTF-8.</doc>
  38539. <return-value transfer-ownership="full">
  38540. <doc xml:space="preserve">A pointer to @tmpl, which has been modified
  38541. to hold the directory name. In case of errors, %NULL is
  38542. returned, and %errno will be set.</doc>
  38543. <type name="utf8" c:type="gchar*"/>
  38544. </return-value>
  38545. <parameters>
  38546. <parameter name="tmpl" transfer-ownership="none">
  38547. <doc xml:space="preserve">template directory name</doc>
  38548. <type name="filename" c:type="gchar*"/>
  38549. </parameter>
  38550. <parameter name="mode" transfer-ownership="none">
  38551. <doc xml:space="preserve">permissions to create the temporary directory with</doc>
  38552. <type name="gint" c:type="gint"/>
  38553. </parameter>
  38554. </parameters>
  38555. </function>
  38556. <function name="mkstemp" c:identifier="g_mkstemp">
  38557. <doc xml:space="preserve">Opens a temporary file. See the mkstemp() documentation
  38558. on most UNIX-like systems.
  38559. The parameter is a string that should follow the rules for
  38560. mkstemp() templates, i.e. contain the string "XXXXXX".
  38561. g_mkstemp() is slightly more flexible than mkstemp() in that the
  38562. sequence does not have to occur at the very end of the template.
  38563. The X string will be modified to form the name of a file that
  38564. didn't exist. The string should be in the GLib file name encoding.
  38565. Most importantly, on Windows it should be in UTF-8.</doc>
  38566. <return-value transfer-ownership="none">
  38567. <doc xml:space="preserve">A file handle (as from open()) to the file
  38568. opened for reading and writing. The file is opened in binary
  38569. mode on platforms where there is a difference. The file handle
  38570. should be closed with close(). In case of errors, -1 is
  38571. returned and %errno will be set.</doc>
  38572. <type name="gint" c:type="gint"/>
  38573. </return-value>
  38574. <parameters>
  38575. <parameter name="tmpl" transfer-ownership="none">
  38576. <doc xml:space="preserve">template filename</doc>
  38577. <type name="filename" c:type="gchar*"/>
  38578. </parameter>
  38579. </parameters>
  38580. </function>
  38581. <function name="mkstemp_full" c:identifier="g_mkstemp_full" version="2.22">
  38582. <doc xml:space="preserve">Opens a temporary file. See the mkstemp() documentation
  38583. on most UNIX-like systems.
  38584. The parameter is a string that should follow the rules for
  38585. mkstemp() templates, i.e. contain the string "XXXXXX".
  38586. g_mkstemp_full() is slightly more flexible than mkstemp()
  38587. in that the sequence does not have to occur at the very end of the
  38588. template and you can pass a @mode and additional @flags. The X
  38589. string will be modified to form the name of a file that didn't exist.
  38590. The string should be in the GLib file name encoding. Most importantly,
  38591. on Windows it should be in UTF-8.</doc>
  38592. <return-value transfer-ownership="none">
  38593. <doc xml:space="preserve">A file handle (as from open()) to the file
  38594. opened for reading and writing. The file handle should be
  38595. closed with close(). In case of errors, -1 is returned
  38596. and %errno will be set.</doc>
  38597. <type name="gint" c:type="gint"/>
  38598. </return-value>
  38599. <parameters>
  38600. <parameter name="tmpl" transfer-ownership="none">
  38601. <doc xml:space="preserve">template filename</doc>
  38602. <type name="filename" c:type="gchar*"/>
  38603. </parameter>
  38604. <parameter name="flags" transfer-ownership="none">
  38605. <doc xml:space="preserve">flags to pass to an open() call in addition to O_EXCL
  38606. and O_CREAT, which are passed automatically</doc>
  38607. <type name="gint" c:type="gint"/>
  38608. </parameter>
  38609. <parameter name="mode" transfer-ownership="none">
  38610. <doc xml:space="preserve">permissions to create the temporary file with</doc>
  38611. <type name="gint" c:type="gint"/>
  38612. </parameter>
  38613. </parameters>
  38614. </function>
  38615. <function name="nullify_pointer" c:identifier="g_nullify_pointer">
  38616. <doc xml:space="preserve">Set the pointer at the specified location to %NULL.</doc>
  38617. <return-value transfer-ownership="none">
  38618. <type name="none" c:type="void"/>
  38619. </return-value>
  38620. <parameters>
  38621. <parameter name="nullify_location" transfer-ownership="none">
  38622. <doc xml:space="preserve">the memory address of the pointer.</doc>
  38623. <type name="gpointer" c:type="gpointer*"/>
  38624. </parameter>
  38625. </parameters>
  38626. </function>
  38627. <function name="on_error_query" c:identifier="g_on_error_query">
  38628. <doc xml:space="preserve">Prompts the user with
  38629. `[E]xit, [H]alt, show [S]tack trace or [P]roceed`.
  38630. This function is intended to be used for debugging use only.
  38631. The following example shows how it can be used together with
  38632. the g_log() functions.
  38633. |[&lt;!-- language="C" --&gt;
  38634. #include &lt;glib.h&gt;
  38635. static void
  38636. log_handler (const gchar *log_domain,
  38637. GLogLevelFlags log_level,
  38638. const gchar *message,
  38639. gpointer user_data)
  38640. {
  38641. g_log_default_handler (log_domain, log_level, message, user_data);
  38642. g_on_error_query (MY_PROGRAM_NAME);
  38643. }
  38644. int
  38645. main (int argc, char *argv[])
  38646. {
  38647. g_log_set_handler (MY_LOG_DOMAIN,
  38648. G_LOG_LEVEL_WARNING |
  38649. G_LOG_LEVEL_ERROR |
  38650. G_LOG_LEVEL_CRITICAL,
  38651. log_handler,
  38652. NULL);
  38653. ...
  38654. ]|
  38655. If "[E]xit" is selected, the application terminates with a call
  38656. to _exit(0).
  38657. If "[S]tack" trace is selected, g_on_error_stack_trace() is called.
  38658. This invokes gdb, which attaches to the current process and shows
  38659. a stack trace. The prompt is then shown again.
  38660. If "[P]roceed" is selected, the function returns.
  38661. This function may cause different actions on non-UNIX platforms.</doc>
  38662. <return-value transfer-ownership="none">
  38663. <type name="none" c:type="void"/>
  38664. </return-value>
  38665. <parameters>
  38666. <parameter name="prg_name" transfer-ownership="none">
  38667. <doc xml:space="preserve">the program name, needed by gdb for the "[S]tack trace"
  38668. option. If @prg_name is %NULL, g_get_prgname() is called to get
  38669. the program name (which will work correctly if gdk_init() or
  38670. gtk_init() has been called)</doc>
  38671. <type name="utf8" c:type="const gchar*"/>
  38672. </parameter>
  38673. </parameters>
  38674. </function>
  38675. <function name="on_error_stack_trace"
  38676. c:identifier="g_on_error_stack_trace">
  38677. <doc xml:space="preserve">Invokes gdb, which attaches to the current process and shows a
  38678. stack trace. Called by g_on_error_query() when the "[S]tack trace"
  38679. option is selected. You can get the current process's program name
  38680. with g_get_prgname(), assuming that you have called gtk_init() or
  38681. gdk_init().
  38682. This function may cause different actions on non-UNIX platforms.</doc>
  38683. <return-value transfer-ownership="none">
  38684. <type name="none" c:type="void"/>
  38685. </return-value>
  38686. <parameters>
  38687. <parameter name="prg_name" transfer-ownership="none">
  38688. <doc xml:space="preserve">the program name, needed by gdb for the "[S]tack trace"
  38689. option</doc>
  38690. <type name="utf8" c:type="const gchar*"/>
  38691. </parameter>
  38692. </parameters>
  38693. </function>
  38694. <function name="once_init_enter"
  38695. c:identifier="g_once_init_enter"
  38696. moved-to="Once.init_enter"
  38697. version="2.14">
  38698. <doc xml:space="preserve">Function to be called when starting a critical initialization
  38699. section. The argument @location must point to a static
  38700. 0-initialized variable that will be set to a value other than 0 at
  38701. the end of the initialization section. In combination with
  38702. g_once_init_leave() and the unique address @value_location, it can
  38703. be ensured that an initialization section will be executed only once
  38704. during a program's life time, and that concurrent threads are
  38705. blocked until initialization completed. To be used in constructs
  38706. like this:
  38707. |[&lt;!-- language="C" --&gt;
  38708. static gsize initialization_value = 0;
  38709. if (g_once_init_enter (&amp;initialization_value))
  38710. {
  38711. gsize setup_value = 42; // initialization code here
  38712. g_once_init_leave (&amp;initialization_value, setup_value);
  38713. }
  38714. // use initialization_value here
  38715. ]|</doc>
  38716. <return-value transfer-ownership="none">
  38717. <doc xml:space="preserve">%TRUE if the initialization section should be entered,
  38718. %FALSE and blocks otherwise</doc>
  38719. <type name="gboolean" c:type="gboolean"/>
  38720. </return-value>
  38721. <parameters>
  38722. <parameter name="location" transfer-ownership="none">
  38723. <doc xml:space="preserve">location of a static initializable variable
  38724. containing 0</doc>
  38725. <type name="gpointer" c:type="void*"/>
  38726. </parameter>
  38727. </parameters>
  38728. </function>
  38729. <function name="once_init_leave"
  38730. c:identifier="g_once_init_leave"
  38731. moved-to="Once.init_leave"
  38732. version="2.14">
  38733. <doc xml:space="preserve">Counterpart to g_once_init_enter(). Expects a location of a static
  38734. 0-initialized initialization variable, and an initialization value
  38735. other than 0. Sets the variable to the initialization value, and
  38736. releases concurrent threads blocking in g_once_init_enter() on this
  38737. initialization variable.</doc>
  38738. <return-value transfer-ownership="none">
  38739. <type name="none" c:type="void"/>
  38740. </return-value>
  38741. <parameters>
  38742. <parameter name="location" transfer-ownership="none">
  38743. <doc xml:space="preserve">location of a static initializable variable
  38744. containing 0</doc>
  38745. <type name="gpointer" c:type="void*"/>
  38746. </parameter>
  38747. <parameter name="result" transfer-ownership="none">
  38748. <doc xml:space="preserve">new non-0 value for *@value_location</doc>
  38749. <type name="gsize" c:type="gsize"/>
  38750. </parameter>
  38751. </parameters>
  38752. </function>
  38753. <function name="option_error_quark" c:identifier="g_option_error_quark">
  38754. <return-value transfer-ownership="none">
  38755. <type name="Quark" c:type="GQuark"/>
  38756. </return-value>
  38757. </function>
  38758. <function name="parse_debug_string" c:identifier="g_parse_debug_string">
  38759. <doc xml:space="preserve">Parses a string containing debugging options
  38760. into a %guint containing bit flags. This is used
  38761. within GDK and GTK+ to parse the debug options passed on the
  38762. command line or through environment variables.
  38763. If @string is equal to "all", all flags are set. Any flags
  38764. specified along with "all" in @string are inverted; thus,
  38765. "all,foo,bar" or "foo,bar,all" sets all flags except those
  38766. corresponding to "foo" and "bar".
  38767. If @string is equal to "help", all the available keys in @keys
  38768. are printed out to standard error.</doc>
  38769. <return-value transfer-ownership="none">
  38770. <doc xml:space="preserve">the combined set of bit flags.</doc>
  38771. <type name="guint" c:type="guint"/>
  38772. </return-value>
  38773. <parameters>
  38774. <parameter name="string"
  38775. transfer-ownership="none"
  38776. nullable="1"
  38777. allow-none="1">
  38778. <doc xml:space="preserve">a list of debug options separated by colons, spaces, or
  38779. commas, or %NULL.</doc>
  38780. <type name="utf8" c:type="const gchar*"/>
  38781. </parameter>
  38782. <parameter name="keys" transfer-ownership="none">
  38783. <doc xml:space="preserve">pointer to an array of #GDebugKey which associate
  38784. strings with bit flags.</doc>
  38785. <array length="2" zero-terminated="0" c:type="GDebugKey*">
  38786. <type name="DebugKey" c:type="GDebugKey"/>
  38787. </array>
  38788. </parameter>
  38789. <parameter name="nkeys" transfer-ownership="none">
  38790. <doc xml:space="preserve">the number of #GDebugKeys in the array.</doc>
  38791. <type name="guint" c:type="guint"/>
  38792. </parameter>
  38793. </parameters>
  38794. </function>
  38795. <function name="path_get_basename" c:identifier="g_path_get_basename">
  38796. <doc xml:space="preserve">Gets the last component of the filename.
  38797. If @file_name ends with a directory separator it gets the component
  38798. before the last slash. If @file_name consists only of directory
  38799. separators (and on Windows, possibly a drive letter), a single
  38800. separator is returned. If @file_name is empty, it gets ".".</doc>
  38801. <return-value transfer-ownership="full">
  38802. <doc xml:space="preserve">a newly allocated string containing the last
  38803. component of the filename</doc>
  38804. <type name="utf8" c:type="gchar*"/>
  38805. </return-value>
  38806. <parameters>
  38807. <parameter name="file_name" transfer-ownership="none">
  38808. <doc xml:space="preserve">the name of the file</doc>
  38809. <type name="utf8" c:type="const gchar*"/>
  38810. </parameter>
  38811. </parameters>
  38812. </function>
  38813. <function name="path_get_dirname" c:identifier="g_path_get_dirname">
  38814. <doc xml:space="preserve">Gets the directory components of a file name.
  38815. If the file name has no directory components "." is returned.
  38816. The returned string should be freed when no longer needed.</doc>
  38817. <return-value transfer-ownership="full">
  38818. <doc xml:space="preserve">the directory components of the file</doc>
  38819. <type name="utf8" c:type="gchar*"/>
  38820. </return-value>
  38821. <parameters>
  38822. <parameter name="file_name" transfer-ownership="none">
  38823. <doc xml:space="preserve">the name of the file</doc>
  38824. <type name="utf8" c:type="const gchar*"/>
  38825. </parameter>
  38826. </parameters>
  38827. </function>
  38828. <function name="path_is_absolute" c:identifier="g_path_is_absolute">
  38829. <doc xml:space="preserve">Returns %TRUE if the given @file_name is an absolute file name.
  38830. Note that this is a somewhat vague concept on Windows.
  38831. On POSIX systems, an absolute file name is well-defined. It always
  38832. starts from the single root directory. For example "/usr/local".
  38833. On Windows, the concepts of current drive and drive-specific
  38834. current directory introduce vagueness. This function interprets as
  38835. an absolute file name one that either begins with a directory
  38836. separator such as "\Users\tml" or begins with the root on a drive,
  38837. for example "C:\Windows". The first case also includes UNC paths
  38838. such as "\\myserver\docs\foo". In all cases, either slashes or
  38839. backslashes are accepted.
  38840. Note that a file name relative to the current drive root does not
  38841. truly specify a file uniquely over time and across processes, as
  38842. the current drive is a per-process value and can be changed.
  38843. File names relative the current directory on some specific drive,
  38844. such as "D:foo/bar", are not interpreted as absolute by this
  38845. function, but they obviously are not relative to the normal current
  38846. directory as returned by getcwd() or g_get_current_dir()
  38847. either. Such paths should be avoided, or need to be handled using
  38848. Windows-specific code.</doc>
  38849. <return-value transfer-ownership="none">
  38850. <doc xml:space="preserve">%TRUE if @file_name is absolute</doc>
  38851. <type name="gboolean" c:type="gboolean"/>
  38852. </return-value>
  38853. <parameters>
  38854. <parameter name="file_name" transfer-ownership="none">
  38855. <doc xml:space="preserve">a file name</doc>
  38856. <type name="utf8" c:type="const gchar*"/>
  38857. </parameter>
  38858. </parameters>
  38859. </function>
  38860. <function name="path_skip_root" c:identifier="g_path_skip_root">
  38861. <doc xml:space="preserve">Returns a pointer into @file_name after the root component,
  38862. i.e. after the "/" in UNIX or "C:\" under Windows. If @file_name
  38863. is not an absolute path it returns %NULL.</doc>
  38864. <return-value transfer-ownership="none" nullable="1">
  38865. <doc xml:space="preserve">a pointer into @file_name after the root component</doc>
  38866. <type name="utf8" c:type="const gchar*"/>
  38867. </return-value>
  38868. <parameters>
  38869. <parameter name="file_name" transfer-ownership="none">
  38870. <doc xml:space="preserve">a file name</doc>
  38871. <type name="utf8" c:type="const gchar*"/>
  38872. </parameter>
  38873. </parameters>
  38874. </function>
  38875. <function name="pattern_match" c:identifier="g_pattern_match">
  38876. <doc xml:space="preserve">Matches a string against a compiled pattern. Passing the correct
  38877. length of the string given is mandatory. The reversed string can be
  38878. omitted by passing %NULL, this is more efficient if the reversed
  38879. version of the string to be matched is not at hand, as
  38880. g_pattern_match() will only construct it if the compiled pattern
  38881. requires reverse matches.
  38882. Note that, if the user code will (possibly) match a string against a
  38883. multitude of patterns containing wildcards, chances are high that
  38884. some patterns will require a reversed string. In this case, it's
  38885. more efficient to provide the reversed string to avoid multiple
  38886. constructions thereof in the various calls to g_pattern_match().
  38887. Note also that the reverse of a UTF-8 encoded string can in general
  38888. not be obtained by g_strreverse(). This works only if the string
  38889. does not contain any multibyte characters. GLib offers the
  38890. g_utf8_strreverse() function to reverse UTF-8 encoded strings.</doc>
  38891. <return-value transfer-ownership="none">
  38892. <doc xml:space="preserve">%TRUE if @string matches @pspec</doc>
  38893. <type name="gboolean" c:type="gboolean"/>
  38894. </return-value>
  38895. <parameters>
  38896. <parameter name="pspec" transfer-ownership="none">
  38897. <doc xml:space="preserve">a #GPatternSpec</doc>
  38898. <type name="PatternSpec" c:type="GPatternSpec*"/>
  38899. </parameter>
  38900. <parameter name="string_length" transfer-ownership="none">
  38901. <doc xml:space="preserve">the length of @string (in bytes, i.e. strlen(),
  38902. not g_utf8_strlen())</doc>
  38903. <type name="guint" c:type="guint"/>
  38904. </parameter>
  38905. <parameter name="string" transfer-ownership="none">
  38906. <doc xml:space="preserve">the UTF-8 encoded string to match</doc>
  38907. <type name="utf8" c:type="const gchar*"/>
  38908. </parameter>
  38909. <parameter name="string_reversed"
  38910. transfer-ownership="none"
  38911. nullable="1"
  38912. allow-none="1">
  38913. <doc xml:space="preserve">the reverse of @string or %NULL</doc>
  38914. <type name="utf8" c:type="const gchar*"/>
  38915. </parameter>
  38916. </parameters>
  38917. </function>
  38918. <function name="pattern_match_simple"
  38919. c:identifier="g_pattern_match_simple">
  38920. <doc xml:space="preserve">Matches a string against a pattern given as a string. If this
  38921. function is to be called in a loop, it's more efficient to compile
  38922. the pattern once with g_pattern_spec_new() and call
  38923. g_pattern_match_string() repeatedly.</doc>
  38924. <return-value transfer-ownership="none">
  38925. <doc xml:space="preserve">%TRUE if @string matches @pspec</doc>
  38926. <type name="gboolean" c:type="gboolean"/>
  38927. </return-value>
  38928. <parameters>
  38929. <parameter name="pattern" transfer-ownership="none">
  38930. <doc xml:space="preserve">the UTF-8 encoded pattern</doc>
  38931. <type name="utf8" c:type="const gchar*"/>
  38932. </parameter>
  38933. <parameter name="string" transfer-ownership="none">
  38934. <doc xml:space="preserve">the UTF-8 encoded string to match</doc>
  38935. <type name="utf8" c:type="const gchar*"/>
  38936. </parameter>
  38937. </parameters>
  38938. </function>
  38939. <function name="pattern_match_string"
  38940. c:identifier="g_pattern_match_string">
  38941. <doc xml:space="preserve">Matches a string against a compiled pattern. If the string is to be
  38942. matched against more than one pattern, consider using
  38943. g_pattern_match() instead while supplying the reversed string.</doc>
  38944. <return-value transfer-ownership="none">
  38945. <doc xml:space="preserve">%TRUE if @string matches @pspec</doc>
  38946. <type name="gboolean" c:type="gboolean"/>
  38947. </return-value>
  38948. <parameters>
  38949. <parameter name="pspec" transfer-ownership="none">
  38950. <doc xml:space="preserve">a #GPatternSpec</doc>
  38951. <type name="PatternSpec" c:type="GPatternSpec*"/>
  38952. </parameter>
  38953. <parameter name="string" transfer-ownership="none">
  38954. <doc xml:space="preserve">the UTF-8 encoded string to match</doc>
  38955. <type name="utf8" c:type="const gchar*"/>
  38956. </parameter>
  38957. </parameters>
  38958. </function>
  38959. <function name="pointer_bit_lock"
  38960. c:identifier="g_pointer_bit_lock"
  38961. version="2.30">
  38962. <doc xml:space="preserve">This is equivalent to g_bit_lock, but working on pointers (or other
  38963. pointer-sized values).
  38964. For portability reasons, you may only lock on the bottom 32 bits of
  38965. the pointer.</doc>
  38966. <return-value transfer-ownership="none">
  38967. <type name="none" c:type="void"/>
  38968. </return-value>
  38969. <parameters>
  38970. <parameter name="address" transfer-ownership="none">
  38971. <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
  38972. <type name="gpointer" c:type="void*"/>
  38973. </parameter>
  38974. <parameter name="lock_bit" transfer-ownership="none">
  38975. <doc xml:space="preserve">a bit value between 0 and 31</doc>
  38976. <type name="gint" c:type="gint"/>
  38977. </parameter>
  38978. </parameters>
  38979. </function>
  38980. <function name="pointer_bit_trylock"
  38981. c:identifier="g_pointer_bit_trylock"
  38982. version="2.30">
  38983. <doc xml:space="preserve">This is equivalent to g_bit_trylock, but working on pointers (or
  38984. other pointer-sized values).
  38985. For portability reasons, you may only lock on the bottom 32 bits of
  38986. the pointer.</doc>
  38987. <return-value transfer-ownership="none">
  38988. <doc xml:space="preserve">%TRUE if the lock was acquired</doc>
  38989. <type name="gboolean" c:type="gboolean"/>
  38990. </return-value>
  38991. <parameters>
  38992. <parameter name="address" transfer-ownership="none">
  38993. <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
  38994. <type name="gpointer" c:type="void*"/>
  38995. </parameter>
  38996. <parameter name="lock_bit" transfer-ownership="none">
  38997. <doc xml:space="preserve">a bit value between 0 and 31</doc>
  38998. <type name="gint" c:type="gint"/>
  38999. </parameter>
  39000. </parameters>
  39001. </function>
  39002. <function name="pointer_bit_unlock"
  39003. c:identifier="g_pointer_bit_unlock"
  39004. version="2.30">
  39005. <doc xml:space="preserve">This is equivalent to g_bit_unlock, but working on pointers (or other
  39006. pointer-sized values).
  39007. For portability reasons, you may only lock on the bottom 32 bits of
  39008. the pointer.</doc>
  39009. <return-value transfer-ownership="none">
  39010. <type name="none" c:type="void"/>
  39011. </return-value>
  39012. <parameters>
  39013. <parameter name="address" transfer-ownership="none">
  39014. <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
  39015. <type name="gpointer" c:type="void*"/>
  39016. </parameter>
  39017. <parameter name="lock_bit" transfer-ownership="none">
  39018. <doc xml:space="preserve">a bit value between 0 and 31</doc>
  39019. <type name="gint" c:type="gint"/>
  39020. </parameter>
  39021. </parameters>
  39022. </function>
  39023. <function name="poll" c:identifier="g_poll" version="2.20">
  39024. <doc xml:space="preserve">Polls @fds, as with the poll() system call, but portably. (On
  39025. systems that don't have poll(), it is emulated using select().)
  39026. This is used internally by #GMainContext, but it can be called
  39027. directly if you need to block until a file descriptor is ready, but
  39028. don't want to run the full main loop.
  39029. Each element of @fds is a #GPollFD describing a single file
  39030. descriptor to poll. The %fd field indicates the file descriptor,
  39031. and the %events field indicates the events to poll for. On return,
  39032. the %revents fields will be filled with the events that actually
  39033. occurred.
  39034. On POSIX systems, the file descriptors in @fds can be any sort of
  39035. file descriptor, but the situation is much more complicated on
  39036. Windows. If you need to use g_poll() in code that has to run on
  39037. Windows, the easiest solution is to construct all of your
  39038. #GPollFDs with g_io_channel_win32_make_pollfd().</doc>
  39039. <return-value transfer-ownership="none">
  39040. <doc xml:space="preserve">the number of entries in @fds whose %revents fields
  39041. were filled in, or 0 if the operation timed out, or -1 on error or
  39042. if the call was interrupted.</doc>
  39043. <type name="gint" c:type="gint"/>
  39044. </return-value>
  39045. <parameters>
  39046. <parameter name="fds" transfer-ownership="none">
  39047. <doc xml:space="preserve">file descriptors to poll</doc>
  39048. <type name="PollFD" c:type="GPollFD*"/>
  39049. </parameter>
  39050. <parameter name="nfds" transfer-ownership="none">
  39051. <doc xml:space="preserve">the number of file descriptors in @fds</doc>
  39052. <type name="guint" c:type="guint"/>
  39053. </parameter>
  39054. <parameter name="timeout" transfer-ownership="none">
  39055. <doc xml:space="preserve">amount of time to wait, in milliseconds, or -1 to wait forever</doc>
  39056. <type name="gint" c:type="gint"/>
  39057. </parameter>
  39058. </parameters>
  39059. </function>
  39060. <function name="prefix_error"
  39061. c:identifier="g_prefix_error"
  39062. version="2.16"
  39063. introspectable="0">
  39064. <doc xml:space="preserve">Formats a string according to @format and prefix it to an existing
  39065. error message. If @err is %NULL (ie: no error variable) then do
  39066. nothing.
  39067. If *@err is %NULL (ie: an error variable is present but there is no
  39068. error condition) then also do nothing. Whether or not it makes sense
  39069. to take advantage of this feature is up to you.</doc>
  39070. <return-value transfer-ownership="none">
  39071. <type name="none" c:type="void"/>
  39072. </return-value>
  39073. <parameters>
  39074. <parameter name="err"
  39075. direction="inout"
  39076. caller-allocates="0"
  39077. transfer-ownership="full"
  39078. nullable="1"
  39079. allow-none="1">
  39080. <doc xml:space="preserve">a return location for a #GError</doc>
  39081. <type name="Error" c:type="GError**"/>
  39082. </parameter>
  39083. <parameter name="format" transfer-ownership="none">
  39084. <doc xml:space="preserve">printf()-style format string</doc>
  39085. <type name="utf8" c:type="const gchar*"/>
  39086. </parameter>
  39087. <parameter name="..." transfer-ownership="none">
  39088. <doc xml:space="preserve">arguments to @format</doc>
  39089. <varargs/>
  39090. </parameter>
  39091. </parameters>
  39092. </function>
  39093. <function name="print" c:identifier="g_print" introspectable="0">
  39094. <doc xml:space="preserve">Outputs a formatted message via the print handler.
  39095. The default print handler simply outputs the message to stdout, without
  39096. appending a trailing new-line character. Typically, @format should end with
  39097. its own new-line character.
  39098. g_print() should not be used from within libraries for debugging
  39099. messages, since it may be redirected by applications to special
  39100. purpose message windows or even files. Instead, libraries should
  39101. use g_log(), or the convenience functions g_message(), g_warning()
  39102. and g_error().</doc>
  39103. <return-value transfer-ownership="none">
  39104. <type name="none" c:type="void"/>
  39105. </return-value>
  39106. <parameters>
  39107. <parameter name="format" transfer-ownership="none">
  39108. <doc xml:space="preserve">the message format. See the printf() documentation</doc>
  39109. <type name="utf8" c:type="const gchar*"/>
  39110. </parameter>
  39111. <parameter name="..." transfer-ownership="none">
  39112. <doc xml:space="preserve">the parameters to insert into the format string</doc>
  39113. <varargs/>
  39114. </parameter>
  39115. </parameters>
  39116. </function>
  39117. <function name="printerr" c:identifier="g_printerr" introspectable="0">
  39118. <doc xml:space="preserve">Outputs a formatted message via the error message handler.
  39119. The default handler simply outputs the message to stderr, without appending
  39120. a trailing new-line character. Typically, @format should end with its own
  39121. new-line character.
  39122. g_printerr() should not be used from within libraries.
  39123. Instead g_log() should be used, or the convenience functions
  39124. g_message(), g_warning() and g_error().</doc>
  39125. <return-value transfer-ownership="none">
  39126. <type name="none" c:type="void"/>
  39127. </return-value>
  39128. <parameters>
  39129. <parameter name="format" transfer-ownership="none">
  39130. <doc xml:space="preserve">the message format. See the printf() documentation</doc>
  39131. <type name="utf8" c:type="const gchar*"/>
  39132. </parameter>
  39133. <parameter name="..." transfer-ownership="none">
  39134. <doc xml:space="preserve">the parameters to insert into the format string</doc>
  39135. <varargs/>
  39136. </parameter>
  39137. </parameters>
  39138. </function>
  39139. <function name="printf"
  39140. c:identifier="g_printf"
  39141. version="2.2"
  39142. introspectable="0">
  39143. <doc xml:space="preserve">An implementation of the standard printf() function which supports
  39144. positional parameters, as specified in the Single Unix Specification.
  39145. As with the standard printf(), this does not automatically append a trailing
  39146. new-line character to the message, so typically @format should end with its
  39147. own new-line character.</doc>
  39148. <return-value transfer-ownership="none">
  39149. <doc xml:space="preserve">the number of bytes printed.</doc>
  39150. <type name="gint" c:type="gint"/>
  39151. </return-value>
  39152. <parameters>
  39153. <parameter name="format" transfer-ownership="none">
  39154. <doc xml:space="preserve">a standard printf() format string, but notice
  39155. [string precision pitfalls][string-precision]</doc>
  39156. <type name="utf8" c:type="gchar*"/>
  39157. </parameter>
  39158. <parameter name="..." transfer-ownership="none">
  39159. <doc xml:space="preserve">the arguments to insert in the output.</doc>
  39160. <varargs/>
  39161. </parameter>
  39162. </parameters>
  39163. </function>
  39164. <function name="printf_string_upper_bound"
  39165. c:identifier="g_printf_string_upper_bound"
  39166. introspectable="0">
  39167. <doc xml:space="preserve">Calculates the maximum space needed to store the output
  39168. of the sprintf() function.</doc>
  39169. <return-value transfer-ownership="none">
  39170. <doc xml:space="preserve">the maximum space needed to store the formatted string</doc>
  39171. <type name="gsize" c:type="gsize"/>
  39172. </return-value>
  39173. <parameters>
  39174. <parameter name="format" transfer-ownership="none">
  39175. <doc xml:space="preserve">the format string. See the printf() documentation</doc>
  39176. <type name="utf8" c:type="const gchar*"/>
  39177. </parameter>
  39178. <parameter name="args" transfer-ownership="none">
  39179. <doc xml:space="preserve">the parameters to be inserted into the format string</doc>
  39180. <type name="va_list" c:type="va_list"/>
  39181. </parameter>
  39182. </parameters>
  39183. </function>
  39184. <function name="propagate_error" c:identifier="g_propagate_error">
  39185. <doc xml:space="preserve">If @dest is %NULL, free @src; otherwise, moves @src into *@dest.
  39186. The error variable @dest points to must be %NULL.
  39187. @src must be non-%NULL.
  39188. Note that @src is no longer valid after this call. If you want
  39189. to keep using the same GError*, you need to set it to %NULL
  39190. after calling this function on it.</doc>
  39191. <return-value transfer-ownership="none">
  39192. <type name="none" c:type="void"/>
  39193. </return-value>
  39194. <parameters>
  39195. <parameter name="dest"
  39196. direction="out"
  39197. caller-allocates="0"
  39198. transfer-ownership="full"
  39199. nullable="1"
  39200. optional="1"
  39201. allow-none="1">
  39202. <doc xml:space="preserve">error return location</doc>
  39203. <type name="Error" c:type="GError**"/>
  39204. </parameter>
  39205. <parameter name="src" transfer-ownership="full">
  39206. <doc xml:space="preserve">error to move into the return location</doc>
  39207. <type name="Error" c:type="GError*"/>
  39208. </parameter>
  39209. </parameters>
  39210. </function>
  39211. <function name="propagate_prefixed_error"
  39212. c:identifier="g_propagate_prefixed_error"
  39213. version="2.16"
  39214. introspectable="0">
  39215. <doc xml:space="preserve">If @dest is %NULL, free @src; otherwise, moves @src into *@dest.
  39216. *@dest must be %NULL. After the move, add a prefix as with
  39217. g_prefix_error().</doc>
  39218. <return-value transfer-ownership="none">
  39219. <type name="none" c:type="void"/>
  39220. </return-value>
  39221. <parameters>
  39222. <parameter name="dest" transfer-ownership="none">
  39223. <doc xml:space="preserve">error return location</doc>
  39224. <type name="Error" c:type="GError**"/>
  39225. </parameter>
  39226. <parameter name="src" transfer-ownership="none">
  39227. <doc xml:space="preserve">error to move into the return location</doc>
  39228. <type name="Error" c:type="GError*"/>
  39229. </parameter>
  39230. <parameter name="format" transfer-ownership="none">
  39231. <doc xml:space="preserve">printf()-style format string</doc>
  39232. <type name="utf8" c:type="const gchar*"/>
  39233. </parameter>
  39234. <parameter name="..." transfer-ownership="none">
  39235. <doc xml:space="preserve">arguments to @format</doc>
  39236. <varargs/>
  39237. </parameter>
  39238. </parameters>
  39239. </function>
  39240. <function name="qsort_with_data"
  39241. c:identifier="g_qsort_with_data"
  39242. introspectable="0">
  39243. <doc xml:space="preserve">This is just like the standard C qsort() function, but
  39244. the comparison routine accepts a user data argument.
  39245. This is guaranteed to be a stable sort since version 2.32.</doc>
  39246. <return-value transfer-ownership="none">
  39247. <type name="none" c:type="void"/>
  39248. </return-value>
  39249. <parameters>
  39250. <parameter name="pbase" transfer-ownership="none">
  39251. <doc xml:space="preserve">start of array to sort</doc>
  39252. <type name="gpointer" c:type="gconstpointer"/>
  39253. </parameter>
  39254. <parameter name="total_elems" transfer-ownership="none">
  39255. <doc xml:space="preserve">elements in the array</doc>
  39256. <type name="gint" c:type="gint"/>
  39257. </parameter>
  39258. <parameter name="size" transfer-ownership="none">
  39259. <doc xml:space="preserve">size of each element</doc>
  39260. <type name="gsize" c:type="gsize"/>
  39261. </parameter>
  39262. <parameter name="compare_func" transfer-ownership="none" closure="4">
  39263. <doc xml:space="preserve">function to compare elements</doc>
  39264. <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
  39265. </parameter>
  39266. <parameter name="user_data"
  39267. transfer-ownership="none"
  39268. nullable="1"
  39269. allow-none="1">
  39270. <doc xml:space="preserve">data to pass to @compare_func</doc>
  39271. <type name="gpointer" c:type="gpointer"/>
  39272. </parameter>
  39273. </parameters>
  39274. </function>
  39275. <function name="quark_from_static_string"
  39276. c:identifier="g_quark_from_static_string">
  39277. <doc xml:space="preserve">Gets the #GQuark identifying the given (static) string. If the
  39278. string does not currently have an associated #GQuark, a new #GQuark
  39279. is created, linked to the given string.
  39280. Note that this function is identical to g_quark_from_string() except
  39281. that if a new #GQuark is created the string itself is used rather
  39282. than a copy. This saves memory, but can only be used if the string
  39283. will continue to exist until the program terminates. It can be used
  39284. with statically allocated strings in the main program, but not with
  39285. statically allocated memory in dynamically loaded modules, if you
  39286. expect to ever unload the module again (e.g. do not use this
  39287. function in GTK+ theme engines).</doc>
  39288. <return-value transfer-ownership="none">
  39289. <doc xml:space="preserve">the #GQuark identifying the string, or 0 if @string is %NULL</doc>
  39290. <type name="Quark" c:type="GQuark"/>
  39291. </return-value>
  39292. <parameters>
  39293. <parameter name="string"
  39294. transfer-ownership="none"
  39295. nullable="1"
  39296. allow-none="1">
  39297. <doc xml:space="preserve">a string</doc>
  39298. <type name="utf8" c:type="const gchar*"/>
  39299. </parameter>
  39300. </parameters>
  39301. </function>
  39302. <function name="quark_from_string" c:identifier="g_quark_from_string">
  39303. <doc xml:space="preserve">Gets the #GQuark identifying the given string. If the string does
  39304. not currently have an associated #GQuark, a new #GQuark is created,
  39305. using a copy of the string.</doc>
  39306. <return-value transfer-ownership="none">
  39307. <doc xml:space="preserve">the #GQuark identifying the string, or 0 if @string is %NULL</doc>
  39308. <type name="Quark" c:type="GQuark"/>
  39309. </return-value>
  39310. <parameters>
  39311. <parameter name="string"
  39312. transfer-ownership="none"
  39313. nullable="1"
  39314. allow-none="1">
  39315. <doc xml:space="preserve">a string</doc>
  39316. <type name="utf8" c:type="const gchar*"/>
  39317. </parameter>
  39318. </parameters>
  39319. </function>
  39320. <function name="quark_to_string" c:identifier="g_quark_to_string">
  39321. <doc xml:space="preserve">Gets the string associated with the given #GQuark.</doc>
  39322. <return-value transfer-ownership="none">
  39323. <doc xml:space="preserve">the string associated with the #GQuark</doc>
  39324. <type name="utf8" c:type="const gchar*"/>
  39325. </return-value>
  39326. <parameters>
  39327. <parameter name="quark" transfer-ownership="none">
  39328. <doc xml:space="preserve">a #GQuark.</doc>
  39329. <type name="Quark" c:type="GQuark"/>
  39330. </parameter>
  39331. </parameters>
  39332. </function>
  39333. <function name="quark_try_string" c:identifier="g_quark_try_string">
  39334. <doc xml:space="preserve">Gets the #GQuark associated with the given string, or 0 if string is
  39335. %NULL or it has no associated #GQuark.
  39336. If you want the GQuark to be created if it doesn't already exist,
  39337. use g_quark_from_string() or g_quark_from_static_string().</doc>
  39338. <return-value transfer-ownership="none">
  39339. <doc xml:space="preserve">the #GQuark associated with the string, or 0 if @string is
  39340. %NULL or there is no #GQuark associated with it</doc>
  39341. <type name="Quark" c:type="GQuark"/>
  39342. </return-value>
  39343. <parameters>
  39344. <parameter name="string"
  39345. transfer-ownership="none"
  39346. nullable="1"
  39347. allow-none="1">
  39348. <doc xml:space="preserve">a string</doc>
  39349. <type name="utf8" c:type="const gchar*"/>
  39350. </parameter>
  39351. </parameters>
  39352. </function>
  39353. <function name="random_double" c:identifier="g_random_double">
  39354. <doc xml:space="preserve">Returns a random #gdouble equally distributed over the range [0..1).</doc>
  39355. <return-value transfer-ownership="none">
  39356. <doc xml:space="preserve">a random number</doc>
  39357. <type name="gdouble" c:type="gdouble"/>
  39358. </return-value>
  39359. </function>
  39360. <function name="random_double_range" c:identifier="g_random_double_range">
  39361. <doc xml:space="preserve">Returns a random #gdouble equally distributed over the range
  39362. [@begin..@end).</doc>
  39363. <return-value transfer-ownership="none">
  39364. <doc xml:space="preserve">a random number</doc>
  39365. <type name="gdouble" c:type="gdouble"/>
  39366. </return-value>
  39367. <parameters>
  39368. <parameter name="begin" transfer-ownership="none">
  39369. <doc xml:space="preserve">lower closed bound of the interval</doc>
  39370. <type name="gdouble" c:type="gdouble"/>
  39371. </parameter>
  39372. <parameter name="end" transfer-ownership="none">
  39373. <doc xml:space="preserve">upper open bound of the interval</doc>
  39374. <type name="gdouble" c:type="gdouble"/>
  39375. </parameter>
  39376. </parameters>
  39377. </function>
  39378. <function name="random_int" c:identifier="g_random_int">
  39379. <doc xml:space="preserve">Return a random #guint32 equally distributed over the range
  39380. [0..2^32-1].</doc>
  39381. <return-value transfer-ownership="none">
  39382. <doc xml:space="preserve">a random number</doc>
  39383. <type name="guint32" c:type="guint32"/>
  39384. </return-value>
  39385. </function>
  39386. <function name="random_int_range" c:identifier="g_random_int_range">
  39387. <doc xml:space="preserve">Returns a random #gint32 equally distributed over the range
  39388. [@begin..@end-1].</doc>
  39389. <return-value transfer-ownership="none">
  39390. <doc xml:space="preserve">a random number</doc>
  39391. <type name="gint32" c:type="gint32"/>
  39392. </return-value>
  39393. <parameters>
  39394. <parameter name="begin" transfer-ownership="none">
  39395. <doc xml:space="preserve">lower closed bound of the interval</doc>
  39396. <type name="gint32" c:type="gint32"/>
  39397. </parameter>
  39398. <parameter name="end" transfer-ownership="none">
  39399. <doc xml:space="preserve">upper open bound of the interval</doc>
  39400. <type name="gint32" c:type="gint32"/>
  39401. </parameter>
  39402. </parameters>
  39403. </function>
  39404. <function name="random_set_seed" c:identifier="g_random_set_seed">
  39405. <doc xml:space="preserve">Sets the seed for the global random number generator, which is used
  39406. by the g_random_* functions, to @seed.</doc>
  39407. <return-value transfer-ownership="none">
  39408. <type name="none" c:type="void"/>
  39409. </return-value>
  39410. <parameters>
  39411. <parameter name="seed" transfer-ownership="none">
  39412. <doc xml:space="preserve">a value to reinitialize the global random number generator</doc>
  39413. <type name="guint32" c:type="guint32"/>
  39414. </parameter>
  39415. </parameters>
  39416. </function>
  39417. <function name="realloc" c:identifier="g_realloc">
  39418. <doc xml:space="preserve">Reallocates the memory pointed to by @mem, so that it now has space for
  39419. @n_bytes bytes of memory. It returns the new address of the memory, which may
  39420. have been moved. @mem may be %NULL, in which case it's considered to
  39421. have zero-length. @n_bytes may be 0, in which case %NULL will be returned
  39422. and @mem will be freed unless it is %NULL.</doc>
  39423. <return-value transfer-ownership="none" nullable="1">
  39424. <doc xml:space="preserve">the new address of the allocated memory</doc>
  39425. <type name="gpointer" c:type="gpointer"/>
  39426. </return-value>
  39427. <parameters>
  39428. <parameter name="mem"
  39429. transfer-ownership="none"
  39430. nullable="1"
  39431. allow-none="1">
  39432. <doc xml:space="preserve">the memory to reallocate</doc>
  39433. <type name="gpointer" c:type="gpointer"/>
  39434. </parameter>
  39435. <parameter name="n_bytes" transfer-ownership="none">
  39436. <doc xml:space="preserve">new size of the memory in bytes</doc>
  39437. <type name="gsize" c:type="gsize"/>
  39438. </parameter>
  39439. </parameters>
  39440. </function>
  39441. <function name="realloc_n" c:identifier="g_realloc_n" version="2.24">
  39442. <doc xml:space="preserve">This function is similar to g_realloc(), allocating (@n_blocks * @n_block_bytes) bytes,
  39443. but care is taken to detect possible overflow during multiplication.</doc>
  39444. <return-value transfer-ownership="none" nullable="1">
  39445. <doc xml:space="preserve">the new address of the allocated memory</doc>
  39446. <type name="gpointer" c:type="gpointer"/>
  39447. </return-value>
  39448. <parameters>
  39449. <parameter name="mem"
  39450. transfer-ownership="none"
  39451. nullable="1"
  39452. allow-none="1">
  39453. <doc xml:space="preserve">the memory to reallocate</doc>
  39454. <type name="gpointer" c:type="gpointer"/>
  39455. </parameter>
  39456. <parameter name="n_blocks" transfer-ownership="none">
  39457. <doc xml:space="preserve">the number of blocks to allocate</doc>
  39458. <type name="gsize" c:type="gsize"/>
  39459. </parameter>
  39460. <parameter name="n_block_bytes" transfer-ownership="none">
  39461. <doc xml:space="preserve">the size of each block in bytes</doc>
  39462. <type name="gsize" c:type="gsize"/>
  39463. </parameter>
  39464. </parameters>
  39465. </function>
  39466. <function name="regex_check_replacement"
  39467. c:identifier="g_regex_check_replacement"
  39468. moved-to="Regex.check_replacement"
  39469. version="2.14"
  39470. throws="1">
  39471. <doc xml:space="preserve">Checks whether @replacement is a valid replacement string
  39472. (see g_regex_replace()), i.e. that all escape sequences in
  39473. it are valid.
  39474. If @has_references is not %NULL then @replacement is checked
  39475. for pattern references. For instance, replacement text 'foo\n'
  39476. does not contain references and may be evaluated without information
  39477. about actual match, but '\0\1' (whole match followed by first
  39478. subpattern) requires valid #GMatchInfo object.</doc>
  39479. <return-value transfer-ownership="none">
  39480. <doc xml:space="preserve">whether @replacement is a valid replacement string</doc>
  39481. <type name="gboolean" c:type="gboolean"/>
  39482. </return-value>
  39483. <parameters>
  39484. <parameter name="replacement" transfer-ownership="none">
  39485. <doc xml:space="preserve">the replacement string</doc>
  39486. <type name="utf8" c:type="const gchar*"/>
  39487. </parameter>
  39488. <parameter name="has_references"
  39489. direction="out"
  39490. caller-allocates="0"
  39491. transfer-ownership="full"
  39492. optional="1"
  39493. allow-none="1">
  39494. <doc xml:space="preserve">location to store information about
  39495. references in @replacement or %NULL</doc>
  39496. <type name="gboolean" c:type="gboolean*"/>
  39497. </parameter>
  39498. </parameters>
  39499. </function>
  39500. <function name="regex_error_quark"
  39501. c:identifier="g_regex_error_quark"
  39502. moved-to="Regex.error_quark">
  39503. <return-value transfer-ownership="none">
  39504. <type name="Quark" c:type="GQuark"/>
  39505. </return-value>
  39506. </function>
  39507. <function name="regex_escape_nul"
  39508. c:identifier="g_regex_escape_nul"
  39509. moved-to="Regex.escape_nul"
  39510. version="2.30">
  39511. <doc xml:space="preserve">Escapes the nul characters in @string to "\x00". It can be used
  39512. to compile a regex with embedded nul characters.
  39513. For completeness, @length can be -1 for a nul-terminated string.
  39514. In this case the output string will be of course equal to @string.</doc>
  39515. <return-value transfer-ownership="full">
  39516. <doc xml:space="preserve">a newly-allocated escaped string</doc>
  39517. <type name="utf8" c:type="gchar*"/>
  39518. </return-value>
  39519. <parameters>
  39520. <parameter name="string" transfer-ownership="none">
  39521. <doc xml:space="preserve">the string to escape</doc>
  39522. <type name="utf8" c:type="const gchar*"/>
  39523. </parameter>
  39524. <parameter name="length" transfer-ownership="none">
  39525. <doc xml:space="preserve">the length of @string</doc>
  39526. <type name="gint" c:type="gint"/>
  39527. </parameter>
  39528. </parameters>
  39529. </function>
  39530. <function name="regex_escape_string"
  39531. c:identifier="g_regex_escape_string"
  39532. moved-to="Regex.escape_string"
  39533. version="2.14">
  39534. <doc xml:space="preserve">Escapes the special characters used for regular expressions
  39535. in @string, for instance "a.b*c" becomes "a\.b\*c". This
  39536. function is useful to dynamically generate regular expressions.
  39537. @string can contain nul characters that are replaced with "\0",
  39538. in this case remember to specify the correct length of @string
  39539. in @length.</doc>
  39540. <return-value transfer-ownership="full">
  39541. <doc xml:space="preserve">a newly-allocated escaped string</doc>
  39542. <type name="utf8" c:type="gchar*"/>
  39543. </return-value>
  39544. <parameters>
  39545. <parameter name="string" transfer-ownership="none">
  39546. <doc xml:space="preserve">the string to escape</doc>
  39547. <array length="1" zero-terminated="0" c:type="gchar*">
  39548. <type name="utf8" c:type="gchar"/>
  39549. </array>
  39550. </parameter>
  39551. <parameter name="length" transfer-ownership="none">
  39552. <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
  39553. <type name="gint" c:type="gint"/>
  39554. </parameter>
  39555. </parameters>
  39556. </function>
  39557. <function name="regex_match_simple"
  39558. c:identifier="g_regex_match_simple"
  39559. moved-to="Regex.match_simple"
  39560. version="2.14">
  39561. <doc xml:space="preserve">Scans for a match in @string for @pattern.
  39562. This function is equivalent to g_regex_match() but it does not
  39563. require to compile the pattern with g_regex_new(), avoiding some
  39564. lines of code when you need just to do a match without extracting
  39565. substrings, capture counts, and so on.
  39566. If this function is to be called on the same @pattern more than
  39567. once, it's more efficient to compile the pattern once with
  39568. g_regex_new() and then use g_regex_match().</doc>
  39569. <return-value transfer-ownership="none">
  39570. <doc xml:space="preserve">%TRUE if the string matched, %FALSE otherwise</doc>
  39571. <type name="gboolean" c:type="gboolean"/>
  39572. </return-value>
  39573. <parameters>
  39574. <parameter name="pattern" transfer-ownership="none">
  39575. <doc xml:space="preserve">the regular expression</doc>
  39576. <type name="utf8" c:type="const gchar*"/>
  39577. </parameter>
  39578. <parameter name="string" transfer-ownership="none">
  39579. <doc xml:space="preserve">the string to scan for matches</doc>
  39580. <type name="utf8" c:type="const gchar*"/>
  39581. </parameter>
  39582. <parameter name="compile_options" transfer-ownership="none">
  39583. <doc xml:space="preserve">compile options for the regular expression, or 0</doc>
  39584. <type name="RegexCompileFlags" c:type="GRegexCompileFlags"/>
  39585. </parameter>
  39586. <parameter name="match_options" transfer-ownership="none">
  39587. <doc xml:space="preserve">match options, or 0</doc>
  39588. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  39589. </parameter>
  39590. </parameters>
  39591. </function>
  39592. <function name="regex_split_simple"
  39593. c:identifier="g_regex_split_simple"
  39594. moved-to="Regex.split_simple"
  39595. version="2.14">
  39596. <doc xml:space="preserve">Breaks the string on the pattern, and returns an array of
  39597. the tokens. If the pattern contains capturing parentheses,
  39598. then the text for each of the substrings will also be returned.
  39599. If the pattern does not match anywhere in the string, then the
  39600. whole string is returned as the first token.
  39601. This function is equivalent to g_regex_split() but it does
  39602. not require to compile the pattern with g_regex_new(), avoiding
  39603. some lines of code when you need just to do a split without
  39604. extracting substrings, capture counts, and so on.
  39605. If this function is to be called on the same @pattern more than
  39606. once, it's more efficient to compile the pattern once with
  39607. g_regex_new() and then use g_regex_split().
  39608. As a special case, the result of splitting the empty string ""
  39609. is an empty vector, not a vector containing a single string.
  39610. The reason for this special case is that being able to represent
  39611. a empty vector is typically more useful than consistent handling
  39612. of empty elements. If you do need to represent empty elements,
  39613. you'll need to check for the empty string before calling this
  39614. function.
  39615. A pattern that can match empty strings splits @string into
  39616. separate characters wherever it matches the empty string between
  39617. characters. For example splitting "ab c" using as a separator
  39618. "\s*", you will get "a", "b" and "c".</doc>
  39619. <return-value transfer-ownership="full">
  39620. <doc xml:space="preserve">a %NULL-terminated array of strings. Free
  39621. it using g_strfreev()</doc>
  39622. <array c:type="gchar**">
  39623. <type name="utf8"/>
  39624. </array>
  39625. </return-value>
  39626. <parameters>
  39627. <parameter name="pattern" transfer-ownership="none">
  39628. <doc xml:space="preserve">the regular expression</doc>
  39629. <type name="utf8" c:type="const gchar*"/>
  39630. </parameter>
  39631. <parameter name="string" transfer-ownership="none">
  39632. <doc xml:space="preserve">the string to scan for matches</doc>
  39633. <type name="utf8" c:type="const gchar*"/>
  39634. </parameter>
  39635. <parameter name="compile_options" transfer-ownership="none">
  39636. <doc xml:space="preserve">compile options for the regular expression, or 0</doc>
  39637. <type name="RegexCompileFlags" c:type="GRegexCompileFlags"/>
  39638. </parameter>
  39639. <parameter name="match_options" transfer-ownership="none">
  39640. <doc xml:space="preserve">match options, or 0</doc>
  39641. <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
  39642. </parameter>
  39643. </parameters>
  39644. </function>
  39645. <function name="reload_user_special_dirs_cache"
  39646. c:identifier="g_reload_user_special_dirs_cache"
  39647. version="2.22">
  39648. <doc xml:space="preserve">Resets the cache used for g_get_user_special_dir(), so
  39649. that the latest on-disk version is used. Call this only
  39650. if you just changed the data on disk yourself.
  39651. Due to threadsafety issues this may cause leaking of strings
  39652. that were previously returned from g_get_user_special_dir()
  39653. that can't be freed. We ensure to only leak the data for
  39654. the directories that actually changed value though.</doc>
  39655. <return-value transfer-ownership="none">
  39656. <type name="none" c:type="void"/>
  39657. </return-value>
  39658. </function>
  39659. <function name="return_if_fail_warning"
  39660. c:identifier="g_return_if_fail_warning"
  39661. introspectable="0">
  39662. <return-value transfer-ownership="none">
  39663. <type name="none" c:type="void"/>
  39664. </return-value>
  39665. <parameters>
  39666. <parameter name="log_domain"
  39667. transfer-ownership="none"
  39668. nullable="1"
  39669. allow-none="1">
  39670. <type name="utf8" c:type="const char*"/>
  39671. </parameter>
  39672. <parameter name="pretty_function" transfer-ownership="none">
  39673. <type name="utf8" c:type="const char*"/>
  39674. </parameter>
  39675. <parameter name="expression"
  39676. transfer-ownership="none"
  39677. nullable="1"
  39678. allow-none="1">
  39679. <type name="utf8" c:type="const char*"/>
  39680. </parameter>
  39681. </parameters>
  39682. </function>
  39683. <function name="rmdir" c:identifier="g_rmdir" version="2.6">
  39684. <doc xml:space="preserve">A wrapper for the POSIX rmdir() function. The rmdir() function
  39685. deletes a directory from the filesystem.
  39686. See your C library manual for more details about how rmdir() works
  39687. on your system.</doc>
  39688. <return-value transfer-ownership="none">
  39689. <doc xml:space="preserve">0 if the directory was successfully removed, -1 if an error
  39690. occurred</doc>
  39691. <type name="gint" c:type="int"/>
  39692. </return-value>
  39693. <parameters>
  39694. <parameter name="filename" transfer-ownership="none">
  39695. <doc xml:space="preserve">a pathname in the GLib file name encoding (UTF-8 on Windows)</doc>
  39696. <type name="utf8" c:type="const gchar*"/>
  39697. </parameter>
  39698. </parameters>
  39699. </function>
  39700. <function name="sequence_get"
  39701. c:identifier="g_sequence_get"
  39702. moved-to="Sequence.get"
  39703. version="2.14">
  39704. <doc xml:space="preserve">Returns the data that @iter points to.</doc>
  39705. <return-value transfer-ownership="none" nullable="1">
  39706. <doc xml:space="preserve">the data that @iter points to</doc>
  39707. <type name="gpointer" c:type="gpointer"/>
  39708. </return-value>
  39709. <parameters>
  39710. <parameter name="iter" transfer-ownership="none">
  39711. <doc xml:space="preserve">a #GSequenceIter</doc>
  39712. <type name="SequenceIter" c:type="GSequenceIter*"/>
  39713. </parameter>
  39714. </parameters>
  39715. </function>
  39716. <function name="sequence_move"
  39717. c:identifier="g_sequence_move"
  39718. moved-to="Sequence.move"
  39719. version="2.14">
  39720. <doc xml:space="preserve">Moves the item pointed to by @src to the position indicated by @dest.
  39721. After calling this function @dest will point to the position immediately
  39722. after @src. It is allowed for @src and @dest to point into different
  39723. sequences.</doc>
  39724. <return-value transfer-ownership="none">
  39725. <type name="none" c:type="void"/>
  39726. </return-value>
  39727. <parameters>
  39728. <parameter name="src" transfer-ownership="none">
  39729. <doc xml:space="preserve">a #GSequenceIter pointing to the item to move</doc>
  39730. <type name="SequenceIter" c:type="GSequenceIter*"/>
  39731. </parameter>
  39732. <parameter name="dest" transfer-ownership="none">
  39733. <doc xml:space="preserve">a #GSequenceIter pointing to the position to which
  39734. the item is moved</doc>
  39735. <type name="SequenceIter" c:type="GSequenceIter*"/>
  39736. </parameter>
  39737. </parameters>
  39738. </function>
  39739. <function name="sequence_move_range"
  39740. c:identifier="g_sequence_move_range"
  39741. moved-to="Sequence.move_range"
  39742. version="2.14">
  39743. <doc xml:space="preserve">Inserts the (@begin, @end) range at the destination pointed to by ptr.
  39744. The @begin and @end iters must point into the same sequence. It is
  39745. allowed for @dest to point to a different sequence than the one pointed
  39746. into by @begin and @end.
  39747. If @dest is NULL, the range indicated by @begin and @end is
  39748. removed from the sequence. If @dest iter points to a place within
  39749. the (@begin, @end) range, the range does not move.</doc>
  39750. <return-value transfer-ownership="none">
  39751. <type name="none" c:type="void"/>
  39752. </return-value>
  39753. <parameters>
  39754. <parameter name="dest" transfer-ownership="none">
  39755. <doc xml:space="preserve">a #GSequenceIter</doc>
  39756. <type name="SequenceIter" c:type="GSequenceIter*"/>
  39757. </parameter>
  39758. <parameter name="begin" transfer-ownership="none">
  39759. <doc xml:space="preserve">a #GSequenceIter</doc>
  39760. <type name="SequenceIter" c:type="GSequenceIter*"/>
  39761. </parameter>
  39762. <parameter name="end" transfer-ownership="none">
  39763. <doc xml:space="preserve">a #GSequenceIter</doc>
  39764. <type name="SequenceIter" c:type="GSequenceIter*"/>
  39765. </parameter>
  39766. </parameters>
  39767. </function>
  39768. <function name="sequence_remove"
  39769. c:identifier="g_sequence_remove"
  39770. moved-to="Sequence.remove"
  39771. version="2.14">
  39772. <doc xml:space="preserve">Removes the item pointed to by @iter. It is an error to pass the
  39773. end iterator to this function.
  39774. If the sequence has a data destroy function associated with it, this
  39775. function is called on the data for the removed item.</doc>
  39776. <return-value transfer-ownership="none">
  39777. <type name="none" c:type="void"/>
  39778. </return-value>
  39779. <parameters>
  39780. <parameter name="iter" transfer-ownership="none">
  39781. <doc xml:space="preserve">a #GSequenceIter</doc>
  39782. <type name="SequenceIter" c:type="GSequenceIter*"/>
  39783. </parameter>
  39784. </parameters>
  39785. </function>
  39786. <function name="sequence_remove_range"
  39787. c:identifier="g_sequence_remove_range"
  39788. moved-to="Sequence.remove_range"
  39789. version="2.14">
  39790. <doc xml:space="preserve">Removes all items in the (@begin, @end) range.
  39791. If the sequence has a data destroy function associated with it, this
  39792. function is called on the data for the removed items.</doc>
  39793. <return-value transfer-ownership="none">
  39794. <type name="none" c:type="void"/>
  39795. </return-value>
  39796. <parameters>
  39797. <parameter name="begin" transfer-ownership="none">
  39798. <doc xml:space="preserve">a #GSequenceIter</doc>
  39799. <type name="SequenceIter" c:type="GSequenceIter*"/>
  39800. </parameter>
  39801. <parameter name="end" transfer-ownership="none">
  39802. <doc xml:space="preserve">a #GSequenceIter</doc>
  39803. <type name="SequenceIter" c:type="GSequenceIter*"/>
  39804. </parameter>
  39805. </parameters>
  39806. </function>
  39807. <function name="sequence_set"
  39808. c:identifier="g_sequence_set"
  39809. moved-to="Sequence.set"
  39810. version="2.14">
  39811. <doc xml:space="preserve">Changes the data for the item pointed to by @iter to be @data. If
  39812. the sequence has a data destroy function associated with it, that
  39813. function is called on the existing data that @iter pointed to.</doc>
  39814. <return-value transfer-ownership="none">
  39815. <type name="none" c:type="void"/>
  39816. </return-value>
  39817. <parameters>
  39818. <parameter name="iter" transfer-ownership="none">
  39819. <doc xml:space="preserve">a #GSequenceIter</doc>
  39820. <type name="SequenceIter" c:type="GSequenceIter*"/>
  39821. </parameter>
  39822. <parameter name="data"
  39823. transfer-ownership="none"
  39824. nullable="1"
  39825. allow-none="1">
  39826. <doc xml:space="preserve">new data for the item</doc>
  39827. <type name="gpointer" c:type="gpointer"/>
  39828. </parameter>
  39829. </parameters>
  39830. </function>
  39831. <function name="sequence_swap"
  39832. c:identifier="g_sequence_swap"
  39833. moved-to="Sequence.swap"
  39834. version="2.14">
  39835. <doc xml:space="preserve">Swaps the items pointed to by @a and @b. It is allowed for @a and @b
  39836. to point into difference sequences.</doc>
  39837. <return-value transfer-ownership="none">
  39838. <type name="none" c:type="void"/>
  39839. </return-value>
  39840. <parameters>
  39841. <parameter name="a" transfer-ownership="none">
  39842. <doc xml:space="preserve">a #GSequenceIter</doc>
  39843. <type name="SequenceIter" c:type="GSequenceIter*"/>
  39844. </parameter>
  39845. <parameter name="b" transfer-ownership="none">
  39846. <doc xml:space="preserve">a #GSequenceIter</doc>
  39847. <type name="SequenceIter" c:type="GSequenceIter*"/>
  39848. </parameter>
  39849. </parameters>
  39850. </function>
  39851. <function name="set_application_name"
  39852. c:identifier="g_set_application_name"
  39853. version="2.2">
  39854. <doc xml:space="preserve">Sets a human-readable name for the application. This name should be
  39855. localized if possible, and is intended for display to the user.
  39856. Contrast with g_set_prgname(), which sets a non-localized name.
  39857. g_set_prgname() will be called automatically by gtk_init(),
  39858. but g_set_application_name() will not.
  39859. Note that for thread safety reasons, this function can only
  39860. be called once.
  39861. The application name will be used in contexts such as error messages,
  39862. or when displaying an application's name in the task list.</doc>
  39863. <return-value transfer-ownership="none">
  39864. <type name="none" c:type="void"/>
  39865. </return-value>
  39866. <parameters>
  39867. <parameter name="application_name" transfer-ownership="none">
  39868. <doc xml:space="preserve">localized name of the application</doc>
  39869. <type name="utf8" c:type="const gchar*"/>
  39870. </parameter>
  39871. </parameters>
  39872. </function>
  39873. <function name="set_error" c:identifier="g_set_error" introspectable="0">
  39874. <doc xml:space="preserve">Does nothing if @err is %NULL; if @err is non-%NULL, then *@err
  39875. must be %NULL. A new #GError is created and assigned to *@err.</doc>
  39876. <return-value transfer-ownership="none">
  39877. <type name="none" c:type="void"/>
  39878. </return-value>
  39879. <parameters>
  39880. <parameter name="err"
  39881. direction="out"
  39882. caller-allocates="0"
  39883. transfer-ownership="full"
  39884. optional="1"
  39885. allow-none="1">
  39886. <doc xml:space="preserve">a return location for a #GError</doc>
  39887. <type name="Error" c:type="GError**"/>
  39888. </parameter>
  39889. <parameter name="domain" transfer-ownership="none">
  39890. <doc xml:space="preserve">error domain</doc>
  39891. <type name="Quark" c:type="GQuark"/>
  39892. </parameter>
  39893. <parameter name="code" transfer-ownership="none">
  39894. <doc xml:space="preserve">error code</doc>
  39895. <type name="gint" c:type="gint"/>
  39896. </parameter>
  39897. <parameter name="format" transfer-ownership="none">
  39898. <doc xml:space="preserve">printf()-style format</doc>
  39899. <type name="utf8" c:type="const gchar*"/>
  39900. </parameter>
  39901. <parameter name="..." transfer-ownership="none">
  39902. <doc xml:space="preserve">args for @format</doc>
  39903. <varargs/>
  39904. </parameter>
  39905. </parameters>
  39906. </function>
  39907. <function name="set_error_literal"
  39908. c:identifier="g_set_error_literal"
  39909. version="2.18">
  39910. <doc xml:space="preserve">Does nothing if @err is %NULL; if @err is non-%NULL, then *@err
  39911. must be %NULL. A new #GError is created and assigned to *@err.
  39912. Unlike g_set_error(), @message is not a printf()-style format string.
  39913. Use this function if @message contains text you don't have control over,
  39914. that could include printf() escape sequences.</doc>
  39915. <return-value transfer-ownership="none">
  39916. <type name="none" c:type="void"/>
  39917. </return-value>
  39918. <parameters>
  39919. <parameter name="err"
  39920. direction="out"
  39921. caller-allocates="0"
  39922. transfer-ownership="full"
  39923. optional="1"
  39924. allow-none="1">
  39925. <doc xml:space="preserve">a return location for a #GError</doc>
  39926. <type name="Error" c:type="GError**"/>
  39927. </parameter>
  39928. <parameter name="domain" transfer-ownership="none">
  39929. <doc xml:space="preserve">error domain</doc>
  39930. <type name="Quark" c:type="GQuark"/>
  39931. </parameter>
  39932. <parameter name="code" transfer-ownership="none">
  39933. <doc xml:space="preserve">error code</doc>
  39934. <type name="gint" c:type="gint"/>
  39935. </parameter>
  39936. <parameter name="message" transfer-ownership="none">
  39937. <doc xml:space="preserve">error message</doc>
  39938. <type name="utf8" c:type="const gchar*"/>
  39939. </parameter>
  39940. </parameters>
  39941. </function>
  39942. <function name="set_prgname" c:identifier="g_set_prgname">
  39943. <doc xml:space="preserve">Sets the name of the program. This name should not be localized,
  39944. in contrast to g_set_application_name().
  39945. Note that for thread-safety reasons this function can only be called once.</doc>
  39946. <return-value transfer-ownership="none">
  39947. <type name="none" c:type="void"/>
  39948. </return-value>
  39949. <parameters>
  39950. <parameter name="prgname" transfer-ownership="none">
  39951. <doc xml:space="preserve">the name of the program.</doc>
  39952. <type name="utf8" c:type="const gchar*"/>
  39953. </parameter>
  39954. </parameters>
  39955. </function>
  39956. <function name="set_print_handler"
  39957. c:identifier="g_set_print_handler"
  39958. introspectable="0">
  39959. <doc xml:space="preserve">Sets the print handler.
  39960. Any messages passed to g_print() will be output via
  39961. the new handler. The default handler simply outputs
  39962. the message to stdout. By providing your own handler
  39963. you can redirect the output, to a GTK+ widget or a
  39964. log file for example.</doc>
  39965. <return-value>
  39966. <doc xml:space="preserve">the old print handler</doc>
  39967. <type name="PrintFunc" c:type="GPrintFunc"/>
  39968. </return-value>
  39969. <parameters>
  39970. <parameter name="func" transfer-ownership="none">
  39971. <doc xml:space="preserve">the new print handler</doc>
  39972. <type name="PrintFunc" c:type="GPrintFunc"/>
  39973. </parameter>
  39974. </parameters>
  39975. </function>
  39976. <function name="set_printerr_handler"
  39977. c:identifier="g_set_printerr_handler"
  39978. introspectable="0">
  39979. <doc xml:space="preserve">Sets the handler for printing error messages.
  39980. Any messages passed to g_printerr() will be output via
  39981. the new handler. The default handler simply outputs the
  39982. message to stderr. By providing your own handler you can
  39983. redirect the output, to a GTK+ widget or a log file for
  39984. example.</doc>
  39985. <return-value>
  39986. <doc xml:space="preserve">the old error message handler</doc>
  39987. <type name="PrintFunc" c:type="GPrintFunc"/>
  39988. </return-value>
  39989. <parameters>
  39990. <parameter name="func" transfer-ownership="none">
  39991. <doc xml:space="preserve">the new error message handler</doc>
  39992. <type name="PrintFunc" c:type="GPrintFunc"/>
  39993. </parameter>
  39994. </parameters>
  39995. </function>
  39996. <function name="setenv" c:identifier="g_setenv" version="2.4">
  39997. <doc xml:space="preserve">Sets an environment variable. On UNIX, both the variable's name and
  39998. value can be arbitrary byte strings, except that the variable's name
  39999. cannot contain '='. On Windows, they should be in UTF-8.
  40000. Note that on some systems, when variables are overwritten, the memory
  40001. used for the previous variables and its value isn't reclaimed.
  40002. You should be mindful of the fact that environment variable handling
  40003. in UNIX is not thread-safe, and your program may crash if one thread
  40004. calls g_setenv() while another thread is calling getenv(). (And note
  40005. that many functions, such as gettext(), call getenv() internally.)
  40006. This function is only safe to use at the very start of your program,
  40007. before creating any other threads (or creating objects that create
  40008. worker threads of their own).
  40009. If you need to set up the environment for a child process, you can
  40010. use g_get_environ() to get an environment array, modify that with
  40011. g_environ_setenv() and g_environ_unsetenv(), and then pass that
  40012. array directly to execvpe(), g_spawn_async(), or the like.</doc>
  40013. <return-value transfer-ownership="none">
  40014. <doc xml:space="preserve">%FALSE if the environment variable couldn't be set.</doc>
  40015. <type name="gboolean" c:type="gboolean"/>
  40016. </return-value>
  40017. <parameters>
  40018. <parameter name="variable" transfer-ownership="none">
  40019. <doc xml:space="preserve">the environment variable to set, must not contain '='.</doc>
  40020. <type name="utf8" c:type="const gchar*"/>
  40021. </parameter>
  40022. <parameter name="value" transfer-ownership="none">
  40023. <doc xml:space="preserve">the value for to set the variable to.</doc>
  40024. <type name="utf8" c:type="const gchar*"/>
  40025. </parameter>
  40026. <parameter name="overwrite" transfer-ownership="none">
  40027. <doc xml:space="preserve">whether to change the variable if it already exists.</doc>
  40028. <type name="gboolean" c:type="gboolean"/>
  40029. </parameter>
  40030. </parameters>
  40031. </function>
  40032. <function name="shell_error_quark" c:identifier="g_shell_error_quark">
  40033. <return-value transfer-ownership="none">
  40034. <type name="Quark" c:type="GQuark"/>
  40035. </return-value>
  40036. </function>
  40037. <function name="shell_parse_argv"
  40038. c:identifier="g_shell_parse_argv"
  40039. throws="1">
  40040. <doc xml:space="preserve">Parses a command line into an argument vector, in much the same way
  40041. the shell would, but without many of the expansions the shell would
  40042. perform (variable expansion, globs, operators, filename expansion,
  40043. etc. are not supported). The results are defined to be the same as
  40044. those you would get from a UNIX98 /bin/sh, as long as the input
  40045. contains none of the unsupported shell expansions. If the input
  40046. does contain such expansions, they are passed through
  40047. literally. Possible errors are those from the #G_SHELL_ERROR
  40048. domain. Free the returned vector with g_strfreev().</doc>
  40049. <return-value transfer-ownership="none">
  40050. <doc xml:space="preserve">%TRUE on success, %FALSE if error set</doc>
  40051. <type name="gboolean" c:type="gboolean"/>
  40052. </return-value>
  40053. <parameters>
  40054. <parameter name="command_line" transfer-ownership="none">
  40055. <doc xml:space="preserve">command line to parse</doc>
  40056. <type name="utf8" c:type="const gchar*"/>
  40057. </parameter>
  40058. <parameter name="argcp"
  40059. direction="out"
  40060. caller-allocates="0"
  40061. transfer-ownership="full"
  40062. optional="1"
  40063. allow-none="1">
  40064. <doc xml:space="preserve">return location for number of args</doc>
  40065. <type name="gint" c:type="gint*"/>
  40066. </parameter>
  40067. <parameter name="argvp"
  40068. direction="out"
  40069. caller-allocates="0"
  40070. transfer-ownership="full"
  40071. optional="1"
  40072. allow-none="1">
  40073. <doc xml:space="preserve">return
  40074. location for array of args</doc>
  40075. <array length="1" zero-terminated="1" c:type="gchar***">
  40076. <type name="utf8" c:type="gchar**"/>
  40077. </array>
  40078. </parameter>
  40079. </parameters>
  40080. </function>
  40081. <function name="shell_quote" c:identifier="g_shell_quote">
  40082. <doc xml:space="preserve">Quotes a string so that the shell (/bin/sh) will interpret the
  40083. quoted string to mean @unquoted_string. If you pass a filename to
  40084. the shell, for example, you should first quote it with this
  40085. function. The return value must be freed with g_free(). The
  40086. quoting style used is undefined (single or double quotes may be
  40087. used).</doc>
  40088. <return-value transfer-ownership="full">
  40089. <doc xml:space="preserve">quoted string</doc>
  40090. <type name="utf8" c:type="gchar*"/>
  40091. </return-value>
  40092. <parameters>
  40093. <parameter name="unquoted_string" transfer-ownership="none">
  40094. <doc xml:space="preserve">a literal string</doc>
  40095. <type name="utf8" c:type="const gchar*"/>
  40096. </parameter>
  40097. </parameters>
  40098. </function>
  40099. <function name="shell_unquote" c:identifier="g_shell_unquote" throws="1">
  40100. <doc xml:space="preserve">Unquotes a string as the shell (/bin/sh) would. Only handles
  40101. quotes; if a string contains file globs, arithmetic operators,
  40102. variables, backticks, redirections, or other special-to-the-shell
  40103. features, the result will be different from the result a real shell
  40104. would produce (the variables, backticks, etc. will be passed
  40105. through literally instead of being expanded). This function is
  40106. guaranteed to succeed if applied to the result of
  40107. g_shell_quote(). If it fails, it returns %NULL and sets the
  40108. error. The @quoted_string need not actually contain quoted or
  40109. escaped text; g_shell_unquote() simply goes through the string and
  40110. unquotes/unescapes anything that the shell would. Both single and
  40111. double quotes are handled, as are escapes including escaped
  40112. newlines. The return value must be freed with g_free(). Possible
  40113. errors are in the #G_SHELL_ERROR domain.
  40114. Shell quoting rules are a bit strange. Single quotes preserve the
  40115. literal string exactly. escape sequences are not allowed; not even
  40116. \' - if you want a ' in the quoted text, you have to do something
  40117. like 'foo'\''bar'. Double quotes allow $, `, ", \, and newline to
  40118. be escaped with backslash. Otherwise double quotes preserve things
  40119. literally.</doc>
  40120. <return-value transfer-ownership="full">
  40121. <doc xml:space="preserve">an unquoted string</doc>
  40122. <type name="utf8" c:type="gchar*"/>
  40123. </return-value>
  40124. <parameters>
  40125. <parameter name="quoted_string" transfer-ownership="none">
  40126. <doc xml:space="preserve">shell-quoted string</doc>
  40127. <type name="utf8" c:type="const gchar*"/>
  40128. </parameter>
  40129. </parameters>
  40130. </function>
  40131. <function name="slice_alloc" c:identifier="g_slice_alloc" version="2.10">
  40132. <doc xml:space="preserve">Allocates a block of memory from the slice allocator.
  40133. The block adress handed out can be expected to be aligned
  40134. to at least 1 * sizeof (void*),
  40135. though in general slices are 2 * sizeof (void*) bytes aligned,
  40136. if a malloc() fallback implementation is used instead,
  40137. the alignment may be reduced in a libc dependent fashion.
  40138. Note that the underlying slice allocation mechanism can
  40139. be changed with the [`G_SLICE=always-malloc`][G_SLICE]
  40140. environment variable.</doc>
  40141. <return-value transfer-ownership="none" nullable="1">
  40142. <doc xml:space="preserve">a pointer to the allocated memory block, which will be %NULL if and
  40143. only if @mem_size is 0</doc>
  40144. <type name="gpointer" c:type="gpointer"/>
  40145. </return-value>
  40146. <parameters>
  40147. <parameter name="block_size" transfer-ownership="none">
  40148. <doc xml:space="preserve">the number of bytes to allocate</doc>
  40149. <type name="gsize" c:type="gsize"/>
  40150. </parameter>
  40151. </parameters>
  40152. </function>
  40153. <function name="slice_alloc0" c:identifier="g_slice_alloc0" version="2.10">
  40154. <doc xml:space="preserve">Allocates a block of memory via g_slice_alloc() and initializes
  40155. the returned memory to 0. Note that the underlying slice allocation
  40156. mechanism can be changed with the [`G_SLICE=always-malloc`][G_SLICE]
  40157. environment variable.</doc>
  40158. <return-value transfer-ownership="none" nullable="1">
  40159. <doc xml:space="preserve">a pointer to the allocated block, which will be %NULL if and only
  40160. if @mem_size is 0</doc>
  40161. <type name="gpointer" c:type="gpointer"/>
  40162. </return-value>
  40163. <parameters>
  40164. <parameter name="block_size" transfer-ownership="none">
  40165. <doc xml:space="preserve">the number of bytes to allocate</doc>
  40166. <type name="gsize" c:type="gsize"/>
  40167. </parameter>
  40168. </parameters>
  40169. </function>
  40170. <function name="slice_copy" c:identifier="g_slice_copy" version="2.14">
  40171. <doc xml:space="preserve">Allocates a block of memory from the slice allocator
  40172. and copies @block_size bytes into it from @mem_block.
  40173. @mem_block must be non-%NULL if @block_size is non-zero.</doc>
  40174. <return-value transfer-ownership="none" nullable="1">
  40175. <doc xml:space="preserve">a pointer to the allocated memory block, which will be %NULL if and
  40176. only if @mem_size is 0</doc>
  40177. <type name="gpointer" c:type="gpointer"/>
  40178. </return-value>
  40179. <parameters>
  40180. <parameter name="block_size" transfer-ownership="none">
  40181. <doc xml:space="preserve">the number of bytes to allocate</doc>
  40182. <type name="gsize" c:type="gsize"/>
  40183. </parameter>
  40184. <parameter name="mem_block"
  40185. transfer-ownership="none"
  40186. nullable="1"
  40187. allow-none="1">
  40188. <doc xml:space="preserve">the memory to copy</doc>
  40189. <type name="gpointer" c:type="gconstpointer"/>
  40190. </parameter>
  40191. </parameters>
  40192. </function>
  40193. <function name="slice_free1" c:identifier="g_slice_free1" version="2.10">
  40194. <doc xml:space="preserve">Frees a block of memory.
  40195. The memory must have been allocated via g_slice_alloc() or
  40196. g_slice_alloc0() and the @block_size has to match the size
  40197. specified upon allocation. Note that the exact release behaviour
  40198. can be changed with the [`G_DEBUG=gc-friendly`][G_DEBUG] environment
  40199. variable, also see [`G_SLICE`][G_SLICE] for related debugging options.
  40200. If @mem_block is %NULL, this function does nothing.</doc>
  40201. <return-value transfer-ownership="none">
  40202. <type name="none" c:type="void"/>
  40203. </return-value>
  40204. <parameters>
  40205. <parameter name="block_size" transfer-ownership="none">
  40206. <doc xml:space="preserve">the size of the block</doc>
  40207. <type name="gsize" c:type="gsize"/>
  40208. </parameter>
  40209. <parameter name="mem_block"
  40210. transfer-ownership="none"
  40211. nullable="1"
  40212. allow-none="1">
  40213. <doc xml:space="preserve">a pointer to the block to free</doc>
  40214. <type name="gpointer" c:type="gpointer"/>
  40215. </parameter>
  40216. </parameters>
  40217. </function>
  40218. <function name="slice_free_chain_with_offset"
  40219. c:identifier="g_slice_free_chain_with_offset"
  40220. version="2.10">
  40221. <doc xml:space="preserve">Frees a linked list of memory blocks of structure type @type.
  40222. The memory blocks must be equal-sized, allocated via
  40223. g_slice_alloc() or g_slice_alloc0() and linked together by a
  40224. @next pointer (similar to #GSList). The offset of the @next
  40225. field in each block is passed as third argument.
  40226. Note that the exact release behaviour can be changed with the
  40227. [`G_DEBUG=gc-friendly`][G_DEBUG] environment variable, also see
  40228. [`G_SLICE`][G_SLICE] for related debugging options.
  40229. If @mem_chain is %NULL, this function does nothing.</doc>
  40230. <return-value transfer-ownership="none">
  40231. <type name="none" c:type="void"/>
  40232. </return-value>
  40233. <parameters>
  40234. <parameter name="block_size" transfer-ownership="none">
  40235. <doc xml:space="preserve">the size of the blocks</doc>
  40236. <type name="gsize" c:type="gsize"/>
  40237. </parameter>
  40238. <parameter name="mem_chain"
  40239. transfer-ownership="none"
  40240. nullable="1"
  40241. allow-none="1">
  40242. <doc xml:space="preserve">a pointer to the first block of the chain</doc>
  40243. <type name="gpointer" c:type="gpointer"/>
  40244. </parameter>
  40245. <parameter name="next_offset" transfer-ownership="none">
  40246. <doc xml:space="preserve">the offset of the @next field in the blocks</doc>
  40247. <type name="gsize" c:type="gsize"/>
  40248. </parameter>
  40249. </parameters>
  40250. </function>
  40251. <function name="slice_get_config" c:identifier="g_slice_get_config">
  40252. <return-value transfer-ownership="none">
  40253. <type name="gint64" c:type="gint64"/>
  40254. </return-value>
  40255. <parameters>
  40256. <parameter name="ckey" transfer-ownership="none">
  40257. <type name="SliceConfig" c:type="GSliceConfig"/>
  40258. </parameter>
  40259. </parameters>
  40260. </function>
  40261. <function name="slice_get_config_state"
  40262. c:identifier="g_slice_get_config_state">
  40263. <return-value transfer-ownership="none">
  40264. <type name="gint64" c:type="gint64*"/>
  40265. </return-value>
  40266. <parameters>
  40267. <parameter name="ckey" transfer-ownership="none">
  40268. <type name="SliceConfig" c:type="GSliceConfig"/>
  40269. </parameter>
  40270. <parameter name="address" transfer-ownership="none">
  40271. <type name="gint64" c:type="gint64"/>
  40272. </parameter>
  40273. <parameter name="n_values" transfer-ownership="none">
  40274. <type name="guint" c:type="guint*"/>
  40275. </parameter>
  40276. </parameters>
  40277. </function>
  40278. <function name="slice_set_config" c:identifier="g_slice_set_config">
  40279. <return-value transfer-ownership="none">
  40280. <type name="none" c:type="void"/>
  40281. </return-value>
  40282. <parameters>
  40283. <parameter name="ckey" transfer-ownership="none">
  40284. <type name="SliceConfig" c:type="GSliceConfig"/>
  40285. </parameter>
  40286. <parameter name="value" transfer-ownership="none">
  40287. <type name="gint64" c:type="gint64"/>
  40288. </parameter>
  40289. </parameters>
  40290. </function>
  40291. <function name="snprintf" c:identifier="g_snprintf" introspectable="0">
  40292. <doc xml:space="preserve">A safer form of the standard sprintf() function. The output is guaranteed
  40293. to not exceed @n characters (including the terminating nul character), so
  40294. it is easy to ensure that a buffer overflow cannot occur.
  40295. See also g_strdup_printf().
  40296. In versions of GLib prior to 1.2.3, this function may return -1 if the
  40297. output was truncated, and the truncated string may not be nul-terminated.
  40298. In versions prior to 1.3.12, this function returns the length of the output
  40299. string.
  40300. The return value of g_snprintf() conforms to the snprintf()
  40301. function as standardized in ISO C99. Note that this is different from
  40302. traditional snprintf(), which returns the length of the output string.
  40303. The format string may contain positional parameters, as specified in
  40304. the Single Unix Specification.</doc>
  40305. <return-value transfer-ownership="none">
  40306. <doc xml:space="preserve">the number of bytes which would be produced if the buffer
  40307. was large enough.</doc>
  40308. <type name="gint" c:type="gint"/>
  40309. </return-value>
  40310. <parameters>
  40311. <parameter name="string" transfer-ownership="none">
  40312. <doc xml:space="preserve">the buffer to hold the output.</doc>
  40313. <type name="utf8" c:type="gchar*"/>
  40314. </parameter>
  40315. <parameter name="n" transfer-ownership="none">
  40316. <doc xml:space="preserve">the maximum number of bytes to produce (including the
  40317. terminating nul character).</doc>
  40318. <type name="gulong" c:type="gulong"/>
  40319. </parameter>
  40320. <parameter name="format" transfer-ownership="none">
  40321. <doc xml:space="preserve">a standard printf() format string, but notice
  40322. [string precision pitfalls][string-precision]</doc>
  40323. <type name="utf8" c:type="gchar*"/>
  40324. </parameter>
  40325. <parameter name="..." transfer-ownership="none">
  40326. <doc xml:space="preserve">the arguments to insert in the output.</doc>
  40327. <varargs/>
  40328. </parameter>
  40329. </parameters>
  40330. </function>
  40331. <function name="source_remove"
  40332. c:identifier="g_source_remove"
  40333. moved-to="Source.remove">
  40334. <doc xml:space="preserve">Removes the source with the given id from the default main context.
  40335. The id of a #GSource is given by g_source_get_id(), or will be
  40336. returned by the functions g_source_attach(), g_idle_add(),
  40337. g_idle_add_full(), g_timeout_add(), g_timeout_add_full(),
  40338. g_child_watch_add(), g_child_watch_add_full(), g_io_add_watch(), and
  40339. g_io_add_watch_full().
  40340. See also g_source_destroy(). You must use g_source_destroy() for sources
  40341. added to a non-default main context.
  40342. It is a programmer error to attempt to remove a non-existent source.
  40343. More specifically: source IDs can be reissued after a source has been
  40344. destroyed and therefore it is never valid to use this function with a
  40345. source ID which may have already been removed. An example is when
  40346. scheduling an idle to run in another thread with g_idle_add(): the
  40347. idle may already have run and been removed by the time this function
  40348. is called on its (now invalid) source ID. This source ID may have
  40349. been reissued, leading to the operation being performed against the
  40350. wrong source.</doc>
  40351. <return-value transfer-ownership="none">
  40352. <doc xml:space="preserve">For historical reasons, this function always returns %TRUE</doc>
  40353. <type name="gboolean" c:type="gboolean"/>
  40354. </return-value>
  40355. <parameters>
  40356. <parameter name="tag" transfer-ownership="none">
  40357. <doc xml:space="preserve">the ID of the source to remove.</doc>
  40358. <type name="guint" c:type="guint"/>
  40359. </parameter>
  40360. </parameters>
  40361. </function>
  40362. <function name="source_remove_by_funcs_user_data"
  40363. c:identifier="g_source_remove_by_funcs_user_data"
  40364. moved-to="Source.remove_by_funcs_user_data">
  40365. <doc xml:space="preserve">Removes a source from the default main loop context given the
  40366. source functions and user data. If multiple sources exist with the
  40367. same source functions and user data, only one will be destroyed.</doc>
  40368. <return-value transfer-ownership="none">
  40369. <doc xml:space="preserve">%TRUE if a source was found and removed.</doc>
  40370. <type name="gboolean" c:type="gboolean"/>
  40371. </return-value>
  40372. <parameters>
  40373. <parameter name="funcs" transfer-ownership="none">
  40374. <doc xml:space="preserve">The @source_funcs passed to g_source_new()</doc>
  40375. <type name="SourceFuncs" c:type="GSourceFuncs*"/>
  40376. </parameter>
  40377. <parameter name="user_data"
  40378. transfer-ownership="none"
  40379. nullable="1"
  40380. allow-none="1">
  40381. <doc xml:space="preserve">the user data for the callback</doc>
  40382. <type name="gpointer" c:type="gpointer"/>
  40383. </parameter>
  40384. </parameters>
  40385. </function>
  40386. <function name="source_remove_by_user_data"
  40387. c:identifier="g_source_remove_by_user_data"
  40388. moved-to="Source.remove_by_user_data">
  40389. <doc xml:space="preserve">Removes a source from the default main loop context given the user
  40390. data for the callback. If multiple sources exist with the same user
  40391. data, only one will be destroyed.</doc>
  40392. <return-value transfer-ownership="none">
  40393. <doc xml:space="preserve">%TRUE if a source was found and removed.</doc>
  40394. <type name="gboolean" c:type="gboolean"/>
  40395. </return-value>
  40396. <parameters>
  40397. <parameter name="user_data"
  40398. transfer-ownership="none"
  40399. nullable="1"
  40400. allow-none="1">
  40401. <doc xml:space="preserve">the user_data for the callback.</doc>
  40402. <type name="gpointer" c:type="gpointer"/>
  40403. </parameter>
  40404. </parameters>
  40405. </function>
  40406. <function name="source_set_name_by_id"
  40407. c:identifier="g_source_set_name_by_id"
  40408. moved-to="Source.set_name_by_id"
  40409. version="2.26">
  40410. <doc xml:space="preserve">Sets the name of a source using its ID.
  40411. This is a convenience utility to set source names from the return
  40412. value of g_idle_add(), g_timeout_add(), etc.
  40413. It is a programmer error to attempt to set the name of a non-existent
  40414. source.
  40415. More specifically: source IDs can be reissued after a source has been
  40416. destroyed and therefore it is never valid to use this function with a
  40417. source ID which may have already been removed. An example is when
  40418. scheduling an idle to run in another thread with g_idle_add(): the
  40419. idle may already have run and been removed by the time this function
  40420. is called on its (now invalid) source ID. This source ID may have
  40421. been reissued, leading to the operation being performed against the
  40422. wrong source.</doc>
  40423. <return-value transfer-ownership="none">
  40424. <type name="none" c:type="void"/>
  40425. </return-value>
  40426. <parameters>
  40427. <parameter name="tag" transfer-ownership="none">
  40428. <doc xml:space="preserve">a #GSource ID</doc>
  40429. <type name="guint" c:type="guint"/>
  40430. </parameter>
  40431. <parameter name="name" transfer-ownership="none">
  40432. <doc xml:space="preserve">debug name for the source</doc>
  40433. <type name="utf8" c:type="const char*"/>
  40434. </parameter>
  40435. </parameters>
  40436. </function>
  40437. <function name="spaced_primes_closest"
  40438. c:identifier="g_spaced_primes_closest">
  40439. <doc xml:space="preserve">Gets the smallest prime number from a built-in array of primes which
  40440. is larger than @num. This is used within GLib to calculate the optimum
  40441. size of a #GHashTable.
  40442. The built-in array of primes ranges from 11 to 13845163 such that
  40443. each prime is approximately 1.5-2 times the previous prime.</doc>
  40444. <return-value transfer-ownership="none">
  40445. <doc xml:space="preserve">the smallest prime number from a built-in array of primes
  40446. which is larger than @num</doc>
  40447. <type name="guint" c:type="guint"/>
  40448. </return-value>
  40449. <parameters>
  40450. <parameter name="num" transfer-ownership="none">
  40451. <doc xml:space="preserve">a #guint</doc>
  40452. <type name="guint" c:type="guint"/>
  40453. </parameter>
  40454. </parameters>
  40455. </function>
  40456. <function name="spawn_async" c:identifier="g_spawn_async" throws="1">
  40457. <doc xml:space="preserve">See g_spawn_async_with_pipes() for a full description; this function
  40458. simply calls the g_spawn_async_with_pipes() without any pipes.
  40459. You should call g_spawn_close_pid() on the returned child process
  40460. reference when you don't need it any more.
  40461. If you are writing a GTK+ application, and the program you are
  40462. spawning is a graphical application, too, then you may want to
  40463. use gdk_spawn_on_screen() instead to ensure that the spawned program
  40464. opens its windows on the right screen.
  40465. Note that the returned @child_pid on Windows is a handle to the child
  40466. process and not its identifier. Process handles and process identifiers
  40467. are different concepts on Windows.</doc>
  40468. <return-value transfer-ownership="none">
  40469. <doc xml:space="preserve">%TRUE on success, %FALSE if error is set</doc>
  40470. <type name="gboolean" c:type="gboolean"/>
  40471. </return-value>
  40472. <parameters>
  40473. <parameter name="working_directory"
  40474. transfer-ownership="none"
  40475. nullable="1"
  40476. allow-none="1">
  40477. <doc xml:space="preserve">child's current working directory, or %NULL to inherit parent's</doc>
  40478. <type name="utf8" c:type="const gchar*"/>
  40479. </parameter>
  40480. <parameter name="argv" transfer-ownership="none">
  40481. <doc xml:space="preserve">child's argument vector</doc>
  40482. <array c:type="gchar**">
  40483. <type name="utf8" c:type="gchar*"/>
  40484. </array>
  40485. </parameter>
  40486. <parameter name="envp"
  40487. transfer-ownership="none"
  40488. nullable="1"
  40489. allow-none="1">
  40490. <doc xml:space="preserve">child's environment, or %NULL to inherit parent's</doc>
  40491. <array c:type="gchar**">
  40492. <type name="utf8" c:type="gchar*"/>
  40493. </array>
  40494. </parameter>
  40495. <parameter name="flags" transfer-ownership="none">
  40496. <doc xml:space="preserve">flags from #GSpawnFlags</doc>
  40497. <type name="SpawnFlags" c:type="GSpawnFlags"/>
  40498. </parameter>
  40499. <parameter name="child_setup"
  40500. transfer-ownership="none"
  40501. nullable="1"
  40502. allow-none="1"
  40503. scope="async"
  40504. closure="5">
  40505. <doc xml:space="preserve">function to run in the child just before exec()</doc>
  40506. <type name="SpawnChildSetupFunc" c:type="GSpawnChildSetupFunc"/>
  40507. </parameter>
  40508. <parameter name="user_data"
  40509. transfer-ownership="none"
  40510. nullable="1"
  40511. allow-none="1">
  40512. <doc xml:space="preserve">user data for @child_setup</doc>
  40513. <type name="gpointer" c:type="gpointer"/>
  40514. </parameter>
  40515. <parameter name="child_pid"
  40516. direction="out"
  40517. caller-allocates="0"
  40518. transfer-ownership="full"
  40519. optional="1"
  40520. allow-none="1">
  40521. <doc xml:space="preserve">return location for child process reference, or %NULL</doc>
  40522. <type name="Pid" c:type="GPid*"/>
  40523. </parameter>
  40524. </parameters>
  40525. </function>
  40526. <function name="spawn_async_with_pipes"
  40527. c:identifier="g_spawn_async_with_pipes"
  40528. throws="1">
  40529. <doc xml:space="preserve">Executes a child program asynchronously (your program will not
  40530. block waiting for the child to exit). The child program is
  40531. specified by the only argument that must be provided, @argv.
  40532. @argv should be a %NULL-terminated array of strings, to be passed
  40533. as the argument vector for the child. The first string in @argv
  40534. is of course the name of the program to execute. By default, the
  40535. name of the program must be a full path. If @flags contains the
  40536. %G_SPAWN_SEARCH_PATH flag, the `PATH` environment variable is
  40537. used to search for the executable. If @flags contains the
  40538. %G_SPAWN_SEARCH_PATH_FROM_ENVP flag, the `PATH` variable from
  40539. @envp is used to search for the executable. If both the
  40540. %G_SPAWN_SEARCH_PATH and %G_SPAWN_SEARCH_PATH_FROM_ENVP flags
  40541. are set, the `PATH` variable from @envp takes precedence over
  40542. the environment variable.
  40543. If the program name is not a full path and %G_SPAWN_SEARCH_PATH flag is not
  40544. used, then the program will be run from the current directory (or
  40545. @working_directory, if specified); this might be unexpected or even
  40546. dangerous in some cases when the current directory is world-writable.
  40547. On Windows, note that all the string or string vector arguments to
  40548. this function and the other g_spawn*() functions are in UTF-8, the
  40549. GLib file name encoding. Unicode characters that are not part of
  40550. the system codepage passed in these arguments will be correctly
  40551. available in the spawned program only if it uses wide character API
  40552. to retrieve its command line. For C programs built with Microsoft's
  40553. tools it is enough to make the program have a wmain() instead of
  40554. main(). wmain() has a wide character argument vector as parameter.
  40555. At least currently, mingw doesn't support wmain(), so if you use
  40556. mingw to develop the spawned program, it should call
  40557. g_win32_get_command_line() to get arguments in UTF-8.
  40558. On Windows the low-level child process creation API CreateProcess()
  40559. doesn't use argument vectors, but a command line. The C runtime
  40560. library's spawn*() family of functions (which g_spawn_async_with_pipes()
  40561. eventually calls) paste the argument vector elements together into
  40562. a command line, and the C runtime startup code does a corresponding
  40563. reconstruction of an argument vector from the command line, to be
  40564. passed to main(). Complications arise when you have argument vector
  40565. elements that contain spaces of double quotes. The spawn*() functions
  40566. don't do any quoting or escaping, but on the other hand the startup
  40567. code does do unquoting and unescaping in order to enable receiving
  40568. arguments with embedded spaces or double quotes. To work around this
  40569. asymmetry, g_spawn_async_with_pipes() will do quoting and escaping on
  40570. argument vector elements that need it before calling the C runtime
  40571. spawn() function.
  40572. The returned @child_pid on Windows is a handle to the child
  40573. process, not its identifier. Process handles and process
  40574. identifiers are different concepts on Windows.
  40575. @envp is a %NULL-terminated array of strings, where each string
  40576. has the form `KEY=VALUE`. This will become the child's environment.
  40577. If @envp is %NULL, the child inherits its parent's environment.
  40578. @flags should be the bitwise OR of any flags you want to affect the
  40579. function's behaviour. The %G_SPAWN_DO_NOT_REAP_CHILD means that the
  40580. child will not automatically be reaped; you must use a child watch to
  40581. be notified about the death of the child process. Eventually you must
  40582. call g_spawn_close_pid() on the @child_pid, in order to free
  40583. resources which may be associated with the child process. (On Unix,
  40584. using a child watch is equivalent to calling waitpid() or handling
  40585. the %SIGCHLD signal manually. On Windows, calling g_spawn_close_pid()
  40586. is equivalent to calling CloseHandle() on the process handle returned
  40587. in @child_pid). See g_child_watch_add().
  40588. %G_SPAWN_LEAVE_DESCRIPTORS_OPEN means that the parent's open file
  40589. descriptors will be inherited by the child; otherwise all descriptors
  40590. except stdin/stdout/stderr will be closed before calling exec() in
  40591. the child. %G_SPAWN_SEARCH_PATH means that @argv[0] need not be an
  40592. absolute path, it will be looked for in the `PATH` environment
  40593. variable. %G_SPAWN_SEARCH_PATH_FROM_ENVP means need not be an
  40594. absolute path, it will be looked for in the `PATH` variable from
  40595. @envp. If both %G_SPAWN_SEARCH_PATH and %G_SPAWN_SEARCH_PATH_FROM_ENVP
  40596. are used, the value from @envp takes precedence over the environment.
  40597. %G_SPAWN_STDOUT_TO_DEV_NULL means that the child's standard output
  40598. will be discarded, instead of going to the same location as the parent's
  40599. standard output. If you use this flag, @standard_output must be %NULL.
  40600. %G_SPAWN_STDERR_TO_DEV_NULL means that the child's standard error
  40601. will be discarded, instead of going to the same location as the parent's
  40602. standard error. If you use this flag, @standard_error must be %NULL.
  40603. %G_SPAWN_CHILD_INHERITS_STDIN means that the child will inherit the parent's
  40604. standard input (by default, the child's standard input is attached to
  40605. /dev/null). If you use this flag, @standard_input must be %NULL.
  40606. %G_SPAWN_FILE_AND_ARGV_ZERO means that the first element of @argv is
  40607. the file to execute, while the remaining elements are the actual
  40608. argument vector to pass to the file. Normally g_spawn_async_with_pipes()
  40609. uses @argv[0] as the file to execute, and passes all of @argv to the child.
  40610. @child_setup and @user_data are a function and user data. On POSIX
  40611. platforms, the function is called in the child after GLib has
  40612. performed all the setup it plans to perform (including creating
  40613. pipes, closing file descriptors, etc.) but before calling exec().
  40614. That is, @child_setup is called just before calling exec() in the
  40615. child. Obviously actions taken in this function will only affect
  40616. the child, not the parent.
  40617. On Windows, there is no separate fork() and exec() functionality.
  40618. Child processes are created and run with a single API call,
  40619. CreateProcess(). There is no sensible thing @child_setup
  40620. could be used for on Windows so it is ignored and not called.
  40621. If non-%NULL, @child_pid will on Unix be filled with the child's
  40622. process ID. You can use the process ID to send signals to the child,
  40623. or to use g_child_watch_add() (or waitpid()) if you specified the
  40624. %G_SPAWN_DO_NOT_REAP_CHILD flag. On Windows, @child_pid will be
  40625. filled with a handle to the child process only if you specified the
  40626. %G_SPAWN_DO_NOT_REAP_CHILD flag. You can then access the child
  40627. process using the Win32 API, for example wait for its termination
  40628. with the WaitFor*() functions, or examine its exit code with
  40629. GetExitCodeProcess(). You should close the handle with CloseHandle()
  40630. or g_spawn_close_pid() when you no longer need it.
  40631. If non-%NULL, the @standard_input, @standard_output, @standard_error
  40632. locations will be filled with file descriptors for writing to the child's
  40633. standard input or reading from its standard output or standard error.
  40634. The caller of g_spawn_async_with_pipes() must close these file descriptors
  40635. when they are no longer in use. If these parameters are %NULL, the
  40636. corresponding pipe won't be created.
  40637. If @standard_input is NULL, the child's standard input is attached to
  40638. /dev/null unless %G_SPAWN_CHILD_INHERITS_STDIN is set.
  40639. If @standard_error is NULL, the child's standard error goes to the same
  40640. location as the parent's standard error unless %G_SPAWN_STDERR_TO_DEV_NULL
  40641. is set.
  40642. If @standard_output is NULL, the child's standard output goes to the same
  40643. location as the parent's standard output unless %G_SPAWN_STDOUT_TO_DEV_NULL
  40644. is set.
  40645. @error can be %NULL to ignore errors, or non-%NULL to report errors.
  40646. If an error is set, the function returns %FALSE. Errors are reported
  40647. even if they occur in the child (for example if the executable in
  40648. @argv[0] is not found). Typically the `message` field of returned
  40649. errors should be displayed to users. Possible errors are those from
  40650. the #G_SPAWN_ERROR domain.
  40651. If an error occurs, @child_pid, @standard_input, @standard_output,
  40652. and @standard_error will not be filled with valid values.
  40653. If @child_pid is not %NULL and an error does not occur then the returned
  40654. process reference must be closed using g_spawn_close_pid().
  40655. If you are writing a GTK+ application, and the program you
  40656. are spawning is a graphical application, too, then you may
  40657. want to use gdk_spawn_on_screen_with_pipes() instead to ensure that
  40658. the spawned program opens its windows on the right screen.</doc>
  40659. <return-value transfer-ownership="none">
  40660. <doc xml:space="preserve">%TRUE on success, %FALSE if an error was set</doc>
  40661. <type name="gboolean" c:type="gboolean"/>
  40662. </return-value>
  40663. <parameters>
  40664. <parameter name="working_directory"
  40665. transfer-ownership="none"
  40666. nullable="1"
  40667. allow-none="1">
  40668. <doc xml:space="preserve">child's current working directory, or %NULL to inherit parent's, in the GLib file name encoding</doc>
  40669. <type name="utf8" c:type="const gchar*"/>
  40670. </parameter>
  40671. <parameter name="argv" transfer-ownership="none">
  40672. <doc xml:space="preserve">child's argument vector, in the GLib file name encoding</doc>
  40673. <array c:type="gchar**">
  40674. <type name="utf8" c:type="gchar*"/>
  40675. </array>
  40676. </parameter>
  40677. <parameter name="envp"
  40678. transfer-ownership="none"
  40679. nullable="1"
  40680. allow-none="1">
  40681. <doc xml:space="preserve">child's environment, or %NULL to inherit parent's, in the GLib file name encoding</doc>
  40682. <array c:type="gchar**">
  40683. <type name="utf8" c:type="gchar*"/>
  40684. </array>
  40685. </parameter>
  40686. <parameter name="flags" transfer-ownership="none">
  40687. <doc xml:space="preserve">flags from #GSpawnFlags</doc>
  40688. <type name="SpawnFlags" c:type="GSpawnFlags"/>
  40689. </parameter>
  40690. <parameter name="child_setup"
  40691. transfer-ownership="none"
  40692. nullable="1"
  40693. allow-none="1"
  40694. scope="async"
  40695. closure="5">
  40696. <doc xml:space="preserve">function to run in the child just before exec()</doc>
  40697. <type name="SpawnChildSetupFunc" c:type="GSpawnChildSetupFunc"/>
  40698. </parameter>
  40699. <parameter name="user_data"
  40700. transfer-ownership="none"
  40701. nullable="1"
  40702. allow-none="1">
  40703. <doc xml:space="preserve">user data for @child_setup</doc>
  40704. <type name="gpointer" c:type="gpointer"/>
  40705. </parameter>
  40706. <parameter name="child_pid"
  40707. direction="out"
  40708. caller-allocates="0"
  40709. transfer-ownership="full"
  40710. optional="1"
  40711. allow-none="1">
  40712. <doc xml:space="preserve">return location for child process ID, or %NULL</doc>
  40713. <type name="Pid" c:type="GPid*"/>
  40714. </parameter>
  40715. <parameter name="standard_input"
  40716. direction="out"
  40717. caller-allocates="0"
  40718. transfer-ownership="full"
  40719. optional="1"
  40720. allow-none="1">
  40721. <doc xml:space="preserve">return location for file descriptor to write to child's stdin, or %NULL</doc>
  40722. <type name="gint" c:type="gint*"/>
  40723. </parameter>
  40724. <parameter name="standard_output"
  40725. direction="out"
  40726. caller-allocates="0"
  40727. transfer-ownership="full"
  40728. optional="1"
  40729. allow-none="1">
  40730. <doc xml:space="preserve">return location for file descriptor to read child's stdout, or %NULL</doc>
  40731. <type name="gint" c:type="gint*"/>
  40732. </parameter>
  40733. <parameter name="standard_error"
  40734. direction="out"
  40735. caller-allocates="0"
  40736. transfer-ownership="full"
  40737. optional="1"
  40738. allow-none="1">
  40739. <doc xml:space="preserve">return location for file descriptor to read child's stderr, or %NULL</doc>
  40740. <type name="gint" c:type="gint*"/>
  40741. </parameter>
  40742. </parameters>
  40743. </function>
  40744. <function name="spawn_check_exit_status"
  40745. c:identifier="g_spawn_check_exit_status"
  40746. version="2.34"
  40747. throws="1">
  40748. <doc xml:space="preserve">Set @error if @exit_status indicates the child exited abnormally
  40749. (e.g. with a nonzero exit code, or via a fatal signal).
  40750. The g_spawn_sync() and g_child_watch_add() family of APIs return an
  40751. exit status for subprocesses encoded in a platform-specific way.
  40752. On Unix, this is guaranteed to be in the same format waitpid() returns,
  40753. and on Windows it is guaranteed to be the result of GetExitCodeProcess().
  40754. Prior to the introduction of this function in GLib 2.34, interpreting
  40755. @exit_status required use of platform-specific APIs, which is problematic
  40756. for software using GLib as a cross-platform layer.
  40757. Additionally, many programs simply want to determine whether or not
  40758. the child exited successfully, and either propagate a #GError or
  40759. print a message to standard error. In that common case, this function
  40760. can be used. Note that the error message in @error will contain
  40761. human-readable information about the exit status.
  40762. The @domain and @code of @error have special semantics in the case
  40763. where the process has an "exit code", as opposed to being killed by
  40764. a signal. On Unix, this happens if WIFEXITED() would be true of
  40765. @exit_status. On Windows, it is always the case.
  40766. The special semantics are that the actual exit code will be the
  40767. code set in @error, and the domain will be %G_SPAWN_EXIT_ERROR.
  40768. This allows you to differentiate between different exit codes.
  40769. If the process was terminated by some means other than an exit
  40770. status, the domain will be %G_SPAWN_ERROR, and the code will be
  40771. %G_SPAWN_ERROR_FAILED.
  40772. This function just offers convenience; you can of course also check
  40773. the available platform via a macro such as %G_OS_UNIX, and use
  40774. WIFEXITED() and WEXITSTATUS() on @exit_status directly. Do not attempt
  40775. to scan or parse the error message string; it may be translated and/or
  40776. change in future versions of GLib.</doc>
  40777. <return-value transfer-ownership="none">
  40778. <doc xml:space="preserve">%TRUE if child exited successfully, %FALSE otherwise (and
  40779. @error will be set)</doc>
  40780. <type name="gboolean" c:type="gboolean"/>
  40781. </return-value>
  40782. <parameters>
  40783. <parameter name="exit_status" transfer-ownership="none">
  40784. <doc xml:space="preserve">An exit code as returned from g_spawn_sync()</doc>
  40785. <type name="gint" c:type="gint"/>
  40786. </parameter>
  40787. </parameters>
  40788. </function>
  40789. <function name="spawn_close_pid" c:identifier="g_spawn_close_pid">
  40790. <doc xml:space="preserve">On some platforms, notably Windows, the #GPid type represents a resource
  40791. which must be closed to prevent resource leaking. g_spawn_close_pid()
  40792. is provided for this purpose. It should be used on all platforms, even
  40793. though it doesn't do anything under UNIX.</doc>
  40794. <return-value transfer-ownership="none">
  40795. <type name="none" c:type="void"/>
  40796. </return-value>
  40797. <parameters>
  40798. <parameter name="pid" transfer-ownership="none">
  40799. <doc xml:space="preserve">The process reference to close</doc>
  40800. <type name="Pid" c:type="GPid"/>
  40801. </parameter>
  40802. </parameters>
  40803. </function>
  40804. <function name="spawn_command_line_async"
  40805. c:identifier="g_spawn_command_line_async"
  40806. throws="1">
  40807. <doc xml:space="preserve">A simple version of g_spawn_async() that parses a command line with
  40808. g_shell_parse_argv() and passes it to g_spawn_async(). Runs a
  40809. command line in the background. Unlike g_spawn_async(), the
  40810. %G_SPAWN_SEARCH_PATH flag is enabled, other flags are not. Note
  40811. that %G_SPAWN_SEARCH_PATH can have security implications, so
  40812. consider using g_spawn_async() directly if appropriate. Possible
  40813. errors are those from g_shell_parse_argv() and g_spawn_async().
  40814. The same concerns on Windows apply as for g_spawn_command_line_sync().</doc>
  40815. <return-value transfer-ownership="none">
  40816. <doc xml:space="preserve">%TRUE on success, %FALSE if error is set</doc>
  40817. <type name="gboolean" c:type="gboolean"/>
  40818. </return-value>
  40819. <parameters>
  40820. <parameter name="command_line" transfer-ownership="none">
  40821. <doc xml:space="preserve">a command line</doc>
  40822. <type name="utf8" c:type="const gchar*"/>
  40823. </parameter>
  40824. </parameters>
  40825. </function>
  40826. <function name="spawn_command_line_sync"
  40827. c:identifier="g_spawn_command_line_sync"
  40828. throws="1">
  40829. <doc xml:space="preserve">A simple version of g_spawn_sync() with little-used parameters
  40830. removed, taking a command line instead of an argument vector. See
  40831. g_spawn_sync() for full details. @command_line will be parsed by
  40832. g_shell_parse_argv(). Unlike g_spawn_sync(), the %G_SPAWN_SEARCH_PATH flag
  40833. is enabled. Note that %G_SPAWN_SEARCH_PATH can have security
  40834. implications, so consider using g_spawn_sync() directly if
  40835. appropriate. Possible errors are those from g_spawn_sync() and those
  40836. from g_shell_parse_argv().
  40837. If @exit_status is non-%NULL, the platform-specific exit status of
  40838. the child is stored there; see the documentation of
  40839. g_spawn_check_exit_status() for how to use and interpret this.
  40840. On Windows, please note the implications of g_shell_parse_argv()
  40841. parsing @command_line. Parsing is done according to Unix shell rules, not
  40842. Windows command interpreter rules.
  40843. Space is a separator, and backslashes are
  40844. special. Thus you cannot simply pass a @command_line containing
  40845. canonical Windows paths, like "c:\\program files\\app\\app.exe", as
  40846. the backslashes will be eaten, and the space will act as a
  40847. separator. You need to enclose such paths with single quotes, like
  40848. "'c:\\program files\\app\\app.exe' 'e:\\folder\\argument.txt'".</doc>
  40849. <return-value transfer-ownership="none">
  40850. <doc xml:space="preserve">%TRUE on success, %FALSE if an error was set</doc>
  40851. <type name="gboolean" c:type="gboolean"/>
  40852. </return-value>
  40853. <parameters>
  40854. <parameter name="command_line" transfer-ownership="none">
  40855. <doc xml:space="preserve">a command line</doc>
  40856. <type name="utf8" c:type="const gchar*"/>
  40857. </parameter>
  40858. <parameter name="standard_output"
  40859. direction="out"
  40860. caller-allocates="0"
  40861. transfer-ownership="full"
  40862. optional="1"
  40863. allow-none="1">
  40864. <doc xml:space="preserve">return location for child output</doc>
  40865. <array c:type="gchar**">
  40866. <type name="guint8"/>
  40867. </array>
  40868. </parameter>
  40869. <parameter name="standard_error"
  40870. direction="out"
  40871. caller-allocates="0"
  40872. transfer-ownership="full"
  40873. optional="1"
  40874. allow-none="1">
  40875. <doc xml:space="preserve">return location for child errors</doc>
  40876. <array c:type="gchar**">
  40877. <type name="guint8"/>
  40878. </array>
  40879. </parameter>
  40880. <parameter name="exit_status"
  40881. direction="out"
  40882. caller-allocates="0"
  40883. transfer-ownership="full"
  40884. optional="1"
  40885. allow-none="1">
  40886. <doc xml:space="preserve">return location for child exit status, as returned by waitpid()</doc>
  40887. <type name="gint" c:type="gint*"/>
  40888. </parameter>
  40889. </parameters>
  40890. </function>
  40891. <function name="spawn_error_quark" c:identifier="g_spawn_error_quark">
  40892. <return-value transfer-ownership="none">
  40893. <type name="Quark" c:type="GQuark"/>
  40894. </return-value>
  40895. </function>
  40896. <function name="spawn_exit_error_quark"
  40897. c:identifier="g_spawn_exit_error_quark">
  40898. <return-value transfer-ownership="none">
  40899. <type name="Quark" c:type="GQuark"/>
  40900. </return-value>
  40901. </function>
  40902. <function name="spawn_sync" c:identifier="g_spawn_sync" throws="1">
  40903. <doc xml:space="preserve">Executes a child synchronously (waits for the child to exit before returning).
  40904. All output from the child is stored in @standard_output and @standard_error,
  40905. if those parameters are non-%NULL. Note that you must set the
  40906. %G_SPAWN_STDOUT_TO_DEV_NULL and %G_SPAWN_STDERR_TO_DEV_NULL flags when
  40907. passing %NULL for @standard_output and @standard_error.
  40908. If @exit_status is non-%NULL, the platform-specific exit status of
  40909. the child is stored there; see the documentation of
  40910. g_spawn_check_exit_status() for how to use and interpret this.
  40911. Note that it is invalid to pass %G_SPAWN_DO_NOT_REAP_CHILD in
  40912. @flags.
  40913. If an error occurs, no data is returned in @standard_output,
  40914. @standard_error, or @exit_status.
  40915. This function calls g_spawn_async_with_pipes() internally; see that
  40916. function for full details on the other parameters and details on
  40917. how these functions work on Windows.</doc>
  40918. <return-value transfer-ownership="none">
  40919. <doc xml:space="preserve">%TRUE on success, %FALSE if an error was set</doc>
  40920. <type name="gboolean" c:type="gboolean"/>
  40921. </return-value>
  40922. <parameters>
  40923. <parameter name="working_directory"
  40924. transfer-ownership="none"
  40925. nullable="1"
  40926. allow-none="1">
  40927. <doc xml:space="preserve">child's current working directory, or %NULL to inherit parent's</doc>
  40928. <type name="utf8" c:type="const gchar*"/>
  40929. </parameter>
  40930. <parameter name="argv" transfer-ownership="none">
  40931. <doc xml:space="preserve">child's argument vector</doc>
  40932. <array c:type="gchar**">
  40933. <type name="utf8" c:type="gchar*"/>
  40934. </array>
  40935. </parameter>
  40936. <parameter name="envp"
  40937. transfer-ownership="none"
  40938. nullable="1"
  40939. allow-none="1">
  40940. <doc xml:space="preserve">child's environment, or %NULL to inherit parent's</doc>
  40941. <array c:type="gchar**">
  40942. <type name="utf8" c:type="gchar*"/>
  40943. </array>
  40944. </parameter>
  40945. <parameter name="flags" transfer-ownership="none">
  40946. <doc xml:space="preserve">flags from #GSpawnFlags</doc>
  40947. <type name="SpawnFlags" c:type="GSpawnFlags"/>
  40948. </parameter>
  40949. <parameter name="child_setup"
  40950. transfer-ownership="none"
  40951. nullable="1"
  40952. allow-none="1"
  40953. scope="async"
  40954. closure="5">
  40955. <doc xml:space="preserve">function to run in the child just before exec()</doc>
  40956. <type name="SpawnChildSetupFunc" c:type="GSpawnChildSetupFunc"/>
  40957. </parameter>
  40958. <parameter name="user_data"
  40959. transfer-ownership="none"
  40960. nullable="1"
  40961. allow-none="1">
  40962. <doc xml:space="preserve">user data for @child_setup</doc>
  40963. <type name="gpointer" c:type="gpointer"/>
  40964. </parameter>
  40965. <parameter name="standard_output"
  40966. direction="out"
  40967. caller-allocates="0"
  40968. transfer-ownership="full"
  40969. optional="1"
  40970. allow-none="1">
  40971. <doc xml:space="preserve">return location for child output, or %NULL</doc>
  40972. <array c:type="gchar**">
  40973. <type name="guint8"/>
  40974. </array>
  40975. </parameter>
  40976. <parameter name="standard_error"
  40977. direction="out"
  40978. caller-allocates="0"
  40979. transfer-ownership="full"
  40980. optional="1"
  40981. allow-none="1">
  40982. <doc xml:space="preserve">return location for child error messages, or %NULL</doc>
  40983. <array c:type="gchar**">
  40984. <type name="guint8"/>
  40985. </array>
  40986. </parameter>
  40987. <parameter name="exit_status"
  40988. direction="out"
  40989. caller-allocates="0"
  40990. transfer-ownership="full"
  40991. optional="1"
  40992. allow-none="1">
  40993. <doc xml:space="preserve">return location for child exit status, as returned by waitpid(), or %NULL</doc>
  40994. <type name="gint" c:type="gint*"/>
  40995. </parameter>
  40996. </parameters>
  40997. </function>
  40998. <function name="sprintf"
  40999. c:identifier="g_sprintf"
  41000. version="2.2"
  41001. introspectable="0">
  41002. <doc xml:space="preserve">An implementation of the standard sprintf() function which supports
  41003. positional parameters, as specified in the Single Unix Specification.
  41004. Note that it is usually better to use g_snprintf(), to avoid the
  41005. risk of buffer overflow.
  41006. See also g_strdup_printf().</doc>
  41007. <return-value transfer-ownership="none">
  41008. <doc xml:space="preserve">the number of bytes printed.</doc>
  41009. <type name="gint" c:type="gint"/>
  41010. </return-value>
  41011. <parameters>
  41012. <parameter name="string" transfer-ownership="none">
  41013. <doc xml:space="preserve">A pointer to a memory buffer to contain the resulting string. It
  41014. is up to the caller to ensure that the allocated buffer is large
  41015. enough to hold the formatted result</doc>
  41016. <type name="utf8" c:type="gchar*"/>
  41017. </parameter>
  41018. <parameter name="format" transfer-ownership="none">
  41019. <doc xml:space="preserve">a standard printf() format string, but notice
  41020. [string precision pitfalls][string-precision]</doc>
  41021. <type name="utf8" c:type="gchar*"/>
  41022. </parameter>
  41023. <parameter name="..." transfer-ownership="none">
  41024. <doc xml:space="preserve">the arguments to insert in the output.</doc>
  41025. <varargs/>
  41026. </parameter>
  41027. </parameters>
  41028. </function>
  41029. <function name="stpcpy" c:identifier="g_stpcpy">
  41030. <doc xml:space="preserve">Copies a nul-terminated string into the dest buffer, include the
  41031. trailing nul, and return a pointer to the trailing nul byte.
  41032. This is useful for concatenating multiple strings together
  41033. without having to repeatedly scan for the end.</doc>
  41034. <return-value transfer-ownership="full">
  41035. <doc xml:space="preserve">a pointer to trailing nul byte.</doc>
  41036. <type name="utf8" c:type="gchar*"/>
  41037. </return-value>
  41038. <parameters>
  41039. <parameter name="dest" transfer-ownership="none">
  41040. <doc xml:space="preserve">destination buffer.</doc>
  41041. <type name="utf8" c:type="gchar*"/>
  41042. </parameter>
  41043. <parameter name="src" transfer-ownership="none">
  41044. <doc xml:space="preserve">source string.</doc>
  41045. <type name="utf8" c:type="const char*"/>
  41046. </parameter>
  41047. </parameters>
  41048. </function>
  41049. <function name="str_equal" c:identifier="g_str_equal">
  41050. <doc xml:space="preserve">Compares two strings for byte-by-byte equality and returns %TRUE
  41051. if they are equal. It can be passed to g_hash_table_new() as the
  41052. @key_equal_func parameter, when using non-%NULL strings as keys in a
  41053. #GHashTable.
  41054. Note that this function is primarily meant as a hash table comparison
  41055. function. For a general-purpose, %NULL-safe string comparison function,
  41056. see g_strcmp0().</doc>
  41057. <return-value transfer-ownership="none">
  41058. <doc xml:space="preserve">%TRUE if the two keys match</doc>
  41059. <type name="gboolean" c:type="gboolean"/>
  41060. </return-value>
  41061. <parameters>
  41062. <parameter name="v1" transfer-ownership="none">
  41063. <doc xml:space="preserve">a key</doc>
  41064. <type name="gpointer" c:type="gconstpointer"/>
  41065. </parameter>
  41066. <parameter name="v2" transfer-ownership="none">
  41067. <doc xml:space="preserve">a key to compare with @v1</doc>
  41068. <type name="gpointer" c:type="gconstpointer"/>
  41069. </parameter>
  41070. </parameters>
  41071. </function>
  41072. <function name="str_has_prefix"
  41073. c:identifier="g_str_has_prefix"
  41074. version="2.2">
  41075. <doc xml:space="preserve">Looks whether the string @str begins with @prefix.</doc>
  41076. <return-value transfer-ownership="none">
  41077. <doc xml:space="preserve">%TRUE if @str begins with @prefix, %FALSE otherwise.</doc>
  41078. <type name="gboolean" c:type="gboolean"/>
  41079. </return-value>
  41080. <parameters>
  41081. <parameter name="str" transfer-ownership="none">
  41082. <doc xml:space="preserve">a nul-terminated string</doc>
  41083. <type name="utf8" c:type="const gchar*"/>
  41084. </parameter>
  41085. <parameter name="prefix" transfer-ownership="none">
  41086. <doc xml:space="preserve">the nul-terminated prefix to look for</doc>
  41087. <type name="utf8" c:type="const gchar*"/>
  41088. </parameter>
  41089. </parameters>
  41090. </function>
  41091. <function name="str_has_suffix"
  41092. c:identifier="g_str_has_suffix"
  41093. version="2.2">
  41094. <doc xml:space="preserve">Looks whether the string @str ends with @suffix.</doc>
  41095. <return-value transfer-ownership="none">
  41096. <doc xml:space="preserve">%TRUE if @str end with @suffix, %FALSE otherwise.</doc>
  41097. <type name="gboolean" c:type="gboolean"/>
  41098. </return-value>
  41099. <parameters>
  41100. <parameter name="str" transfer-ownership="none">
  41101. <doc xml:space="preserve">a nul-terminated string</doc>
  41102. <type name="utf8" c:type="const gchar*"/>
  41103. </parameter>
  41104. <parameter name="suffix" transfer-ownership="none">
  41105. <doc xml:space="preserve">the nul-terminated suffix to look for</doc>
  41106. <type name="utf8" c:type="const gchar*"/>
  41107. </parameter>
  41108. </parameters>
  41109. </function>
  41110. <function name="str_hash" c:identifier="g_str_hash">
  41111. <doc xml:space="preserve">Converts a string to a hash value.
  41112. This function implements the widely used "djb" hash apparently
  41113. posted by Daniel Bernstein to comp.lang.c some time ago. The 32
  41114. bit unsigned hash value starts at 5381 and for each byte 'c' in
  41115. the string, is updated: `hash = hash * 33 + c`. This function
  41116. uses the signed value of each byte.
  41117. It can be passed to g_hash_table_new() as the @hash_func parameter,
  41118. when using non-%NULL strings as keys in a #GHashTable.
  41119. Note that this function may not be a perfect fit for all use cases.
  41120. For example, it produces some hash collisions with strings as short
  41121. as 2.</doc>
  41122. <return-value transfer-ownership="none">
  41123. <doc xml:space="preserve">a hash value corresponding to the key</doc>
  41124. <type name="guint" c:type="guint"/>
  41125. </return-value>
  41126. <parameters>
  41127. <parameter name="v" transfer-ownership="none">
  41128. <doc xml:space="preserve">a string key</doc>
  41129. <type name="gpointer" c:type="gconstpointer"/>
  41130. </parameter>
  41131. </parameters>
  41132. </function>
  41133. <function name="str_is_ascii" c:identifier="g_str_is_ascii" version="2.40">
  41134. <doc xml:space="preserve">Determines if a string is pure ASCII. A string is pure ASCII if it
  41135. contains no bytes with the high bit set.</doc>
  41136. <return-value transfer-ownership="none">
  41137. <doc xml:space="preserve">%TRUE if @str is ASCII</doc>
  41138. <type name="gboolean" c:type="gboolean"/>
  41139. </return-value>
  41140. <parameters>
  41141. <parameter name="str" transfer-ownership="none">
  41142. <doc xml:space="preserve">a string</doc>
  41143. <type name="utf8" c:type="const gchar*"/>
  41144. </parameter>
  41145. </parameters>
  41146. </function>
  41147. <function name="str_match_string"
  41148. c:identifier="g_str_match_string"
  41149. version="2.40">
  41150. <doc xml:space="preserve">Checks if a search conducted for @search_term should match
  41151. @potential_hit.
  41152. This function calls g_str_tokenize_and_fold() on both
  41153. @search_term and @potential_hit. ASCII alternates are never taken
  41154. for @search_term but will be taken for @potential_hit according to
  41155. the value of @accept_alternates.
  41156. A hit occurs when each folded token in @search_term is a prefix of a
  41157. folded token from @potential_hit.
  41158. Depending on how you're performing the search, it will typically be
  41159. faster to call g_str_tokenize_and_fold() on each string in
  41160. your corpus and build an index on the returned folded tokens, then
  41161. call g_str_tokenize_and_fold() on the search term and
  41162. perform lookups into that index.
  41163. As some examples, searching for "fred" would match the potential hit
  41164. "Smith, Fred" and also "Frédéric". Searching for "Fréd" would match
  41165. "Frédéric" but not "Frederic" (due to the one-directional nature of
  41166. accent matching). Searching "fo" would match "Foo" and "Bar Foo
  41167. Baz", but not "SFO" (because no word as "fo" as a prefix).</doc>
  41168. <return-value transfer-ownership="none">
  41169. <doc xml:space="preserve">%TRUE if @potential_hit is a hit</doc>
  41170. <type name="gboolean" c:type="gboolean"/>
  41171. </return-value>
  41172. <parameters>
  41173. <parameter name="search_term" transfer-ownership="none">
  41174. <doc xml:space="preserve">the search term from the user</doc>
  41175. <type name="utf8" c:type="const gchar*"/>
  41176. </parameter>
  41177. <parameter name="potential_hit" transfer-ownership="none">
  41178. <doc xml:space="preserve">the text that may be a hit</doc>
  41179. <type name="utf8" c:type="const gchar*"/>
  41180. </parameter>
  41181. <parameter name="accept_alternates" transfer-ownership="none">
  41182. <doc xml:space="preserve">%TRUE to accept ASCII alternates</doc>
  41183. <type name="gboolean" c:type="gboolean"/>
  41184. </parameter>
  41185. </parameters>
  41186. </function>
  41187. <function name="str_to_ascii" c:identifier="g_str_to_ascii" version="2.40">
  41188. <doc xml:space="preserve">Transliterate @str to plain ASCII.
  41189. For best results, @str should be in composed normalised form.
  41190. This function performs a reasonably good set of character
  41191. replacements. The particular set of replacements that is done may
  41192. change by version or even by runtime environment.
  41193. If the source language of @str is known, it can used to improve the
  41194. accuracy of the translation by passing it as @from_locale. It should
  41195. be a valid POSIX locale string (of the form
  41196. "language[_territory][.codeset][@modifier]").
  41197. If @from_locale is %NULL then the current locale is used.
  41198. If you want to do translation for no specific locale, and you want it
  41199. to be done independently of the currently locale, specify "C" for
  41200. @from_locale.</doc>
  41201. <return-value transfer-ownership="full">
  41202. <doc xml:space="preserve">a string in plain ASCII</doc>
  41203. <type name="utf8" c:type="gchar*"/>
  41204. </return-value>
  41205. <parameters>
  41206. <parameter name="str" transfer-ownership="none">
  41207. <doc xml:space="preserve">a string, in UTF-8</doc>
  41208. <type name="utf8" c:type="const gchar*"/>
  41209. </parameter>
  41210. <parameter name="from_locale"
  41211. transfer-ownership="none"
  41212. nullable="1"
  41213. allow-none="1">
  41214. <doc xml:space="preserve">the source locale, if known</doc>
  41215. <type name="utf8" c:type="const gchar*"/>
  41216. </parameter>
  41217. </parameters>
  41218. </function>
  41219. <function name="str_tokenize_and_fold"
  41220. c:identifier="g_str_tokenize_and_fold"
  41221. version="2.40">
  41222. <doc xml:space="preserve">Tokenises @string and performs folding on each token.
  41223. A token is a non-empty sequence of alphanumeric characters in the
  41224. source string, separated by non-alphanumeric characters. An
  41225. "alphanumeric" character for this purpose is one that matches
  41226. g_unichar_isalnum() or g_unichar_ismark().
  41227. Each token is then (Unicode) normalised and case-folded. If
  41228. @ascii_alternates is non-%NULL and some of the returned tokens
  41229. contain non-ASCII characters, ASCII alternatives will be generated.
  41230. The number of ASCII alternatives that are generated and the method
  41231. for doing so is unspecified, but @translit_locale (if specified) may
  41232. improve the transliteration if the language of the source string is
  41233. known.</doc>
  41234. <return-value transfer-ownership="full">
  41235. <doc xml:space="preserve">the folded tokens</doc>
  41236. <array c:type="gchar**">
  41237. <type name="utf8"/>
  41238. </array>
  41239. </return-value>
  41240. <parameters>
  41241. <parameter name="string" transfer-ownership="none">
  41242. <doc xml:space="preserve">a string</doc>
  41243. <type name="utf8" c:type="const gchar*"/>
  41244. </parameter>
  41245. <parameter name="translit_locale"
  41246. transfer-ownership="none"
  41247. nullable="1"
  41248. allow-none="1">
  41249. <doc xml:space="preserve">the language code (like 'de' or
  41250. 'en_GB') from which @string originates</doc>
  41251. <type name="utf8" c:type="const gchar*"/>
  41252. </parameter>
  41253. <parameter name="ascii_alternates"
  41254. direction="out"
  41255. caller-allocates="0"
  41256. transfer-ownership="full">
  41257. <doc xml:space="preserve">a
  41258. return location for ASCII alternates</doc>
  41259. <array c:type="gchar***">
  41260. <type name="utf8" c:type="gchar**"/>
  41261. </array>
  41262. </parameter>
  41263. </parameters>
  41264. </function>
  41265. <function name="strcanon" c:identifier="g_strcanon">
  41266. <doc xml:space="preserve">For each character in @string, if the character is not in @valid_chars,
  41267. replaces the character with @substitutor. Modifies @string in place,
  41268. and return @string itself, not a copy. The return value is to allow
  41269. nesting such as
  41270. |[&lt;!-- language="C" --&gt;
  41271. g_ascii_strup (g_strcanon (str, "abc", '?'))
  41272. ]|</doc>
  41273. <return-value transfer-ownership="full">
  41274. <doc xml:space="preserve">@string</doc>
  41275. <type name="utf8" c:type="gchar*"/>
  41276. </return-value>
  41277. <parameters>
  41278. <parameter name="string" transfer-ownership="none">
  41279. <doc xml:space="preserve">a nul-terminated array of bytes</doc>
  41280. <type name="utf8" c:type="gchar*"/>
  41281. </parameter>
  41282. <parameter name="valid_chars" transfer-ownership="none">
  41283. <doc xml:space="preserve">bytes permitted in @string</doc>
  41284. <type name="utf8" c:type="const gchar*"/>
  41285. </parameter>
  41286. <parameter name="substitutor" transfer-ownership="none">
  41287. <doc xml:space="preserve">replacement character for disallowed bytes</doc>
  41288. <type name="gchar" c:type="gchar"/>
  41289. </parameter>
  41290. </parameters>
  41291. </function>
  41292. <function name="strcasecmp"
  41293. c:identifier="g_strcasecmp"
  41294. deprecated="1"
  41295. deprecated-version="2.2">
  41296. <doc xml:space="preserve">A case-insensitive string comparison, corresponding to the standard
  41297. strcasecmp() function on platforms which support it.</doc>
  41298. <doc-deprecated xml:space="preserve">See g_strncasecmp() for a discussion of why this
  41299. function is deprecated and how to replace it.</doc-deprecated>
  41300. <return-value transfer-ownership="none">
  41301. <doc xml:space="preserve">0 if the strings match, a negative value if @s1 &lt; @s2,
  41302. or a positive value if @s1 &gt; @s2.</doc>
  41303. <type name="gint" c:type="gint"/>
  41304. </return-value>
  41305. <parameters>
  41306. <parameter name="s1" transfer-ownership="none">
  41307. <doc xml:space="preserve">a string</doc>
  41308. <type name="utf8" c:type="const gchar*"/>
  41309. </parameter>
  41310. <parameter name="s2" transfer-ownership="none">
  41311. <doc xml:space="preserve">a string to compare with @s1</doc>
  41312. <type name="utf8" c:type="const gchar*"/>
  41313. </parameter>
  41314. </parameters>
  41315. </function>
  41316. <function name="strchomp" c:identifier="g_strchomp">
  41317. <doc xml:space="preserve">Removes trailing whitespace from a string.
  41318. This function doesn't allocate or reallocate any memory;
  41319. it modifies @string in place. Therefore, it cannot be used
  41320. on statically allocated strings.
  41321. The pointer to @string is returned to allow the nesting of functions.
  41322. Also see g_strchug() and g_strstrip().</doc>
  41323. <return-value transfer-ownership="full">
  41324. <doc xml:space="preserve">@string</doc>
  41325. <type name="utf8" c:type="gchar*"/>
  41326. </return-value>
  41327. <parameters>
  41328. <parameter name="string" transfer-ownership="none">
  41329. <doc xml:space="preserve">a string to remove the trailing whitespace from</doc>
  41330. <type name="utf8" c:type="gchar*"/>
  41331. </parameter>
  41332. </parameters>
  41333. </function>
  41334. <function name="strchug" c:identifier="g_strchug">
  41335. <doc xml:space="preserve">Removes leading whitespace from a string, by moving the rest
  41336. of the characters forward.
  41337. This function doesn't allocate or reallocate any memory;
  41338. it modifies @string in place. Therefore, it cannot be used on
  41339. statically allocated strings.
  41340. The pointer to @string is returned to allow the nesting of functions.
  41341. Also see g_strchomp() and g_strstrip().</doc>
  41342. <return-value transfer-ownership="full">
  41343. <doc xml:space="preserve">@string</doc>
  41344. <type name="utf8" c:type="gchar*"/>
  41345. </return-value>
  41346. <parameters>
  41347. <parameter name="string" transfer-ownership="none">
  41348. <doc xml:space="preserve">a string to remove the leading whitespace from</doc>
  41349. <type name="utf8" c:type="gchar*"/>
  41350. </parameter>
  41351. </parameters>
  41352. </function>
  41353. <function name="strcmp0" c:identifier="g_strcmp0" version="2.16">
  41354. <doc xml:space="preserve">Compares @str1 and @str2 like strcmp(). Handles %NULL
  41355. gracefully by sorting it before non-%NULL strings.
  41356. Comparing two %NULL pointers returns 0.</doc>
  41357. <return-value transfer-ownership="none">
  41358. <doc xml:space="preserve">an integer less than, equal to, or greater than zero, if @str1 is &lt;, == or &gt; than @str2.</doc>
  41359. <type name="gint" c:type="int"/>
  41360. </return-value>
  41361. <parameters>
  41362. <parameter name="str1"
  41363. transfer-ownership="none"
  41364. nullable="1"
  41365. allow-none="1">
  41366. <doc xml:space="preserve">a C string or %NULL</doc>
  41367. <type name="utf8" c:type="const char*"/>
  41368. </parameter>
  41369. <parameter name="str2"
  41370. transfer-ownership="none"
  41371. nullable="1"
  41372. allow-none="1">
  41373. <doc xml:space="preserve">another C string or %NULL</doc>
  41374. <type name="utf8" c:type="const char*"/>
  41375. </parameter>
  41376. </parameters>
  41377. </function>
  41378. <function name="strcompress" c:identifier="g_strcompress">
  41379. <doc xml:space="preserve">Replaces all escaped characters with their one byte equivalent.
  41380. This function does the reverse conversion of g_strescape().</doc>
  41381. <return-value transfer-ownership="full">
  41382. <doc xml:space="preserve">a newly-allocated copy of @source with all escaped
  41383. character compressed</doc>
  41384. <type name="utf8" c:type="gchar*"/>
  41385. </return-value>
  41386. <parameters>
  41387. <parameter name="source" transfer-ownership="none">
  41388. <doc xml:space="preserve">a string to compress</doc>
  41389. <type name="utf8" c:type="const gchar*"/>
  41390. </parameter>
  41391. </parameters>
  41392. </function>
  41393. <function name="strconcat" c:identifier="g_strconcat" introspectable="0">
  41394. <doc xml:space="preserve">Concatenates all of the given strings into one long string. The
  41395. returned string should be freed with g_free() when no longer needed.
  41396. The variable argument list must end with %NULL. If you forget the %NULL,
  41397. g_strconcat() will start appending random memory junk to your string.
  41398. Note that this function is usually not the right function to use to
  41399. assemble a translated message from pieces, since proper translation
  41400. often requires the pieces to be reordered.</doc>
  41401. <return-value transfer-ownership="full">
  41402. <doc xml:space="preserve">a newly-allocated string containing all the string arguments</doc>
  41403. <type name="utf8" c:type="gchar*"/>
  41404. </return-value>
  41405. <parameters>
  41406. <parameter name="string1" transfer-ownership="none">
  41407. <doc xml:space="preserve">the first string to add, which must not be %NULL</doc>
  41408. <type name="utf8" c:type="const gchar*"/>
  41409. </parameter>
  41410. <parameter name="..." transfer-ownership="none">
  41411. <doc xml:space="preserve">a %NULL-terminated list of strings to append to the string</doc>
  41412. <varargs/>
  41413. </parameter>
  41414. </parameters>
  41415. </function>
  41416. <function name="strdelimit" c:identifier="g_strdelimit">
  41417. <doc xml:space="preserve">Converts any delimiter characters in @string to @new_delimiter.
  41418. Any characters in @string which are found in @delimiters are
  41419. changed to the @new_delimiter character. Modifies @string in place,
  41420. and returns @string itself, not a copy. The return value is to
  41421. allow nesting such as
  41422. |[&lt;!-- language="C" --&gt;
  41423. g_ascii_strup (g_strdelimit (str, "abc", '?'))
  41424. ]|</doc>
  41425. <return-value transfer-ownership="full">
  41426. <doc xml:space="preserve">@string</doc>
  41427. <type name="utf8" c:type="gchar*"/>
  41428. </return-value>
  41429. <parameters>
  41430. <parameter name="string" transfer-ownership="none">
  41431. <doc xml:space="preserve">the string to convert</doc>
  41432. <type name="utf8" c:type="gchar*"/>
  41433. </parameter>
  41434. <parameter name="delimiters"
  41435. transfer-ownership="none"
  41436. nullable="1"
  41437. allow-none="1">
  41438. <doc xml:space="preserve">a string containing the current delimiters,
  41439. or %NULL to use the standard delimiters defined in #G_STR_DELIMITERS</doc>
  41440. <type name="utf8" c:type="const gchar*"/>
  41441. </parameter>
  41442. <parameter name="new_delimiter" transfer-ownership="none">
  41443. <doc xml:space="preserve">the new delimiter character</doc>
  41444. <type name="gchar" c:type="gchar"/>
  41445. </parameter>
  41446. </parameters>
  41447. </function>
  41448. <function name="strdown"
  41449. c:identifier="g_strdown"
  41450. deprecated="1"
  41451. deprecated-version="2.2">
  41452. <doc xml:space="preserve">Converts a string to lower case.</doc>
  41453. <doc-deprecated xml:space="preserve">This function is totally broken for the reasons discussed
  41454. in the g_strncasecmp() docs - use g_ascii_strdown() or g_utf8_strdown()
  41455. instead.</doc-deprecated>
  41456. <return-value transfer-ownership="full">
  41457. <doc xml:space="preserve">the string</doc>
  41458. <type name="utf8" c:type="gchar*"/>
  41459. </return-value>
  41460. <parameters>
  41461. <parameter name="string" transfer-ownership="none">
  41462. <doc xml:space="preserve">the string to convert.</doc>
  41463. <type name="utf8" c:type="gchar*"/>
  41464. </parameter>
  41465. </parameters>
  41466. </function>
  41467. <function name="strdup" c:identifier="g_strdup">
  41468. <doc xml:space="preserve">Duplicates a string. If @str is %NULL it returns %NULL.
  41469. The returned string should be freed with g_free()
  41470. when no longer needed.</doc>
  41471. <return-value transfer-ownership="full">
  41472. <doc xml:space="preserve">a newly-allocated copy of @str</doc>
  41473. <type name="utf8" c:type="gchar*"/>
  41474. </return-value>
  41475. <parameters>
  41476. <parameter name="str"
  41477. transfer-ownership="none"
  41478. nullable="1"
  41479. allow-none="1">
  41480. <doc xml:space="preserve">the string to duplicate</doc>
  41481. <type name="utf8" c:type="const gchar*"/>
  41482. </parameter>
  41483. </parameters>
  41484. </function>
  41485. <function name="strdup_printf"
  41486. c:identifier="g_strdup_printf"
  41487. introspectable="0">
  41488. <doc xml:space="preserve">Similar to the standard C sprintf() function but safer, since it
  41489. calculates the maximum space required and allocates memory to hold
  41490. the result. The returned string should be freed with g_free() when no
  41491. longer needed.</doc>
  41492. <return-value transfer-ownership="full">
  41493. <doc xml:space="preserve">a newly-allocated string holding the result</doc>
  41494. <type name="utf8" c:type="gchar*"/>
  41495. </return-value>
  41496. <parameters>
  41497. <parameter name="format" transfer-ownership="none">
  41498. <doc xml:space="preserve">a standard printf() format string, but notice
  41499. [string precision pitfalls][string-precision]</doc>
  41500. <type name="utf8" c:type="const gchar*"/>
  41501. </parameter>
  41502. <parameter name="..." transfer-ownership="none">
  41503. <doc xml:space="preserve">the parameters to insert into the format string</doc>
  41504. <varargs/>
  41505. </parameter>
  41506. </parameters>
  41507. </function>
  41508. <function name="strdup_vprintf"
  41509. c:identifier="g_strdup_vprintf"
  41510. introspectable="0">
  41511. <doc xml:space="preserve">Similar to the standard C vsprintf() function but safer, since it
  41512. calculates the maximum space required and allocates memory to hold
  41513. the result. The returned string should be freed with g_free() when
  41514. no longer needed.
  41515. See also g_vasprintf(), which offers the same functionality, but
  41516. additionally returns the length of the allocated string.</doc>
  41517. <return-value transfer-ownership="full">
  41518. <doc xml:space="preserve">a newly-allocated string holding the result</doc>
  41519. <type name="utf8" c:type="gchar*"/>
  41520. </return-value>
  41521. <parameters>
  41522. <parameter name="format" transfer-ownership="none">
  41523. <doc xml:space="preserve">a standard printf() format string, but notice
  41524. [string precision pitfalls][string-precision]</doc>
  41525. <type name="utf8" c:type="const gchar*"/>
  41526. </parameter>
  41527. <parameter name="args" transfer-ownership="none">
  41528. <doc xml:space="preserve">the list of parameters to insert into the format string</doc>
  41529. <type name="va_list" c:type="va_list"/>
  41530. </parameter>
  41531. </parameters>
  41532. </function>
  41533. <function name="strdupv" c:identifier="g_strdupv" introspectable="0">
  41534. <doc xml:space="preserve">Copies %NULL-terminated array of strings. The copy is a deep copy;
  41535. the new array should be freed by first freeing each string, then
  41536. the array itself. g_strfreev() does this for you. If called
  41537. on a %NULL value, g_strdupv() simply returns %NULL.</doc>
  41538. <return-value nullable="1">
  41539. <doc xml:space="preserve">a new %NULL-terminated array of strings.</doc>
  41540. <array c:type="gchar**">
  41541. <type name="utf8"/>
  41542. </array>
  41543. </return-value>
  41544. <parameters>
  41545. <parameter name="str_array"
  41546. transfer-ownership="none"
  41547. nullable="1"
  41548. allow-none="1">
  41549. <doc xml:space="preserve">a %NULL-terminated array of strings</doc>
  41550. <type name="utf8" c:type="gchar**"/>
  41551. </parameter>
  41552. </parameters>
  41553. </function>
  41554. <function name="strerror" c:identifier="g_strerror">
  41555. <doc xml:space="preserve">Returns a string corresponding to the given error code, e.g. "no
  41556. such process". Unlike strerror(), this always returns a string in
  41557. UTF-8 encoding, and the pointer is guaranteed to remain valid for
  41558. the lifetime of the process.
  41559. Note that the string may be translated according to the current locale.
  41560. The value of %errno will not be changed by this function.</doc>
  41561. <return-value transfer-ownership="none">
  41562. <doc xml:space="preserve">a UTF-8 string describing the error code. If the error code
  41563. is unknown, it returns a string like "unknown error (&lt;code&gt;)".</doc>
  41564. <type name="utf8" c:type="const gchar*"/>
  41565. </return-value>
  41566. <parameters>
  41567. <parameter name="errnum" transfer-ownership="none">
  41568. <doc xml:space="preserve">the system error number. See the standard C %errno
  41569. documentation</doc>
  41570. <type name="gint" c:type="gint"/>
  41571. </parameter>
  41572. </parameters>
  41573. </function>
  41574. <function name="strescape" c:identifier="g_strescape">
  41575. <doc xml:space="preserve">Escapes the special characters '\b', '\f', '\n', '\r', '\t', '\v', '\'
  41576. and '&amp;quot;' in the string @source by inserting a '\' before
  41577. them. Additionally all characters in the range 0x01-0x1F (everything
  41578. below SPACE) and in the range 0x7F-0xFF (all non-ASCII chars) are
  41579. replaced with a '\' followed by their octal representation.
  41580. Characters supplied in @exceptions are not escaped.
  41581. g_strcompress() does the reverse conversion.</doc>
  41582. <return-value transfer-ownership="full">
  41583. <doc xml:space="preserve">a newly-allocated copy of @source with certain
  41584. characters escaped. See above.</doc>
  41585. <type name="utf8" c:type="gchar*"/>
  41586. </return-value>
  41587. <parameters>
  41588. <parameter name="source" transfer-ownership="none">
  41589. <doc xml:space="preserve">a string to escape</doc>
  41590. <type name="utf8" c:type="const gchar*"/>
  41591. </parameter>
  41592. <parameter name="exceptions"
  41593. transfer-ownership="none"
  41594. nullable="1"
  41595. allow-none="1">
  41596. <doc xml:space="preserve">a string of characters not to escape in @source</doc>
  41597. <type name="utf8" c:type="const gchar*"/>
  41598. </parameter>
  41599. </parameters>
  41600. </function>
  41601. <function name="strfreev" c:identifier="g_strfreev">
  41602. <doc xml:space="preserve">Frees a %NULL-terminated array of strings, as well as each
  41603. string it contains.
  41604. If @str_array is %NULL, this function simply returns.</doc>
  41605. <return-value transfer-ownership="none">
  41606. <type name="none" c:type="void"/>
  41607. </return-value>
  41608. <parameters>
  41609. <parameter name="str_array"
  41610. transfer-ownership="none"
  41611. nullable="1"
  41612. allow-none="1">
  41613. <doc xml:space="preserve">a %NULL-terminated array of strings to free</doc>
  41614. <type name="utf8" c:type="gchar**"/>
  41615. </parameter>
  41616. </parameters>
  41617. </function>
  41618. <function name="string_new" c:identifier="g_string_new">
  41619. <doc xml:space="preserve">Creates a new #GString, initialized with the given string.</doc>
  41620. <return-value transfer-ownership="full">
  41621. <doc xml:space="preserve">the new #GString</doc>
  41622. <type name="String" c:type="GString*"/>
  41623. </return-value>
  41624. <parameters>
  41625. <parameter name="init"
  41626. transfer-ownership="none"
  41627. nullable="1"
  41628. allow-none="1">
  41629. <doc xml:space="preserve">the initial text to copy into the string, or %NULL to
  41630. start with an empty string</doc>
  41631. <type name="utf8" c:type="const gchar*"/>
  41632. </parameter>
  41633. </parameters>
  41634. </function>
  41635. <function name="string_new_len" c:identifier="g_string_new_len">
  41636. <doc xml:space="preserve">Creates a new #GString with @len bytes of the @init buffer.
  41637. Because a length is provided, @init need not be nul-terminated,
  41638. and can contain embedded nul bytes.
  41639. Since this function does not stop at nul bytes, it is the caller's
  41640. responsibility to ensure that @init has at least @len addressable
  41641. bytes.</doc>
  41642. <return-value transfer-ownership="full">
  41643. <doc xml:space="preserve">a new #GString</doc>
  41644. <type name="String" c:type="GString*"/>
  41645. </return-value>
  41646. <parameters>
  41647. <parameter name="init" transfer-ownership="none">
  41648. <doc xml:space="preserve">initial contents of the string</doc>
  41649. <type name="utf8" c:type="const gchar*"/>
  41650. </parameter>
  41651. <parameter name="len" transfer-ownership="none">
  41652. <doc xml:space="preserve">length of @init to use</doc>
  41653. <type name="gssize" c:type="gssize"/>
  41654. </parameter>
  41655. </parameters>
  41656. </function>
  41657. <function name="string_sized_new" c:identifier="g_string_sized_new">
  41658. <doc xml:space="preserve">Creates a new #GString, with enough space for @dfl_size
  41659. bytes. This is useful if you are going to add a lot of
  41660. text to the string and don't want it to be reallocated
  41661. too often.</doc>
  41662. <return-value transfer-ownership="full">
  41663. <doc xml:space="preserve">the new #GString</doc>
  41664. <type name="String" c:type="GString*"/>
  41665. </return-value>
  41666. <parameters>
  41667. <parameter name="dfl_size" transfer-ownership="none">
  41668. <doc xml:space="preserve">the default size of the space allocated to
  41669. hold the string</doc>
  41670. <type name="gsize" c:type="gsize"/>
  41671. </parameter>
  41672. </parameters>
  41673. </function>
  41674. <function name="strip_context"
  41675. c:identifier="g_strip_context"
  41676. version="2.4">
  41677. <doc xml:space="preserve">An auxiliary function for gettext() support (see Q_()).</doc>
  41678. <return-value transfer-ownership="none">
  41679. <doc xml:space="preserve">@msgval, unless @msgval is identical to @msgid
  41680. and contains a '|' character, in which case a pointer to
  41681. the substring of msgid after the first '|' character is returned.</doc>
  41682. <type name="utf8" c:type="const gchar*"/>
  41683. </return-value>
  41684. <parameters>
  41685. <parameter name="msgid" transfer-ownership="none">
  41686. <doc xml:space="preserve">a string</doc>
  41687. <type name="utf8" c:type="const gchar*"/>
  41688. </parameter>
  41689. <parameter name="msgval" transfer-ownership="none">
  41690. <doc xml:space="preserve">another string</doc>
  41691. <type name="utf8" c:type="const gchar*"/>
  41692. </parameter>
  41693. </parameters>
  41694. </function>
  41695. <function name="strjoin" c:identifier="g_strjoin" introspectable="0">
  41696. <doc xml:space="preserve">Joins a number of strings together to form one long string, with the
  41697. optional @separator inserted between each of them. The returned string
  41698. should be freed with g_free().</doc>
  41699. <return-value transfer-ownership="full">
  41700. <doc xml:space="preserve">a newly-allocated string containing all of the strings joined
  41701. together, with @separator between them</doc>
  41702. <type name="utf8" c:type="gchar*"/>
  41703. </return-value>
  41704. <parameters>
  41705. <parameter name="separator"
  41706. transfer-ownership="none"
  41707. nullable="1"
  41708. allow-none="1">
  41709. <doc xml:space="preserve">a string to insert between each of the
  41710. strings, or %NULL</doc>
  41711. <type name="utf8" c:type="const gchar*"/>
  41712. </parameter>
  41713. <parameter name="..." transfer-ownership="none">
  41714. <doc xml:space="preserve">a %NULL-terminated list of strings to join</doc>
  41715. <varargs/>
  41716. </parameter>
  41717. </parameters>
  41718. </function>
  41719. <function name="strjoinv" c:identifier="g_strjoinv">
  41720. <doc xml:space="preserve">Joins a number of strings together to form one long string, with the
  41721. optional @separator inserted between each of them. The returned string
  41722. should be freed with g_free().</doc>
  41723. <return-value transfer-ownership="full">
  41724. <doc xml:space="preserve">a newly-allocated string containing all of the strings joined
  41725. together, with @separator between them</doc>
  41726. <type name="utf8" c:type="gchar*"/>
  41727. </return-value>
  41728. <parameters>
  41729. <parameter name="separator"
  41730. transfer-ownership="none"
  41731. nullable="1"
  41732. allow-none="1">
  41733. <doc xml:space="preserve">a string to insert between each of the
  41734. strings, or %NULL</doc>
  41735. <type name="utf8" c:type="const gchar*"/>
  41736. </parameter>
  41737. <parameter name="str_array" transfer-ownership="none">
  41738. <doc xml:space="preserve">a %NULL-terminated array of strings to join</doc>
  41739. <type name="utf8" c:type="gchar**"/>
  41740. </parameter>
  41741. </parameters>
  41742. </function>
  41743. <function name="strlcat" c:identifier="g_strlcat">
  41744. <doc xml:space="preserve">Portability wrapper that calls strlcat() on systems which have it,
  41745. and emulates it otherwise. Appends nul-terminated @src string to @dest,
  41746. guaranteeing nul-termination for @dest. The total size of @dest won't
  41747. exceed @dest_size.
  41748. At most @dest_size - 1 characters will be copied. Unlike strncat(),
  41749. @dest_size is the full size of dest, not the space left over. This
  41750. function does not allocate memory. It always nul-terminates (unless
  41751. @dest_size == 0 or there were no nul characters in the @dest_size
  41752. characters of dest to start with).
  41753. Caveat: this is supposedly a more secure alternative to strcat() or
  41754. strncat(), but for real security g_strconcat() is harder to mess up.</doc>
  41755. <return-value transfer-ownership="none">
  41756. <doc xml:space="preserve">size of attempted result, which is MIN (dest_size, strlen
  41757. (original dest)) + strlen (src), so if retval &gt;= dest_size,
  41758. truncation occurred.</doc>
  41759. <type name="gsize" c:type="gsize"/>
  41760. </return-value>
  41761. <parameters>
  41762. <parameter name="dest" transfer-ownership="none">
  41763. <doc xml:space="preserve">destination buffer, already containing one nul-terminated string</doc>
  41764. <type name="utf8" c:type="gchar*"/>
  41765. </parameter>
  41766. <parameter name="src" transfer-ownership="none">
  41767. <doc xml:space="preserve">source buffer</doc>
  41768. <type name="utf8" c:type="const gchar*"/>
  41769. </parameter>
  41770. <parameter name="dest_size" transfer-ownership="none">
  41771. <doc xml:space="preserve">length of @dest buffer in bytes (not length of existing string
  41772. inside @dest)</doc>
  41773. <type name="gsize" c:type="gsize"/>
  41774. </parameter>
  41775. </parameters>
  41776. </function>
  41777. <function name="strlcpy" c:identifier="g_strlcpy">
  41778. <doc xml:space="preserve">Portability wrapper that calls strlcpy() on systems which have it,
  41779. and emulates strlcpy() otherwise. Copies @src to @dest; @dest is
  41780. guaranteed to be nul-terminated; @src must be nul-terminated;
  41781. @dest_size is the buffer size, not the number of bytes to copy.
  41782. At most @dest_size - 1 characters will be copied. Always nul-terminates
  41783. (unless @dest_size is 0). This function does not allocate memory. Unlike
  41784. strncpy(), this function doesn't pad @dest (so it's often faster). It
  41785. returns the size of the attempted result, strlen (src), so if
  41786. @retval &gt;= @dest_size, truncation occurred.
  41787. Caveat: strlcpy() is supposedly more secure than strcpy() or strncpy(),
  41788. but if you really want to avoid screwups, g_strdup() is an even better
  41789. idea.</doc>
  41790. <return-value transfer-ownership="none">
  41791. <doc xml:space="preserve">length of @src</doc>
  41792. <type name="gsize" c:type="gsize"/>
  41793. </return-value>
  41794. <parameters>
  41795. <parameter name="dest" transfer-ownership="none">
  41796. <doc xml:space="preserve">destination buffer</doc>
  41797. <type name="utf8" c:type="gchar*"/>
  41798. </parameter>
  41799. <parameter name="src" transfer-ownership="none">
  41800. <doc xml:space="preserve">source buffer</doc>
  41801. <type name="utf8" c:type="const gchar*"/>
  41802. </parameter>
  41803. <parameter name="dest_size" transfer-ownership="none">
  41804. <doc xml:space="preserve">length of @dest in bytes</doc>
  41805. <type name="gsize" c:type="gsize"/>
  41806. </parameter>
  41807. </parameters>
  41808. </function>
  41809. <function name="strncasecmp"
  41810. c:identifier="g_strncasecmp"
  41811. deprecated="1"
  41812. deprecated-version="2.2">
  41813. <doc xml:space="preserve">A case-insensitive string comparison, corresponding to the standard
  41814. strncasecmp() function on platforms which support it. It is similar
  41815. to g_strcasecmp() except it only compares the first @n characters of
  41816. the strings.</doc>
  41817. <doc-deprecated xml:space="preserve">The problem with g_strncasecmp() is that it does
  41818. the comparison by calling toupper()/tolower(). These functions
  41819. are locale-specific and operate on single bytes. However, it is
  41820. impossible to handle things correctly from an internationalization
  41821. standpoint by operating on bytes, since characters may be multibyte.
  41822. Thus g_strncasecmp() is broken if your string is guaranteed to be
  41823. ASCII, since it is locale-sensitive, and it's broken if your string
  41824. is localized, since it doesn't work on many encodings at all,
  41825. including UTF-8, EUC-JP, etc.
  41826. There are therefore two replacement techniques: g_ascii_strncasecmp(),
  41827. which only works on ASCII and is not locale-sensitive, and
  41828. g_utf8_casefold() followed by strcmp() on the resulting strings,
  41829. which is good for case-insensitive sorting of UTF-8.</doc-deprecated>
  41830. <return-value transfer-ownership="none">
  41831. <doc xml:space="preserve">0 if the strings match, a negative value if @s1 &lt; @s2,
  41832. or a positive value if @s1 &gt; @s2.</doc>
  41833. <type name="gint" c:type="gint"/>
  41834. </return-value>
  41835. <parameters>
  41836. <parameter name="s1" transfer-ownership="none">
  41837. <doc xml:space="preserve">a string</doc>
  41838. <type name="utf8" c:type="const gchar*"/>
  41839. </parameter>
  41840. <parameter name="s2" transfer-ownership="none">
  41841. <doc xml:space="preserve">a string to compare with @s1</doc>
  41842. <type name="utf8" c:type="const gchar*"/>
  41843. </parameter>
  41844. <parameter name="n" transfer-ownership="none">
  41845. <doc xml:space="preserve">the maximum number of characters to compare</doc>
  41846. <type name="guint" c:type="guint"/>
  41847. </parameter>
  41848. </parameters>
  41849. </function>
  41850. <function name="strndup" c:identifier="g_strndup">
  41851. <doc xml:space="preserve">Duplicates the first @n bytes of a string, returning a newly-allocated
  41852. buffer @n + 1 bytes long which will always be nul-terminated. If @str
  41853. is less than @n bytes long the buffer is padded with nuls. If @str is
  41854. %NULL it returns %NULL. The returned value should be freed when no longer
  41855. needed.
  41856. To copy a number of characters from a UTF-8 encoded string,
  41857. use g_utf8_strncpy() instead.</doc>
  41858. <return-value transfer-ownership="full">
  41859. <doc xml:space="preserve">a newly-allocated buffer containing the first @n bytes
  41860. of @str, nul-terminated</doc>
  41861. <type name="utf8" c:type="gchar*"/>
  41862. </return-value>
  41863. <parameters>
  41864. <parameter name="str" transfer-ownership="none">
  41865. <doc xml:space="preserve">the string to duplicate</doc>
  41866. <type name="utf8" c:type="const gchar*"/>
  41867. </parameter>
  41868. <parameter name="n" transfer-ownership="none">
  41869. <doc xml:space="preserve">the maximum number of bytes to copy from @str</doc>
  41870. <type name="gsize" c:type="gsize"/>
  41871. </parameter>
  41872. </parameters>
  41873. </function>
  41874. <function name="strnfill" c:identifier="g_strnfill">
  41875. <doc xml:space="preserve">Creates a new string @length bytes long filled with @fill_char.
  41876. The returned string should be freed when no longer needed.</doc>
  41877. <return-value transfer-ownership="full">
  41878. <doc xml:space="preserve">a newly-allocated string filled the @fill_char</doc>
  41879. <type name="utf8" c:type="gchar*"/>
  41880. </return-value>
  41881. <parameters>
  41882. <parameter name="length" transfer-ownership="none">
  41883. <doc xml:space="preserve">the length of the new string</doc>
  41884. <type name="gsize" c:type="gsize"/>
  41885. </parameter>
  41886. <parameter name="fill_char" transfer-ownership="none">
  41887. <doc xml:space="preserve">the byte to fill the string with</doc>
  41888. <type name="gchar" c:type="gchar"/>
  41889. </parameter>
  41890. </parameters>
  41891. </function>
  41892. <function name="strreverse" c:identifier="g_strreverse">
  41893. <doc xml:space="preserve">Reverses all of the bytes in a string. For example,
  41894. `g_strreverse ("abcdef")` will result in "fedcba".
  41895. Note that g_strreverse() doesn't work on UTF-8 strings
  41896. containing multibyte characters. For that purpose, use
  41897. g_utf8_strreverse().</doc>
  41898. <return-value transfer-ownership="full">
  41899. <doc xml:space="preserve">the same pointer passed in as @string</doc>
  41900. <type name="utf8" c:type="gchar*"/>
  41901. </return-value>
  41902. <parameters>
  41903. <parameter name="string" transfer-ownership="none">
  41904. <doc xml:space="preserve">the string to reverse</doc>
  41905. <type name="utf8" c:type="gchar*"/>
  41906. </parameter>
  41907. </parameters>
  41908. </function>
  41909. <function name="strrstr" c:identifier="g_strrstr">
  41910. <doc xml:space="preserve">Searches the string @haystack for the last occurrence
  41911. of the string @needle.</doc>
  41912. <return-value transfer-ownership="full">
  41913. <doc xml:space="preserve">a pointer to the found occurrence, or
  41914. %NULL if not found.</doc>
  41915. <type name="utf8" c:type="gchar*"/>
  41916. </return-value>
  41917. <parameters>
  41918. <parameter name="haystack" transfer-ownership="none">
  41919. <doc xml:space="preserve">a nul-terminated string</doc>
  41920. <type name="utf8" c:type="const gchar*"/>
  41921. </parameter>
  41922. <parameter name="needle" transfer-ownership="none">
  41923. <doc xml:space="preserve">the nul-terminated string to search for</doc>
  41924. <type name="utf8" c:type="const gchar*"/>
  41925. </parameter>
  41926. </parameters>
  41927. </function>
  41928. <function name="strrstr_len" c:identifier="g_strrstr_len">
  41929. <doc xml:space="preserve">Searches the string @haystack for the last occurrence
  41930. of the string @needle, limiting the length of the search
  41931. to @haystack_len.</doc>
  41932. <return-value transfer-ownership="full">
  41933. <doc xml:space="preserve">a pointer to the found occurrence, or
  41934. %NULL if not found.</doc>
  41935. <type name="utf8" c:type="gchar*"/>
  41936. </return-value>
  41937. <parameters>
  41938. <parameter name="haystack" transfer-ownership="none">
  41939. <doc xml:space="preserve">a nul-terminated string</doc>
  41940. <type name="utf8" c:type="const gchar*"/>
  41941. </parameter>
  41942. <parameter name="haystack_len" transfer-ownership="none">
  41943. <doc xml:space="preserve">the maximum length of @haystack</doc>
  41944. <type name="gssize" c:type="gssize"/>
  41945. </parameter>
  41946. <parameter name="needle" transfer-ownership="none">
  41947. <doc xml:space="preserve">the nul-terminated string to search for</doc>
  41948. <type name="utf8" c:type="const gchar*"/>
  41949. </parameter>
  41950. </parameters>
  41951. </function>
  41952. <function name="strsignal" c:identifier="g_strsignal">
  41953. <doc xml:space="preserve">Returns a string describing the given signal, e.g. "Segmentation fault".
  41954. You should use this function in preference to strsignal(), because it
  41955. returns a string in UTF-8 encoding, and since not all platforms support
  41956. the strsignal() function.</doc>
  41957. <return-value transfer-ownership="none">
  41958. <doc xml:space="preserve">a UTF-8 string describing the signal. If the signal is unknown,
  41959. it returns "unknown signal (&lt;signum&gt;)".</doc>
  41960. <type name="utf8" c:type="const gchar*"/>
  41961. </return-value>
  41962. <parameters>
  41963. <parameter name="signum" transfer-ownership="none">
  41964. <doc xml:space="preserve">the signal number. See the `signal` documentation</doc>
  41965. <type name="gint" c:type="gint"/>
  41966. </parameter>
  41967. </parameters>
  41968. </function>
  41969. <function name="strsplit" c:identifier="g_strsplit" introspectable="0">
  41970. <doc xml:space="preserve">Splits a string into a maximum of @max_tokens pieces, using the given
  41971. @delimiter. If @max_tokens is reached, the remainder of @string is
  41972. appended to the last token.
  41973. As an example, the result of g_strsplit (":a:bc::d:", ":", -1) is a
  41974. %NULL-terminated vector containing the six strings "", "a", "bc", "", "d"
  41975. and "".
  41976. As a special case, the result of splitting the empty string "" is an empty
  41977. vector, not a vector containing a single string. The reason for this
  41978. special case is that being able to represent a empty vector is typically
  41979. more useful than consistent handling of empty elements. If you do need
  41980. to represent empty elements, you'll need to check for the empty string
  41981. before calling g_strsplit().</doc>
  41982. <return-value>
  41983. <doc xml:space="preserve">a newly-allocated %NULL-terminated array of strings. Use
  41984. g_strfreev() to free it.</doc>
  41985. <array c:type="gchar**">
  41986. <type name="utf8"/>
  41987. </array>
  41988. </return-value>
  41989. <parameters>
  41990. <parameter name="string" transfer-ownership="none">
  41991. <doc xml:space="preserve">a string to split</doc>
  41992. <type name="utf8" c:type="const gchar*"/>
  41993. </parameter>
  41994. <parameter name="delimiter" transfer-ownership="none">
  41995. <doc xml:space="preserve">a string which specifies the places at which to split
  41996. the string. The delimiter is not included in any of the resulting
  41997. strings, unless @max_tokens is reached.</doc>
  41998. <type name="utf8" c:type="const gchar*"/>
  41999. </parameter>
  42000. <parameter name="max_tokens" transfer-ownership="none">
  42001. <doc xml:space="preserve">the maximum number of pieces to split @string into.
  42002. If this is less than 1, the string is split completely.</doc>
  42003. <type name="gint" c:type="gint"/>
  42004. </parameter>
  42005. </parameters>
  42006. </function>
  42007. <function name="strsplit_set"
  42008. c:identifier="g_strsplit_set"
  42009. version="2.4"
  42010. introspectable="0">
  42011. <doc xml:space="preserve">Splits @string into a number of tokens not containing any of the characters
  42012. in @delimiter. A token is the (possibly empty) longest string that does not
  42013. contain any of the characters in @delimiters. If @max_tokens is reached, the
  42014. remainder is appended to the last token.
  42015. For example the result of g_strsplit_set ("abc:def/ghi", ":/", -1) is a
  42016. %NULL-terminated vector containing the three strings "abc", "def",
  42017. and "ghi".
  42018. The result of g_strsplit_set (":def/ghi:", ":/", -1) is a %NULL-terminated
  42019. vector containing the four strings "", "def", "ghi", and "".
  42020. As a special case, the result of splitting the empty string "" is an empty
  42021. vector, not a vector containing a single string. The reason for this
  42022. special case is that being able to represent a empty vector is typically
  42023. more useful than consistent handling of empty elements. If you do need
  42024. to represent empty elements, you'll need to check for the empty string
  42025. before calling g_strsplit_set().
  42026. Note that this function works on bytes not characters, so it can't be used
  42027. to delimit UTF-8 strings for anything but ASCII characters.</doc>
  42028. <return-value>
  42029. <doc xml:space="preserve">a newly-allocated %NULL-terminated array of strings. Use
  42030. g_strfreev() to free it.</doc>
  42031. <array c:type="gchar**">
  42032. <type name="utf8"/>
  42033. </array>
  42034. </return-value>
  42035. <parameters>
  42036. <parameter name="string" transfer-ownership="none">
  42037. <doc xml:space="preserve">The string to be tokenized</doc>
  42038. <type name="utf8" c:type="const gchar*"/>
  42039. </parameter>
  42040. <parameter name="delimiters" transfer-ownership="none">
  42041. <doc xml:space="preserve">A nul-terminated string containing bytes that are used
  42042. to split the string.</doc>
  42043. <type name="utf8" c:type="const gchar*"/>
  42044. </parameter>
  42045. <parameter name="max_tokens" transfer-ownership="none">
  42046. <doc xml:space="preserve">The maximum number of tokens to split @string into.
  42047. If this is less than 1, the string is split completely</doc>
  42048. <type name="gint" c:type="gint"/>
  42049. </parameter>
  42050. </parameters>
  42051. </function>
  42052. <function name="strstr_len" c:identifier="g_strstr_len">
  42053. <doc xml:space="preserve">Searches the string @haystack for the first occurrence
  42054. of the string @needle, limiting the length of the search
  42055. to @haystack_len.</doc>
  42056. <return-value transfer-ownership="full">
  42057. <doc xml:space="preserve">a pointer to the found occurrence, or
  42058. %NULL if not found.</doc>
  42059. <type name="utf8" c:type="gchar*"/>
  42060. </return-value>
  42061. <parameters>
  42062. <parameter name="haystack" transfer-ownership="none">
  42063. <doc xml:space="preserve">a string</doc>
  42064. <type name="utf8" c:type="const gchar*"/>
  42065. </parameter>
  42066. <parameter name="haystack_len" transfer-ownership="none">
  42067. <doc xml:space="preserve">the maximum length of @haystack. Note that -1 is
  42068. a valid length, if @haystack is nul-terminated, meaning it will
  42069. search through the whole string.</doc>
  42070. <type name="gssize" c:type="gssize"/>
  42071. </parameter>
  42072. <parameter name="needle" transfer-ownership="none">
  42073. <doc xml:space="preserve">the string to search for</doc>
  42074. <type name="utf8" c:type="const gchar*"/>
  42075. </parameter>
  42076. </parameters>
  42077. </function>
  42078. <function name="strtod" c:identifier="g_strtod">
  42079. <doc xml:space="preserve">Converts a string to a #gdouble value.
  42080. It calls the standard strtod() function to handle the conversion, but
  42081. if the string is not completely converted it attempts the conversion
  42082. again with g_ascii_strtod(), and returns the best match.
  42083. This function should seldom be used. The normal situation when reading
  42084. numbers not for human consumption is to use g_ascii_strtod(). Only when
  42085. you know that you must expect both locale formatted and C formatted numbers
  42086. should you use this. Make sure that you don't pass strings such as comma
  42087. separated lists of values, since the commas may be interpreted as a decimal
  42088. point in some locales, causing unexpected results.</doc>
  42089. <return-value transfer-ownership="none">
  42090. <doc xml:space="preserve">the #gdouble value.</doc>
  42091. <type name="gdouble" c:type="gdouble"/>
  42092. </return-value>
  42093. <parameters>
  42094. <parameter name="nptr" transfer-ownership="none">
  42095. <doc xml:space="preserve">the string to convert to a numeric value.</doc>
  42096. <type name="utf8" c:type="const gchar*"/>
  42097. </parameter>
  42098. <parameter name="endptr"
  42099. direction="out"
  42100. caller-allocates="0"
  42101. transfer-ownership="none"
  42102. optional="1"
  42103. allow-none="1">
  42104. <doc xml:space="preserve">if non-%NULL, it returns the
  42105. character after the last character used in the conversion.</doc>
  42106. <type name="utf8" c:type="gchar**"/>
  42107. </parameter>
  42108. </parameters>
  42109. </function>
  42110. <function name="strup"
  42111. c:identifier="g_strup"
  42112. deprecated="1"
  42113. deprecated-version="2.2">
  42114. <doc xml:space="preserve">Converts a string to upper case.</doc>
  42115. <doc-deprecated xml:space="preserve">This function is totally broken for the reasons
  42116. discussed in the g_strncasecmp() docs - use g_ascii_strup()
  42117. or g_utf8_strup() instead.</doc-deprecated>
  42118. <return-value transfer-ownership="full">
  42119. <doc xml:space="preserve">the string</doc>
  42120. <type name="utf8" c:type="gchar*"/>
  42121. </return-value>
  42122. <parameters>
  42123. <parameter name="string" transfer-ownership="none">
  42124. <doc xml:space="preserve">the string to convert</doc>
  42125. <type name="utf8" c:type="gchar*"/>
  42126. </parameter>
  42127. </parameters>
  42128. </function>
  42129. <function name="strv_contains"
  42130. c:identifier="g_strv_contains"
  42131. version="2.44">
  42132. <doc xml:space="preserve">Checks if @strv contains @str. @strv must not be %NULL.</doc>
  42133. <return-value transfer-ownership="none">
  42134. <doc xml:space="preserve">%TRUE if @str is an element of @strv, according to g_str_equal().</doc>
  42135. <type name="gboolean" c:type="gboolean"/>
  42136. </return-value>
  42137. <parameters>
  42138. <parameter name="strv" transfer-ownership="none">
  42139. <doc xml:space="preserve">a %NULL-terminated array of strings</doc>
  42140. <type name="utf8" c:type="const gchar* const*"/>
  42141. </parameter>
  42142. <parameter name="str" transfer-ownership="none">
  42143. <doc xml:space="preserve">a string</doc>
  42144. <type name="utf8" c:type="const gchar*"/>
  42145. </parameter>
  42146. </parameters>
  42147. </function>
  42148. <function name="strv_get_type" c:identifier="g_strv_get_type">
  42149. <return-value transfer-ownership="none">
  42150. <type name="GType" c:type="GType"/>
  42151. </return-value>
  42152. </function>
  42153. <function name="strv_length" c:identifier="g_strv_length" version="2.6">
  42154. <doc xml:space="preserve">Returns the length of the given %NULL-terminated
  42155. string array @str_array.</doc>
  42156. <return-value transfer-ownership="none">
  42157. <doc xml:space="preserve">length of @str_array.</doc>
  42158. <type name="guint" c:type="guint"/>
  42159. </return-value>
  42160. <parameters>
  42161. <parameter name="str_array" transfer-ownership="none">
  42162. <doc xml:space="preserve">a %NULL-terminated array of strings</doc>
  42163. <type name="utf8" c:type="gchar**"/>
  42164. </parameter>
  42165. </parameters>
  42166. </function>
  42167. <function name="test_add_data_func"
  42168. c:identifier="g_test_add_data_func"
  42169. version="2.16">
  42170. <doc xml:space="preserve">Create a new test case, similar to g_test_create_case(). However
  42171. the test is assumed to use no fixture, and test suites are automatically
  42172. created on the fly and added to the root fixture, based on the
  42173. slash-separated portions of @testpath. The @test_data argument
  42174. will be passed as first argument to @test_func.
  42175. If @testpath includes the component "subprocess" anywhere in it,
  42176. the test will be skipped by default, and only run if explicitly
  42177. required via the `-p` command-line option or g_test_trap_subprocess().</doc>
  42178. <return-value transfer-ownership="none">
  42179. <type name="none" c:type="void"/>
  42180. </return-value>
  42181. <parameters>
  42182. <parameter name="testpath" transfer-ownership="none">
  42183. <doc xml:space="preserve">/-separated test case path name for the test.</doc>
  42184. <type name="utf8" c:type="const char*"/>
  42185. </parameter>
  42186. <parameter name="test_data"
  42187. transfer-ownership="none"
  42188. nullable="1"
  42189. allow-none="1">
  42190. <doc xml:space="preserve">Test data argument for the test function.</doc>
  42191. <type name="gpointer" c:type="gconstpointer"/>
  42192. </parameter>
  42193. <parameter name="test_func" transfer-ownership="none" scope="async">
  42194. <doc xml:space="preserve">The test function to invoke for this test.</doc>
  42195. <type name="TestDataFunc" c:type="GTestDataFunc"/>
  42196. </parameter>
  42197. </parameters>
  42198. </function>
  42199. <function name="test_add_data_func_full"
  42200. c:identifier="g_test_add_data_func_full"
  42201. version="2.34">
  42202. <doc xml:space="preserve">Create a new test case, as with g_test_add_data_func(), but freeing
  42203. @test_data after the test run is complete.</doc>
  42204. <return-value transfer-ownership="none">
  42205. <type name="none" c:type="void"/>
  42206. </return-value>
  42207. <parameters>
  42208. <parameter name="testpath" transfer-ownership="none">
  42209. <doc xml:space="preserve">/-separated test case path name for the test.</doc>
  42210. <type name="utf8" c:type="const char*"/>
  42211. </parameter>
  42212. <parameter name="test_data"
  42213. transfer-ownership="none"
  42214. nullable="1"
  42215. allow-none="1">
  42216. <doc xml:space="preserve">Test data argument for the test function.</doc>
  42217. <type name="gpointer" c:type="gpointer"/>
  42218. </parameter>
  42219. <parameter name="test_func"
  42220. transfer-ownership="none"
  42221. scope="notified"
  42222. destroy="3">
  42223. <doc xml:space="preserve">The test function to invoke for this test.</doc>
  42224. <type name="TestDataFunc" c:type="GTestDataFunc"/>
  42225. </parameter>
  42226. <parameter name="data_free_func"
  42227. transfer-ownership="none"
  42228. scope="async">
  42229. <doc xml:space="preserve">#GDestroyNotify for @test_data.</doc>
  42230. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  42231. </parameter>
  42232. </parameters>
  42233. </function>
  42234. <function name="test_add_func"
  42235. c:identifier="g_test_add_func"
  42236. version="2.16">
  42237. <doc xml:space="preserve">Create a new test case, similar to g_test_create_case(). However
  42238. the test is assumed to use no fixture, and test suites are automatically
  42239. created on the fly and added to the root fixture, based on the
  42240. slash-separated portions of @testpath.
  42241. If @testpath includes the component "subprocess" anywhere in it,
  42242. the test will be skipped by default, and only run if explicitly
  42243. required via the `-p` command-line option or g_test_trap_subprocess().</doc>
  42244. <return-value transfer-ownership="none">
  42245. <type name="none" c:type="void"/>
  42246. </return-value>
  42247. <parameters>
  42248. <parameter name="testpath" transfer-ownership="none">
  42249. <doc xml:space="preserve">/-separated test case path name for the test.</doc>
  42250. <type name="utf8" c:type="const char*"/>
  42251. </parameter>
  42252. <parameter name="test_func" transfer-ownership="none" scope="async">
  42253. <doc xml:space="preserve">The test function to invoke for this test.</doc>
  42254. <type name="TestFunc" c:type="GTestFunc"/>
  42255. </parameter>
  42256. </parameters>
  42257. </function>
  42258. <function name="test_add_vtable"
  42259. c:identifier="g_test_add_vtable"
  42260. introspectable="0">
  42261. <return-value transfer-ownership="none">
  42262. <type name="none" c:type="void"/>
  42263. </return-value>
  42264. <parameters>
  42265. <parameter name="testpath" transfer-ownership="none">
  42266. <type name="utf8" c:type="const char*"/>
  42267. </parameter>
  42268. <parameter name="data_size" transfer-ownership="none">
  42269. <type name="gsize" c:type="gsize"/>
  42270. </parameter>
  42271. <parameter name="test_data"
  42272. transfer-ownership="none"
  42273. nullable="1"
  42274. allow-none="1">
  42275. <type name="gpointer" c:type="gconstpointer"/>
  42276. </parameter>
  42277. <parameter name="data_setup" transfer-ownership="none">
  42278. <type name="TestFixtureFunc" c:type="GTestFixtureFunc"/>
  42279. </parameter>
  42280. <parameter name="data_test" transfer-ownership="none">
  42281. <type name="TestFixtureFunc" c:type="GTestFixtureFunc"/>
  42282. </parameter>
  42283. <parameter name="data_teardown" transfer-ownership="none">
  42284. <type name="TestFixtureFunc" c:type="GTestFixtureFunc"/>
  42285. </parameter>
  42286. </parameters>
  42287. </function>
  42288. <function name="test_assert_expected_messages_internal"
  42289. c:identifier="g_test_assert_expected_messages_internal">
  42290. <return-value transfer-ownership="none">
  42291. <type name="none" c:type="void"/>
  42292. </return-value>
  42293. <parameters>
  42294. <parameter name="domain" transfer-ownership="none">
  42295. <type name="utf8" c:type="const char*"/>
  42296. </parameter>
  42297. <parameter name="file" transfer-ownership="none">
  42298. <type name="utf8" c:type="const char*"/>
  42299. </parameter>
  42300. <parameter name="line" transfer-ownership="none">
  42301. <type name="gint" c:type="int"/>
  42302. </parameter>
  42303. <parameter name="func" transfer-ownership="none">
  42304. <type name="utf8" c:type="const char*"/>
  42305. </parameter>
  42306. </parameters>
  42307. </function>
  42308. <function name="test_bug" c:identifier="g_test_bug" version="2.16">
  42309. <doc xml:space="preserve">This function adds a message to test reports that
  42310. associates a bug URI with a test case.
  42311. Bug URIs are constructed from a base URI set with g_test_bug_base()
  42312. and @bug_uri_snippet.</doc>
  42313. <return-value transfer-ownership="none">
  42314. <type name="none" c:type="void"/>
  42315. </return-value>
  42316. <parameters>
  42317. <parameter name="bug_uri_snippet" transfer-ownership="none">
  42318. <doc xml:space="preserve">Bug specific bug tracker URI portion.</doc>
  42319. <type name="utf8" c:type="const char*"/>
  42320. </parameter>
  42321. </parameters>
  42322. </function>
  42323. <function name="test_bug_base"
  42324. c:identifier="g_test_bug_base"
  42325. version="2.16">
  42326. <doc xml:space="preserve">Specify the base URI for bug reports.
  42327. The base URI is used to construct bug report messages for
  42328. g_test_message() when g_test_bug() is called.
  42329. Calling this function outside of a test case sets the
  42330. default base URI for all test cases. Calling it from within
  42331. a test case changes the base URI for the scope of the test
  42332. case only.
  42333. Bug URIs are constructed by appending a bug specific URI
  42334. portion to @uri_pattern, or by replacing the special string
  42335. '\%s' within @uri_pattern if that is present.</doc>
  42336. <return-value transfer-ownership="none">
  42337. <type name="none" c:type="void"/>
  42338. </return-value>
  42339. <parameters>
  42340. <parameter name="uri_pattern" transfer-ownership="none">
  42341. <doc xml:space="preserve">the base pattern for bug URIs</doc>
  42342. <type name="utf8" c:type="const char*"/>
  42343. </parameter>
  42344. </parameters>
  42345. </function>
  42346. <function name="test_build_filename"
  42347. c:identifier="g_test_build_filename"
  42348. version="2.38"
  42349. introspectable="0">
  42350. <doc xml:space="preserve">Creates the pathname to a data file that is required for a test.
  42351. This function is conceptually similar to g_build_filename() except
  42352. that the first argument has been replaced with a #GTestFileType
  42353. argument.
  42354. The data file should either have been distributed with the module
  42355. containing the test (%G_TEST_DIST) or built as part of the build
  42356. system of that module (%G_TEST_BUILT).
  42357. In order for this function to work in srcdir != builddir situations,
  42358. the G_TEST_SRCDIR and G_TEST_BUILDDIR environment variables need to
  42359. have been defined. As of 2.38, this is done by the glib.mk
  42360. included in GLib. Please ensure that your copy is up to date before
  42361. using this function.
  42362. In case neither variable is set, this function will fall back to
  42363. using the dirname portion of argv[0], possibly removing ".libs".
  42364. This allows for casual running of tests directly from the commandline
  42365. in the srcdir == builddir case and should also support running of
  42366. installed tests, assuming the data files have been installed in the
  42367. same relative path as the test binary.</doc>
  42368. <return-value transfer-ownership="full">
  42369. <doc xml:space="preserve">the path of the file, to be freed using g_free()</doc>
  42370. <type name="utf8" c:type="gchar*"/>
  42371. </return-value>
  42372. <parameters>
  42373. <parameter name="file_type" transfer-ownership="none">
  42374. <doc xml:space="preserve">the type of file (built vs. distributed)</doc>
  42375. <type name="TestFileType" c:type="GTestFileType"/>
  42376. </parameter>
  42377. <parameter name="first_path" transfer-ownership="none">
  42378. <doc xml:space="preserve">the first segment of the pathname</doc>
  42379. <type name="utf8" c:type="const gchar*"/>
  42380. </parameter>
  42381. <parameter name="..." transfer-ownership="none">
  42382. <doc xml:space="preserve">%NULL-terminated additional path segments</doc>
  42383. <varargs/>
  42384. </parameter>
  42385. </parameters>
  42386. </function>
  42387. <function name="test_create_case"
  42388. c:identifier="g_test_create_case"
  42389. version="2.16"
  42390. introspectable="0">
  42391. <doc xml:space="preserve">Create a new #GTestCase, named @test_name, this API is fairly
  42392. low level, calling g_test_add() or g_test_add_func() is preferable.
  42393. When this test is executed, a fixture structure of size @data_size
  42394. will be automatically allocated and filled with zeros. Then @data_setup is
  42395. called to initialize the fixture. After fixture setup, the actual test
  42396. function @data_test is called. Once the test run completes, the
  42397. fixture structure is torn down by calling @data_teardown and
  42398. after that the memory is automatically released by the test framework.
  42399. Splitting up a test run into fixture setup, test function and
  42400. fixture teardown is most useful if the same fixture is used for
  42401. multiple tests. In this cases, g_test_create_case() will be
  42402. called with the same fixture, but varying @test_name and
  42403. @data_test arguments.</doc>
  42404. <return-value>
  42405. <doc xml:space="preserve">a newly allocated #GTestCase.</doc>
  42406. <type name="TestCase" c:type="GTestCase*"/>
  42407. </return-value>
  42408. <parameters>
  42409. <parameter name="test_name" transfer-ownership="none">
  42410. <doc xml:space="preserve">the name for the test case</doc>
  42411. <type name="utf8" c:type="const char*"/>
  42412. </parameter>
  42413. <parameter name="data_size" transfer-ownership="none">
  42414. <doc xml:space="preserve">the size of the fixture data structure</doc>
  42415. <type name="gsize" c:type="gsize"/>
  42416. </parameter>
  42417. <parameter name="test_data"
  42418. transfer-ownership="none"
  42419. nullable="1"
  42420. allow-none="1">
  42421. <doc xml:space="preserve">test data argument for the test functions</doc>
  42422. <type name="gpointer" c:type="gconstpointer"/>
  42423. </parameter>
  42424. <parameter name="data_setup" transfer-ownership="none" scope="async">
  42425. <doc xml:space="preserve">the function to set up the fixture data</doc>
  42426. <type name="TestFixtureFunc" c:type="GTestFixtureFunc"/>
  42427. </parameter>
  42428. <parameter name="data_test" transfer-ownership="none" scope="async">
  42429. <doc xml:space="preserve">the actual test function</doc>
  42430. <type name="TestFixtureFunc" c:type="GTestFixtureFunc"/>
  42431. </parameter>
  42432. <parameter name="data_teardown"
  42433. transfer-ownership="none"
  42434. scope="async">
  42435. <doc xml:space="preserve">the function to teardown the fixture data</doc>
  42436. <type name="TestFixtureFunc" c:type="GTestFixtureFunc"/>
  42437. </parameter>
  42438. </parameters>
  42439. </function>
  42440. <function name="test_create_suite"
  42441. c:identifier="g_test_create_suite"
  42442. version="2.16"
  42443. introspectable="0">
  42444. <doc xml:space="preserve">Create a new test suite with the name @suite_name.</doc>
  42445. <return-value>
  42446. <doc xml:space="preserve">A newly allocated #GTestSuite instance.</doc>
  42447. <type name="TestSuite" c:type="GTestSuite*"/>
  42448. </return-value>
  42449. <parameters>
  42450. <parameter name="suite_name" transfer-ownership="none">
  42451. <doc xml:space="preserve">a name for the suite</doc>
  42452. <type name="utf8" c:type="const char*"/>
  42453. </parameter>
  42454. </parameters>
  42455. </function>
  42456. <function name="test_expect_message"
  42457. c:identifier="g_test_expect_message"
  42458. version="2.34">
  42459. <doc xml:space="preserve">Indicates that a message with the given @log_domain and @log_level,
  42460. with text matching @pattern, is expected to be logged. When this
  42461. message is logged, it will not be printed, and the test case will
  42462. not abort.
  42463. Use g_test_assert_expected_messages() to assert that all
  42464. previously-expected messages have been seen and suppressed.
  42465. You can call this multiple times in a row, if multiple messages are
  42466. expected as a result of a single call. (The messages must appear in
  42467. the same order as the calls to g_test_expect_message().)
  42468. For example:
  42469. |[&lt;!-- language="C" --&gt;
  42470. // g_main_context_push_thread_default() should fail if the
  42471. // context is already owned by another thread.
  42472. g_test_expect_message (G_LOG_DOMAIN,
  42473. G_LOG_LEVEL_CRITICAL,
  42474. "assertion*acquired_context*failed");
  42475. g_main_context_push_thread_default (bad_context);
  42476. g_test_assert_expected_messages ();
  42477. ]|
  42478. Note that you cannot use this to test g_error() messages, since
  42479. g_error() intentionally never returns even if the program doesn't
  42480. abort; use g_test_trap_subprocess() in this case.
  42481. If messages at %G_LOG_LEVEL_DEBUG are emitted, but not explicitly
  42482. expected via g_test_expect_message() then they will be ignored.</doc>
  42483. <return-value transfer-ownership="none">
  42484. <type name="none" c:type="void"/>
  42485. </return-value>
  42486. <parameters>
  42487. <parameter name="log_domain"
  42488. transfer-ownership="none"
  42489. nullable="1"
  42490. allow-none="1">
  42491. <doc xml:space="preserve">the log domain of the message</doc>
  42492. <type name="utf8" c:type="const gchar*"/>
  42493. </parameter>
  42494. <parameter name="log_level" transfer-ownership="none">
  42495. <doc xml:space="preserve">the log level of the message</doc>
  42496. <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
  42497. </parameter>
  42498. <parameter name="pattern" transfer-ownership="none">
  42499. <doc xml:space="preserve">a glob-style [pattern][glib-Glob-style-pattern-matching]</doc>
  42500. <type name="utf8" c:type="const gchar*"/>
  42501. </parameter>
  42502. </parameters>
  42503. </function>
  42504. <function name="test_fail" c:identifier="g_test_fail" version="2.30">
  42505. <doc xml:space="preserve">Indicates that a test failed. This function can be called
  42506. multiple times from the same test. You can use this function
  42507. if your test failed in a recoverable way.
  42508. Do not use this function if the failure of a test could cause
  42509. other tests to malfunction.
  42510. Calling this function will not stop the test from running, you
  42511. need to return from the test function yourself. So you can
  42512. produce additional diagnostic messages or even continue running
  42513. the test.
  42514. If not called from inside a test, this function does nothing.</doc>
  42515. <return-value transfer-ownership="none">
  42516. <type name="none" c:type="void"/>
  42517. </return-value>
  42518. </function>
  42519. <function name="test_failed" c:identifier="g_test_failed" version="2.38">
  42520. <doc xml:space="preserve">Returns whether a test has already failed. This will
  42521. be the case when g_test_fail(), g_test_incomplete()
  42522. or g_test_skip() have been called, but also if an
  42523. assertion has failed.
  42524. This can be useful to return early from a test if
  42525. continuing after a failed assertion might be harmful.
  42526. The return value of this function is only meaningful
  42527. if it is called from inside a test function.</doc>
  42528. <return-value transfer-ownership="none">
  42529. <doc xml:space="preserve">%TRUE if the test has failed</doc>
  42530. <type name="gboolean" c:type="gboolean"/>
  42531. </return-value>
  42532. </function>
  42533. <function name="test_get_dir" c:identifier="g_test_get_dir" version="2.38">
  42534. <doc xml:space="preserve">Gets the pathname of the directory containing test files of the type
  42535. specified by @file_type.
  42536. This is approximately the same as calling g_test_build_filename("."),
  42537. but you don't need to free the return value.</doc>
  42538. <return-value transfer-ownership="none">
  42539. <doc xml:space="preserve">the path of the directory, owned by GLib</doc>
  42540. <type name="utf8" c:type="const gchar*"/>
  42541. </return-value>
  42542. <parameters>
  42543. <parameter name="file_type" transfer-ownership="none">
  42544. <doc xml:space="preserve">the type of file (built vs. distributed)</doc>
  42545. <type name="TestFileType" c:type="GTestFileType"/>
  42546. </parameter>
  42547. </parameters>
  42548. </function>
  42549. <function name="test_get_filename"
  42550. c:identifier="g_test_get_filename"
  42551. version="2.38"
  42552. introspectable="0">
  42553. <doc xml:space="preserve">Gets the pathname to a data file that is required for a test.
  42554. This is the same as g_test_build_filename() with two differences.
  42555. The first difference is that must only use this function from within
  42556. a testcase function. The second difference is that you need not free
  42557. the return value -- it will be automatically freed when the testcase
  42558. finishes running.
  42559. It is safe to use this function from a thread inside of a testcase
  42560. but you must ensure that all such uses occur before the main testcase
  42561. function returns (ie: it is best to ensure that all threads have been
  42562. joined).</doc>
  42563. <return-value transfer-ownership="none">
  42564. <doc xml:space="preserve">the path, automatically freed at the end of the testcase</doc>
  42565. <type name="utf8" c:type="const gchar*"/>
  42566. </return-value>
  42567. <parameters>
  42568. <parameter name="file_type" transfer-ownership="none">
  42569. <doc xml:space="preserve">the type of file (built vs. distributed)</doc>
  42570. <type name="TestFileType" c:type="GTestFileType"/>
  42571. </parameter>
  42572. <parameter name="first_path" transfer-ownership="none">
  42573. <doc xml:space="preserve">the first segment of the pathname</doc>
  42574. <type name="utf8" c:type="const gchar*"/>
  42575. </parameter>
  42576. <parameter name="..." transfer-ownership="none">
  42577. <doc xml:space="preserve">%NULL-terminated additional path segments</doc>
  42578. <varargs/>
  42579. </parameter>
  42580. </parameters>
  42581. </function>
  42582. <function name="test_get_root"
  42583. c:identifier="g_test_get_root"
  42584. version="2.16"
  42585. introspectable="0">
  42586. <doc xml:space="preserve">Get the toplevel test suite for the test path API.</doc>
  42587. <return-value>
  42588. <doc xml:space="preserve">the toplevel #GTestSuite</doc>
  42589. <type name="TestSuite" c:type="GTestSuite*"/>
  42590. </return-value>
  42591. </function>
  42592. <function name="test_incomplete"
  42593. c:identifier="g_test_incomplete"
  42594. version="2.38">
  42595. <doc xml:space="preserve">Indicates that a test failed because of some incomplete
  42596. functionality. This function can be called multiple times
  42597. from the same test.
  42598. Calling this function will not stop the test from running, you
  42599. need to return from the test function yourself. So you can
  42600. produce additional diagnostic messages or even continue running
  42601. the test.
  42602. If not called from inside a test, this function does nothing.</doc>
  42603. <return-value transfer-ownership="none">
  42604. <type name="none" c:type="void"/>
  42605. </return-value>
  42606. <parameters>
  42607. <parameter name="msg"
  42608. transfer-ownership="none"
  42609. nullable="1"
  42610. allow-none="1">
  42611. <doc xml:space="preserve">explanation</doc>
  42612. <type name="utf8" c:type="const gchar*"/>
  42613. </parameter>
  42614. </parameters>
  42615. </function>
  42616. <function name="test_init"
  42617. c:identifier="g_test_init"
  42618. version="2.16"
  42619. introspectable="0">
  42620. <doc xml:space="preserve">Initialize the GLib testing framework, e.g. by seeding the
  42621. test random number generator, the name for g_get_prgname()
  42622. and parsing test related command line args.
  42623. So far, the following arguments are understood:
  42624. - `-l`: List test cases available in a test executable.
  42625. - `--seed=SEED`: Provide a random seed to reproduce test
  42626. runs using random numbers.
  42627. - `--verbose`: Run tests verbosely.
  42628. - `-q`, `--quiet`: Run tests quietly.
  42629. - `-p PATH`: Execute all tests matching the given path.
  42630. This can also be used to force a test to run that would otherwise
  42631. be skipped (ie, a test whose name contains "/subprocess").
  42632. - `-m {perf|slow|thorough|quick|undefined|no-undefined}`: Execute tests according to these test modes:
  42633. `perf`: Performance tests, may take long and report results.
  42634. `slow`, `thorough`: Slow and thorough tests, may take quite long and maximize coverage.
  42635. `quick`: Quick tests, should run really quickly and give good coverage.
  42636. `undefined`: Tests for undefined behaviour, may provoke programming errors
  42637. under g_test_trap_subprocess() or g_test_expect_messages() to check
  42638. that appropriate assertions or warnings are given
  42639. `no-undefined`: Avoid tests for undefined behaviour
  42640. - `--debug-log`: Debug test logging output.</doc>
  42641. <return-value transfer-ownership="none">
  42642. <type name="none" c:type="void"/>
  42643. </return-value>
  42644. <parameters>
  42645. <parameter name="argc" transfer-ownership="none">
  42646. <doc xml:space="preserve">Address of the @argc parameter of the main() function.
  42647. Changed if any arguments were handled.</doc>
  42648. <type name="gint" c:type="int*"/>
  42649. </parameter>
  42650. <parameter name="argv" transfer-ownership="none">
  42651. <doc xml:space="preserve">Address of the @argv parameter of main().
  42652. Any parameters understood by g_test_init() stripped before return.</doc>
  42653. <type name="utf8" c:type="char***"/>
  42654. </parameter>
  42655. <parameter name="..." transfer-ownership="none">
  42656. <doc xml:space="preserve">%NULL-terminated list of special options. Currently the only
  42657. defined option is `"no_g_set_prgname"`, which
  42658. will cause g_test_init() to not call g_set_prgname().</doc>
  42659. <varargs/>
  42660. </parameter>
  42661. </parameters>
  42662. </function>
  42663. <function name="test_log_set_fatal_handler"
  42664. c:identifier="g_test_log_set_fatal_handler"
  42665. version="2.22"
  42666. introspectable="0">
  42667. <doc xml:space="preserve">Installs a non-error fatal log handler which can be
  42668. used to decide whether log messages which are counted
  42669. as fatal abort the program.
  42670. The use case here is that you are running a test case
  42671. that depends on particular libraries or circumstances
  42672. and cannot prevent certain known critical or warning
  42673. messages. So you install a handler that compares the
  42674. domain and message to precisely not abort in such a case.
  42675. Note that the handler is reset at the beginning of
  42676. any test case, so you have to set it inside each test
  42677. function which needs the special behavior.
  42678. This handler has no effect on g_error messages.</doc>
  42679. <return-value transfer-ownership="none">
  42680. <type name="none" c:type="void"/>
  42681. </return-value>
  42682. <parameters>
  42683. <parameter name="log_func" transfer-ownership="none" closure="1">
  42684. <doc xml:space="preserve">the log handler function.</doc>
  42685. <type name="TestLogFatalFunc" c:type="GTestLogFatalFunc"/>
  42686. </parameter>
  42687. <parameter name="user_data"
  42688. transfer-ownership="none"
  42689. nullable="1"
  42690. allow-none="1">
  42691. <doc xml:space="preserve">data passed to the log handler.</doc>
  42692. <type name="gpointer" c:type="gpointer"/>
  42693. </parameter>
  42694. </parameters>
  42695. </function>
  42696. <function name="test_log_type_name" c:identifier="g_test_log_type_name">
  42697. <return-value transfer-ownership="none">
  42698. <type name="utf8" c:type="const char*"/>
  42699. </return-value>
  42700. <parameters>
  42701. <parameter name="log_type" transfer-ownership="none">
  42702. <type name="TestLogType" c:type="GTestLogType"/>
  42703. </parameter>
  42704. </parameters>
  42705. </function>
  42706. <function name="test_maximized_result"
  42707. c:identifier="g_test_maximized_result"
  42708. version="2.16"
  42709. introspectable="0">
  42710. <doc xml:space="preserve">Report the result of a performance or measurement test.
  42711. The test should generally strive to maximize the reported
  42712. quantities (larger values are better than smaller ones),
  42713. this and @maximized_quantity can determine sorting
  42714. order for test result reports.</doc>
  42715. <return-value transfer-ownership="none">
  42716. <type name="none" c:type="void"/>
  42717. </return-value>
  42718. <parameters>
  42719. <parameter name="maximized_quantity" transfer-ownership="none">
  42720. <doc xml:space="preserve">the reported value</doc>
  42721. <type name="gdouble" c:type="double"/>
  42722. </parameter>
  42723. <parameter name="format" transfer-ownership="none">
  42724. <doc xml:space="preserve">the format string of the report message</doc>
  42725. <type name="utf8" c:type="const char*"/>
  42726. </parameter>
  42727. <parameter name="..." transfer-ownership="none">
  42728. <doc xml:space="preserve">arguments to pass to the printf() function</doc>
  42729. <varargs/>
  42730. </parameter>
  42731. </parameters>
  42732. </function>
  42733. <function name="test_message"
  42734. c:identifier="g_test_message"
  42735. version="2.16"
  42736. introspectable="0">
  42737. <doc xml:space="preserve">Add a message to the test report.</doc>
  42738. <return-value transfer-ownership="none">
  42739. <type name="none" c:type="void"/>
  42740. </return-value>
  42741. <parameters>
  42742. <parameter name="format" transfer-ownership="none">
  42743. <doc xml:space="preserve">the format string</doc>
  42744. <type name="utf8" c:type="const char*"/>
  42745. </parameter>
  42746. <parameter name="..." transfer-ownership="none">
  42747. <doc xml:space="preserve">printf-like arguments to @format</doc>
  42748. <varargs/>
  42749. </parameter>
  42750. </parameters>
  42751. </function>
  42752. <function name="test_minimized_result"
  42753. c:identifier="g_test_minimized_result"
  42754. version="2.16"
  42755. introspectable="0">
  42756. <doc xml:space="preserve">Report the result of a performance or measurement test.
  42757. The test should generally strive to minimize the reported
  42758. quantities (smaller values are better than larger ones),
  42759. this and @minimized_quantity can determine sorting
  42760. order for test result reports.</doc>
  42761. <return-value transfer-ownership="none">
  42762. <type name="none" c:type="void"/>
  42763. </return-value>
  42764. <parameters>
  42765. <parameter name="minimized_quantity" transfer-ownership="none">
  42766. <doc xml:space="preserve">the reported value</doc>
  42767. <type name="gdouble" c:type="double"/>
  42768. </parameter>
  42769. <parameter name="format" transfer-ownership="none">
  42770. <doc xml:space="preserve">the format string of the report message</doc>
  42771. <type name="utf8" c:type="const char*"/>
  42772. </parameter>
  42773. <parameter name="..." transfer-ownership="none">
  42774. <doc xml:space="preserve">arguments to pass to the printf() function</doc>
  42775. <varargs/>
  42776. </parameter>
  42777. </parameters>
  42778. </function>
  42779. <function name="test_queue_destroy"
  42780. c:identifier="g_test_queue_destroy"
  42781. version="2.16">
  42782. <doc xml:space="preserve">This function enqueus a callback @destroy_func to be executed
  42783. during the next test case teardown phase. This is most useful
  42784. to auto destruct allocted test resources at the end of a test run.
  42785. Resources are released in reverse queue order, that means enqueueing
  42786. callback A before callback B will cause B() to be called before
  42787. A() during teardown.</doc>
  42788. <return-value transfer-ownership="none">
  42789. <type name="none" c:type="void"/>
  42790. </return-value>
  42791. <parameters>
  42792. <parameter name="destroy_func" transfer-ownership="none" scope="async">
  42793. <doc xml:space="preserve">Destroy callback for teardown phase.</doc>
  42794. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  42795. </parameter>
  42796. <parameter name="destroy_data"
  42797. transfer-ownership="none"
  42798. nullable="1"
  42799. allow-none="1">
  42800. <doc xml:space="preserve">Destroy callback data.</doc>
  42801. <type name="gpointer" c:type="gpointer"/>
  42802. </parameter>
  42803. </parameters>
  42804. </function>
  42805. <function name="test_queue_free"
  42806. c:identifier="g_test_queue_free"
  42807. version="2.16">
  42808. <doc xml:space="preserve">Enqueue a pointer to be released with g_free() during the next
  42809. teardown phase. This is equivalent to calling g_test_queue_destroy()
  42810. with a destroy callback of g_free().</doc>
  42811. <return-value transfer-ownership="none">
  42812. <type name="none" c:type="void"/>
  42813. </return-value>
  42814. <parameters>
  42815. <parameter name="gfree_pointer"
  42816. transfer-ownership="none"
  42817. nullable="1"
  42818. allow-none="1">
  42819. <doc xml:space="preserve">the pointer to be stored.</doc>
  42820. <type name="gpointer" c:type="gpointer"/>
  42821. </parameter>
  42822. </parameters>
  42823. </function>
  42824. <function name="test_rand_double"
  42825. c:identifier="g_test_rand_double"
  42826. version="2.16">
  42827. <doc xml:space="preserve">Get a reproducible random floating point number,
  42828. see g_test_rand_int() for details on test case random numbers.</doc>
  42829. <return-value transfer-ownership="none">
  42830. <doc xml:space="preserve">a random number from the seeded random number generator.</doc>
  42831. <type name="gdouble" c:type="double"/>
  42832. </return-value>
  42833. </function>
  42834. <function name="test_rand_double_range"
  42835. c:identifier="g_test_rand_double_range"
  42836. version="2.16">
  42837. <doc xml:space="preserve">Get a reproducible random floating pointer number out of a specified range,
  42838. see g_test_rand_int() for details on test case random numbers.</doc>
  42839. <return-value transfer-ownership="none">
  42840. <doc xml:space="preserve">a number with @range_start &lt;= number &lt; @range_end.</doc>
  42841. <type name="gdouble" c:type="double"/>
  42842. </return-value>
  42843. <parameters>
  42844. <parameter name="range_start" transfer-ownership="none">
  42845. <doc xml:space="preserve">the minimum value returned by this function</doc>
  42846. <type name="gdouble" c:type="double"/>
  42847. </parameter>
  42848. <parameter name="range_end" transfer-ownership="none">
  42849. <doc xml:space="preserve">the minimum value not returned by this function</doc>
  42850. <type name="gdouble" c:type="double"/>
  42851. </parameter>
  42852. </parameters>
  42853. </function>
  42854. <function name="test_rand_int"
  42855. c:identifier="g_test_rand_int"
  42856. version="2.16">
  42857. <doc xml:space="preserve">Get a reproducible random integer number.
  42858. The random numbers generated by the g_test_rand_*() family of functions
  42859. change with every new test program start, unless the --seed option is
  42860. given when starting test programs.
  42861. For individual test cases however, the random number generator is
  42862. reseeded, to avoid dependencies between tests and to make --seed
  42863. effective for all test cases.</doc>
  42864. <return-value transfer-ownership="none">
  42865. <doc xml:space="preserve">a random number from the seeded random number generator.</doc>
  42866. <type name="gint32" c:type="gint32"/>
  42867. </return-value>
  42868. </function>
  42869. <function name="test_rand_int_range"
  42870. c:identifier="g_test_rand_int_range"
  42871. version="2.16">
  42872. <doc xml:space="preserve">Get a reproducible random integer number out of a specified range,
  42873. see g_test_rand_int() for details on test case random numbers.</doc>
  42874. <return-value transfer-ownership="none">
  42875. <doc xml:space="preserve">a number with @begin &lt;= number &lt; @end.</doc>
  42876. <type name="gint32" c:type="gint32"/>
  42877. </return-value>
  42878. <parameters>
  42879. <parameter name="begin" transfer-ownership="none">
  42880. <doc xml:space="preserve">the minimum value returned by this function</doc>
  42881. <type name="gint32" c:type="gint32"/>
  42882. </parameter>
  42883. <parameter name="end" transfer-ownership="none">
  42884. <doc xml:space="preserve">the smallest value not to be returned by this function</doc>
  42885. <type name="gint32" c:type="gint32"/>
  42886. </parameter>
  42887. </parameters>
  42888. </function>
  42889. <function name="test_run" c:identifier="g_test_run" version="2.16">
  42890. <doc xml:space="preserve">Runs all tests under the toplevel suite which can be retrieved
  42891. with g_test_get_root(). Similar to g_test_run_suite(), the test
  42892. cases to be run are filtered according to test path arguments
  42893. (`-p testpath`) as parsed by g_test_init(). g_test_run_suite()
  42894. or g_test_run() may only be called once in a program.
  42895. In general, the tests and sub-suites within each suite are run in
  42896. the order in which they are defined. However, note that prior to
  42897. GLib 2.36, there was a bug in the `g_test_add_*`
  42898. functions which caused them to create multiple suites with the same
  42899. name, meaning that if you created tests "/foo/simple",
  42900. "/bar/simple", and "/foo/using-bar" in that order, they would get
  42901. run in that order (since g_test_run() would run the first "/foo"
  42902. suite, then the "/bar" suite, then the second "/foo" suite). As of
  42903. 2.36, this bug is fixed, and adding the tests in that order would
  42904. result in a running order of "/foo/simple", "/foo/using-bar",
  42905. "/bar/simple". If this new ordering is sub-optimal (because it puts
  42906. more-complicated tests before simpler ones, making it harder to
  42907. figure out exactly what has failed), you can fix it by changing the
  42908. test paths to group tests by suite in a way that will result in the
  42909. desired running order. Eg, "/simple/foo", "/simple/bar",
  42910. "/complex/foo-using-bar".
  42911. However, you should never make the actual result of a test depend
  42912. on the order that tests are run in. If you need to ensure that some
  42913. particular code runs before or after a given test case, use
  42914. g_test_add(), which lets you specify setup and teardown functions.
  42915. If all tests are skipped, this function will return 0 if
  42916. producing TAP output, or 77 (treated as "skip test" by Automake) otherwise.</doc>
  42917. <return-value transfer-ownership="none">
  42918. <doc xml:space="preserve">0 on success, 1 on failure (assuming it returns at all),
  42919. 0 or 77 if all tests were skipped with g_test_skip()</doc>
  42920. <type name="gint" c:type="int"/>
  42921. </return-value>
  42922. </function>
  42923. <function name="test_run_suite"
  42924. c:identifier="g_test_run_suite"
  42925. version="2.16">
  42926. <doc xml:space="preserve">Execute the tests within @suite and all nested #GTestSuites.
  42927. The test suites to be executed are filtered according to
  42928. test path arguments (`-p testpath`) as parsed by g_test_init().
  42929. See the g_test_run() documentation for more information on the
  42930. order that tests are run in.
  42931. g_test_run_suite() or g_test_run() may only be called once
  42932. in a program.</doc>
  42933. <return-value transfer-ownership="none">
  42934. <doc xml:space="preserve">0 on success</doc>
  42935. <type name="gint" c:type="int"/>
  42936. </return-value>
  42937. <parameters>
  42938. <parameter name="suite" transfer-ownership="none">
  42939. <doc xml:space="preserve">a #GTestSuite</doc>
  42940. <type name="TestSuite" c:type="GTestSuite*"/>
  42941. </parameter>
  42942. </parameters>
  42943. </function>
  42944. <function name="test_set_nonfatal_assertions"
  42945. c:identifier="g_test_set_nonfatal_assertions"
  42946. version="2.38">
  42947. <doc xml:space="preserve">Changes the behaviour of g_assert_cmpstr(), g_assert_cmpint(),
  42948. g_assert_cmpuint(), g_assert_cmphex(), g_assert_cmpfloat(),
  42949. g_assert_true(), g_assert_false(), g_assert_null(), g_assert_no_error(),
  42950. g_assert_error(), g_test_assert_expected_messages() and the various
  42951. g_test_trap_assert_*() macros to not abort to program, but instead
  42952. call g_test_fail() and continue. (This also changes the behavior of
  42953. g_test_fail() so that it will not cause the test program to abort
  42954. after completing the failed test.)
  42955. Note that the g_assert_not_reached() and g_assert() are not
  42956. affected by this.
  42957. This function can only be called after g_test_init().</doc>
  42958. <return-value transfer-ownership="none">
  42959. <type name="none" c:type="void"/>
  42960. </return-value>
  42961. </function>
  42962. <function name="test_skip" c:identifier="g_test_skip" version="2.38">
  42963. <doc xml:space="preserve">Indicates that a test was skipped.
  42964. Calling this function will not stop the test from running, you
  42965. need to return from the test function yourself. So you can
  42966. produce additional diagnostic messages or even continue running
  42967. the test.
  42968. If not called from inside a test, this function does nothing.</doc>
  42969. <return-value transfer-ownership="none">
  42970. <type name="none" c:type="void"/>
  42971. </return-value>
  42972. <parameters>
  42973. <parameter name="msg"
  42974. transfer-ownership="none"
  42975. nullable="1"
  42976. allow-none="1">
  42977. <doc xml:space="preserve">explanation</doc>
  42978. <type name="utf8" c:type="const gchar*"/>
  42979. </parameter>
  42980. </parameters>
  42981. </function>
  42982. <function name="test_subprocess"
  42983. c:identifier="g_test_subprocess"
  42984. version="2.38">
  42985. <doc xml:space="preserve">Returns %TRUE (after g_test_init() has been called) if the test
  42986. program is running under g_test_trap_subprocess().</doc>
  42987. <return-value transfer-ownership="none">
  42988. <doc xml:space="preserve">%TRUE if the test program is running under
  42989. g_test_trap_subprocess().</doc>
  42990. <type name="gboolean" c:type="gboolean"/>
  42991. </return-value>
  42992. </function>
  42993. <function name="test_timer_elapsed"
  42994. c:identifier="g_test_timer_elapsed"
  42995. version="2.16">
  42996. <doc xml:space="preserve">Get the time since the last start of the timer with g_test_timer_start().</doc>
  42997. <return-value transfer-ownership="none">
  42998. <doc xml:space="preserve">the time since the last start of the timer, as a double</doc>
  42999. <type name="gdouble" c:type="double"/>
  43000. </return-value>
  43001. </function>
  43002. <function name="test_timer_last"
  43003. c:identifier="g_test_timer_last"
  43004. version="2.16">
  43005. <doc xml:space="preserve">Report the last result of g_test_timer_elapsed().</doc>
  43006. <return-value transfer-ownership="none">
  43007. <doc xml:space="preserve">the last result of g_test_timer_elapsed(), as a double</doc>
  43008. <type name="gdouble" c:type="double"/>
  43009. </return-value>
  43010. </function>
  43011. <function name="test_timer_start"
  43012. c:identifier="g_test_timer_start"
  43013. version="2.16">
  43014. <doc xml:space="preserve">Start a timing test. Call g_test_timer_elapsed() when the task is supposed
  43015. to be done. Call this function again to restart the timer.</doc>
  43016. <return-value transfer-ownership="none">
  43017. <type name="none" c:type="void"/>
  43018. </return-value>
  43019. </function>
  43020. <function name="test_trap_assertions"
  43021. c:identifier="g_test_trap_assertions">
  43022. <return-value transfer-ownership="none">
  43023. <type name="none" c:type="void"/>
  43024. </return-value>
  43025. <parameters>
  43026. <parameter name="domain" transfer-ownership="none">
  43027. <type name="utf8" c:type="const char*"/>
  43028. </parameter>
  43029. <parameter name="file" transfer-ownership="none">
  43030. <type name="utf8" c:type="const char*"/>
  43031. </parameter>
  43032. <parameter name="line" transfer-ownership="none">
  43033. <type name="gint" c:type="int"/>
  43034. </parameter>
  43035. <parameter name="func" transfer-ownership="none">
  43036. <type name="utf8" c:type="const char*"/>
  43037. </parameter>
  43038. <parameter name="assertion_flags" transfer-ownership="none">
  43039. <type name="guint64" c:type="guint64"/>
  43040. </parameter>
  43041. <parameter name="pattern" transfer-ownership="none">
  43042. <type name="utf8" c:type="const char*"/>
  43043. </parameter>
  43044. </parameters>
  43045. </function>
  43046. <function name="test_trap_fork"
  43047. c:identifier="g_test_trap_fork"
  43048. version="2.16"
  43049. deprecated="1">
  43050. <doc xml:space="preserve">Fork the current test program to execute a test case that might
  43051. not return or that might abort.
  43052. If @usec_timeout is non-0, the forked test case is aborted and
  43053. considered failing if its run time exceeds it.
  43054. The forking behavior can be configured with the #GTestTrapFlags flags.
  43055. In the following example, the test code forks, the forked child
  43056. process produces some sample output and exits successfully.
  43057. The forking parent process then asserts successful child program
  43058. termination and validates child program outputs.
  43059. |[&lt;!-- language="C" --&gt;
  43060. static void
  43061. test_fork_patterns (void)
  43062. {
  43063. if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR))
  43064. {
  43065. g_print ("some stdout text: somagic17\n");
  43066. g_printerr ("some stderr text: semagic43\n");
  43067. exit (0); // successful test run
  43068. }
  43069. g_test_trap_assert_passed ();
  43070. g_test_trap_assert_stdout ("*somagic17*");
  43071. g_test_trap_assert_stderr ("*semagic43*");
  43072. }
  43073. ]|</doc>
  43074. <doc-deprecated xml:space="preserve">This function is implemented only on Unix platforms,
  43075. and is not always reliable due to problems inherent in
  43076. fork-without-exec. Use g_test_trap_subprocess() instead.</doc-deprecated>
  43077. <return-value transfer-ownership="none">
  43078. <doc xml:space="preserve">%TRUE for the forked child and %FALSE for the executing parent process.</doc>
  43079. <type name="gboolean" c:type="gboolean"/>
  43080. </return-value>
  43081. <parameters>
  43082. <parameter name="usec_timeout" transfer-ownership="none">
  43083. <doc xml:space="preserve">Timeout for the forked test in micro seconds.</doc>
  43084. <type name="guint64" c:type="guint64"/>
  43085. </parameter>
  43086. <parameter name="test_trap_flags" transfer-ownership="none">
  43087. <doc xml:space="preserve">Flags to modify forking behaviour.</doc>
  43088. <type name="TestTrapFlags" c:type="GTestTrapFlags"/>
  43089. </parameter>
  43090. </parameters>
  43091. </function>
  43092. <function name="test_trap_has_passed"
  43093. c:identifier="g_test_trap_has_passed"
  43094. version="2.16">
  43095. <doc xml:space="preserve">Check the result of the last g_test_trap_subprocess() call.</doc>
  43096. <return-value transfer-ownership="none">
  43097. <doc xml:space="preserve">%TRUE if the last test subprocess terminated successfully.</doc>
  43098. <type name="gboolean" c:type="gboolean"/>
  43099. </return-value>
  43100. </function>
  43101. <function name="test_trap_reached_timeout"
  43102. c:identifier="g_test_trap_reached_timeout"
  43103. version="2.16">
  43104. <doc xml:space="preserve">Check the result of the last g_test_trap_subprocess() call.</doc>
  43105. <return-value transfer-ownership="none">
  43106. <doc xml:space="preserve">%TRUE if the last test subprocess got killed due to a timeout.</doc>
  43107. <type name="gboolean" c:type="gboolean"/>
  43108. </return-value>
  43109. </function>
  43110. <function name="test_trap_subprocess"
  43111. c:identifier="g_test_trap_subprocess"
  43112. version="2.38">
  43113. <doc xml:space="preserve">Respawns the test program to run only @test_path in a subprocess.
  43114. This can be used for a test case that might not return, or that
  43115. might abort.
  43116. If @test_path is %NULL then the same test is re-run in a subprocess.
  43117. You can use g_test_subprocess() to determine whether the test is in
  43118. a subprocess or not.
  43119. @test_path can also be the name of the parent test, followed by
  43120. "`/subprocess/`" and then a name for the specific subtest (or just
  43121. ending with "`/subprocess`" if the test only has one child test);
  43122. tests with names of this form will automatically be skipped in the
  43123. parent process.
  43124. If @usec_timeout is non-0, the test subprocess is aborted and
  43125. considered failing if its run time exceeds it.
  43126. The subprocess behavior can be configured with the
  43127. #GTestSubprocessFlags flags.
  43128. You can use methods such as g_test_trap_assert_passed(),
  43129. g_test_trap_assert_failed(), and g_test_trap_assert_stderr() to
  43130. check the results of the subprocess. (But note that
  43131. g_test_trap_assert_stdout() and g_test_trap_assert_stderr()
  43132. cannot be used if @test_flags specifies that the child should
  43133. inherit the parent stdout/stderr.)
  43134. If your `main ()` needs to behave differently in
  43135. the subprocess, you can call g_test_subprocess() (after calling
  43136. g_test_init()) to see whether you are in a subprocess.
  43137. The following example tests that calling
  43138. `my_object_new(1000000)` will abort with an error
  43139. message.
  43140. |[&lt;!-- language="C" --&gt;
  43141. static void
  43142. test_create_large_object (void)
  43143. {
  43144. if (g_test_subprocess ())
  43145. {
  43146. my_object_new (1000000);
  43147. return;
  43148. }
  43149. // Reruns this same test in a subprocess
  43150. g_test_trap_subprocess (NULL, 0, 0);
  43151. g_test_trap_assert_failed ();
  43152. g_test_trap_assert_stderr ("*ERROR*too large*");
  43153. }
  43154. int
  43155. main (int argc, char **argv)
  43156. {
  43157. g_test_init (&amp;argc, &amp;argv, NULL);
  43158. g_test_add_func ("/myobject/create_large_object",
  43159. test_create_large_object);
  43160. return g_test_run ();
  43161. }
  43162. ]|</doc>
  43163. <return-value transfer-ownership="none">
  43164. <type name="none" c:type="void"/>
  43165. </return-value>
  43166. <parameters>
  43167. <parameter name="test_path"
  43168. transfer-ownership="none"
  43169. nullable="1"
  43170. allow-none="1">
  43171. <doc xml:space="preserve">Test to run in a subprocess</doc>
  43172. <type name="utf8" c:type="const char*"/>
  43173. </parameter>
  43174. <parameter name="usec_timeout" transfer-ownership="none">
  43175. <doc xml:space="preserve">Timeout for the subprocess test in micro seconds.</doc>
  43176. <type name="guint64" c:type="guint64"/>
  43177. </parameter>
  43178. <parameter name="test_flags" transfer-ownership="none">
  43179. <doc xml:space="preserve">Flags to modify subprocess behaviour.</doc>
  43180. <type name="TestSubprocessFlags" c:type="GTestSubprocessFlags"/>
  43181. </parameter>
  43182. </parameters>
  43183. </function>
  43184. <function name="thread_error_quark"
  43185. c:identifier="g_thread_error_quark"
  43186. moved-to="Thread.error_quark">
  43187. <return-value transfer-ownership="none">
  43188. <type name="Quark" c:type="GQuark"/>
  43189. </return-value>
  43190. </function>
  43191. <function name="thread_exit"
  43192. c:identifier="g_thread_exit"
  43193. moved-to="Thread.exit">
  43194. <doc xml:space="preserve">Terminates the current thread.
  43195. If another thread is waiting for us using g_thread_join() then the
  43196. waiting thread will be woken up and get @retval as the return value
  43197. of g_thread_join().
  43198. Calling g_thread_exit() with a parameter @retval is equivalent to
  43199. returning @retval from the function @func, as given to g_thread_new().
  43200. You must only call g_thread_exit() from a thread that you created
  43201. yourself with g_thread_new() or related APIs. You must not call
  43202. this function from a thread created with another threading library
  43203. or or from within a #GThreadPool.</doc>
  43204. <return-value transfer-ownership="none">
  43205. <type name="none" c:type="void"/>
  43206. </return-value>
  43207. <parameters>
  43208. <parameter name="retval"
  43209. transfer-ownership="none"
  43210. nullable="1"
  43211. allow-none="1">
  43212. <doc xml:space="preserve">the return value of this thread</doc>
  43213. <type name="gpointer" c:type="gpointer"/>
  43214. </parameter>
  43215. </parameters>
  43216. </function>
  43217. <function name="thread_pool_get_max_idle_time"
  43218. c:identifier="g_thread_pool_get_max_idle_time"
  43219. moved-to="ThreadPool.get_max_idle_time"
  43220. version="2.10">
  43221. <doc xml:space="preserve">This function will return the maximum @interval that a
  43222. thread will wait in the thread pool for new tasks before
  43223. being stopped.
  43224. If this function returns 0, threads waiting in the thread
  43225. pool for new work are not stopped.</doc>
  43226. <return-value transfer-ownership="none">
  43227. <doc xml:space="preserve">the maximum @interval (milliseconds) to wait
  43228. for new tasks in the thread pool before stopping the
  43229. thread</doc>
  43230. <type name="guint" c:type="guint"/>
  43231. </return-value>
  43232. </function>
  43233. <function name="thread_pool_get_max_unused_threads"
  43234. c:identifier="g_thread_pool_get_max_unused_threads"
  43235. moved-to="ThreadPool.get_max_unused_threads">
  43236. <doc xml:space="preserve">Returns the maximal allowed number of unused threads.</doc>
  43237. <return-value transfer-ownership="none">
  43238. <doc xml:space="preserve">the maximal number of unused threads</doc>
  43239. <type name="gint" c:type="gint"/>
  43240. </return-value>
  43241. </function>
  43242. <function name="thread_pool_get_num_unused_threads"
  43243. c:identifier="g_thread_pool_get_num_unused_threads"
  43244. moved-to="ThreadPool.get_num_unused_threads">
  43245. <doc xml:space="preserve">Returns the number of currently unused threads.</doc>
  43246. <return-value transfer-ownership="none">
  43247. <doc xml:space="preserve">the number of currently unused threads</doc>
  43248. <type name="guint" c:type="guint"/>
  43249. </return-value>
  43250. </function>
  43251. <function name="thread_pool_set_max_idle_time"
  43252. c:identifier="g_thread_pool_set_max_idle_time"
  43253. moved-to="ThreadPool.set_max_idle_time"
  43254. version="2.10">
  43255. <doc xml:space="preserve">This function will set the maximum @interval that a thread
  43256. waiting in the pool for new tasks can be idle for before
  43257. being stopped. This function is similar to calling
  43258. g_thread_pool_stop_unused_threads() on a regular timeout,
  43259. except this is done on a per thread basis.
  43260. By setting @interval to 0, idle threads will not be stopped.
  43261. The default value is 15000 (15 seconds).</doc>
  43262. <return-value transfer-ownership="none">
  43263. <type name="none" c:type="void"/>
  43264. </return-value>
  43265. <parameters>
  43266. <parameter name="interval" transfer-ownership="none">
  43267. <doc xml:space="preserve">the maximum @interval (in milliseconds)
  43268. a thread can be idle</doc>
  43269. <type name="guint" c:type="guint"/>
  43270. </parameter>
  43271. </parameters>
  43272. </function>
  43273. <function name="thread_pool_set_max_unused_threads"
  43274. c:identifier="g_thread_pool_set_max_unused_threads"
  43275. moved-to="ThreadPool.set_max_unused_threads">
  43276. <doc xml:space="preserve">Sets the maximal number of unused threads to @max_threads.
  43277. If @max_threads is -1, no limit is imposed on the number
  43278. of unused threads.
  43279. The default value is 2.</doc>
  43280. <return-value transfer-ownership="none">
  43281. <type name="none" c:type="void"/>
  43282. </return-value>
  43283. <parameters>
  43284. <parameter name="max_threads" transfer-ownership="none">
  43285. <doc xml:space="preserve">maximal number of unused threads</doc>
  43286. <type name="gint" c:type="gint"/>
  43287. </parameter>
  43288. </parameters>
  43289. </function>
  43290. <function name="thread_pool_stop_unused_threads"
  43291. c:identifier="g_thread_pool_stop_unused_threads"
  43292. moved-to="ThreadPool.stop_unused_threads">
  43293. <doc xml:space="preserve">Stops all currently unused threads. This does not change the
  43294. maximal number of unused threads. This function can be used to
  43295. regularly stop all unused threads e.g. from g_timeout_add().</doc>
  43296. <return-value transfer-ownership="none">
  43297. <type name="none" c:type="void"/>
  43298. </return-value>
  43299. </function>
  43300. <function name="thread_self"
  43301. c:identifier="g_thread_self"
  43302. moved-to="Thread.self">
  43303. <doc xml:space="preserve">This function returns the #GThread corresponding to the
  43304. current thread. Note that this function does not increase
  43305. the reference count of the returned struct.
  43306. This function will return a #GThread even for threads that
  43307. were not created by GLib (i.e. those created by other threading
  43308. APIs). This may be useful for thread identification purposes
  43309. (i.e. comparisons) but you must not use GLib functions (such
  43310. as g_thread_join()) on these threads.</doc>
  43311. <return-value transfer-ownership="full">
  43312. <doc xml:space="preserve">the #GThread representing the current thread</doc>
  43313. <type name="Thread" c:type="GThread*"/>
  43314. </return-value>
  43315. </function>
  43316. <function name="thread_yield"
  43317. c:identifier="g_thread_yield"
  43318. moved-to="Thread.yield">
  43319. <doc xml:space="preserve">Causes the calling thread to voluntarily relinquish the CPU, so
  43320. that other threads can run.
  43321. This function is often used as a method to make busy wait less evil.</doc>
  43322. <return-value transfer-ownership="none">
  43323. <type name="none" c:type="void"/>
  43324. </return-value>
  43325. </function>
  43326. <function name="time_val_from_iso8601"
  43327. c:identifier="g_time_val_from_iso8601"
  43328. moved-to="TimeVal.from_iso8601"
  43329. version="2.12">
  43330. <doc xml:space="preserve">Converts a string containing an ISO 8601 encoded date and time
  43331. to a #GTimeVal and puts it into @time_.
  43332. @iso_date must include year, month, day, hours, minutes, and
  43333. seconds. It can optionally include fractions of a second and a time
  43334. zone indicator. (In the absence of any time zone indication, the
  43335. timestamp is assumed to be in local time.)</doc>
  43336. <return-value transfer-ownership="none">
  43337. <doc xml:space="preserve">%TRUE if the conversion was successful.</doc>
  43338. <type name="gboolean" c:type="gboolean"/>
  43339. </return-value>
  43340. <parameters>
  43341. <parameter name="iso_date" transfer-ownership="none">
  43342. <doc xml:space="preserve">an ISO 8601 encoded date string</doc>
  43343. <type name="utf8" c:type="const gchar*"/>
  43344. </parameter>
  43345. <parameter name="time_"
  43346. direction="out"
  43347. caller-allocates="1"
  43348. transfer-ownership="none">
  43349. <doc xml:space="preserve">a #GTimeVal</doc>
  43350. <type name="TimeVal" c:type="GTimeVal*"/>
  43351. </parameter>
  43352. </parameters>
  43353. </function>
  43354. <function name="timeout_add"
  43355. c:identifier="g_timeout_add"
  43356. shadowed-by="timeout_add_full"
  43357. introspectable="0">
  43358. <doc xml:space="preserve">Sets a function to be called at regular intervals, with the default
  43359. priority, #G_PRIORITY_DEFAULT. The function is called repeatedly
  43360. until it returns %FALSE, at which point the timeout is automatically
  43361. destroyed and the function will not be called again. The first call
  43362. to the function will be at the end of the first @interval.
  43363. Note that timeout functions may be delayed, due to the processing of other
  43364. event sources. Thus they should not be relied on for precise timing.
  43365. After each call to the timeout function, the time of the next
  43366. timeout is recalculated based on the current time and the given interval
  43367. (it does not try to 'catch up' time lost in delays).
  43368. See [memory management of sources][mainloop-memory-management] for details
  43369. on how to handle the return value and memory management of @data.
  43370. If you want to have a timer in the "seconds" range and do not care
  43371. about the exact time of the first call of the timer, use the
  43372. g_timeout_add_seconds() function; this function allows for more
  43373. optimizations and more efficient system power usage.
  43374. This internally creates a main loop source using g_timeout_source_new()
  43375. and attaches it to the global #GMainContext using g_source_attach(), so
  43376. the callback will be invoked in whichever thread is running that main
  43377. context. You can do these steps manually if you need greater control or to
  43378. use a custom main context.
  43379. The interval given is in terms of monotonic time, not wall clock
  43380. time. See g_get_monotonic_time().</doc>
  43381. <return-value transfer-ownership="none">
  43382. <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
  43383. <type name="guint" c:type="guint"/>
  43384. </return-value>
  43385. <parameters>
  43386. <parameter name="interval" transfer-ownership="none">
  43387. <doc xml:space="preserve">the time between calls to the function, in milliseconds
  43388. (1/1000ths of a second)</doc>
  43389. <type name="guint" c:type="guint"/>
  43390. </parameter>
  43391. <parameter name="function" transfer-ownership="none" closure="2">
  43392. <doc xml:space="preserve">function to call</doc>
  43393. <type name="SourceFunc" c:type="GSourceFunc"/>
  43394. </parameter>
  43395. <parameter name="data"
  43396. transfer-ownership="none"
  43397. nullable="1"
  43398. allow-none="1">
  43399. <doc xml:space="preserve">data to pass to @function</doc>
  43400. <type name="gpointer" c:type="gpointer"/>
  43401. </parameter>
  43402. </parameters>
  43403. </function>
  43404. <function name="timeout_add_full"
  43405. c:identifier="g_timeout_add_full"
  43406. shadows="timeout_add">
  43407. <doc xml:space="preserve">Sets a function to be called at regular intervals, with the given
  43408. priority. The function is called repeatedly until it returns
  43409. %FALSE, at which point the timeout is automatically destroyed and
  43410. the function will not be called again. The @notify function is
  43411. called when the timeout is destroyed. The first call to the
  43412. function will be at the end of the first @interval.
  43413. Note that timeout functions may be delayed, due to the processing of other
  43414. event sources. Thus they should not be relied on for precise timing.
  43415. After each call to the timeout function, the time of the next
  43416. timeout is recalculated based on the current time and the given interval
  43417. (it does not try to 'catch up' time lost in delays).
  43418. See [memory management of sources][mainloop-memory-management] for details
  43419. on how to handle the return value and memory management of @data.
  43420. This internally creates a main loop source using g_timeout_source_new()
  43421. and attaches it to the global #GMainContext using g_source_attach(), so
  43422. the callback will be invoked in whichever thread is running that main
  43423. context. You can do these steps manually if you need greater control or to
  43424. use a custom main context.
  43425. The interval given in terms of monotonic time, not wall clock time.
  43426. See g_get_monotonic_time().</doc>
  43427. <return-value transfer-ownership="none">
  43428. <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
  43429. <type name="guint" c:type="guint"/>
  43430. </return-value>
  43431. <parameters>
  43432. <parameter name="priority" transfer-ownership="none">
  43433. <doc xml:space="preserve">the priority of the timeout source. Typically this will be in
  43434. the range between #G_PRIORITY_DEFAULT and #G_PRIORITY_HIGH.</doc>
  43435. <type name="gint" c:type="gint"/>
  43436. </parameter>
  43437. <parameter name="interval" transfer-ownership="none">
  43438. <doc xml:space="preserve">the time between calls to the function, in milliseconds
  43439. (1/1000ths of a second)</doc>
  43440. <type name="guint" c:type="guint"/>
  43441. </parameter>
  43442. <parameter name="function"
  43443. transfer-ownership="none"
  43444. scope="notified"
  43445. closure="3"
  43446. destroy="4">
  43447. <doc xml:space="preserve">function to call</doc>
  43448. <type name="SourceFunc" c:type="GSourceFunc"/>
  43449. </parameter>
  43450. <parameter name="data"
  43451. transfer-ownership="none"
  43452. nullable="1"
  43453. allow-none="1">
  43454. <doc xml:space="preserve">data to pass to @function</doc>
  43455. <type name="gpointer" c:type="gpointer"/>
  43456. </parameter>
  43457. <parameter name="notify"
  43458. transfer-ownership="none"
  43459. nullable="1"
  43460. allow-none="1"
  43461. scope="async">
  43462. <doc xml:space="preserve">function to call when the timeout is removed, or %NULL</doc>
  43463. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  43464. </parameter>
  43465. </parameters>
  43466. </function>
  43467. <function name="timeout_add_seconds"
  43468. c:identifier="g_timeout_add_seconds"
  43469. shadowed-by="timeout_add_seconds_full"
  43470. version="2.14"
  43471. introspectable="0">
  43472. <doc xml:space="preserve">Sets a function to be called at regular intervals with the default
  43473. priority, #G_PRIORITY_DEFAULT. The function is called repeatedly until
  43474. it returns %FALSE, at which point the timeout is automatically destroyed
  43475. and the function will not be called again.
  43476. This internally creates a main loop source using
  43477. g_timeout_source_new_seconds() and attaches it to the main loop context
  43478. using g_source_attach(). You can do these steps manually if you need
  43479. greater control. Also see g_timeout_add_seconds_full().
  43480. Note that the first call of the timer may not be precise for timeouts
  43481. of one second. If you need finer precision and have such a timeout,
  43482. you may want to use g_timeout_add() instead.
  43483. See [memory management of sources][mainloop-memory-management] for details
  43484. on how to handle the return value and memory management of @data.
  43485. The interval given is in terms of monotonic time, not wall clock
  43486. time. See g_get_monotonic_time().</doc>
  43487. <return-value transfer-ownership="none">
  43488. <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
  43489. <type name="guint" c:type="guint"/>
  43490. </return-value>
  43491. <parameters>
  43492. <parameter name="interval" transfer-ownership="none">
  43493. <doc xml:space="preserve">the time between calls to the function, in seconds</doc>
  43494. <type name="guint" c:type="guint"/>
  43495. </parameter>
  43496. <parameter name="function" transfer-ownership="none" closure="2">
  43497. <doc xml:space="preserve">function to call</doc>
  43498. <type name="SourceFunc" c:type="GSourceFunc"/>
  43499. </parameter>
  43500. <parameter name="data"
  43501. transfer-ownership="none"
  43502. nullable="1"
  43503. allow-none="1">
  43504. <doc xml:space="preserve">data to pass to @function</doc>
  43505. <type name="gpointer" c:type="gpointer"/>
  43506. </parameter>
  43507. </parameters>
  43508. </function>
  43509. <function name="timeout_add_seconds_full"
  43510. c:identifier="g_timeout_add_seconds_full"
  43511. shadows="timeout_add_seconds"
  43512. version="2.14">
  43513. <doc xml:space="preserve">Sets a function to be called at regular intervals, with @priority.
  43514. The function is called repeatedly until it returns %FALSE, at which
  43515. point the timeout is automatically destroyed and the function will
  43516. not be called again.
  43517. Unlike g_timeout_add(), this function operates at whole second granularity.
  43518. The initial starting point of the timer is determined by the implementation
  43519. and the implementation is expected to group multiple timers together so that
  43520. they fire all at the same time.
  43521. To allow this grouping, the @interval to the first timer is rounded
  43522. and can deviate up to one second from the specified interval.
  43523. Subsequent timer iterations will generally run at the specified interval.
  43524. Note that timeout functions may be delayed, due to the processing of other
  43525. event sources. Thus they should not be relied on for precise timing.
  43526. After each call to the timeout function, the time of the next
  43527. timeout is recalculated based on the current time and the given @interval
  43528. See [memory management of sources][mainloop-memory-management] for details
  43529. on how to handle the return value and memory management of @data.
  43530. If you want timing more precise than whole seconds, use g_timeout_add()
  43531. instead.
  43532. The grouping of timers to fire at the same time results in a more power
  43533. and CPU efficient behavior so if your timer is in multiples of seconds
  43534. and you don't require the first timer exactly one second from now, the
  43535. use of g_timeout_add_seconds() is preferred over g_timeout_add().
  43536. This internally creates a main loop source using
  43537. g_timeout_source_new_seconds() and attaches it to the main loop context
  43538. using g_source_attach(). You can do these steps manually if you need
  43539. greater control.
  43540. The interval given is in terms of monotonic time, not wall clock
  43541. time. See g_get_monotonic_time().</doc>
  43542. <return-value transfer-ownership="none">
  43543. <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
  43544. <type name="guint" c:type="guint"/>
  43545. </return-value>
  43546. <parameters>
  43547. <parameter name="priority" transfer-ownership="none">
  43548. <doc xml:space="preserve">the priority of the timeout source. Typically this will be in
  43549. the range between #G_PRIORITY_DEFAULT and #G_PRIORITY_HIGH.</doc>
  43550. <type name="gint" c:type="gint"/>
  43551. </parameter>
  43552. <parameter name="interval" transfer-ownership="none">
  43553. <doc xml:space="preserve">the time between calls to the function, in seconds</doc>
  43554. <type name="guint" c:type="guint"/>
  43555. </parameter>
  43556. <parameter name="function"
  43557. transfer-ownership="none"
  43558. scope="notified"
  43559. closure="3"
  43560. destroy="4">
  43561. <doc xml:space="preserve">function to call</doc>
  43562. <type name="SourceFunc" c:type="GSourceFunc"/>
  43563. </parameter>
  43564. <parameter name="data"
  43565. transfer-ownership="none"
  43566. nullable="1"
  43567. allow-none="1">
  43568. <doc xml:space="preserve">data to pass to @function</doc>
  43569. <type name="gpointer" c:type="gpointer"/>
  43570. </parameter>
  43571. <parameter name="notify"
  43572. transfer-ownership="none"
  43573. nullable="1"
  43574. allow-none="1"
  43575. scope="async">
  43576. <doc xml:space="preserve">function to call when the timeout is removed, or %NULL</doc>
  43577. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  43578. </parameter>
  43579. </parameters>
  43580. </function>
  43581. <function name="timeout_source_new" c:identifier="g_timeout_source_new">
  43582. <doc xml:space="preserve">Creates a new timeout source.
  43583. The source will not initially be associated with any #GMainContext
  43584. and must be added to one with g_source_attach() before it will be
  43585. executed.
  43586. The interval given is in terms of monotonic time, not wall clock
  43587. time. See g_get_monotonic_time().</doc>
  43588. <return-value transfer-ownership="full">
  43589. <doc xml:space="preserve">the newly-created timeout source</doc>
  43590. <type name="Source" c:type="GSource*"/>
  43591. </return-value>
  43592. <parameters>
  43593. <parameter name="interval" transfer-ownership="none">
  43594. <doc xml:space="preserve">the timeout interval in milliseconds.</doc>
  43595. <type name="guint" c:type="guint"/>
  43596. </parameter>
  43597. </parameters>
  43598. </function>
  43599. <function name="timeout_source_new_seconds"
  43600. c:identifier="g_timeout_source_new_seconds"
  43601. version="2.14">
  43602. <doc xml:space="preserve">Creates a new timeout source.
  43603. The source will not initially be associated with any #GMainContext
  43604. and must be added to one with g_source_attach() before it will be
  43605. executed.
  43606. The scheduling granularity/accuracy of this timeout source will be
  43607. in seconds.
  43608. The interval given in terms of monotonic time, not wall clock time.
  43609. See g_get_monotonic_time().</doc>
  43610. <return-value transfer-ownership="full">
  43611. <doc xml:space="preserve">the newly-created timeout source</doc>
  43612. <type name="Source" c:type="GSource*"/>
  43613. </return-value>
  43614. <parameters>
  43615. <parameter name="interval" transfer-ownership="none">
  43616. <doc xml:space="preserve">the timeout interval in seconds</doc>
  43617. <type name="guint" c:type="guint"/>
  43618. </parameter>
  43619. </parameters>
  43620. </function>
  43621. <function name="trash_stack_height"
  43622. c:identifier="g_trash_stack_height"
  43623. moved-to="TrashStack.height"
  43624. deprecated="1"
  43625. deprecated-version="2.48">
  43626. <doc xml:space="preserve">Returns the height of a #GTrashStack.
  43627. Note that execution of this function is of O(N) complexity
  43628. where N denotes the number of items on the stack.</doc>
  43629. <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
  43630. <return-value transfer-ownership="none">
  43631. <doc xml:space="preserve">the height of the stack</doc>
  43632. <type name="guint" c:type="guint"/>
  43633. </return-value>
  43634. <parameters>
  43635. <parameter name="stack_p" transfer-ownership="none">
  43636. <doc xml:space="preserve">a #GTrashStack</doc>
  43637. <type name="TrashStack" c:type="GTrashStack**"/>
  43638. </parameter>
  43639. </parameters>
  43640. </function>
  43641. <function name="trash_stack_peek"
  43642. c:identifier="g_trash_stack_peek"
  43643. moved-to="TrashStack.peek"
  43644. deprecated="1"
  43645. deprecated-version="2.48">
  43646. <doc xml:space="preserve">Returns the element at the top of a #GTrashStack
  43647. which may be %NULL.</doc>
  43648. <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
  43649. <return-value transfer-ownership="none" nullable="1">
  43650. <doc xml:space="preserve">the element at the top of the stack</doc>
  43651. <type name="gpointer" c:type="gpointer"/>
  43652. </return-value>
  43653. <parameters>
  43654. <parameter name="stack_p" transfer-ownership="none">
  43655. <doc xml:space="preserve">a #GTrashStack</doc>
  43656. <type name="TrashStack" c:type="GTrashStack**"/>
  43657. </parameter>
  43658. </parameters>
  43659. </function>
  43660. <function name="trash_stack_pop"
  43661. c:identifier="g_trash_stack_pop"
  43662. moved-to="TrashStack.pop"
  43663. deprecated="1"
  43664. deprecated-version="2.48">
  43665. <doc xml:space="preserve">Pops a piece of memory off a #GTrashStack.</doc>
  43666. <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
  43667. <return-value transfer-ownership="none" nullable="1">
  43668. <doc xml:space="preserve">the element at the top of the stack</doc>
  43669. <type name="gpointer" c:type="gpointer"/>
  43670. </return-value>
  43671. <parameters>
  43672. <parameter name="stack_p" transfer-ownership="none">
  43673. <doc xml:space="preserve">a #GTrashStack</doc>
  43674. <type name="TrashStack" c:type="GTrashStack**"/>
  43675. </parameter>
  43676. </parameters>
  43677. </function>
  43678. <function name="trash_stack_push"
  43679. c:identifier="g_trash_stack_push"
  43680. moved-to="TrashStack.push"
  43681. deprecated="1"
  43682. deprecated-version="2.48">
  43683. <doc xml:space="preserve">Pushes a piece of memory onto a #GTrashStack.</doc>
  43684. <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
  43685. <return-value transfer-ownership="none">
  43686. <type name="none" c:type="void"/>
  43687. </return-value>
  43688. <parameters>
  43689. <parameter name="stack_p" transfer-ownership="none">
  43690. <doc xml:space="preserve">a #GTrashStack</doc>
  43691. <type name="TrashStack" c:type="GTrashStack**"/>
  43692. </parameter>
  43693. <parameter name="data_p" transfer-ownership="none">
  43694. <doc xml:space="preserve">the piece of memory to push on the stack</doc>
  43695. <type name="gpointer" c:type="gpointer"/>
  43696. </parameter>
  43697. </parameters>
  43698. </function>
  43699. <function name="try_malloc" c:identifier="g_try_malloc">
  43700. <doc xml:space="preserve">Attempts to allocate @n_bytes, and returns %NULL on failure.
  43701. Contrast with g_malloc(), which aborts the program on failure.</doc>
  43702. <return-value transfer-ownership="none" nullable="1">
  43703. <doc xml:space="preserve">the allocated memory, or %NULL.</doc>
  43704. <type name="gpointer" c:type="gpointer"/>
  43705. </return-value>
  43706. <parameters>
  43707. <parameter name="n_bytes" transfer-ownership="none">
  43708. <doc xml:space="preserve">number of bytes to allocate.</doc>
  43709. <type name="gsize" c:type="gsize"/>
  43710. </parameter>
  43711. </parameters>
  43712. </function>
  43713. <function name="try_malloc0" c:identifier="g_try_malloc0" version="2.8">
  43714. <doc xml:space="preserve">Attempts to allocate @n_bytes, initialized to 0's, and returns %NULL on
  43715. failure. Contrast with g_malloc0(), which aborts the program on failure.</doc>
  43716. <return-value transfer-ownership="none" nullable="1">
  43717. <doc xml:space="preserve">the allocated memory, or %NULL</doc>
  43718. <type name="gpointer" c:type="gpointer"/>
  43719. </return-value>
  43720. <parameters>
  43721. <parameter name="n_bytes" transfer-ownership="none">
  43722. <doc xml:space="preserve">number of bytes to allocate</doc>
  43723. <type name="gsize" c:type="gsize"/>
  43724. </parameter>
  43725. </parameters>
  43726. </function>
  43727. <function name="try_malloc0_n"
  43728. c:identifier="g_try_malloc0_n"
  43729. version="2.24">
  43730. <doc xml:space="preserve">This function is similar to g_try_malloc0(), allocating (@n_blocks * @n_block_bytes) bytes,
  43731. but care is taken to detect possible overflow during multiplication.</doc>
  43732. <return-value transfer-ownership="none" nullable="1">
  43733. <doc xml:space="preserve">the allocated memory, or %NULL</doc>
  43734. <type name="gpointer" c:type="gpointer"/>
  43735. </return-value>
  43736. <parameters>
  43737. <parameter name="n_blocks" transfer-ownership="none">
  43738. <doc xml:space="preserve">the number of blocks to allocate</doc>
  43739. <type name="gsize" c:type="gsize"/>
  43740. </parameter>
  43741. <parameter name="n_block_bytes" transfer-ownership="none">
  43742. <doc xml:space="preserve">the size of each block in bytes</doc>
  43743. <type name="gsize" c:type="gsize"/>
  43744. </parameter>
  43745. </parameters>
  43746. </function>
  43747. <function name="try_malloc_n" c:identifier="g_try_malloc_n" version="2.24">
  43748. <doc xml:space="preserve">This function is similar to g_try_malloc(), allocating (@n_blocks * @n_block_bytes) bytes,
  43749. but care is taken to detect possible overflow during multiplication.</doc>
  43750. <return-value transfer-ownership="none" nullable="1">
  43751. <doc xml:space="preserve">the allocated memory, or %NULL.</doc>
  43752. <type name="gpointer" c:type="gpointer"/>
  43753. </return-value>
  43754. <parameters>
  43755. <parameter name="n_blocks" transfer-ownership="none">
  43756. <doc xml:space="preserve">the number of blocks to allocate</doc>
  43757. <type name="gsize" c:type="gsize"/>
  43758. </parameter>
  43759. <parameter name="n_block_bytes" transfer-ownership="none">
  43760. <doc xml:space="preserve">the size of each block in bytes</doc>
  43761. <type name="gsize" c:type="gsize"/>
  43762. </parameter>
  43763. </parameters>
  43764. </function>
  43765. <function name="try_realloc" c:identifier="g_try_realloc">
  43766. <doc xml:space="preserve">Attempts to realloc @mem to a new size, @n_bytes, and returns %NULL
  43767. on failure. Contrast with g_realloc(), which aborts the program
  43768. on failure.
  43769. If @mem is %NULL, behaves the same as g_try_malloc().</doc>
  43770. <return-value transfer-ownership="none" nullable="1">
  43771. <doc xml:space="preserve">the allocated memory, or %NULL.</doc>
  43772. <type name="gpointer" c:type="gpointer"/>
  43773. </return-value>
  43774. <parameters>
  43775. <parameter name="mem"
  43776. transfer-ownership="none"
  43777. nullable="1"
  43778. allow-none="1">
  43779. <doc xml:space="preserve">previously-allocated memory, or %NULL.</doc>
  43780. <type name="gpointer" c:type="gpointer"/>
  43781. </parameter>
  43782. <parameter name="n_bytes" transfer-ownership="none">
  43783. <doc xml:space="preserve">number of bytes to allocate.</doc>
  43784. <type name="gsize" c:type="gsize"/>
  43785. </parameter>
  43786. </parameters>
  43787. </function>
  43788. <function name="try_realloc_n"
  43789. c:identifier="g_try_realloc_n"
  43790. version="2.24">
  43791. <doc xml:space="preserve">This function is similar to g_try_realloc(), allocating (@n_blocks * @n_block_bytes) bytes,
  43792. but care is taken to detect possible overflow during multiplication.</doc>
  43793. <return-value transfer-ownership="none" nullable="1">
  43794. <doc xml:space="preserve">the allocated memory, or %NULL.</doc>
  43795. <type name="gpointer" c:type="gpointer"/>
  43796. </return-value>
  43797. <parameters>
  43798. <parameter name="mem"
  43799. transfer-ownership="none"
  43800. nullable="1"
  43801. allow-none="1">
  43802. <doc xml:space="preserve">previously-allocated memory, or %NULL.</doc>
  43803. <type name="gpointer" c:type="gpointer"/>
  43804. </parameter>
  43805. <parameter name="n_blocks" transfer-ownership="none">
  43806. <doc xml:space="preserve">the number of blocks to allocate</doc>
  43807. <type name="gsize" c:type="gsize"/>
  43808. </parameter>
  43809. <parameter name="n_block_bytes" transfer-ownership="none">
  43810. <doc xml:space="preserve">the size of each block in bytes</doc>
  43811. <type name="gsize" c:type="gsize"/>
  43812. </parameter>
  43813. </parameters>
  43814. </function>
  43815. <function name="ucs4_to_utf16" c:identifier="g_ucs4_to_utf16" throws="1">
  43816. <doc xml:space="preserve">Convert a string from UCS-4 to UTF-16. A 0 character will be
  43817. added to the result after the converted text.</doc>
  43818. <return-value transfer-ownership="none">
  43819. <doc xml:space="preserve">a pointer to a newly allocated UTF-16 string.
  43820. This value must be freed with g_free(). If an error occurs,
  43821. %NULL will be returned and @error set.</doc>
  43822. <type name="guint16" c:type="gunichar2*"/>
  43823. </return-value>
  43824. <parameters>
  43825. <parameter name="str" transfer-ownership="none">
  43826. <doc xml:space="preserve">a UCS-4 encoded string</doc>
  43827. <type name="gunichar" c:type="const gunichar*"/>
  43828. </parameter>
  43829. <parameter name="len" transfer-ownership="none">
  43830. <doc xml:space="preserve">the maximum length (number of characters) of @str to use.
  43831. If @len &lt; 0, then the string is nul-terminated.</doc>
  43832. <type name="glong" c:type="glong"/>
  43833. </parameter>
  43834. <parameter name="items_read"
  43835. direction="out"
  43836. caller-allocates="1"
  43837. transfer-ownership="none"
  43838. optional="1"
  43839. allow-none="1">
  43840. <doc xml:space="preserve">location to store number of
  43841. bytes read, or %NULL. If an error occurs then the index of the invalid
  43842. input is stored here.</doc>
  43843. <type name="glong" c:type="glong*"/>
  43844. </parameter>
  43845. <parameter name="items_written"
  43846. direction="out"
  43847. caller-allocates="1"
  43848. transfer-ownership="none"
  43849. optional="1"
  43850. allow-none="1">
  43851. <doc xml:space="preserve">location to store number
  43852. of #gunichar2 written, or %NULL. The value stored here does not include
  43853. the trailing 0.</doc>
  43854. <type name="glong" c:type="glong*"/>
  43855. </parameter>
  43856. </parameters>
  43857. </function>
  43858. <function name="ucs4_to_utf8" c:identifier="g_ucs4_to_utf8" throws="1">
  43859. <doc xml:space="preserve">Convert a string from a 32-bit fixed width representation as UCS-4.
  43860. to UTF-8. The result will be terminated with a 0 byte.</doc>
  43861. <return-value transfer-ownership="full">
  43862. <doc xml:space="preserve">a pointer to a newly allocated UTF-8 string.
  43863. This value must be freed with g_free(). If an error occurs,
  43864. %NULL will be returned and @error set. In that case, @items_read
  43865. will be set to the position of the first invalid input character.</doc>
  43866. <type name="utf8" c:type="gchar*"/>
  43867. </return-value>
  43868. <parameters>
  43869. <parameter name="str" transfer-ownership="none">
  43870. <doc xml:space="preserve">a UCS-4 encoded string</doc>
  43871. <type name="gunichar" c:type="const gunichar*"/>
  43872. </parameter>
  43873. <parameter name="len" transfer-ownership="none">
  43874. <doc xml:space="preserve">the maximum length (number of characters) of @str to use.
  43875. If @len &lt; 0, then the string is nul-terminated.</doc>
  43876. <type name="glong" c:type="glong"/>
  43877. </parameter>
  43878. <parameter name="items_read"
  43879. direction="out"
  43880. caller-allocates="1"
  43881. transfer-ownership="none"
  43882. optional="1"
  43883. allow-none="1">
  43884. <doc xml:space="preserve">location to store number of
  43885. characters read, or %NULL.</doc>
  43886. <type name="glong" c:type="glong*"/>
  43887. </parameter>
  43888. <parameter name="items_written"
  43889. direction="out"
  43890. caller-allocates="1"
  43891. transfer-ownership="none"
  43892. optional="1"
  43893. allow-none="1">
  43894. <doc xml:space="preserve">location to store number
  43895. of bytes written or %NULL. The value here stored does not include the
  43896. trailing 0 byte.</doc>
  43897. <type name="glong" c:type="glong*"/>
  43898. </parameter>
  43899. </parameters>
  43900. </function>
  43901. <function name="unichar_break_type" c:identifier="g_unichar_break_type">
  43902. <doc xml:space="preserve">Determines the break type of @c. @c should be a Unicode character
  43903. (to derive a character from UTF-8 encoded text, use
  43904. g_utf8_get_char()). The break type is used to find word and line
  43905. breaks ("text boundaries"), Pango implements the Unicode boundary
  43906. resolution algorithms and normally you would use a function such
  43907. as pango_break() instead of caring about break types yourself.</doc>
  43908. <return-value transfer-ownership="none">
  43909. <doc xml:space="preserve">the break type of @c</doc>
  43910. <type name="UnicodeBreakType" c:type="GUnicodeBreakType"/>
  43911. </return-value>
  43912. <parameters>
  43913. <parameter name="c" transfer-ownership="none">
  43914. <doc xml:space="preserve">a Unicode character</doc>
  43915. <type name="gunichar" c:type="gunichar"/>
  43916. </parameter>
  43917. </parameters>
  43918. </function>
  43919. <function name="unichar_combining_class"
  43920. c:identifier="g_unichar_combining_class"
  43921. version="2.14">
  43922. <doc xml:space="preserve">Determines the canonical combining class of a Unicode character.</doc>
  43923. <return-value transfer-ownership="none">
  43924. <doc xml:space="preserve">the combining class of the character</doc>
  43925. <type name="gint" c:type="gint"/>
  43926. </return-value>
  43927. <parameters>
  43928. <parameter name="uc" transfer-ownership="none">
  43929. <doc xml:space="preserve">a Unicode character</doc>
  43930. <type name="gunichar" c:type="gunichar"/>
  43931. </parameter>
  43932. </parameters>
  43933. </function>
  43934. <function name="unichar_compose"
  43935. c:identifier="g_unichar_compose"
  43936. version="2.30">
  43937. <doc xml:space="preserve">Performs a single composition step of the
  43938. Unicode canonical composition algorithm.
  43939. This function includes algorithmic Hangul Jamo composition,
  43940. but it is not exactly the inverse of g_unichar_decompose().
  43941. No composition can have either of @a or @b equal to zero.
  43942. To be precise, this function composes if and only if
  43943. there exists a Primary Composite P which is canonically
  43944. equivalent to the sequence &lt;@a,@b&gt;. See the Unicode
  43945. Standard for the definition of Primary Composite.
  43946. If @a and @b do not compose a new character, @ch is set to zero.
  43947. See
  43948. [UAX#15](http://unicode.org/reports/tr15/)
  43949. for details.</doc>
  43950. <return-value transfer-ownership="none">
  43951. <doc xml:space="preserve">%TRUE if the characters could be composed</doc>
  43952. <type name="gboolean" c:type="gboolean"/>
  43953. </return-value>
  43954. <parameters>
  43955. <parameter name="a" transfer-ownership="none">
  43956. <doc xml:space="preserve">a Unicode character</doc>
  43957. <type name="gunichar" c:type="gunichar"/>
  43958. </parameter>
  43959. <parameter name="b" transfer-ownership="none">
  43960. <doc xml:space="preserve">a Unicode character</doc>
  43961. <type name="gunichar" c:type="gunichar"/>
  43962. </parameter>
  43963. <parameter name="ch" transfer-ownership="none">
  43964. <doc xml:space="preserve">return location for the composed character</doc>
  43965. <type name="gunichar" c:type="gunichar*"/>
  43966. </parameter>
  43967. </parameters>
  43968. </function>
  43969. <function name="unichar_decompose"
  43970. c:identifier="g_unichar_decompose"
  43971. version="2.30">
  43972. <doc xml:space="preserve">Performs a single decomposition step of the
  43973. Unicode canonical decomposition algorithm.
  43974. This function does not include compatibility
  43975. decompositions. It does, however, include algorithmic
  43976. Hangul Jamo decomposition, as well as 'singleton'
  43977. decompositions which replace a character by a single
  43978. other character. In the case of singletons *@b will
  43979. be set to zero.
  43980. If @ch is not decomposable, *@a is set to @ch and *@b
  43981. is set to zero.
  43982. Note that the way Unicode decomposition pairs are
  43983. defined, it is guaranteed that @b would not decompose
  43984. further, but @a may itself decompose. To get the full
  43985. canonical decomposition for @ch, one would need to
  43986. recursively call this function on @a. Or use
  43987. g_unichar_fully_decompose().
  43988. See
  43989. [UAX#15](http://unicode.org/reports/tr15/)
  43990. for details.</doc>
  43991. <return-value transfer-ownership="none">
  43992. <doc xml:space="preserve">%TRUE if the character could be decomposed</doc>
  43993. <type name="gboolean" c:type="gboolean"/>
  43994. </return-value>
  43995. <parameters>
  43996. <parameter name="ch" transfer-ownership="none">
  43997. <doc xml:space="preserve">a Unicode character</doc>
  43998. <type name="gunichar" c:type="gunichar"/>
  43999. </parameter>
  44000. <parameter name="a" transfer-ownership="none">
  44001. <doc xml:space="preserve">return location for the first component of @ch</doc>
  44002. <type name="gunichar" c:type="gunichar*"/>
  44003. </parameter>
  44004. <parameter name="b" transfer-ownership="none">
  44005. <doc xml:space="preserve">return location for the second component of @ch</doc>
  44006. <type name="gunichar" c:type="gunichar*"/>
  44007. </parameter>
  44008. </parameters>
  44009. </function>
  44010. <function name="unichar_digit_value" c:identifier="g_unichar_digit_value">
  44011. <doc xml:space="preserve">Determines the numeric value of a character as a decimal
  44012. digit.</doc>
  44013. <return-value transfer-ownership="none">
  44014. <doc xml:space="preserve">If @c is a decimal digit (according to
  44015. g_unichar_isdigit()), its numeric value. Otherwise, -1.</doc>
  44016. <type name="gint" c:type="gint"/>
  44017. </return-value>
  44018. <parameters>
  44019. <parameter name="c" transfer-ownership="none">
  44020. <doc xml:space="preserve">a Unicode character</doc>
  44021. <type name="gunichar" c:type="gunichar"/>
  44022. </parameter>
  44023. </parameters>
  44024. </function>
  44025. <function name="unichar_fully_decompose"
  44026. c:identifier="g_unichar_fully_decompose"
  44027. version="2.30">
  44028. <doc xml:space="preserve">Computes the canonical or compatibility decomposition of a
  44029. Unicode character. For compatibility decomposition,
  44030. pass %TRUE for @compat; for canonical decomposition
  44031. pass %FALSE for @compat.
  44032. The decomposed sequence is placed in @result. Only up to
  44033. @result_len characters are written into @result. The length
  44034. of the full decomposition (irrespective of @result_len) is
  44035. returned by the function. For canonical decomposition,
  44036. currently all decompositions are of length at most 4, but
  44037. this may change in the future (very unlikely though).
  44038. At any rate, Unicode does guarantee that a buffer of length
  44039. 18 is always enough for both compatibility and canonical
  44040. decompositions, so that is the size recommended. This is provided
  44041. as %G_UNICHAR_MAX_DECOMPOSITION_LENGTH.
  44042. See
  44043. [UAX#15](http://unicode.org/reports/tr15/)
  44044. for details.</doc>
  44045. <return-value transfer-ownership="none">
  44046. <doc xml:space="preserve">the length of the full decomposition.</doc>
  44047. <type name="gsize" c:type="gsize"/>
  44048. </return-value>
  44049. <parameters>
  44050. <parameter name="ch" transfer-ownership="none">
  44051. <doc xml:space="preserve">a Unicode character.</doc>
  44052. <type name="gunichar" c:type="gunichar"/>
  44053. </parameter>
  44054. <parameter name="compat" transfer-ownership="none">
  44055. <doc xml:space="preserve">whether perform canonical or compatibility decomposition</doc>
  44056. <type name="gboolean" c:type="gboolean"/>
  44057. </parameter>
  44058. <parameter name="result"
  44059. transfer-ownership="none"
  44060. nullable="1"
  44061. allow-none="1">
  44062. <doc xml:space="preserve">location to store decomposed result, or %NULL</doc>
  44063. <type name="gunichar" c:type="gunichar*"/>
  44064. </parameter>
  44065. <parameter name="result_len" transfer-ownership="none">
  44066. <doc xml:space="preserve">length of @result</doc>
  44067. <type name="gsize" c:type="gsize"/>
  44068. </parameter>
  44069. </parameters>
  44070. </function>
  44071. <function name="unichar_get_mirror_char"
  44072. c:identifier="g_unichar_get_mirror_char"
  44073. version="2.4">
  44074. <doc xml:space="preserve">In Unicode, some characters are "mirrored". This means that their
  44075. images are mirrored horizontally in text that is laid out from right
  44076. to left. For instance, "(" would become its mirror image, ")", in
  44077. right-to-left text.
  44078. If @ch has the Unicode mirrored property and there is another unicode
  44079. character that typically has a glyph that is the mirror image of @ch's
  44080. glyph and @mirrored_ch is set, it puts that character in the address
  44081. pointed to by @mirrored_ch. Otherwise the original character is put.</doc>
  44082. <return-value transfer-ownership="none">
  44083. <doc xml:space="preserve">%TRUE if @ch has a mirrored character, %FALSE otherwise</doc>
  44084. <type name="gboolean" c:type="gboolean"/>
  44085. </return-value>
  44086. <parameters>
  44087. <parameter name="ch" transfer-ownership="none">
  44088. <doc xml:space="preserve">a Unicode character</doc>
  44089. <type name="gunichar" c:type="gunichar"/>
  44090. </parameter>
  44091. <parameter name="mirrored_ch" transfer-ownership="none">
  44092. <doc xml:space="preserve">location to store the mirrored character</doc>
  44093. <type name="gunichar" c:type="gunichar*"/>
  44094. </parameter>
  44095. </parameters>
  44096. </function>
  44097. <function name="unichar_get_script"
  44098. c:identifier="g_unichar_get_script"
  44099. version="2.14">
  44100. <doc xml:space="preserve">Looks up the #GUnicodeScript for a particular character (as defined
  44101. by Unicode Standard Annex \#24). No check is made for @ch being a
  44102. valid Unicode character; if you pass in invalid character, the
  44103. result is undefined.
  44104. This function is equivalent to pango_script_for_unichar() and the
  44105. two are interchangeable.</doc>
  44106. <return-value transfer-ownership="none">
  44107. <doc xml:space="preserve">the #GUnicodeScript for the character.</doc>
  44108. <type name="UnicodeScript" c:type="GUnicodeScript"/>
  44109. </return-value>
  44110. <parameters>
  44111. <parameter name="ch" transfer-ownership="none">
  44112. <doc xml:space="preserve">a Unicode character</doc>
  44113. <type name="gunichar" c:type="gunichar"/>
  44114. </parameter>
  44115. </parameters>
  44116. </function>
  44117. <function name="unichar_isalnum" c:identifier="g_unichar_isalnum">
  44118. <doc xml:space="preserve">Determines whether a character is alphanumeric.
  44119. Given some UTF-8 text, obtain a character value
  44120. with g_utf8_get_char().</doc>
  44121. <return-value transfer-ownership="none">
  44122. <doc xml:space="preserve">%TRUE if @c is an alphanumeric character</doc>
  44123. <type name="gboolean" c:type="gboolean"/>
  44124. </return-value>
  44125. <parameters>
  44126. <parameter name="c" transfer-ownership="none">
  44127. <doc xml:space="preserve">a Unicode character</doc>
  44128. <type name="gunichar" c:type="gunichar"/>
  44129. </parameter>
  44130. </parameters>
  44131. </function>
  44132. <function name="unichar_isalpha" c:identifier="g_unichar_isalpha">
  44133. <doc xml:space="preserve">Determines whether a character is alphabetic (i.e. a letter).
  44134. Given some UTF-8 text, obtain a character value with
  44135. g_utf8_get_char().</doc>
  44136. <return-value transfer-ownership="none">
  44137. <doc xml:space="preserve">%TRUE if @c is an alphabetic character</doc>
  44138. <type name="gboolean" c:type="gboolean"/>
  44139. </return-value>
  44140. <parameters>
  44141. <parameter name="c" transfer-ownership="none">
  44142. <doc xml:space="preserve">a Unicode character</doc>
  44143. <type name="gunichar" c:type="gunichar"/>
  44144. </parameter>
  44145. </parameters>
  44146. </function>
  44147. <function name="unichar_iscntrl" c:identifier="g_unichar_iscntrl">
  44148. <doc xml:space="preserve">Determines whether a character is a control character.
  44149. Given some UTF-8 text, obtain a character value with
  44150. g_utf8_get_char().</doc>
  44151. <return-value transfer-ownership="none">
  44152. <doc xml:space="preserve">%TRUE if @c is a control character</doc>
  44153. <type name="gboolean" c:type="gboolean"/>
  44154. </return-value>
  44155. <parameters>
  44156. <parameter name="c" transfer-ownership="none">
  44157. <doc xml:space="preserve">a Unicode character</doc>
  44158. <type name="gunichar" c:type="gunichar"/>
  44159. </parameter>
  44160. </parameters>
  44161. </function>
  44162. <function name="unichar_isdefined" c:identifier="g_unichar_isdefined">
  44163. <doc xml:space="preserve">Determines if a given character is assigned in the Unicode
  44164. standard.</doc>
  44165. <return-value transfer-ownership="none">
  44166. <doc xml:space="preserve">%TRUE if the character has an assigned value</doc>
  44167. <type name="gboolean" c:type="gboolean"/>
  44168. </return-value>
  44169. <parameters>
  44170. <parameter name="c" transfer-ownership="none">
  44171. <doc xml:space="preserve">a Unicode character</doc>
  44172. <type name="gunichar" c:type="gunichar"/>
  44173. </parameter>
  44174. </parameters>
  44175. </function>
  44176. <function name="unichar_isdigit" c:identifier="g_unichar_isdigit">
  44177. <doc xml:space="preserve">Determines whether a character is numeric (i.e. a digit). This
  44178. covers ASCII 0-9 and also digits in other languages/scripts. Given
  44179. some UTF-8 text, obtain a character value with g_utf8_get_char().</doc>
  44180. <return-value transfer-ownership="none">
  44181. <doc xml:space="preserve">%TRUE if @c is a digit</doc>
  44182. <type name="gboolean" c:type="gboolean"/>
  44183. </return-value>
  44184. <parameters>
  44185. <parameter name="c" transfer-ownership="none">
  44186. <doc xml:space="preserve">a Unicode character</doc>
  44187. <type name="gunichar" c:type="gunichar"/>
  44188. </parameter>
  44189. </parameters>
  44190. </function>
  44191. <function name="unichar_isgraph" c:identifier="g_unichar_isgraph">
  44192. <doc xml:space="preserve">Determines whether a character is printable and not a space
  44193. (returns %FALSE for control characters, format characters, and
  44194. spaces). g_unichar_isprint() is similar, but returns %TRUE for
  44195. spaces. Given some UTF-8 text, obtain a character value with
  44196. g_utf8_get_char().</doc>
  44197. <return-value transfer-ownership="none">
  44198. <doc xml:space="preserve">%TRUE if @c is printable unless it's a space</doc>
  44199. <type name="gboolean" c:type="gboolean"/>
  44200. </return-value>
  44201. <parameters>
  44202. <parameter name="c" transfer-ownership="none">
  44203. <doc xml:space="preserve">a Unicode character</doc>
  44204. <type name="gunichar" c:type="gunichar"/>
  44205. </parameter>
  44206. </parameters>
  44207. </function>
  44208. <function name="unichar_islower" c:identifier="g_unichar_islower">
  44209. <doc xml:space="preserve">Determines whether a character is a lowercase letter.
  44210. Given some UTF-8 text, obtain a character value with
  44211. g_utf8_get_char().</doc>
  44212. <return-value transfer-ownership="none">
  44213. <doc xml:space="preserve">%TRUE if @c is a lowercase letter</doc>
  44214. <type name="gboolean" c:type="gboolean"/>
  44215. </return-value>
  44216. <parameters>
  44217. <parameter name="c" transfer-ownership="none">
  44218. <doc xml:space="preserve">a Unicode character</doc>
  44219. <type name="gunichar" c:type="gunichar"/>
  44220. </parameter>
  44221. </parameters>
  44222. </function>
  44223. <function name="unichar_ismark"
  44224. c:identifier="g_unichar_ismark"
  44225. version="2.14">
  44226. <doc xml:space="preserve">Determines whether a character is a mark (non-spacing mark,
  44227. combining mark, or enclosing mark in Unicode speak).
  44228. Given some UTF-8 text, obtain a character value
  44229. with g_utf8_get_char().
  44230. Note: in most cases where isalpha characters are allowed,
  44231. ismark characters should be allowed to as they are essential
  44232. for writing most European languages as well as many non-Latin
  44233. scripts.</doc>
  44234. <return-value transfer-ownership="none">
  44235. <doc xml:space="preserve">%TRUE if @c is a mark character</doc>
  44236. <type name="gboolean" c:type="gboolean"/>
  44237. </return-value>
  44238. <parameters>
  44239. <parameter name="c" transfer-ownership="none">
  44240. <doc xml:space="preserve">a Unicode character</doc>
  44241. <type name="gunichar" c:type="gunichar"/>
  44242. </parameter>
  44243. </parameters>
  44244. </function>
  44245. <function name="unichar_isprint" c:identifier="g_unichar_isprint">
  44246. <doc xml:space="preserve">Determines whether a character is printable.
  44247. Unlike g_unichar_isgraph(), returns %TRUE for spaces.
  44248. Given some UTF-8 text, obtain a character value with
  44249. g_utf8_get_char().</doc>
  44250. <return-value transfer-ownership="none">
  44251. <doc xml:space="preserve">%TRUE if @c is printable</doc>
  44252. <type name="gboolean" c:type="gboolean"/>
  44253. </return-value>
  44254. <parameters>
  44255. <parameter name="c" transfer-ownership="none">
  44256. <doc xml:space="preserve">a Unicode character</doc>
  44257. <type name="gunichar" c:type="gunichar"/>
  44258. </parameter>
  44259. </parameters>
  44260. </function>
  44261. <function name="unichar_ispunct" c:identifier="g_unichar_ispunct">
  44262. <doc xml:space="preserve">Determines whether a character is punctuation or a symbol.
  44263. Given some UTF-8 text, obtain a character value with
  44264. g_utf8_get_char().</doc>
  44265. <return-value transfer-ownership="none">
  44266. <doc xml:space="preserve">%TRUE if @c is a punctuation or symbol character</doc>
  44267. <type name="gboolean" c:type="gboolean"/>
  44268. </return-value>
  44269. <parameters>
  44270. <parameter name="c" transfer-ownership="none">
  44271. <doc xml:space="preserve">a Unicode character</doc>
  44272. <type name="gunichar" c:type="gunichar"/>
  44273. </parameter>
  44274. </parameters>
  44275. </function>
  44276. <function name="unichar_isspace" c:identifier="g_unichar_isspace">
  44277. <doc xml:space="preserve">Determines whether a character is a space, tab, or line separator
  44278. (newline, carriage return, etc.). Given some UTF-8 text, obtain a
  44279. character value with g_utf8_get_char().
  44280. (Note: don't use this to do word breaking; you have to use
  44281. Pango or equivalent to get word breaking right, the algorithm
  44282. is fairly complex.)</doc>
  44283. <return-value transfer-ownership="none">
  44284. <doc xml:space="preserve">%TRUE if @c is a space character</doc>
  44285. <type name="gboolean" c:type="gboolean"/>
  44286. </return-value>
  44287. <parameters>
  44288. <parameter name="c" transfer-ownership="none">
  44289. <doc xml:space="preserve">a Unicode character</doc>
  44290. <type name="gunichar" c:type="gunichar"/>
  44291. </parameter>
  44292. </parameters>
  44293. </function>
  44294. <function name="unichar_istitle" c:identifier="g_unichar_istitle">
  44295. <doc xml:space="preserve">Determines if a character is titlecase. Some characters in
  44296. Unicode which are composites, such as the DZ digraph
  44297. have three case variants instead of just two. The titlecase
  44298. form is used at the beginning of a word where only the
  44299. first letter is capitalized. The titlecase form of the DZ
  44300. digraph is U+01F2 LATIN CAPITAL LETTTER D WITH SMALL LETTER Z.</doc>
  44301. <return-value transfer-ownership="none">
  44302. <doc xml:space="preserve">%TRUE if the character is titlecase</doc>
  44303. <type name="gboolean" c:type="gboolean"/>
  44304. </return-value>
  44305. <parameters>
  44306. <parameter name="c" transfer-ownership="none">
  44307. <doc xml:space="preserve">a Unicode character</doc>
  44308. <type name="gunichar" c:type="gunichar"/>
  44309. </parameter>
  44310. </parameters>
  44311. </function>
  44312. <function name="unichar_isupper" c:identifier="g_unichar_isupper">
  44313. <doc xml:space="preserve">Determines if a character is uppercase.</doc>
  44314. <return-value transfer-ownership="none">
  44315. <doc xml:space="preserve">%TRUE if @c is an uppercase character</doc>
  44316. <type name="gboolean" c:type="gboolean"/>
  44317. </return-value>
  44318. <parameters>
  44319. <parameter name="c" transfer-ownership="none">
  44320. <doc xml:space="preserve">a Unicode character</doc>
  44321. <type name="gunichar" c:type="gunichar"/>
  44322. </parameter>
  44323. </parameters>
  44324. </function>
  44325. <function name="unichar_iswide" c:identifier="g_unichar_iswide">
  44326. <doc xml:space="preserve">Determines if a character is typically rendered in a double-width
  44327. cell.</doc>
  44328. <return-value transfer-ownership="none">
  44329. <doc xml:space="preserve">%TRUE if the character is wide</doc>
  44330. <type name="gboolean" c:type="gboolean"/>
  44331. </return-value>
  44332. <parameters>
  44333. <parameter name="c" transfer-ownership="none">
  44334. <doc xml:space="preserve">a Unicode character</doc>
  44335. <type name="gunichar" c:type="gunichar"/>
  44336. </parameter>
  44337. </parameters>
  44338. </function>
  44339. <function name="unichar_iswide_cjk"
  44340. c:identifier="g_unichar_iswide_cjk"
  44341. version="2.12">
  44342. <doc xml:space="preserve">Determines if a character is typically rendered in a double-width
  44343. cell under legacy East Asian locales. If a character is wide according to
  44344. g_unichar_iswide(), then it is also reported wide with this function, but
  44345. the converse is not necessarily true. See the
  44346. [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/)
  44347. for details.
  44348. If a character passes the g_unichar_iswide() test then it will also pass
  44349. this test, but not the other way around. Note that some characters may
  44350. pass both this test and g_unichar_iszerowidth().</doc>
  44351. <return-value transfer-ownership="none">
  44352. <doc xml:space="preserve">%TRUE if the character is wide in legacy East Asian locales</doc>
  44353. <type name="gboolean" c:type="gboolean"/>
  44354. </return-value>
  44355. <parameters>
  44356. <parameter name="c" transfer-ownership="none">
  44357. <doc xml:space="preserve">a Unicode character</doc>
  44358. <type name="gunichar" c:type="gunichar"/>
  44359. </parameter>
  44360. </parameters>
  44361. </function>
  44362. <function name="unichar_isxdigit" c:identifier="g_unichar_isxdigit">
  44363. <doc xml:space="preserve">Determines if a character is a hexidecimal digit.</doc>
  44364. <return-value transfer-ownership="none">
  44365. <doc xml:space="preserve">%TRUE if the character is a hexadecimal digit</doc>
  44366. <type name="gboolean" c:type="gboolean"/>
  44367. </return-value>
  44368. <parameters>
  44369. <parameter name="c" transfer-ownership="none">
  44370. <doc xml:space="preserve">a Unicode character.</doc>
  44371. <type name="gunichar" c:type="gunichar"/>
  44372. </parameter>
  44373. </parameters>
  44374. </function>
  44375. <function name="unichar_iszerowidth"
  44376. c:identifier="g_unichar_iszerowidth"
  44377. version="2.14">
  44378. <doc xml:space="preserve">Determines if a given character typically takes zero width when rendered.
  44379. The return value is %TRUE for all non-spacing and enclosing marks
  44380. (e.g., combining accents), format characters, zero-width
  44381. space, but not U+00AD SOFT HYPHEN.
  44382. A typical use of this function is with one of g_unichar_iswide() or
  44383. g_unichar_iswide_cjk() to determine the number of cells a string occupies
  44384. when displayed on a grid display (terminals). However, note that not all
  44385. terminals support zero-width rendering of zero-width marks.</doc>
  44386. <return-value transfer-ownership="none">
  44387. <doc xml:space="preserve">%TRUE if the character has zero width</doc>
  44388. <type name="gboolean" c:type="gboolean"/>
  44389. </return-value>
  44390. <parameters>
  44391. <parameter name="c" transfer-ownership="none">
  44392. <doc xml:space="preserve">a Unicode character</doc>
  44393. <type name="gunichar" c:type="gunichar"/>
  44394. </parameter>
  44395. </parameters>
  44396. </function>
  44397. <function name="unichar_to_utf8" c:identifier="g_unichar_to_utf8">
  44398. <doc xml:space="preserve">Converts a single character to UTF-8.</doc>
  44399. <return-value transfer-ownership="none">
  44400. <doc xml:space="preserve">number of bytes written</doc>
  44401. <type name="gint" c:type="gint"/>
  44402. </return-value>
  44403. <parameters>
  44404. <parameter name="c" transfer-ownership="none">
  44405. <doc xml:space="preserve">a Unicode character code</doc>
  44406. <type name="gunichar" c:type="gunichar"/>
  44407. </parameter>
  44408. <parameter name="outbuf"
  44409. direction="out"
  44410. caller-allocates="1"
  44411. transfer-ownership="none"
  44412. optional="1"
  44413. allow-none="1">
  44414. <doc xml:space="preserve">output buffer, must have at
  44415. least 6 bytes of space. If %NULL, the length will be computed and
  44416. returned and nothing will be written to @outbuf.</doc>
  44417. <type name="utf8" c:type="gchar*"/>
  44418. </parameter>
  44419. </parameters>
  44420. </function>
  44421. <function name="unichar_tolower" c:identifier="g_unichar_tolower">
  44422. <doc xml:space="preserve">Converts a character to lower case.</doc>
  44423. <return-value transfer-ownership="none">
  44424. <doc xml:space="preserve">the result of converting @c to lower case.
  44425. If @c is not an upperlower or titlecase character,
  44426. or has no lowercase equivalent @c is returned unchanged.</doc>
  44427. <type name="gunichar" c:type="gunichar"/>
  44428. </return-value>
  44429. <parameters>
  44430. <parameter name="c" transfer-ownership="none">
  44431. <doc xml:space="preserve">a Unicode character.</doc>
  44432. <type name="gunichar" c:type="gunichar"/>
  44433. </parameter>
  44434. </parameters>
  44435. </function>
  44436. <function name="unichar_totitle" c:identifier="g_unichar_totitle">
  44437. <doc xml:space="preserve">Converts a character to the titlecase.</doc>
  44438. <return-value transfer-ownership="none">
  44439. <doc xml:space="preserve">the result of converting @c to titlecase.
  44440. If @c is not an uppercase or lowercase character,
  44441. @c is returned unchanged.</doc>
  44442. <type name="gunichar" c:type="gunichar"/>
  44443. </return-value>
  44444. <parameters>
  44445. <parameter name="c" transfer-ownership="none">
  44446. <doc xml:space="preserve">a Unicode character</doc>
  44447. <type name="gunichar" c:type="gunichar"/>
  44448. </parameter>
  44449. </parameters>
  44450. </function>
  44451. <function name="unichar_toupper" c:identifier="g_unichar_toupper">
  44452. <doc xml:space="preserve">Converts a character to uppercase.</doc>
  44453. <return-value transfer-ownership="none">
  44454. <doc xml:space="preserve">the result of converting @c to uppercase.
  44455. If @c is not an lowercase or titlecase character,
  44456. or has no upper case equivalent @c is returned unchanged.</doc>
  44457. <type name="gunichar" c:type="gunichar"/>
  44458. </return-value>
  44459. <parameters>
  44460. <parameter name="c" transfer-ownership="none">
  44461. <doc xml:space="preserve">a Unicode character</doc>
  44462. <type name="gunichar" c:type="gunichar"/>
  44463. </parameter>
  44464. </parameters>
  44465. </function>
  44466. <function name="unichar_type" c:identifier="g_unichar_type">
  44467. <doc xml:space="preserve">Classifies a Unicode character by type.</doc>
  44468. <return-value transfer-ownership="none">
  44469. <doc xml:space="preserve">the type of the character.</doc>
  44470. <type name="UnicodeType" c:type="GUnicodeType"/>
  44471. </return-value>
  44472. <parameters>
  44473. <parameter name="c" transfer-ownership="none">
  44474. <doc xml:space="preserve">a Unicode character</doc>
  44475. <type name="gunichar" c:type="gunichar"/>
  44476. </parameter>
  44477. </parameters>
  44478. </function>
  44479. <function name="unichar_validate" c:identifier="g_unichar_validate">
  44480. <doc xml:space="preserve">Checks whether @ch is a valid Unicode character. Some possible
  44481. integer values of @ch will not be valid. 0 is considered a valid
  44482. character, though it's normally a string terminator.</doc>
  44483. <return-value transfer-ownership="none">
  44484. <doc xml:space="preserve">%TRUE if @ch is a valid Unicode character</doc>
  44485. <type name="gboolean" c:type="gboolean"/>
  44486. </return-value>
  44487. <parameters>
  44488. <parameter name="ch" transfer-ownership="none">
  44489. <doc xml:space="preserve">a Unicode character</doc>
  44490. <type name="gunichar" c:type="gunichar"/>
  44491. </parameter>
  44492. </parameters>
  44493. </function>
  44494. <function name="unichar_xdigit_value"
  44495. c:identifier="g_unichar_xdigit_value">
  44496. <doc xml:space="preserve">Determines the numeric value of a character as a hexidecimal
  44497. digit.</doc>
  44498. <return-value transfer-ownership="none">
  44499. <doc xml:space="preserve">If @c is a hex digit (according to
  44500. g_unichar_isxdigit()), its numeric value. Otherwise, -1.</doc>
  44501. <type name="gint" c:type="gint"/>
  44502. </return-value>
  44503. <parameters>
  44504. <parameter name="c" transfer-ownership="none">
  44505. <doc xml:space="preserve">a Unicode character</doc>
  44506. <type name="gunichar" c:type="gunichar"/>
  44507. </parameter>
  44508. </parameters>
  44509. </function>
  44510. <function name="unicode_canonical_decomposition"
  44511. c:identifier="g_unicode_canonical_decomposition"
  44512. deprecated="1"
  44513. deprecated-version="2.30">
  44514. <doc xml:space="preserve">Computes the canonical decomposition of a Unicode character.</doc>
  44515. <doc-deprecated xml:space="preserve">Use the more flexible g_unichar_fully_decompose()
  44516. instead.</doc-deprecated>
  44517. <return-value transfer-ownership="none">
  44518. <doc xml:space="preserve">a newly allocated string of Unicode characters.
  44519. @result_len is set to the resulting length of the string.</doc>
  44520. <type name="gunichar" c:type="gunichar*"/>
  44521. </return-value>
  44522. <parameters>
  44523. <parameter name="ch" transfer-ownership="none">
  44524. <doc xml:space="preserve">a Unicode character.</doc>
  44525. <type name="gunichar" c:type="gunichar"/>
  44526. </parameter>
  44527. <parameter name="result_len" transfer-ownership="none">
  44528. <doc xml:space="preserve">location to store the length of the return value.</doc>
  44529. <type name="gsize" c:type="gsize*"/>
  44530. </parameter>
  44531. </parameters>
  44532. </function>
  44533. <function name="unicode_canonical_ordering"
  44534. c:identifier="g_unicode_canonical_ordering">
  44535. <doc xml:space="preserve">Computes the canonical ordering of a string in-place.
  44536. This rearranges decomposed characters in the string
  44537. according to their combining classes. See the Unicode
  44538. manual for more information.</doc>
  44539. <return-value transfer-ownership="none">
  44540. <type name="none" c:type="void"/>
  44541. </return-value>
  44542. <parameters>
  44543. <parameter name="string" transfer-ownership="none">
  44544. <doc xml:space="preserve">a UCS-4 encoded string.</doc>
  44545. <type name="gunichar" c:type="gunichar*"/>
  44546. </parameter>
  44547. <parameter name="len" transfer-ownership="none">
  44548. <doc xml:space="preserve">the maximum length of @string to use.</doc>
  44549. <type name="gsize" c:type="gsize"/>
  44550. </parameter>
  44551. </parameters>
  44552. </function>
  44553. <function name="unicode_script_from_iso15924"
  44554. c:identifier="g_unicode_script_from_iso15924"
  44555. version="2.30">
  44556. <doc xml:space="preserve">Looks up the Unicode script for @iso15924. ISO 15924 assigns four-letter
  44557. codes to scripts. For example, the code for Arabic is 'Arab'.
  44558. This function accepts four letter codes encoded as a @guint32 in a
  44559. big-endian fashion. That is, the code expected for Arabic is
  44560. 0x41726162 (0x41 is ASCII code for 'A', 0x72 is ASCII code for 'r', etc).
  44561. See
  44562. [Codes for the representation of names of scripts](http://unicode.org/iso15924/codelists.html)
  44563. for details.</doc>
  44564. <return-value transfer-ownership="none">
  44565. <doc xml:space="preserve">the Unicode script for @iso15924, or
  44566. of %G_UNICODE_SCRIPT_INVALID_CODE if @iso15924 is zero and
  44567. %G_UNICODE_SCRIPT_UNKNOWN if @iso15924 is unknown.</doc>
  44568. <type name="UnicodeScript" c:type="GUnicodeScript"/>
  44569. </return-value>
  44570. <parameters>
  44571. <parameter name="iso15924" transfer-ownership="none">
  44572. <doc xml:space="preserve">a Unicode script</doc>
  44573. <type name="guint32" c:type="guint32"/>
  44574. </parameter>
  44575. </parameters>
  44576. </function>
  44577. <function name="unicode_script_to_iso15924"
  44578. c:identifier="g_unicode_script_to_iso15924"
  44579. version="2.30">
  44580. <doc xml:space="preserve">Looks up the ISO 15924 code for @script. ISO 15924 assigns four-letter
  44581. codes to scripts. For example, the code for Arabic is 'Arab'. The
  44582. four letter codes are encoded as a @guint32 by this function in a
  44583. big-endian fashion. That is, the code returned for Arabic is
  44584. 0x41726162 (0x41 is ASCII code for 'A', 0x72 is ASCII code for 'r', etc).
  44585. See
  44586. [Codes for the representation of names of scripts](http://unicode.org/iso15924/codelists.html)
  44587. for details.</doc>
  44588. <return-value transfer-ownership="none">
  44589. <doc xml:space="preserve">the ISO 15924 code for @script, encoded as an integer,
  44590. of zero if @script is %G_UNICODE_SCRIPT_INVALID_CODE or
  44591. ISO 15924 code 'Zzzz' (script code for UNKNOWN) if @script is not understood.</doc>
  44592. <type name="guint32" c:type="guint32"/>
  44593. </return-value>
  44594. <parameters>
  44595. <parameter name="script" transfer-ownership="none">
  44596. <doc xml:space="preserve">a Unicode script</doc>
  44597. <type name="UnicodeScript" c:type="GUnicodeScript"/>
  44598. </parameter>
  44599. </parameters>
  44600. </function>
  44601. <function name="unix_error_quark" c:identifier="g_unix_error_quark">
  44602. <return-value transfer-ownership="none">
  44603. <type name="Quark" c:type="GQuark"/>
  44604. </return-value>
  44605. </function>
  44606. <function name="unix_fd_add"
  44607. c:identifier="g_unix_fd_add"
  44608. version="2.36"
  44609. introspectable="0">
  44610. <doc xml:space="preserve">Sets a function to be called when the IO condition, as specified by
  44611. @condition becomes true for @fd.
  44612. @function will be called when the specified IO condition becomes
  44613. %TRUE. The function is expected to clear whatever event caused the
  44614. IO condition to become true and return %TRUE in order to be notified
  44615. when it happens again. If @function returns %FALSE then the watch
  44616. will be cancelled.
  44617. The return value of this function can be passed to g_source_remove()
  44618. to cancel the watch at any time that it exists.
  44619. The source will never close the fd -- you must do it yourself.</doc>
  44620. <return-value transfer-ownership="none">
  44621. <doc xml:space="preserve">the ID (greater than 0) of the event source</doc>
  44622. <type name="guint" c:type="guint"/>
  44623. </return-value>
  44624. <parameters>
  44625. <parameter name="fd" transfer-ownership="none">
  44626. <doc xml:space="preserve">a file descriptor</doc>
  44627. <type name="gint" c:type="gint"/>
  44628. </parameter>
  44629. <parameter name="condition" transfer-ownership="none">
  44630. <doc xml:space="preserve">IO conditions to watch for on @fd</doc>
  44631. <type name="IOCondition" c:type="GIOCondition"/>
  44632. </parameter>
  44633. <parameter name="function" transfer-ownership="none" closure="3">
  44634. <doc xml:space="preserve">a #GPollFDFunc</doc>
  44635. <type name="UnixFDSourceFunc" c:type="GUnixFDSourceFunc"/>
  44636. </parameter>
  44637. <parameter name="user_data"
  44638. transfer-ownership="none"
  44639. nullable="1"
  44640. allow-none="1">
  44641. <doc xml:space="preserve">data to pass to @function</doc>
  44642. <type name="gpointer" c:type="gpointer"/>
  44643. </parameter>
  44644. </parameters>
  44645. </function>
  44646. <function name="unix_fd_add_full"
  44647. c:identifier="g_unix_fd_add_full"
  44648. version="2.36">
  44649. <doc xml:space="preserve">Sets a function to be called when the IO condition, as specified by
  44650. @condition becomes true for @fd.
  44651. This is the same as g_unix_fd_add(), except that it allows you to
  44652. specify a non-default priority and a provide a #GDestroyNotify for
  44653. @user_data.</doc>
  44654. <return-value transfer-ownership="none">
  44655. <doc xml:space="preserve">the ID (greater than 0) of the event source</doc>
  44656. <type name="guint" c:type="guint"/>
  44657. </return-value>
  44658. <parameters>
  44659. <parameter name="priority" transfer-ownership="none">
  44660. <doc xml:space="preserve">the priority of the source</doc>
  44661. <type name="gint" c:type="gint"/>
  44662. </parameter>
  44663. <parameter name="fd" transfer-ownership="none">
  44664. <doc xml:space="preserve">a file descriptor</doc>
  44665. <type name="gint" c:type="gint"/>
  44666. </parameter>
  44667. <parameter name="condition" transfer-ownership="none">
  44668. <doc xml:space="preserve">IO conditions to watch for on @fd</doc>
  44669. <type name="IOCondition" c:type="GIOCondition"/>
  44670. </parameter>
  44671. <parameter name="function"
  44672. transfer-ownership="none"
  44673. scope="notified"
  44674. closure="4"
  44675. destroy="5">
  44676. <doc xml:space="preserve">a #GUnixFDSourceFunc</doc>
  44677. <type name="UnixFDSourceFunc" c:type="GUnixFDSourceFunc"/>
  44678. </parameter>
  44679. <parameter name="user_data"
  44680. transfer-ownership="none"
  44681. nullable="1"
  44682. allow-none="1">
  44683. <doc xml:space="preserve">data to pass to @function</doc>
  44684. <type name="gpointer" c:type="gpointer"/>
  44685. </parameter>
  44686. <parameter name="notify" transfer-ownership="none" scope="async">
  44687. <doc xml:space="preserve">function to call when the idle is removed, or %NULL</doc>
  44688. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  44689. </parameter>
  44690. </parameters>
  44691. </function>
  44692. <function name="unix_fd_source_new"
  44693. c:identifier="g_unix_fd_source_new"
  44694. version="2.36">
  44695. <doc xml:space="preserve">Creates a #GSource to watch for a particular IO condition on a file
  44696. descriptor.
  44697. The source will never close the fd -- you must do it yourself.</doc>
  44698. <return-value transfer-ownership="full">
  44699. <doc xml:space="preserve">the newly created #GSource</doc>
  44700. <type name="Source" c:type="GSource*"/>
  44701. </return-value>
  44702. <parameters>
  44703. <parameter name="fd" transfer-ownership="none">
  44704. <doc xml:space="preserve">a file descriptor</doc>
  44705. <type name="gint" c:type="gint"/>
  44706. </parameter>
  44707. <parameter name="condition" transfer-ownership="none">
  44708. <doc xml:space="preserve">IO conditions to watch for on @fd</doc>
  44709. <type name="IOCondition" c:type="GIOCondition"/>
  44710. </parameter>
  44711. </parameters>
  44712. </function>
  44713. <function name="unix_open_pipe"
  44714. c:identifier="g_unix_open_pipe"
  44715. version="2.30"
  44716. throws="1">
  44717. <doc xml:space="preserve">Similar to the UNIX pipe() call, but on modern systems like Linux
  44718. uses the pipe2() system call, which atomically creates a pipe with
  44719. the configured flags. The only supported flag currently is
  44720. %FD_CLOEXEC. If for example you want to configure %O_NONBLOCK, that
  44721. must still be done separately with fcntl().
  44722. This function does not take %O_CLOEXEC, it takes %FD_CLOEXEC as if
  44723. for fcntl(); these are different on Linux/glibc.</doc>
  44724. <return-value transfer-ownership="none">
  44725. <doc xml:space="preserve">%TRUE on success, %FALSE if not (and errno will be set).</doc>
  44726. <type name="gboolean" c:type="gboolean"/>
  44727. </return-value>
  44728. <parameters>
  44729. <parameter name="fds" transfer-ownership="none">
  44730. <doc xml:space="preserve">Array of two integers</doc>
  44731. <type name="gint" c:type="gint*"/>
  44732. </parameter>
  44733. <parameter name="flags" transfer-ownership="none">
  44734. <doc xml:space="preserve">Bitfield of file descriptor flags, as for fcntl()</doc>
  44735. <type name="gint" c:type="gint"/>
  44736. </parameter>
  44737. </parameters>
  44738. </function>
  44739. <function name="unix_set_fd_nonblocking"
  44740. c:identifier="g_unix_set_fd_nonblocking"
  44741. version="2.30"
  44742. throws="1">
  44743. <doc xml:space="preserve">Control the non-blocking state of the given file descriptor,
  44744. according to @nonblock. On most systems this uses %O_NONBLOCK, but
  44745. on some older ones may use %O_NDELAY.</doc>
  44746. <return-value transfer-ownership="none">
  44747. <doc xml:space="preserve">%TRUE if successful</doc>
  44748. <type name="gboolean" c:type="gboolean"/>
  44749. </return-value>
  44750. <parameters>
  44751. <parameter name="fd" transfer-ownership="none">
  44752. <doc xml:space="preserve">A file descriptor</doc>
  44753. <type name="gint" c:type="gint"/>
  44754. </parameter>
  44755. <parameter name="nonblock" transfer-ownership="none">
  44756. <doc xml:space="preserve">If %TRUE, set the descriptor to be non-blocking</doc>
  44757. <type name="gboolean" c:type="gboolean"/>
  44758. </parameter>
  44759. </parameters>
  44760. </function>
  44761. <function name="unix_signal_add"
  44762. c:identifier="g_unix_signal_add"
  44763. shadowed-by="unix_signal_add_full"
  44764. version="2.30"
  44765. introspectable="0">
  44766. <doc xml:space="preserve">A convenience function for g_unix_signal_source_new(), which
  44767. attaches to the default #GMainContext. You can remove the watch
  44768. using g_source_remove().</doc>
  44769. <return-value transfer-ownership="none">
  44770. <doc xml:space="preserve">An ID (greater than 0) for the event source</doc>
  44771. <type name="guint" c:type="guint"/>
  44772. </return-value>
  44773. <parameters>
  44774. <parameter name="signum" transfer-ownership="none">
  44775. <doc xml:space="preserve">Signal number</doc>
  44776. <type name="gint" c:type="gint"/>
  44777. </parameter>
  44778. <parameter name="handler" transfer-ownership="none" closure="2">
  44779. <doc xml:space="preserve">Callback</doc>
  44780. <type name="SourceFunc" c:type="GSourceFunc"/>
  44781. </parameter>
  44782. <parameter name="user_data"
  44783. transfer-ownership="none"
  44784. nullable="1"
  44785. allow-none="1">
  44786. <doc xml:space="preserve">Data for @handler</doc>
  44787. <type name="gpointer" c:type="gpointer"/>
  44788. </parameter>
  44789. </parameters>
  44790. </function>
  44791. <function name="unix_signal_add_full"
  44792. c:identifier="g_unix_signal_add_full"
  44793. shadows="unix_signal_add"
  44794. version="2.30">
  44795. <doc xml:space="preserve">A convenience function for g_unix_signal_source_new(), which
  44796. attaches to the default #GMainContext. You can remove the watch
  44797. using g_source_remove().</doc>
  44798. <return-value transfer-ownership="none">
  44799. <doc xml:space="preserve">An ID (greater than 0) for the event source</doc>
  44800. <type name="guint" c:type="guint"/>
  44801. </return-value>
  44802. <parameters>
  44803. <parameter name="priority" transfer-ownership="none">
  44804. <doc xml:space="preserve">the priority of the signal source. Typically this will be in
  44805. the range between #G_PRIORITY_DEFAULT and #G_PRIORITY_HIGH.</doc>
  44806. <type name="gint" c:type="gint"/>
  44807. </parameter>
  44808. <parameter name="signum" transfer-ownership="none">
  44809. <doc xml:space="preserve">Signal number</doc>
  44810. <type name="gint" c:type="gint"/>
  44811. </parameter>
  44812. <parameter name="handler"
  44813. transfer-ownership="none"
  44814. scope="notified"
  44815. closure="3"
  44816. destroy="4">
  44817. <doc xml:space="preserve">Callback</doc>
  44818. <type name="SourceFunc" c:type="GSourceFunc"/>
  44819. </parameter>
  44820. <parameter name="user_data"
  44821. transfer-ownership="none"
  44822. nullable="1"
  44823. allow-none="1">
  44824. <doc xml:space="preserve">Data for @handler</doc>
  44825. <type name="gpointer" c:type="gpointer"/>
  44826. </parameter>
  44827. <parameter name="notify" transfer-ownership="none" scope="async">
  44828. <doc xml:space="preserve">#GDestroyNotify for @handler</doc>
  44829. <type name="DestroyNotify" c:type="GDestroyNotify"/>
  44830. </parameter>
  44831. </parameters>
  44832. </function>
  44833. <function name="unix_signal_source_new"
  44834. c:identifier="g_unix_signal_source_new"
  44835. version="2.30">
  44836. <doc xml:space="preserve">Create a #GSource that will be dispatched upon delivery of the UNIX
  44837. signal @signum. In GLib versions before 2.36, only `SIGHUP`, `SIGINT`,
  44838. `SIGTERM` can be monitored. In GLib 2.36, `SIGUSR1` and `SIGUSR2`
  44839. were added.
  44840. Note that unlike the UNIX default, all sources which have created a
  44841. watch will be dispatched, regardless of which underlying thread
  44842. invoked g_unix_signal_source_new().
  44843. For example, an effective use of this function is to handle `SIGTERM`
  44844. cleanly; flushing any outstanding files, and then calling
  44845. g_main_loop_quit (). It is not safe to do any of this a regular
  44846. UNIX signal handler; your handler may be invoked while malloc() or
  44847. another library function is running, causing reentrancy if you
  44848. attempt to use it from the handler. None of the GLib/GObject API
  44849. is safe against this kind of reentrancy.
  44850. The interaction of this source when combined with native UNIX
  44851. functions like sigprocmask() is not defined.
  44852. The source will not initially be associated with any #GMainContext
  44853. and must be added to one with g_source_attach() before it will be
  44854. executed.</doc>
  44855. <return-value transfer-ownership="full">
  44856. <doc xml:space="preserve">A newly created #GSource</doc>
  44857. <type name="Source" c:type="GSource*"/>
  44858. </return-value>
  44859. <parameters>
  44860. <parameter name="signum" transfer-ownership="none">
  44861. <doc xml:space="preserve">A signal number</doc>
  44862. <type name="gint" c:type="gint"/>
  44863. </parameter>
  44864. </parameters>
  44865. </function>
  44866. <function name="unlink" c:identifier="g_unlink" version="2.6">
  44867. <doc xml:space="preserve">A wrapper for the POSIX unlink() function. The unlink() function
  44868. deletes a name from the filesystem. If this was the last link to the
  44869. file and no processes have it opened, the diskspace occupied by the
  44870. file is freed.
  44871. See your C library manual for more details about unlink(). Note
  44872. that on Windows, it is in general not possible to delete files that
  44873. are open to some process, or mapped into memory.</doc>
  44874. <return-value transfer-ownership="none">
  44875. <doc xml:space="preserve">0 if the name was successfully deleted, -1 if an error
  44876. occurred</doc>
  44877. <type name="gint" c:type="int"/>
  44878. </return-value>
  44879. <parameters>
  44880. <parameter name="filename" transfer-ownership="none">
  44881. <doc xml:space="preserve">a pathname in the GLib file name encoding (UTF-8 on Windows)</doc>
  44882. <type name="utf8" c:type="const gchar*"/>
  44883. </parameter>
  44884. </parameters>
  44885. </function>
  44886. <function name="unsetenv" c:identifier="g_unsetenv" version="2.4">
  44887. <doc xml:space="preserve">Removes an environment variable from the environment.
  44888. Note that on some systems, when variables are overwritten, the
  44889. memory used for the previous variables and its value isn't reclaimed.
  44890. You should be mindful of the fact that environment variable handling
  44891. in UNIX is not thread-safe, and your program may crash if one thread
  44892. calls g_unsetenv() while another thread is calling getenv(). (And note
  44893. that many functions, such as gettext(), call getenv() internally.) This
  44894. function is only safe to use at the very start of your program, before
  44895. creating any other threads (or creating objects that create worker
  44896. threads of their own).
  44897. If you need to set up the environment for a child process, you can
  44898. use g_get_environ() to get an environment array, modify that with
  44899. g_environ_setenv() and g_environ_unsetenv(), and then pass that
  44900. array directly to execvpe(), g_spawn_async(), or the like.</doc>
  44901. <return-value transfer-ownership="none">
  44902. <type name="none" c:type="void"/>
  44903. </return-value>
  44904. <parameters>
  44905. <parameter name="variable" transfer-ownership="none">
  44906. <doc xml:space="preserve">the environment variable to remove, must not contain '='</doc>
  44907. <type name="utf8" c:type="const gchar*"/>
  44908. </parameter>
  44909. </parameters>
  44910. </function>
  44911. <function name="uri_escape_string"
  44912. c:identifier="g_uri_escape_string"
  44913. version="2.16">
  44914. <doc xml:space="preserve">Escapes a string for use in a URI.
  44915. Normally all characters that are not "unreserved" (i.e. ASCII alphanumerical
  44916. characters plus dash, dot, underscore and tilde) are escaped.
  44917. But if you specify characters in @reserved_chars_allowed they are not
  44918. escaped. This is useful for the "reserved" characters in the URI
  44919. specification, since those are allowed unescaped in some portions of
  44920. a URI.</doc>
  44921. <return-value transfer-ownership="full">
  44922. <doc xml:space="preserve">an escaped version of @unescaped. The returned string should be
  44923. freed when no longer needed.</doc>
  44924. <type name="utf8" c:type="char*"/>
  44925. </return-value>
  44926. <parameters>
  44927. <parameter name="unescaped" transfer-ownership="none">
  44928. <doc xml:space="preserve">the unescaped input string.</doc>
  44929. <type name="utf8" c:type="const char*"/>
  44930. </parameter>
  44931. <parameter name="reserved_chars_allowed"
  44932. transfer-ownership="none"
  44933. nullable="1"
  44934. allow-none="1">
  44935. <doc xml:space="preserve">a string of reserved characters that
  44936. are allowed to be used, or %NULL.</doc>
  44937. <type name="utf8" c:type="const char*"/>
  44938. </parameter>
  44939. <parameter name="allow_utf8" transfer-ownership="none">
  44940. <doc xml:space="preserve">%TRUE if the result can include UTF-8 characters.</doc>
  44941. <type name="gboolean" c:type="gboolean"/>
  44942. </parameter>
  44943. </parameters>
  44944. </function>
  44945. <function name="uri_list_extract_uris"
  44946. c:identifier="g_uri_list_extract_uris"
  44947. version="2.6">
  44948. <doc xml:space="preserve">Splits an URI list conforming to the text/uri-list
  44949. mime type defined in RFC 2483 into individual URIs,
  44950. discarding any comments. The URIs are not validated.</doc>
  44951. <return-value transfer-ownership="full">
  44952. <doc xml:space="preserve">a newly allocated %NULL-terminated list
  44953. of strings holding the individual URIs. The array should be freed
  44954. with g_strfreev().</doc>
  44955. <array c:type="gchar**">
  44956. <type name="utf8"/>
  44957. </array>
  44958. </return-value>
  44959. <parameters>
  44960. <parameter name="uri_list" transfer-ownership="none">
  44961. <doc xml:space="preserve">an URI list</doc>
  44962. <type name="utf8" c:type="const gchar*"/>
  44963. </parameter>
  44964. </parameters>
  44965. </function>
  44966. <function name="uri_parse_scheme"
  44967. c:identifier="g_uri_parse_scheme"
  44968. version="2.16">
  44969. <doc xml:space="preserve">Gets the scheme portion of a URI string. RFC 3986 decodes the scheme as:
  44970. |[
  44971. URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
  44972. ]|
  44973. Common schemes include "file", "http", "svn+ssh", etc.</doc>
  44974. <return-value transfer-ownership="full">
  44975. <doc xml:space="preserve">The "Scheme" component of the URI, or %NULL on error.
  44976. The returned string should be freed when no longer needed.</doc>
  44977. <type name="utf8" c:type="char*"/>
  44978. </return-value>
  44979. <parameters>
  44980. <parameter name="uri" transfer-ownership="none">
  44981. <doc xml:space="preserve">a valid URI.</doc>
  44982. <type name="utf8" c:type="const char*"/>
  44983. </parameter>
  44984. </parameters>
  44985. </function>
  44986. <function name="uri_unescape_segment"
  44987. c:identifier="g_uri_unescape_segment"
  44988. version="2.16">
  44989. <doc xml:space="preserve">Unescapes a segment of an escaped string.
  44990. If any of the characters in @illegal_characters or the character zero appears
  44991. as an escaped character in @escaped_string then that is an error and %NULL
  44992. will be returned. This is useful it you want to avoid for instance having a
  44993. slash being expanded in an escaped path element, which might confuse pathname
  44994. handling.</doc>
  44995. <return-value transfer-ownership="full">
  44996. <doc xml:space="preserve">an unescaped version of @escaped_string or %NULL on error.
  44997. The returned string should be freed when no longer needed. As a
  44998. special case if %NULL is given for @escaped_string, this function
  44999. will return %NULL.</doc>
  45000. <type name="utf8" c:type="char*"/>
  45001. </return-value>
  45002. <parameters>
  45003. <parameter name="escaped_string"
  45004. transfer-ownership="none"
  45005. nullable="1"
  45006. allow-none="1">
  45007. <doc xml:space="preserve">A string, may be %NULL</doc>
  45008. <type name="utf8" c:type="const char*"/>
  45009. </parameter>
  45010. <parameter name="escaped_string_end"
  45011. transfer-ownership="none"
  45012. nullable="1"
  45013. allow-none="1">
  45014. <doc xml:space="preserve">Pointer to end of @escaped_string, may be %NULL</doc>
  45015. <type name="utf8" c:type="const char*"/>
  45016. </parameter>
  45017. <parameter name="illegal_characters"
  45018. transfer-ownership="none"
  45019. nullable="1"
  45020. allow-none="1">
  45021. <doc xml:space="preserve">An optional string of illegal characters not to be allowed, may be %NULL</doc>
  45022. <type name="utf8" c:type="const char*"/>
  45023. </parameter>
  45024. </parameters>
  45025. </function>
  45026. <function name="uri_unescape_string"
  45027. c:identifier="g_uri_unescape_string"
  45028. version="2.16">
  45029. <doc xml:space="preserve">Unescapes a whole escaped string.
  45030. If any of the characters in @illegal_characters or the character zero appears
  45031. as an escaped character in @escaped_string then that is an error and %NULL
  45032. will be returned. This is useful it you want to avoid for instance having a
  45033. slash being expanded in an escaped path element, which might confuse pathname
  45034. handling.</doc>
  45035. <return-value transfer-ownership="full">
  45036. <doc xml:space="preserve">an unescaped version of @escaped_string. The returned string
  45037. should be freed when no longer needed.</doc>
  45038. <type name="utf8" c:type="char*"/>
  45039. </return-value>
  45040. <parameters>
  45041. <parameter name="escaped_string" transfer-ownership="none">
  45042. <doc xml:space="preserve">an escaped string to be unescaped.</doc>
  45043. <type name="utf8" c:type="const char*"/>
  45044. </parameter>
  45045. <parameter name="illegal_characters"
  45046. transfer-ownership="none"
  45047. nullable="1"
  45048. allow-none="1">
  45049. <doc xml:space="preserve">a string of illegal characters not to be
  45050. allowed, or %NULL.</doc>
  45051. <type name="utf8" c:type="const char*"/>
  45052. </parameter>
  45053. </parameters>
  45054. </function>
  45055. <function name="usleep" c:identifier="g_usleep">
  45056. <doc xml:space="preserve">Pauses the current thread for the given number of microseconds.
  45057. There are 1 million microseconds per second (represented by the
  45058. #G_USEC_PER_SEC macro). g_usleep() may have limited precision,
  45059. depending on hardware and operating system; don't rely on the exact
  45060. length of the sleep.</doc>
  45061. <return-value transfer-ownership="none">
  45062. <type name="none" c:type="void"/>
  45063. </return-value>
  45064. <parameters>
  45065. <parameter name="microseconds" transfer-ownership="none">
  45066. <doc xml:space="preserve">number of microseconds to pause</doc>
  45067. <type name="gulong" c:type="gulong"/>
  45068. </parameter>
  45069. </parameters>
  45070. </function>
  45071. <function name="utf16_to_ucs4" c:identifier="g_utf16_to_ucs4" throws="1">
  45072. <doc xml:space="preserve">Convert a string from UTF-16 to UCS-4. The result will be
  45073. nul-terminated.</doc>
  45074. <return-value transfer-ownership="none">
  45075. <doc xml:space="preserve">a pointer to a newly allocated UCS-4 string.
  45076. This value must be freed with g_free(). If an error occurs,
  45077. %NULL will be returned and @error set.</doc>
  45078. <type name="gunichar" c:type="gunichar*"/>
  45079. </return-value>
  45080. <parameters>
  45081. <parameter name="str" transfer-ownership="none">
  45082. <doc xml:space="preserve">a UTF-16 encoded string</doc>
  45083. <type name="guint16" c:type="const gunichar2*"/>
  45084. </parameter>
  45085. <parameter name="len" transfer-ownership="none">
  45086. <doc xml:space="preserve">the maximum length (number of #gunichar2) of @str to use.
  45087. If @len &lt; 0, then the string is nul-terminated.</doc>
  45088. <type name="glong" c:type="glong"/>
  45089. </parameter>
  45090. <parameter name="items_read"
  45091. direction="out"
  45092. caller-allocates="1"
  45093. transfer-ownership="none"
  45094. optional="1"
  45095. allow-none="1">
  45096. <doc xml:space="preserve">location to store number of
  45097. words read, or %NULL. If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will
  45098. be returned in case @str contains a trailing partial character. If
  45099. an error occurs then the index of the invalid input is stored here.</doc>
  45100. <type name="glong" c:type="glong*"/>
  45101. </parameter>
  45102. <parameter name="items_written"
  45103. direction="out"
  45104. caller-allocates="1"
  45105. transfer-ownership="none"
  45106. optional="1"
  45107. allow-none="1">
  45108. <doc xml:space="preserve">location to store number
  45109. of characters written, or %NULL. The value stored here does not include
  45110. the trailing 0 character.</doc>
  45111. <type name="glong" c:type="glong*"/>
  45112. </parameter>
  45113. </parameters>
  45114. </function>
  45115. <function name="utf16_to_utf8" c:identifier="g_utf16_to_utf8" throws="1">
  45116. <doc xml:space="preserve">Convert a string from UTF-16 to UTF-8. The result will be
  45117. terminated with a 0 byte.
  45118. Note that the input is expected to be already in native endianness,
  45119. an initial byte-order-mark character is not handled specially.
  45120. g_convert() can be used to convert a byte buffer of UTF-16 data of
  45121. ambiguous endianess.
  45122. Further note that this function does not validate the result
  45123. string; it may e.g. include embedded NUL characters. The only
  45124. validation done by this function is to ensure that the input can
  45125. be correctly interpreted as UTF-16, i.e. it doesn't contain
  45126. things unpaired surrogates.</doc>
  45127. <return-value transfer-ownership="full">
  45128. <doc xml:space="preserve">a pointer to a newly allocated UTF-8 string.
  45129. This value must be freed with g_free(). If an error occurs,
  45130. %NULL will be returned and @error set.</doc>
  45131. <type name="utf8" c:type="gchar*"/>
  45132. </return-value>
  45133. <parameters>
  45134. <parameter name="str" transfer-ownership="none">
  45135. <doc xml:space="preserve">a UTF-16 encoded string</doc>
  45136. <type name="guint16" c:type="const gunichar2*"/>
  45137. </parameter>
  45138. <parameter name="len" transfer-ownership="none">
  45139. <doc xml:space="preserve">the maximum length (number of #gunichar2) of @str to use.
  45140. If @len &lt; 0, then the string is nul-terminated.</doc>
  45141. <type name="glong" c:type="glong"/>
  45142. </parameter>
  45143. <parameter name="items_read"
  45144. direction="out"
  45145. caller-allocates="1"
  45146. transfer-ownership="none"
  45147. optional="1"
  45148. allow-none="1">
  45149. <doc xml:space="preserve">location to store number of
  45150. words read, or %NULL. If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will
  45151. be returned in case @str contains a trailing partial character. If
  45152. an error occurs then the index of the invalid input is stored here.</doc>
  45153. <type name="glong" c:type="glong*"/>
  45154. </parameter>
  45155. <parameter name="items_written"
  45156. direction="out"
  45157. caller-allocates="1"
  45158. transfer-ownership="none"
  45159. optional="1"
  45160. allow-none="1">
  45161. <doc xml:space="preserve">location to store number
  45162. of bytes written, or %NULL. The value stored here does not include the
  45163. trailing 0 byte.</doc>
  45164. <type name="glong" c:type="glong*"/>
  45165. </parameter>
  45166. </parameters>
  45167. </function>
  45168. <function name="utf8_casefold" c:identifier="g_utf8_casefold">
  45169. <doc xml:space="preserve">Converts a string into a form that is independent of case. The
  45170. result will not correspond to any particular case, but can be
  45171. compared for equality or ordered with the results of calling
  45172. g_utf8_casefold() on other strings.
  45173. Note that calling g_utf8_casefold() followed by g_utf8_collate() is
  45174. only an approximation to the correct linguistic case insensitive
  45175. ordering, though it is a fairly good one. Getting this exactly
  45176. right would require a more sophisticated collation function that
  45177. takes case sensitivity into account. GLib does not currently
  45178. provide such a function.</doc>
  45179. <return-value transfer-ownership="full">
  45180. <doc xml:space="preserve">a newly allocated string, that is a
  45181. case independent form of @str.</doc>
  45182. <type name="utf8" c:type="gchar*"/>
  45183. </return-value>
  45184. <parameters>
  45185. <parameter name="str" transfer-ownership="none">
  45186. <doc xml:space="preserve">a UTF-8 encoded string</doc>
  45187. <type name="utf8" c:type="const gchar*"/>
  45188. </parameter>
  45189. <parameter name="len" transfer-ownership="none">
  45190. <doc xml:space="preserve">length of @str, in bytes, or -1 if @str is nul-terminated.</doc>
  45191. <type name="gssize" c:type="gssize"/>
  45192. </parameter>
  45193. </parameters>
  45194. </function>
  45195. <function name="utf8_collate" c:identifier="g_utf8_collate">
  45196. <doc xml:space="preserve">Compares two strings for ordering using the linguistically
  45197. correct rules for the [current locale][setlocale].
  45198. When sorting a large number of strings, it will be significantly
  45199. faster to obtain collation keys with g_utf8_collate_key() and
  45200. compare the keys with strcmp() when sorting instead of sorting
  45201. the original strings.</doc>
  45202. <return-value transfer-ownership="none">
  45203. <doc xml:space="preserve">&lt; 0 if @str1 compares before @str2,
  45204. 0 if they compare equal, &gt; 0 if @str1 compares after @str2.</doc>
  45205. <type name="gint" c:type="gint"/>
  45206. </return-value>
  45207. <parameters>
  45208. <parameter name="str1" transfer-ownership="none">
  45209. <doc xml:space="preserve">a UTF-8 encoded string</doc>
  45210. <type name="utf8" c:type="const gchar*"/>
  45211. </parameter>
  45212. <parameter name="str2" transfer-ownership="none">
  45213. <doc xml:space="preserve">a UTF-8 encoded string</doc>
  45214. <type name="utf8" c:type="const gchar*"/>
  45215. </parameter>
  45216. </parameters>
  45217. </function>
  45218. <function name="utf8_collate_key" c:identifier="g_utf8_collate_key">
  45219. <doc xml:space="preserve">Converts a string into a collation key that can be compared
  45220. with other collation keys produced by the same function using
  45221. strcmp().
  45222. The results of comparing the collation keys of two strings
  45223. with strcmp() will always be the same as comparing the two
  45224. original keys with g_utf8_collate().
  45225. Note that this function depends on the [current locale][setlocale].</doc>
  45226. <return-value transfer-ownership="full">
  45227. <doc xml:space="preserve">a newly allocated string. This string should
  45228. be freed with g_free() when you are done with it.</doc>
  45229. <type name="utf8" c:type="gchar*"/>
  45230. </return-value>
  45231. <parameters>
  45232. <parameter name="str" transfer-ownership="none">
  45233. <doc xml:space="preserve">a UTF-8 encoded string.</doc>
  45234. <type name="utf8" c:type="const gchar*"/>
  45235. </parameter>
  45236. <parameter name="len" transfer-ownership="none">
  45237. <doc xml:space="preserve">length of @str, in bytes, or -1 if @str is nul-terminated.</doc>
  45238. <type name="gssize" c:type="gssize"/>
  45239. </parameter>
  45240. </parameters>
  45241. </function>
  45242. <function name="utf8_collate_key_for_filename"
  45243. c:identifier="g_utf8_collate_key_for_filename"
  45244. version="2.8">
  45245. <doc xml:space="preserve">Converts a string into a collation key that can be compared
  45246. with other collation keys produced by the same function using strcmp().
  45247. In order to sort filenames correctly, this function treats the dot '.'
  45248. as a special case. Most dictionary orderings seem to consider it
  45249. insignificant, thus producing the ordering "event.c" "eventgenerator.c"
  45250. "event.h" instead of "event.c" "event.h" "eventgenerator.c". Also, we
  45251. would like to treat numbers intelligently so that "file1" "file10" "file5"
  45252. is sorted as "file1" "file5" "file10".
  45253. Note that this function depends on the [current locale][setlocale].</doc>
  45254. <return-value transfer-ownership="full">
  45255. <doc xml:space="preserve">a newly allocated string. This string should
  45256. be freed with g_free() when you are done with it.</doc>
  45257. <type name="utf8" c:type="gchar*"/>
  45258. </return-value>
  45259. <parameters>
  45260. <parameter name="str" transfer-ownership="none">
  45261. <doc xml:space="preserve">a UTF-8 encoded string.</doc>
  45262. <type name="utf8" c:type="const gchar*"/>
  45263. </parameter>
  45264. <parameter name="len" transfer-ownership="none">
  45265. <doc xml:space="preserve">length of @str, in bytes, or -1 if @str is nul-terminated.</doc>
  45266. <type name="gssize" c:type="gssize"/>
  45267. </parameter>
  45268. </parameters>
  45269. </function>
  45270. <function name="utf8_find_next_char" c:identifier="g_utf8_find_next_char">
  45271. <doc xml:space="preserve">Finds the start of the next UTF-8 character in the string after @p.
  45272. @p does not have to be at the beginning of a UTF-8 character. No check
  45273. is made to see if the character found is actually valid other than
  45274. it starts with an appropriate byte.</doc>
  45275. <return-value transfer-ownership="full">
  45276. <doc xml:space="preserve">a pointer to the found character or %NULL</doc>
  45277. <type name="utf8" c:type="gchar*"/>
  45278. </return-value>
  45279. <parameters>
  45280. <parameter name="p" transfer-ownership="none">
  45281. <doc xml:space="preserve">a pointer to a position within a UTF-8 encoded string</doc>
  45282. <type name="utf8" c:type="const gchar*"/>
  45283. </parameter>
  45284. <parameter name="end"
  45285. transfer-ownership="none"
  45286. nullable="1"
  45287. allow-none="1">
  45288. <doc xml:space="preserve">a pointer to the byte following the end of the string,
  45289. or %NULL to indicate that the string is nul-terminated</doc>
  45290. <type name="utf8" c:type="const gchar*"/>
  45291. </parameter>
  45292. </parameters>
  45293. </function>
  45294. <function name="utf8_find_prev_char" c:identifier="g_utf8_find_prev_char">
  45295. <doc xml:space="preserve">Given a position @p with a UTF-8 encoded string @str, find the start
  45296. of the previous UTF-8 character starting before @p. Returns %NULL if no
  45297. UTF-8 characters are present in @str before @p.
  45298. @p does not have to be at the beginning of a UTF-8 character. No check
  45299. is made to see if the character found is actually valid other than
  45300. it starts with an appropriate byte.</doc>
  45301. <return-value transfer-ownership="full">
  45302. <doc xml:space="preserve">a pointer to the found character or %NULL.</doc>
  45303. <type name="utf8" c:type="gchar*"/>
  45304. </return-value>
  45305. <parameters>
  45306. <parameter name="str" transfer-ownership="none">
  45307. <doc xml:space="preserve">pointer to the beginning of a UTF-8 encoded string</doc>
  45308. <type name="utf8" c:type="const gchar*"/>
  45309. </parameter>
  45310. <parameter name="p" transfer-ownership="none">
  45311. <doc xml:space="preserve">pointer to some position within @str</doc>
  45312. <type name="utf8" c:type="const gchar*"/>
  45313. </parameter>
  45314. </parameters>
  45315. </function>
  45316. <function name="utf8_get_char" c:identifier="g_utf8_get_char">
  45317. <doc xml:space="preserve">Converts a sequence of bytes encoded as UTF-8 to a Unicode character.
  45318. If @p does not point to a valid UTF-8 encoded character, results
  45319. are undefined. If you are not sure that the bytes are complete
  45320. valid Unicode characters, you should use g_utf8_get_char_validated()
  45321. instead.</doc>
  45322. <return-value transfer-ownership="none">
  45323. <doc xml:space="preserve">the resulting character</doc>
  45324. <type name="gunichar" c:type="gunichar"/>
  45325. </return-value>
  45326. <parameters>
  45327. <parameter name="p" transfer-ownership="none">
  45328. <doc xml:space="preserve">a pointer to Unicode character encoded as UTF-8</doc>
  45329. <type name="utf8" c:type="const gchar*"/>
  45330. </parameter>
  45331. </parameters>
  45332. </function>
  45333. <function name="utf8_get_char_validated"
  45334. c:identifier="g_utf8_get_char_validated">
  45335. <doc xml:space="preserve">Convert a sequence of bytes encoded as UTF-8 to a Unicode character.
  45336. This function checks for incomplete characters, for invalid characters
  45337. such as characters that are out of the range of Unicode, and for
  45338. overlong encodings of valid characters.</doc>
  45339. <return-value transfer-ownership="none">
  45340. <doc xml:space="preserve">the resulting character. If @p points to a partial
  45341. sequence at the end of a string that could begin a valid
  45342. character (or if @max_len is zero), returns (gunichar)-2;
  45343. otherwise, if @p does not point to a valid UTF-8 encoded
  45344. Unicode character, returns (gunichar)-1.</doc>
  45345. <type name="gunichar" c:type="gunichar"/>
  45346. </return-value>
  45347. <parameters>
  45348. <parameter name="p" transfer-ownership="none">
  45349. <doc xml:space="preserve">a pointer to Unicode character encoded as UTF-8</doc>
  45350. <type name="utf8" c:type="const gchar*"/>
  45351. </parameter>
  45352. <parameter name="max_len" transfer-ownership="none">
  45353. <doc xml:space="preserve">the maximum number of bytes to read, or -1, for no maximum or
  45354. if @p is nul-terminated</doc>
  45355. <type name="gssize" c:type="gssize"/>
  45356. </parameter>
  45357. </parameters>
  45358. </function>
  45359. <function name="utf8_normalize" c:identifier="g_utf8_normalize">
  45360. <doc xml:space="preserve">Converts a string into canonical form, standardizing
  45361. such issues as whether a character with an accent
  45362. is represented as a base character and combining
  45363. accent or as a single precomposed character. The
  45364. string has to be valid UTF-8, otherwise %NULL is
  45365. returned. You should generally call g_utf8_normalize()
  45366. before comparing two Unicode strings.
  45367. The normalization mode %G_NORMALIZE_DEFAULT only
  45368. standardizes differences that do not affect the
  45369. text content, such as the above-mentioned accent
  45370. representation. %G_NORMALIZE_ALL also standardizes
  45371. the "compatibility" characters in Unicode, such
  45372. as SUPERSCRIPT THREE to the standard forms
  45373. (in this case DIGIT THREE). Formatting information
  45374. may be lost but for most text operations such
  45375. characters should be considered the same.
  45376. %G_NORMALIZE_DEFAULT_COMPOSE and %G_NORMALIZE_ALL_COMPOSE
  45377. are like %G_NORMALIZE_DEFAULT and %G_NORMALIZE_ALL,
  45378. but returned a result with composed forms rather
  45379. than a maximally decomposed form. This is often
  45380. useful if you intend to convert the string to
  45381. a legacy encoding or pass it to a system with
  45382. less capable Unicode handling.</doc>
  45383. <return-value transfer-ownership="full">
  45384. <doc xml:space="preserve">a newly allocated string, that is the
  45385. normalized form of @str, or %NULL if @str is not
  45386. valid UTF-8.</doc>
  45387. <type name="utf8" c:type="gchar*"/>
  45388. </return-value>
  45389. <parameters>
  45390. <parameter name="str" transfer-ownership="none">
  45391. <doc xml:space="preserve">a UTF-8 encoded string.</doc>
  45392. <type name="utf8" c:type="const gchar*"/>
  45393. </parameter>
  45394. <parameter name="len" transfer-ownership="none">
  45395. <doc xml:space="preserve">length of @str, in bytes, or -1 if @str is nul-terminated.</doc>
  45396. <type name="gssize" c:type="gssize"/>
  45397. </parameter>
  45398. <parameter name="mode" transfer-ownership="none">
  45399. <doc xml:space="preserve">the type of normalization to perform.</doc>
  45400. <type name="NormalizeMode" c:type="GNormalizeMode"/>
  45401. </parameter>
  45402. </parameters>
  45403. </function>
  45404. <function name="utf8_offset_to_pointer"
  45405. c:identifier="g_utf8_offset_to_pointer">
  45406. <doc xml:space="preserve">Converts from an integer character offset to a pointer to a position
  45407. within the string.
  45408. Since 2.10, this function allows to pass a negative @offset to
  45409. step backwards. It is usually worth stepping backwards from the end
  45410. instead of forwards if @offset is in the last fourth of the string,
  45411. since moving forward is about 3 times faster than moving backward.
  45412. Note that this function doesn't abort when reaching the end of @str.
  45413. Therefore you should be sure that @offset is within string boundaries
  45414. before calling that function. Call g_utf8_strlen() when unsure.
  45415. This limitation exists as this function is called frequently during
  45416. text rendering and therefore has to be as fast as possible.</doc>
  45417. <return-value transfer-ownership="full">
  45418. <doc xml:space="preserve">the resulting pointer</doc>
  45419. <type name="utf8" c:type="gchar*"/>
  45420. </return-value>
  45421. <parameters>
  45422. <parameter name="str" transfer-ownership="none">
  45423. <doc xml:space="preserve">a UTF-8 encoded string</doc>
  45424. <type name="utf8" c:type="const gchar*"/>
  45425. </parameter>
  45426. <parameter name="offset" transfer-ownership="none">
  45427. <doc xml:space="preserve">a character offset within @str</doc>
  45428. <type name="glong" c:type="glong"/>
  45429. </parameter>
  45430. </parameters>
  45431. </function>
  45432. <function name="utf8_pointer_to_offset"
  45433. c:identifier="g_utf8_pointer_to_offset">
  45434. <doc xml:space="preserve">Converts from a pointer to position within a string to a integer
  45435. character offset.
  45436. Since 2.10, this function allows @pos to be before @str, and returns
  45437. a negative offset in this case.</doc>
  45438. <return-value transfer-ownership="none">
  45439. <doc xml:space="preserve">the resulting character offset</doc>
  45440. <type name="glong" c:type="glong"/>
  45441. </return-value>
  45442. <parameters>
  45443. <parameter name="str" transfer-ownership="none">
  45444. <doc xml:space="preserve">a UTF-8 encoded string</doc>
  45445. <type name="utf8" c:type="const gchar*"/>
  45446. </parameter>
  45447. <parameter name="pos" transfer-ownership="none">
  45448. <doc xml:space="preserve">a pointer to a position within @str</doc>
  45449. <type name="utf8" c:type="const gchar*"/>
  45450. </parameter>
  45451. </parameters>
  45452. </function>
  45453. <function name="utf8_prev_char" c:identifier="g_utf8_prev_char">
  45454. <doc xml:space="preserve">Finds the previous UTF-8 character in the string before @p.
  45455. @p does not have to be at the beginning of a UTF-8 character. No check
  45456. is made to see if the character found is actually valid other than
  45457. it starts with an appropriate byte. If @p might be the first
  45458. character of the string, you must use g_utf8_find_prev_char() instead.</doc>
  45459. <return-value transfer-ownership="full">
  45460. <doc xml:space="preserve">a pointer to the found character</doc>
  45461. <type name="utf8" c:type="gchar*"/>
  45462. </return-value>
  45463. <parameters>
  45464. <parameter name="p" transfer-ownership="none">
  45465. <doc xml:space="preserve">a pointer to a position within a UTF-8 encoded string</doc>
  45466. <type name="utf8" c:type="const gchar*"/>
  45467. </parameter>
  45468. </parameters>
  45469. </function>
  45470. <function name="utf8_strchr" c:identifier="g_utf8_strchr">
  45471. <doc xml:space="preserve">Finds the leftmost occurrence of the given Unicode character
  45472. in a UTF-8 encoded string, while limiting the search to @len bytes.
  45473. If @len is -1, allow unbounded search.</doc>
  45474. <return-value transfer-ownership="full">
  45475. <doc xml:space="preserve">%NULL if the string does not contain the character,
  45476. otherwise, a pointer to the start of the leftmost occurrence
  45477. of the character in the string.</doc>
  45478. <type name="utf8" c:type="gchar*"/>
  45479. </return-value>
  45480. <parameters>
  45481. <parameter name="p" transfer-ownership="none">
  45482. <doc xml:space="preserve">a nul-terminated UTF-8 encoded string</doc>
  45483. <type name="utf8" c:type="const gchar*"/>
  45484. </parameter>
  45485. <parameter name="len" transfer-ownership="none">
  45486. <doc xml:space="preserve">the maximum length of @p</doc>
  45487. <type name="gssize" c:type="gssize"/>
  45488. </parameter>
  45489. <parameter name="c" transfer-ownership="none">
  45490. <doc xml:space="preserve">a Unicode character</doc>
  45491. <type name="gunichar" c:type="gunichar"/>
  45492. </parameter>
  45493. </parameters>
  45494. </function>
  45495. <function name="utf8_strdown" c:identifier="g_utf8_strdown">
  45496. <doc xml:space="preserve">Converts all Unicode characters in the string that have a case
  45497. to lowercase. The exact manner that this is done depends
  45498. on the current locale, and may result in the number of
  45499. characters in the string changing.</doc>
  45500. <return-value transfer-ownership="full">
  45501. <doc xml:space="preserve">a newly allocated string, with all characters
  45502. converted to lowercase.</doc>
  45503. <type name="utf8" c:type="gchar*"/>
  45504. </return-value>
  45505. <parameters>
  45506. <parameter name="str" transfer-ownership="none">
  45507. <doc xml:space="preserve">a UTF-8 encoded string</doc>
  45508. <type name="utf8" c:type="const gchar*"/>
  45509. </parameter>
  45510. <parameter name="len" transfer-ownership="none">
  45511. <doc xml:space="preserve">length of @str, in bytes, or -1 if @str is nul-terminated.</doc>
  45512. <type name="gssize" c:type="gssize"/>
  45513. </parameter>
  45514. </parameters>
  45515. </function>
  45516. <function name="utf8_strlen" c:identifier="g_utf8_strlen">
  45517. <doc xml:space="preserve">Computes the length of the string in characters, not including
  45518. the terminating nul character. If the @max'th byte falls in the
  45519. middle of a character, the last (partial) character is not counted.</doc>
  45520. <return-value transfer-ownership="none">
  45521. <doc xml:space="preserve">the length of the string in characters</doc>
  45522. <type name="glong" c:type="glong"/>
  45523. </return-value>
  45524. <parameters>
  45525. <parameter name="p" transfer-ownership="none">
  45526. <doc xml:space="preserve">pointer to the start of a UTF-8 encoded string</doc>
  45527. <type name="utf8" c:type="const gchar*"/>
  45528. </parameter>
  45529. <parameter name="max" transfer-ownership="none">
  45530. <doc xml:space="preserve">the maximum number of bytes to examine. If @max
  45531. is less than 0, then the string is assumed to be
  45532. nul-terminated. If @max is 0, @p will not be examined and
  45533. may be %NULL. If @max is greater than 0, up to @max
  45534. bytes are examined</doc>
  45535. <type name="gssize" c:type="gssize"/>
  45536. </parameter>
  45537. </parameters>
  45538. </function>
  45539. <function name="utf8_strncpy" c:identifier="g_utf8_strncpy">
  45540. <doc xml:space="preserve">Like the standard C strncpy() function, but copies a given number
  45541. of characters instead of a given number of bytes. The @src string
  45542. must be valid UTF-8 encoded text. (Use g_utf8_validate() on all
  45543. text before trying to use UTF-8 utility functions with it.)</doc>
  45544. <return-value transfer-ownership="full">
  45545. <doc xml:space="preserve">@dest</doc>
  45546. <type name="utf8" c:type="gchar*"/>
  45547. </return-value>
  45548. <parameters>
  45549. <parameter name="dest" transfer-ownership="none">
  45550. <doc xml:space="preserve">buffer to fill with characters from @src</doc>
  45551. <type name="utf8" c:type="gchar*"/>
  45552. </parameter>
  45553. <parameter name="src" transfer-ownership="none">
  45554. <doc xml:space="preserve">UTF-8 encoded string</doc>
  45555. <type name="utf8" c:type="const gchar*"/>
  45556. </parameter>
  45557. <parameter name="n" transfer-ownership="none">
  45558. <doc xml:space="preserve">character count</doc>
  45559. <type name="gsize" c:type="gsize"/>
  45560. </parameter>
  45561. </parameters>
  45562. </function>
  45563. <function name="utf8_strrchr" c:identifier="g_utf8_strrchr">
  45564. <doc xml:space="preserve">Find the rightmost occurrence of the given Unicode character
  45565. in a UTF-8 encoded string, while limiting the search to @len bytes.
  45566. If @len is -1, allow unbounded search.</doc>
  45567. <return-value transfer-ownership="full">
  45568. <doc xml:space="preserve">%NULL if the string does not contain the character,
  45569. otherwise, a pointer to the start of the rightmost occurrence
  45570. of the character in the string.</doc>
  45571. <type name="utf8" c:type="gchar*"/>
  45572. </return-value>
  45573. <parameters>
  45574. <parameter name="p" transfer-ownership="none">
  45575. <doc xml:space="preserve">a nul-terminated UTF-8 encoded string</doc>
  45576. <type name="utf8" c:type="const gchar*"/>
  45577. </parameter>
  45578. <parameter name="len" transfer-ownership="none">
  45579. <doc xml:space="preserve">the maximum length of @p</doc>
  45580. <type name="gssize" c:type="gssize"/>
  45581. </parameter>
  45582. <parameter name="c" transfer-ownership="none">
  45583. <doc xml:space="preserve">a Unicode character</doc>
  45584. <type name="gunichar" c:type="gunichar"/>
  45585. </parameter>
  45586. </parameters>
  45587. </function>
  45588. <function name="utf8_strreverse"
  45589. c:identifier="g_utf8_strreverse"
  45590. version="2.2">
  45591. <doc xml:space="preserve">Reverses a UTF-8 string. @str must be valid UTF-8 encoded text.
  45592. (Use g_utf8_validate() on all text before trying to use UTF-8
  45593. utility functions with it.)
  45594. This function is intended for programmatic uses of reversed strings.
  45595. It pays no attention to decomposed characters, combining marks, byte
  45596. order marks, directional indicators (LRM, LRO, etc) and similar
  45597. characters which might need special handling when reversing a string
  45598. for display purposes.
  45599. Note that unlike g_strreverse(), this function returns
  45600. newly-allocated memory, which should be freed with g_free() when
  45601. no longer needed.</doc>
  45602. <return-value transfer-ownership="full">
  45603. <doc xml:space="preserve">a newly-allocated string which is the reverse of @str</doc>
  45604. <type name="utf8" c:type="gchar*"/>
  45605. </return-value>
  45606. <parameters>
  45607. <parameter name="str" transfer-ownership="none">
  45608. <doc xml:space="preserve">a UTF-8 encoded string</doc>
  45609. <type name="utf8" c:type="const gchar*"/>
  45610. </parameter>
  45611. <parameter name="len" transfer-ownership="none">
  45612. <doc xml:space="preserve">the maximum length of @str to use, in bytes. If @len &lt; 0,
  45613. then the string is nul-terminated.</doc>
  45614. <type name="gssize" c:type="gssize"/>
  45615. </parameter>
  45616. </parameters>
  45617. </function>
  45618. <function name="utf8_strup" c:identifier="g_utf8_strup">
  45619. <doc xml:space="preserve">Converts all Unicode characters in the string that have a case
  45620. to uppercase. The exact manner that this is done depends
  45621. on the current locale, and may result in the number of
  45622. characters in the string increasing. (For instance, the
  45623. German ess-zet will be changed to SS.)</doc>
  45624. <return-value transfer-ownership="full">
  45625. <doc xml:space="preserve">a newly allocated string, with all characters
  45626. converted to uppercase.</doc>
  45627. <type name="utf8" c:type="gchar*"/>
  45628. </return-value>
  45629. <parameters>
  45630. <parameter name="str" transfer-ownership="none">
  45631. <doc xml:space="preserve">a UTF-8 encoded string</doc>
  45632. <type name="utf8" c:type="const gchar*"/>
  45633. </parameter>
  45634. <parameter name="len" transfer-ownership="none">
  45635. <doc xml:space="preserve">length of @str, in bytes, or -1 if @str is nul-terminated.</doc>
  45636. <type name="gssize" c:type="gssize"/>
  45637. </parameter>
  45638. </parameters>
  45639. </function>
  45640. <function name="utf8_substring"
  45641. c:identifier="g_utf8_substring"
  45642. version="2.30">
  45643. <doc xml:space="preserve">Copies a substring out of a UTF-8 encoded string.
  45644. The substring will contain @end_pos - @start_pos characters.</doc>
  45645. <return-value transfer-ownership="full">
  45646. <doc xml:space="preserve">a newly allocated copy of the requested
  45647. substring. Free with g_free() when no longer needed.</doc>
  45648. <type name="utf8" c:type="gchar*"/>
  45649. </return-value>
  45650. <parameters>
  45651. <parameter name="str" transfer-ownership="none">
  45652. <doc xml:space="preserve">a UTF-8 encoded string</doc>
  45653. <type name="utf8" c:type="const gchar*"/>
  45654. </parameter>
  45655. <parameter name="start_pos" transfer-ownership="none">
  45656. <doc xml:space="preserve">a character offset within @str</doc>
  45657. <type name="glong" c:type="glong"/>
  45658. </parameter>
  45659. <parameter name="end_pos" transfer-ownership="none">
  45660. <doc xml:space="preserve">another character offset within @str</doc>
  45661. <type name="glong" c:type="glong"/>
  45662. </parameter>
  45663. </parameters>
  45664. </function>
  45665. <function name="utf8_to_ucs4" c:identifier="g_utf8_to_ucs4" throws="1">
  45666. <doc xml:space="preserve">Convert a string from UTF-8 to a 32-bit fixed width
  45667. representation as UCS-4. A trailing 0 character will be added to the
  45668. string after the converted text.</doc>
  45669. <return-value transfer-ownership="none">
  45670. <doc xml:space="preserve">a pointer to a newly allocated UCS-4 string.
  45671. This value must be freed with g_free(). If an error occurs,
  45672. %NULL will be returned and @error set.</doc>
  45673. <type name="gunichar" c:type="gunichar*"/>
  45674. </return-value>
  45675. <parameters>
  45676. <parameter name="str" transfer-ownership="none">
  45677. <doc xml:space="preserve">a UTF-8 encoded string</doc>
  45678. <type name="utf8" c:type="const gchar*"/>
  45679. </parameter>
  45680. <parameter name="len" transfer-ownership="none">
  45681. <doc xml:space="preserve">the maximum length of @str to use, in bytes. If @len &lt; 0,
  45682. then the string is nul-terminated.</doc>
  45683. <type name="glong" c:type="glong"/>
  45684. </parameter>
  45685. <parameter name="items_read"
  45686. direction="out"
  45687. caller-allocates="1"
  45688. transfer-ownership="none"
  45689. optional="1"
  45690. allow-none="1">
  45691. <doc xml:space="preserve">location to store number of
  45692. bytes read, or %NULL.
  45693. If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be
  45694. returned in case @str contains a trailing partial
  45695. character. If an error occurs then the index of the
  45696. invalid input is stored here.</doc>
  45697. <type name="glong" c:type="glong*"/>
  45698. </parameter>
  45699. <parameter name="items_written"
  45700. direction="out"
  45701. caller-allocates="1"
  45702. transfer-ownership="none"
  45703. optional="1"
  45704. allow-none="1">
  45705. <doc xml:space="preserve">location to store number
  45706. of characters written or %NULL. The value here stored does not include
  45707. the trailing 0 character.</doc>
  45708. <type name="glong" c:type="glong*"/>
  45709. </parameter>
  45710. </parameters>
  45711. </function>
  45712. <function name="utf8_to_ucs4_fast" c:identifier="g_utf8_to_ucs4_fast">
  45713. <doc xml:space="preserve">Convert a string from UTF-8 to a 32-bit fixed width
  45714. representation as UCS-4, assuming valid UTF-8 input.
  45715. This function is roughly twice as fast as g_utf8_to_ucs4()
  45716. but does no error checking on the input. A trailing 0 character
  45717. will be added to the string after the converted text.</doc>
  45718. <return-value transfer-ownership="none">
  45719. <doc xml:space="preserve">a pointer to a newly allocated UCS-4 string.
  45720. This value must be freed with g_free().</doc>
  45721. <type name="gunichar" c:type="gunichar*"/>
  45722. </return-value>
  45723. <parameters>
  45724. <parameter name="str" transfer-ownership="none">
  45725. <doc xml:space="preserve">a UTF-8 encoded string</doc>
  45726. <type name="utf8" c:type="const gchar*"/>
  45727. </parameter>
  45728. <parameter name="len" transfer-ownership="none">
  45729. <doc xml:space="preserve">the maximum length of @str to use, in bytes. If @len &lt; 0,
  45730. then the string is nul-terminated.</doc>
  45731. <type name="glong" c:type="glong"/>
  45732. </parameter>
  45733. <parameter name="items_written"
  45734. direction="out"
  45735. caller-allocates="1"
  45736. transfer-ownership="none"
  45737. optional="1"
  45738. allow-none="1">
  45739. <doc xml:space="preserve">location to store the
  45740. number of characters in the result, or %NULL.</doc>
  45741. <type name="glong" c:type="glong*"/>
  45742. </parameter>
  45743. </parameters>
  45744. </function>
  45745. <function name="utf8_to_utf16" c:identifier="g_utf8_to_utf16" throws="1">
  45746. <doc xml:space="preserve">Convert a string from UTF-8 to UTF-16. A 0 character will be
  45747. added to the result after the converted text.</doc>
  45748. <return-value transfer-ownership="none">
  45749. <doc xml:space="preserve">a pointer to a newly allocated UTF-16 string.
  45750. This value must be freed with g_free(). If an error occurs,
  45751. %NULL will be returned and @error set.</doc>
  45752. <type name="guint16" c:type="gunichar2*"/>
  45753. </return-value>
  45754. <parameters>
  45755. <parameter name="str" transfer-ownership="none">
  45756. <doc xml:space="preserve">a UTF-8 encoded string</doc>
  45757. <type name="utf8" c:type="const gchar*"/>
  45758. </parameter>
  45759. <parameter name="len" transfer-ownership="none">
  45760. <doc xml:space="preserve">the maximum length (number of bytes) of @str to use.
  45761. If @len &lt; 0, then the string is nul-terminated.</doc>
  45762. <type name="glong" c:type="glong"/>
  45763. </parameter>
  45764. <parameter name="items_read"
  45765. direction="out"
  45766. caller-allocates="1"
  45767. transfer-ownership="none"
  45768. optional="1"
  45769. allow-none="1">
  45770. <doc xml:space="preserve">location to store number of
  45771. bytes read, or %NULL. If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will
  45772. be returned in case @str contains a trailing partial character. If
  45773. an error occurs then the index of the invalid input is stored here.</doc>
  45774. <type name="glong" c:type="glong*"/>
  45775. </parameter>
  45776. <parameter name="items_written"
  45777. direction="out"
  45778. caller-allocates="1"
  45779. transfer-ownership="none"
  45780. optional="1"
  45781. allow-none="1">
  45782. <doc xml:space="preserve">location to store number
  45783. of #gunichar2 written, or %NULL. The value stored here does not include
  45784. the trailing 0.</doc>
  45785. <type name="glong" c:type="glong*"/>
  45786. </parameter>
  45787. </parameters>
  45788. </function>
  45789. <function name="utf8_validate" c:identifier="g_utf8_validate">
  45790. <doc xml:space="preserve">Validates UTF-8 encoded text. @str is the text to validate;
  45791. if @str is nul-terminated, then @max_len can be -1, otherwise
  45792. @max_len should be the number of bytes to validate.
  45793. If @end is non-%NULL, then the end of the valid range
  45794. will be stored there (i.e. the start of the first invalid
  45795. character if some bytes were invalid, or the end of the text
  45796. being validated otherwise).
  45797. Note that g_utf8_validate() returns %FALSE if @max_len is
  45798. positive and any of the @max_len bytes are nul.
  45799. Returns %TRUE if all of @str was valid. Many GLib and GTK+
  45800. routines require valid UTF-8 as input; so data read from a file
  45801. or the network should be checked with g_utf8_validate() before
  45802. doing anything else with it.</doc>
  45803. <return-value transfer-ownership="none">
  45804. <doc xml:space="preserve">%TRUE if the text was valid UTF-8</doc>
  45805. <type name="gboolean" c:type="gboolean"/>
  45806. </return-value>
  45807. <parameters>
  45808. <parameter name="str" transfer-ownership="none">
  45809. <doc xml:space="preserve">a pointer to character data</doc>
  45810. <array length="1" zero-terminated="0" c:type="gchar*">
  45811. <type name="guint8"/>
  45812. </array>
  45813. </parameter>
  45814. <parameter name="max_len" transfer-ownership="none">
  45815. <doc xml:space="preserve">max bytes to validate, or -1 to go until NUL</doc>
  45816. <type name="gssize" c:type="gssize"/>
  45817. </parameter>
  45818. <parameter name="end"
  45819. direction="out"
  45820. caller-allocates="0"
  45821. transfer-ownership="none"
  45822. optional="1"
  45823. allow-none="1">
  45824. <doc xml:space="preserve">return location for end of valid data</doc>
  45825. <type name="utf8" c:type="const gchar**"/>
  45826. </parameter>
  45827. </parameters>
  45828. </function>
  45829. <function name="variant_get_gtype" c:identifier="g_variant_get_gtype">
  45830. <return-value transfer-ownership="none">
  45831. <type name="GType" c:type="GType"/>
  45832. </return-value>
  45833. </function>
  45834. <function name="variant_is_object_path"
  45835. c:identifier="g_variant_is_object_path"
  45836. moved-to="Variant.is_object_path"
  45837. version="2.24">
  45838. <doc xml:space="preserve">Determines if a given string is a valid D-Bus object path. You
  45839. should ensure that a string is a valid D-Bus object path before
  45840. passing it to g_variant_new_object_path().
  45841. A valid object path starts with '/' followed by zero or more
  45842. sequences of characters separated by '/' characters. Each sequence
  45843. must contain only the characters "[A-Z][a-z][0-9]_". No sequence
  45844. (including the one following the final '/' character) may be empty.</doc>
  45845. <return-value transfer-ownership="none">
  45846. <doc xml:space="preserve">%TRUE if @string is a D-Bus object path</doc>
  45847. <type name="gboolean" c:type="gboolean"/>
  45848. </return-value>
  45849. <parameters>
  45850. <parameter name="string" transfer-ownership="none">
  45851. <doc xml:space="preserve">a normal C nul-terminated string</doc>
  45852. <type name="utf8" c:type="const gchar*"/>
  45853. </parameter>
  45854. </parameters>
  45855. </function>
  45856. <function name="variant_is_signature"
  45857. c:identifier="g_variant_is_signature"
  45858. moved-to="Variant.is_signature"
  45859. version="2.24">
  45860. <doc xml:space="preserve">Determines if a given string is a valid D-Bus type signature. You
  45861. should ensure that a string is a valid D-Bus type signature before
  45862. passing it to g_variant_new_signature().
  45863. D-Bus type signatures consist of zero or more definite #GVariantType
  45864. strings in sequence.</doc>
  45865. <return-value transfer-ownership="none">
  45866. <doc xml:space="preserve">%TRUE if @string is a D-Bus type signature</doc>
  45867. <type name="gboolean" c:type="gboolean"/>
  45868. </return-value>
  45869. <parameters>
  45870. <parameter name="string" transfer-ownership="none">
  45871. <doc xml:space="preserve">a normal C nul-terminated string</doc>
  45872. <type name="utf8" c:type="const gchar*"/>
  45873. </parameter>
  45874. </parameters>
  45875. </function>
  45876. <function name="variant_parse"
  45877. c:identifier="g_variant_parse"
  45878. moved-to="Variant.parse"
  45879. throws="1">
  45880. <doc xml:space="preserve">Parses a #GVariant from a text representation.
  45881. A single #GVariant is parsed from the content of @text.
  45882. The format is described [here][gvariant-text].
  45883. The memory at @limit will never be accessed and the parser behaves as
  45884. if the character at @limit is the nul terminator. This has the
  45885. effect of bounding @text.
  45886. If @endptr is non-%NULL then @text is permitted to contain data
  45887. following the value that this function parses and @endptr will be
  45888. updated to point to the first character past the end of the text
  45889. parsed by this function. If @endptr is %NULL and there is extra data
  45890. then an error is returned.
  45891. If @type is non-%NULL then the value will be parsed to have that
  45892. type. This may result in additional parse errors (in the case that
  45893. the parsed value doesn't fit the type) but may also result in fewer
  45894. errors (in the case that the type would have been ambiguous, such as
  45895. with empty arrays).
  45896. In the event that the parsing is successful, the resulting #GVariant
  45897. is returned. It is never floating, and must be freed with
  45898. g_variant_unref().
  45899. In case of any error, %NULL will be returned. If @error is non-%NULL
  45900. then it will be set to reflect the error that occurred.
  45901. Officially, the language understood by the parser is "any string
  45902. produced by g_variant_print()".</doc>
  45903. <return-value transfer-ownership="full">
  45904. <doc xml:space="preserve">a non-floating reference to a #GVariant, or %NULL</doc>
  45905. <type name="Variant" c:type="GVariant*"/>
  45906. </return-value>
  45907. <parameters>
  45908. <parameter name="type"
  45909. transfer-ownership="none"
  45910. nullable="1"
  45911. allow-none="1">
  45912. <doc xml:space="preserve">a #GVariantType, or %NULL</doc>
  45913. <type name="VariantType" c:type="const GVariantType*"/>
  45914. </parameter>
  45915. <parameter name="text" transfer-ownership="none">
  45916. <doc xml:space="preserve">a string containing a GVariant in text form</doc>
  45917. <type name="utf8" c:type="const gchar*"/>
  45918. </parameter>
  45919. <parameter name="limit"
  45920. transfer-ownership="none"
  45921. nullable="1"
  45922. allow-none="1">
  45923. <doc xml:space="preserve">a pointer to the end of @text, or %NULL</doc>
  45924. <type name="utf8" c:type="const gchar*"/>
  45925. </parameter>
  45926. <parameter name="endptr"
  45927. transfer-ownership="none"
  45928. nullable="1"
  45929. allow-none="1">
  45930. <doc xml:space="preserve">a location to store the end pointer, or %NULL</doc>
  45931. <type name="utf8" c:type="const gchar**"/>
  45932. </parameter>
  45933. </parameters>
  45934. </function>
  45935. <function name="variant_parse_error_print_context"
  45936. c:identifier="g_variant_parse_error_print_context"
  45937. moved-to="Variant.parse_error_print_context"
  45938. version="2.40">
  45939. <doc xml:space="preserve">Pretty-prints a message showing the context of a #GVariant parse
  45940. error within the string for which parsing was attempted.
  45941. The resulting string is suitable for output to the console or other
  45942. monospace media where newlines are treated in the usual way.
  45943. The message will typically look something like one of the following:
  45944. |[
  45945. unterminated string constant:
  45946. (1, 2, 3, 'abc
  45947. ^^^^
  45948. ]|
  45949. or
  45950. |[
  45951. unable to find a common type:
  45952. [1, 2, 3, 'str']
  45953. ^ ^^^^^
  45954. ]|
  45955. The format of the message may change in a future version.
  45956. @error must have come from a failed attempt to g_variant_parse() and
  45957. @source_str must be exactly the same string that caused the error.
  45958. If @source_str was not nul-terminated when you passed it to
  45959. g_variant_parse() then you must add nul termination before using this
  45960. function.</doc>
  45961. <return-value transfer-ownership="full">
  45962. <doc xml:space="preserve">the printed message</doc>
  45963. <type name="utf8" c:type="gchar*"/>
  45964. </return-value>
  45965. <parameters>
  45966. <parameter name="error" transfer-ownership="none">
  45967. <doc xml:space="preserve">a #GError from the #GVariantParseError domain</doc>
  45968. <type name="Error" c:type="GError*"/>
  45969. </parameter>
  45970. <parameter name="source_str" transfer-ownership="none">
  45971. <doc xml:space="preserve">the string that was given to the parser</doc>
  45972. <type name="utf8" c:type="const gchar*"/>
  45973. </parameter>
  45974. </parameters>
  45975. </function>
  45976. <function name="variant_parse_error_quark"
  45977. c:identifier="g_variant_parse_error_quark"
  45978. moved-to="Variant.parse_error_quark">
  45979. <return-value transfer-ownership="none">
  45980. <type name="Quark" c:type="GQuark"/>
  45981. </return-value>
  45982. </function>
  45983. <function name="variant_parser_get_error_quark"
  45984. c:identifier="g_variant_parser_get_error_quark"
  45985. moved-to="Variant.parser_get_error_quark"
  45986. deprecated="1">
  45987. <doc xml:space="preserve">Same as g_variant_error_quark().</doc>
  45988. <doc-deprecated xml:space="preserve">Use g_variant_parse_error_quark() instead.</doc-deprecated>
  45989. <return-value transfer-ownership="none">
  45990. <type name="Quark" c:type="GQuark"/>
  45991. </return-value>
  45992. </function>
  45993. <function name="variant_type_checked_"
  45994. c:identifier="g_variant_type_checked_"
  45995. moved-to="VariantType.checked_">
  45996. <return-value transfer-ownership="none">
  45997. <type name="VariantType" c:type="const GVariantType*"/>
  45998. </return-value>
  45999. <parameters>
  46000. <parameter name="arg0" transfer-ownership="none">
  46001. <type name="utf8" c:type="const gchar*"/>
  46002. </parameter>
  46003. </parameters>
  46004. </function>
  46005. <function name="variant_type_string_is_valid"
  46006. c:identifier="g_variant_type_string_is_valid"
  46007. moved-to="VariantType.string_is_valid">
  46008. <doc xml:space="preserve">Checks if @type_string is a valid GVariant type string. This call is
  46009. equivalent to calling g_variant_type_string_scan() and confirming
  46010. that the following character is a nul terminator.</doc>
  46011. <return-value transfer-ownership="none">
  46012. <doc xml:space="preserve">%TRUE if @type_string is exactly one valid type string
  46013. Since 2.24</doc>
  46014. <type name="gboolean" c:type="gboolean"/>
  46015. </return-value>
  46016. <parameters>
  46017. <parameter name="type_string" transfer-ownership="none">
  46018. <doc xml:space="preserve">a pointer to any string</doc>
  46019. <type name="utf8" c:type="const gchar*"/>
  46020. </parameter>
  46021. </parameters>
  46022. </function>
  46023. <function name="variant_type_string_scan"
  46024. c:identifier="g_variant_type_string_scan"
  46025. moved-to="VariantType.string_scan"
  46026. version="2.24">
  46027. <doc xml:space="preserve">Scan for a single complete and valid GVariant type string in @string.
  46028. The memory pointed to by @limit (or bytes beyond it) is never
  46029. accessed.
  46030. If a valid type string is found, @endptr is updated to point to the
  46031. first character past the end of the string that was found and %TRUE
  46032. is returned.
  46033. If there is no valid type string starting at @string, or if the type
  46034. string does not end before @limit then %FALSE is returned.
  46035. For the simple case of checking if a string is a valid type string,
  46036. see g_variant_type_string_is_valid().</doc>
  46037. <return-value transfer-ownership="none">
  46038. <doc xml:space="preserve">%TRUE if a valid type string was found</doc>
  46039. <type name="gboolean" c:type="gboolean"/>
  46040. </return-value>
  46041. <parameters>
  46042. <parameter name="string" transfer-ownership="none">
  46043. <doc xml:space="preserve">a pointer to any string</doc>
  46044. <type name="utf8" c:type="const gchar*"/>
  46045. </parameter>
  46046. <parameter name="limit"
  46047. transfer-ownership="none"
  46048. nullable="1"
  46049. allow-none="1">
  46050. <doc xml:space="preserve">the end of @string, or %NULL</doc>
  46051. <type name="utf8" c:type="const gchar*"/>
  46052. </parameter>
  46053. <parameter name="endptr"
  46054. direction="out"
  46055. caller-allocates="0"
  46056. transfer-ownership="full"
  46057. optional="1"
  46058. allow-none="1">
  46059. <doc xml:space="preserve">location to store the end pointer, or %NULL</doc>
  46060. <type name="utf8" c:type="const gchar**"/>
  46061. </parameter>
  46062. </parameters>
  46063. </function>
  46064. <function name="vasprintf"
  46065. c:identifier="g_vasprintf"
  46066. version="2.4"
  46067. introspectable="0">
  46068. <doc xml:space="preserve">An implementation of the GNU vasprintf() function which supports
  46069. positional parameters, as specified in the Single Unix Specification.
  46070. This function is similar to g_vsprintf(), except that it allocates a
  46071. string to hold the output, instead of putting the output in a buffer
  46072. you allocate in advance.</doc>
  46073. <return-value transfer-ownership="none">
  46074. <doc xml:space="preserve">the number of bytes printed.</doc>
  46075. <type name="gint" c:type="gint"/>
  46076. </return-value>
  46077. <parameters>
  46078. <parameter name="string" transfer-ownership="none">
  46079. <doc xml:space="preserve">the return location for the newly-allocated string.</doc>
  46080. <type name="utf8" c:type="gchar**"/>
  46081. </parameter>
  46082. <parameter name="format" transfer-ownership="none">
  46083. <doc xml:space="preserve">a standard printf() format string, but notice
  46084. [string precision pitfalls][string-precision]</doc>
  46085. <type name="utf8" c:type="gchar*"/>
  46086. </parameter>
  46087. <parameter name="args" transfer-ownership="none">
  46088. <doc xml:space="preserve">the list of arguments to insert in the output.</doc>
  46089. <type name="va_list" c:type="va_list"/>
  46090. </parameter>
  46091. </parameters>
  46092. </function>
  46093. <function name="vfprintf"
  46094. c:identifier="g_vfprintf"
  46095. version="2.2"
  46096. introspectable="0">
  46097. <doc xml:space="preserve">An implementation of the standard fprintf() function which supports
  46098. positional parameters, as specified in the Single Unix Specification.</doc>
  46099. <return-value transfer-ownership="none">
  46100. <doc xml:space="preserve">the number of bytes printed.</doc>
  46101. <type name="gint" c:type="gint"/>
  46102. </return-value>
  46103. <parameters>
  46104. <parameter name="file" transfer-ownership="none">
  46105. <doc xml:space="preserve">the stream to write to.</doc>
  46106. <type name="gpointer" c:type="FILE*"/>
  46107. </parameter>
  46108. <parameter name="format" transfer-ownership="none">
  46109. <doc xml:space="preserve">a standard printf() format string, but notice
  46110. [string precision pitfalls][string-precision]</doc>
  46111. <type name="utf8" c:type="gchar*"/>
  46112. </parameter>
  46113. <parameter name="args" transfer-ownership="none">
  46114. <doc xml:space="preserve">the list of arguments to insert in the output.</doc>
  46115. <type name="va_list" c:type="va_list"/>
  46116. </parameter>
  46117. </parameters>
  46118. </function>
  46119. <function name="vprintf"
  46120. c:identifier="g_vprintf"
  46121. version="2.2"
  46122. introspectable="0">
  46123. <doc xml:space="preserve">An implementation of the standard vprintf() function which supports
  46124. positional parameters, as specified in the Single Unix Specification.</doc>
  46125. <return-value transfer-ownership="none">
  46126. <doc xml:space="preserve">the number of bytes printed.</doc>
  46127. <type name="gint" c:type="gint"/>
  46128. </return-value>
  46129. <parameters>
  46130. <parameter name="format" transfer-ownership="none">
  46131. <doc xml:space="preserve">a standard printf() format string, but notice
  46132. [string precision pitfalls][string-precision]</doc>
  46133. <type name="utf8" c:type="gchar*"/>
  46134. </parameter>
  46135. <parameter name="args" transfer-ownership="none">
  46136. <doc xml:space="preserve">the list of arguments to insert in the output.</doc>
  46137. <type name="va_list" c:type="va_list"/>
  46138. </parameter>
  46139. </parameters>
  46140. </function>
  46141. <function name="vsnprintf" c:identifier="g_vsnprintf" introspectable="0">
  46142. <doc xml:space="preserve">A safer form of the standard vsprintf() function. The output is guaranteed
  46143. to not exceed @n characters (including the terminating nul character), so
  46144. it is easy to ensure that a buffer overflow cannot occur.
  46145. See also g_strdup_vprintf().
  46146. In versions of GLib prior to 1.2.3, this function may return -1 if the
  46147. output was truncated, and the truncated string may not be nul-terminated.
  46148. In versions prior to 1.3.12, this function returns the length of the output
  46149. string.
  46150. The return value of g_vsnprintf() conforms to the vsnprintf() function
  46151. as standardized in ISO C99. Note that this is different from traditional
  46152. vsnprintf(), which returns the length of the output string.
  46153. The format string may contain positional parameters, as specified in
  46154. the Single Unix Specification.</doc>
  46155. <return-value transfer-ownership="none">
  46156. <doc xml:space="preserve">the number of bytes which would be produced if the buffer
  46157. was large enough.</doc>
  46158. <type name="gint" c:type="gint"/>
  46159. </return-value>
  46160. <parameters>
  46161. <parameter name="string" transfer-ownership="none">
  46162. <doc xml:space="preserve">the buffer to hold the output.</doc>
  46163. <type name="utf8" c:type="gchar*"/>
  46164. </parameter>
  46165. <parameter name="n" transfer-ownership="none">
  46166. <doc xml:space="preserve">the maximum number of bytes to produce (including the
  46167. terminating nul character).</doc>
  46168. <type name="gulong" c:type="gulong"/>
  46169. </parameter>
  46170. <parameter name="format" transfer-ownership="none">
  46171. <doc xml:space="preserve">a standard printf() format string, but notice
  46172. string precision pitfalls][string-precision]</doc>
  46173. <type name="utf8" c:type="gchar*"/>
  46174. </parameter>
  46175. <parameter name="args" transfer-ownership="none">
  46176. <doc xml:space="preserve">the list of arguments to insert in the output.</doc>
  46177. <type name="va_list" c:type="va_list"/>
  46178. </parameter>
  46179. </parameters>
  46180. </function>
  46181. <function name="vsprintf"
  46182. c:identifier="g_vsprintf"
  46183. version="2.2"
  46184. introspectable="0">
  46185. <doc xml:space="preserve">An implementation of the standard vsprintf() function which supports
  46186. positional parameters, as specified in the Single Unix Specification.</doc>
  46187. <return-value transfer-ownership="none">
  46188. <doc xml:space="preserve">the number of bytes printed.</doc>
  46189. <type name="gint" c:type="gint"/>
  46190. </return-value>
  46191. <parameters>
  46192. <parameter name="string" transfer-ownership="none">
  46193. <doc xml:space="preserve">the buffer to hold the output.</doc>
  46194. <type name="utf8" c:type="gchar*"/>
  46195. </parameter>
  46196. <parameter name="format" transfer-ownership="none">
  46197. <doc xml:space="preserve">a standard printf() format string, but notice
  46198. [string precision pitfalls][string-precision]</doc>
  46199. <type name="utf8" c:type="gchar*"/>
  46200. </parameter>
  46201. <parameter name="args" transfer-ownership="none">
  46202. <doc xml:space="preserve">the list of arguments to insert in the output.</doc>
  46203. <type name="va_list" c:type="va_list"/>
  46204. </parameter>
  46205. </parameters>
  46206. </function>
  46207. <function name="warn_message"
  46208. c:identifier="g_warn_message"
  46209. introspectable="0">
  46210. <return-value transfer-ownership="none">
  46211. <type name="none" c:type="void"/>
  46212. </return-value>
  46213. <parameters>
  46214. <parameter name="domain"
  46215. transfer-ownership="none"
  46216. nullable="1"
  46217. allow-none="1">
  46218. <type name="utf8" c:type="const char*"/>
  46219. </parameter>
  46220. <parameter name="file" transfer-ownership="none">
  46221. <type name="utf8" c:type="const char*"/>
  46222. </parameter>
  46223. <parameter name="line" transfer-ownership="none">
  46224. <type name="gint" c:type="int"/>
  46225. </parameter>
  46226. <parameter name="func" transfer-ownership="none">
  46227. <type name="utf8" c:type="const char*"/>
  46228. </parameter>
  46229. <parameter name="warnexpr"
  46230. transfer-ownership="none"
  46231. nullable="1"
  46232. allow-none="1">
  46233. <type name="utf8" c:type="const char*"/>
  46234. </parameter>
  46235. </parameters>
  46236. </function>
  46237. </namespace>
  46238. </repository>