12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031 |
- <?xml version="1.0"?>
- <!-- This file was automatically generated from C sources - DO NOT EDIT!
- To affect the contents of this file, edit the original C definitions,
- and/or use gtk-doc annotations. -->
- <repository version="1.2"
- xmlns="http://www.gtk.org/introspection/core/1.0"
- xmlns:c="http://www.gtk.org/introspection/c/1.0"
- xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
- <package name="glib-2.0"/>
- <c:include name="glib.h"/>
- <namespace name="GLib"
- version="2.0"
- shared-library="libgobject-2.0.so.0,libglib-2.0.so.0"
- c:identifier-prefixes="G"
- c:symbol-prefixes="g,glib">
- <alias name="DateDay" c:type="GDateDay">
- <doc xml:space="preserve">Integer representing a day of the month; between 1 and 31.
- #G_DATE_BAD_DAY represents an invalid day of the month.</doc>
- <type name="guint8" c:type="guint8"/>
- </alias>
- <alias name="DateYear" c:type="GDateYear">
- <doc xml:space="preserve">Integer representing a year; #G_DATE_BAD_YEAR is the invalid
- value. The year must be 1 or higher; negative (BC) years are not
- allowed. The year is represented with four digits.</doc>
- <type name="guint16" c:type="guint16"/>
- </alias>
- <alias name="MutexLocker" c:type="GMutexLocker">
- <doc xml:space="preserve">Opaque type. See g_mutex_locker_new() for details.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </alias>
- <alias name="Pid" c:type="GPid">
- <doc xml:space="preserve">A type which is used to hold a process identification.
- On UNIX, processes are identified by a process id (an integer),
- while Windows uses process handles (which are pointers).
- GPid is used in GLib only for descendant processes spawned with
- the g_spawn functions.</doc>
- <type name="gint" c:type="int"/>
- </alias>
- <alias name="Quark" c:type="GQuark">
- <doc xml:space="preserve">A GQuark is a non-zero integer which uniquely identifies a
- particular string. A GQuark value of zero is associated to %NULL.</doc>
- <type name="guint32" c:type="guint32"/>
- </alias>
- <alias name="Strv" c:type="GStrv">
- <doc xml:space="preserve">A typedef alias for gchar**. This is mostly useful when used together with
- g_auto().</doc>
- <type name="gpointer" c:type="gpointer"/>
- </alias>
- <alias name="Time" c:type="GTime">
- <doc xml:space="preserve">Simply a replacement for time_t. It has been deprecated
- since it is not equivalent to time_t on 64-bit platforms
- with a 64-bit time_t. Unrelated to #GTimer.
- Note that #GTime is defined to always be a 32-bit integer,
- unlike time_t which may be 64-bit on some systems. Therefore,
- #GTime will overflow in the year 2038, and you cannot use the
- address of a #GTime variable as argument to the UNIX time()
- function.
- Instead, do the following:
- |[<!-- language="C" -->
- time_t ttime;
- GTime gtime;
- time (&ttime);
- gtime = (GTime)ttime;
- ]|</doc>
- <type name="gint32" c:type="gint32"/>
- </alias>
- <alias name="TimeSpan" c:type="GTimeSpan">
- <doc xml:space="preserve">A value representing an interval of time, in microseconds.</doc>
- <type name="gint64" c:type="gint64"/>
- </alias>
- <alias name="Type" c:type="GType">
- <type name="gsize" c:type="gsize"/>
- </alias>
- <constant name="ANALYZER_ANALYZING"
- value="1"
- c:type="G_ANALYZER_ANALYZING">
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="ASCII_DTOSTR_BUF_SIZE"
- value="39"
- c:type="G_ASCII_DTOSTR_BUF_SIZE">
- <doc xml:space="preserve">A good size for a buffer to be passed into g_ascii_dtostr().
- It is guaranteed to be enough for all output of that function
- on systems with 64bit IEEE-compatible doubles.
- The typical usage would be something like:
- |[<!-- language="C" -->
- char buf[G_ASCII_DTOSTR_BUF_SIZE];
- fprintf (out, "value=%s\n", g_ascii_dtostr (buf, sizeof (buf), value));
- ]|</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <record name="Array"
- c:type="GArray"
- glib:type-name="GArray"
- glib:get-type="g_array_get_type"
- c:symbol-prefix="array">
- <doc xml:space="preserve">Contains the public fields of a GArray.</doc>
- <field name="data" writable="1">
- <doc xml:space="preserve">a pointer to the element data. The data may be moved as
- elements are added to the #GArray.</doc>
- <type name="utf8" c:type="gchar*"/>
- </field>
- <field name="len" writable="1">
- <doc xml:space="preserve">the number of elements in the #GArray not including the
- possible terminating zero element.</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <function name="append_vals"
- c:identifier="g_array_append_vals"
- introspectable="0">
- <doc xml:space="preserve">Adds @len elements onto the end of the array.</doc>
- <return-value>
- <doc xml:space="preserve">the #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to the elements to append to the end of the array</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the number of elements to append</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="free" c:identifier="g_array_free" introspectable="0">
- <doc xml:space="preserve">Frees the memory allocated for the #GArray. If @free_segment is
- %TRUE it frees the memory block holding the elements as well and
- also each element if @array has a @element_free_func set. Pass
- %FALSE if you want to free the #GArray wrapper but preserve the
- underlying array for use elsewhere. If the reference count of @array
- is greater than one, the #GArray wrapper is preserved but the size
- of @array will be set to zero.
- If array elements contain dynamically-allocated memory, they should
- be freed separately.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the element data if @free_segment is %FALSE, otherwise
- %NULL. The element data should be freed using g_free().</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="free_segment" transfer-ownership="none">
- <doc xml:space="preserve">if %TRUE the actual element data is freed as well</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </function>
- <function name="get_element_size"
- c:identifier="g_array_get_element_size"
- version="2.22"
- introspectable="0">
- <doc xml:space="preserve">Gets the size of the elements in @array.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">Size of each element, in bytes</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">A #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- </parameters>
- </function>
- <function name="insert_vals"
- c:identifier="g_array_insert_vals"
- introspectable="0">
- <doc xml:space="preserve">Inserts @len elements into a #GArray at the given index.</doc>
- <return-value>
- <doc xml:space="preserve">the #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="index_" transfer-ownership="none">
- <doc xml:space="preserve">the index to place the elements at</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to the elements to insert</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the number of elements to insert</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="new" c:identifier="g_array_new" introspectable="0">
- <doc xml:space="preserve">Creates a new #GArray with a reference count of 1.</doc>
- <return-value>
- <doc xml:space="preserve">the new #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="zero_terminated" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the array should have an extra element at
- the end which is set to 0</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="clear_" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if #GArray elements should be automatically cleared
- to 0 when they are allocated</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="element_size" transfer-ownership="none">
- <doc xml:space="preserve">the size of each element in bytes</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="prepend_vals"
- c:identifier="g_array_prepend_vals"
- introspectable="0">
- <doc xml:space="preserve">Adds @len elements onto the start of the array.
- This operation is slower than g_array_append_vals() since the
- existing elements in the array have to be moved to make space for
- the new elements.</doc>
- <return-value>
- <doc xml:space="preserve">the #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to the elements to prepend to the start of the array</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the number of elements to prepend</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="ref"
- c:identifier="g_array_ref"
- version="2.22"
- introspectable="0">
- <doc xml:space="preserve">Atomically increments the reference count of @array by one.
- This function is MT-safe and may be called from any thread.</doc>
- <return-value>
- <doc xml:space="preserve">The passed in #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">A #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- </parameters>
- </function>
- <function name="remove_index"
- c:identifier="g_array_remove_index"
- introspectable="0">
- <doc xml:space="preserve">Removes the element at the given index from a #GArray. The following
- elements are moved down one place.</doc>
- <return-value>
- <doc xml:space="preserve">the #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="index_" transfer-ownership="none">
- <doc xml:space="preserve">the index of the element to remove</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_index_fast"
- c:identifier="g_array_remove_index_fast"
- introspectable="0">
- <doc xml:space="preserve">Removes the element at the given index from a #GArray. The last
- element in the array is used to fill in the space, so this function
- does not preserve the order of the #GArray. But it is faster than
- g_array_remove_index().</doc>
- <return-value>
- <doc xml:space="preserve">the #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a @GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="index_" transfer-ownership="none">
- <doc xml:space="preserve">the index of the element to remove</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_range"
- c:identifier="g_array_remove_range"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Removes the given number of elements starting at the given index
- from a #GArray. The following elements are moved to close the gap.</doc>
- <return-value>
- <doc xml:space="preserve">the #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a @GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="index_" transfer-ownership="none">
- <doc xml:space="preserve">the index of the first element to remove</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the number of elements to remove</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="set_clear_func"
- c:identifier="g_array_set_clear_func"
- version="2.32"
- introspectable="0">
- <doc xml:space="preserve">Sets a function to clear an element of @array.
- The @clear_func will be called when an element in the array
- data segment is removed and when the array is freed and data
- segment is deallocated as well.
- Note that in contrast with other uses of #GDestroyNotify
- functions, @clear_func is expected to clear the contents of
- the array element it is given, but not free the element itself.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">A #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="clear_func" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">a function to clear an element of @array</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="set_size"
- c:identifier="g_array_set_size"
- introspectable="0">
- <doc xml:space="preserve">Sets the size of the array, expanding it if necessary. If the array
- was created with @clear_ set to %TRUE, the new elements are set to 0.</doc>
- <return-value>
- <doc xml:space="preserve">the #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the new size of the #GArray</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="sized_new"
- c:identifier="g_array_sized_new"
- introspectable="0">
- <doc xml:space="preserve">Creates a new #GArray with @reserved_size elements preallocated and
- a reference count of 1. This avoids frequent reallocation, if you
- are going to add many elements to the array. Note however that the
- size of the array is still 0.</doc>
- <return-value>
- <doc xml:space="preserve">the new #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="zero_terminated" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the array should have an extra element at
- the end with all bits cleared</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="clear_" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if all bits in the array should be cleared to 0 on
- allocation</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="element_size" transfer-ownership="none">
- <doc xml:space="preserve">size of each element in the array</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="reserved_size" transfer-ownership="none">
- <doc xml:space="preserve">number of elements preallocated</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="sort" c:identifier="g_array_sort" introspectable="0">
- <doc xml:space="preserve">Sorts a #GArray using @compare_func which should be a qsort()-style
- comparison function (returns less than zero for first arg is less
- than second arg, zero for equal, greater zero if first arg is
- greater than second arg).
- This is guaranteed to be a stable sort since version 2.32.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="compare_func" transfer-ownership="none">
- <doc xml:space="preserve">comparison function</doc>
- <type name="CompareFunc" c:type="GCompareFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="sort_with_data"
- c:identifier="g_array_sort_with_data"
- introspectable="0">
- <doc xml:space="preserve">Like g_array_sort(), but the comparison function receives an extra
- user data argument.
- This is guaranteed to be a stable sort since version 2.32.
- There used to be a comment here about making the sort stable by
- using the addresses of the elements in the comparison function.
- This did not actually work, so any such code should be removed.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="compare_func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">comparison function</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @compare_func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="unref"
- c:identifier="g_array_unref"
- version="2.22"
- introspectable="0">
- <doc xml:space="preserve">Atomically decrements the reference count of @array by one. If the
- reference count drops to 0, all memory allocated by the array is
- released. This function is MT-safe and may be called from any
- thread.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">A #GArray</doc>
- <array name="GLib.Array" c:type="GArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- </parameters>
- </function>
- </record>
- <bitfield name="AsciiType" c:type="GAsciiType">
- <member name="alnum" value="1" c:identifier="G_ASCII_ALNUM">
- </member>
- <member name="alpha" value="2" c:identifier="G_ASCII_ALPHA">
- </member>
- <member name="cntrl" value="4" c:identifier="G_ASCII_CNTRL">
- </member>
- <member name="digit" value="8" c:identifier="G_ASCII_DIGIT">
- </member>
- <member name="graph" value="16" c:identifier="G_ASCII_GRAPH">
- </member>
- <member name="lower" value="32" c:identifier="G_ASCII_LOWER">
- </member>
- <member name="print" value="64" c:identifier="G_ASCII_PRINT">
- </member>
- <member name="punct" value="128" c:identifier="G_ASCII_PUNCT">
- </member>
- <member name="space" value="256" c:identifier="G_ASCII_SPACE">
- </member>
- <member name="upper" value="512" c:identifier="G_ASCII_UPPER">
- </member>
- <member name="xdigit" value="1024" c:identifier="G_ASCII_XDIGIT">
- </member>
- </bitfield>
- <record name="AsyncQueue" c:type="GAsyncQueue" disguised="1">
- <doc xml:space="preserve">The GAsyncQueue struct is an opaque data structure which represents
- an asynchronous queue. It should only be accessed through the
- g_async_queue_* functions.</doc>
- <method name="length" c:identifier="g_async_queue_length">
- <doc xml:space="preserve">Returns the length of the queue.
- Actually this function returns the number of data items in
- the queue minus the number of waiting threads, so a negative
- value means waiting threads, and a positive value means available
- entries in the @queue. A return value of 0 could mean n entries
- in the queue and n threads waiting. This can happen due to locking
- of the queue or due to scheduling.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the length of the @queue</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue.</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="length_unlocked"
- c:identifier="g_async_queue_length_unlocked">
- <doc xml:space="preserve">Returns the length of the queue.
- Actually this function returns the number of data items in
- the queue minus the number of waiting threads, so a negative
- value means waiting threads, and a positive value means available
- entries in the @queue. A return value of 0 could mean n entries
- in the queue and n threads waiting. This can happen due to locking
- of the queue or due to scheduling.
- This function must be called while holding the @queue's lock.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the length of the @queue.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="lock" c:identifier="g_async_queue_lock">
- <doc xml:space="preserve">Acquires the @queue's lock. If another thread is already
- holding the lock, this call will block until the lock
- becomes available.
- Call g_async_queue_unlock() to drop the lock again.
- While holding the lock, you can only call the
- g_async_queue_*_unlocked() functions on @queue. Otherwise,
- deadlock may occur.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="pop" c:identifier="g_async_queue_pop">
- <doc xml:space="preserve">Pops data from the @queue. If @queue is empty, this function
- blocks until data becomes available.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">data from the queue</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="pop_unlocked" c:identifier="g_async_queue_pop_unlocked">
- <doc xml:space="preserve">Pops data from the @queue. If @queue is empty, this function
- blocks until data becomes available.
- This function must be called while holding the @queue's lock.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">data from the queue.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="push" c:identifier="g_async_queue_push">
- <doc xml:space="preserve">Pushes the @data into the @queue. @data must not be %NULL.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">@data to push into the @queue</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="push_front"
- c:identifier="g_async_queue_push_front"
- version="2.46">
- <doc xml:space="preserve">Pushes the @item into the @queue. @item must not be %NULL.
- In contrast to g_async_queue_push(), this function
- pushes the new item ahead of the items already in the queue,
- so that it will be the next one to be popped off the queue.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- <parameter name="item"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to push into the @queue</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="push_front_unlocked"
- c:identifier="g_async_queue_push_front_unlocked"
- version="2.46">
- <doc xml:space="preserve">Pushes the @item into the @queue. @item must not be %NULL.
- In contrast to g_async_queue_push_unlocked(), this function
- pushes the new item ahead of the items already in the queue,
- so that it will be the next one to be popped off the queue.
- This function must be called while holding the @queue's lock.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- <parameter name="item"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to push into the @queue</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="push_sorted"
- c:identifier="g_async_queue_push_sorted"
- version="2.10"
- introspectable="0">
- <doc xml:space="preserve">Inserts @data into @queue using @func to determine the new
- position.
- This function requires that the @queue is sorted before pushing on
- new elements, see g_async_queue_sort().
- This function will lock @queue before it sorts the queue and unlock
- it when it is finished.
- For an example of @func see g_async_queue_sort().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the @data to push into the @queue</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the #GCompareDataFunc is used to sort @queue</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @func.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="push_sorted_unlocked"
- c:identifier="g_async_queue_push_sorted_unlocked"
- version="2.10"
- introspectable="0">
- <doc xml:space="preserve">Inserts @data into @queue using @func to determine the new
- position.
- The sort function @func is passed two elements of the @queue.
- It should return 0 if they are equal, a negative value if the
- first element should be higher in the @queue or a positive value
- if the first element should be lower in the @queue than the second
- element.
- This function requires that the @queue is sorted before pushing on
- new elements, see g_async_queue_sort().
- This function must be called while holding the @queue's lock.
- For an example of @func see g_async_queue_sort().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the @data to push into the @queue</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the #GCompareDataFunc is used to sort @queue</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @func.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="push_unlocked" c:identifier="g_async_queue_push_unlocked">
- <doc xml:space="preserve">Pushes the @data into the @queue. @data must not be %NULL.
- This function must be called while holding the @queue's lock.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">@data to push into the @queue</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_async_queue_ref" introspectable="0">
- <doc xml:space="preserve">Increases the reference count of the asynchronous @queue by 1.
- You do not need to hold the lock to call this function.</doc>
- <return-value>
- <doc xml:space="preserve">the @queue that was passed in (since 2.6)</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="ref_unlocked"
- c:identifier="g_async_queue_ref_unlocked"
- deprecated="1"
- deprecated-version="2.8">
- <doc xml:space="preserve">Increases the reference count of the asynchronous @queue by 1.</doc>
- <doc-deprecated xml:space="preserve">Reference counting is done atomically.
- so g_async_queue_ref() can be used regardless of the @queue's
- lock.</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="remove" c:identifier="g_async_queue_remove" version="2.46">
- <doc xml:space="preserve">Remove an item from the queue.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the item was removed</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- <parameter name="item"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to remove from the @queue</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="remove_unlocked"
- c:identifier="g_async_queue_remove_unlocked"
- version="2.46">
- <doc xml:space="preserve">Remove an item from the queue.
- This function must be called while holding the @queue's lock.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the item was removed</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- <parameter name="item"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to remove from the @queue</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="sort"
- c:identifier="g_async_queue_sort"
- version="2.10"
- introspectable="0">
- <doc xml:space="preserve">Sorts @queue using @func.
- The sort function @func is passed two elements of the @queue.
- It should return 0 if they are equal, a negative value if the
- first element should be higher in the @queue or a positive value
- if the first element should be lower in the @queue than the second
- element.
- This function will lock @queue before it sorts the queue and unlock
- it when it is finished.
- If you were sorting a list of priority numbers to make sure the
- lowest priority would be at the top of the queue, you could use:
- |[<!-- language="C" -->
- gint32 id1;
- gint32 id2;
- id1 = GPOINTER_TO_INT (element1);
- id2 = GPOINTER_TO_INT (element2);
- return (id1 > id2 ? +1 : id1 == id2 ? 0 : -1);
- ]|</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- <parameter name="func" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">the #GCompareDataFunc is used to sort @queue</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="sort_unlocked"
- c:identifier="g_async_queue_sort_unlocked"
- version="2.10"
- introspectable="0">
- <doc xml:space="preserve">Sorts @queue using @func.
- The sort function @func is passed two elements of the @queue.
- It should return 0 if they are equal, a negative value if the
- first element should be higher in the @queue or a positive value
- if the first element should be lower in the @queue than the second
- element.
- This function must be called while holding the @queue's lock.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- <parameter name="func" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">the #GCompareDataFunc is used to sort @queue</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="timed_pop"
- c:identifier="g_async_queue_timed_pop"
- deprecated="1">
- <doc xml:space="preserve">Pops data from the @queue. If the queue is empty, blocks until
- @end_time or until data becomes available.
- If no data is received before @end_time, %NULL is returned.
- To easily calculate @end_time, a combination of g_get_current_time()
- and g_time_val_add() can be used.</doc>
- <doc-deprecated xml:space="preserve">use g_async_queue_timeout_pop().</doc-deprecated>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">data from the queue or %NULL, when no data is
- received before @end_time.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- <parameter name="end_time" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeVal, determining the final time</doc>
- <type name="TimeVal" c:type="GTimeVal*"/>
- </parameter>
- </parameters>
- </method>
- <method name="timed_pop_unlocked"
- c:identifier="g_async_queue_timed_pop_unlocked"
- deprecated="1">
- <doc xml:space="preserve">Pops data from the @queue. If the queue is empty, blocks until
- @end_time or until data becomes available.
- If no data is received before @end_time, %NULL is returned.
- To easily calculate @end_time, a combination of g_get_current_time()
- and g_time_val_add() can be used.
- This function must be called while holding the @queue's lock.</doc>
- <doc-deprecated xml:space="preserve">use g_async_queue_timeout_pop_unlocked().</doc-deprecated>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">data from the queue or %NULL, when no data is
- received before @end_time.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- <parameter name="end_time" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeVal, determining the final time</doc>
- <type name="TimeVal" c:type="GTimeVal*"/>
- </parameter>
- </parameters>
- </method>
- <method name="timeout_pop" c:identifier="g_async_queue_timeout_pop">
- <doc xml:space="preserve">Pops data from the @queue. If the queue is empty, blocks for
- @timeout microseconds, or until data becomes available.
- If no data is received before the timeout, %NULL is returned.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">data from the queue or %NULL, when no data is
- received before the timeout.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- <parameter name="timeout" transfer-ownership="none">
- <doc xml:space="preserve">the number of microseconds to wait</doc>
- <type name="guint64" c:type="guint64"/>
- </parameter>
- </parameters>
- </method>
- <method name="timeout_pop_unlocked"
- c:identifier="g_async_queue_timeout_pop_unlocked">
- <doc xml:space="preserve">Pops data from the @queue. If the queue is empty, blocks for
- @timeout microseconds, or until data becomes available.
- If no data is received before the timeout, %NULL is returned.
- This function must be called while holding the @queue's lock.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">data from the queue or %NULL, when no data is
- received before the timeout.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- <parameter name="timeout" transfer-ownership="none">
- <doc xml:space="preserve">the number of microseconds to wait</doc>
- <type name="guint64" c:type="guint64"/>
- </parameter>
- </parameters>
- </method>
- <method name="try_pop" c:identifier="g_async_queue_try_pop">
- <doc xml:space="preserve">Tries to pop data from the @queue. If no data is available,
- %NULL is returned.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">data from the queue or %NULL, when no data is
- available immediately.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="try_pop_unlocked"
- c:identifier="g_async_queue_try_pop_unlocked">
- <doc xml:space="preserve">Tries to pop data from the @queue. If no data is available,
- %NULL is returned.
- This function must be called while holding the @queue's lock.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">data from the queue or %NULL, when no data is
- available immediately.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unlock" c:identifier="g_async_queue_unlock">
- <doc xml:space="preserve">Releases the queue's lock.
- Calling this function when you have not acquired
- the with g_async_queue_lock() leads to undefined
- behaviour.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_async_queue_unref">
- <doc xml:space="preserve">Decreases the reference count of the asynchronous @queue by 1.
- If the reference count went to 0, the @queue will be destroyed
- and the memory allocated will be freed. So you are not allowed
- to use the @queue afterwards, as it might have disappeared.
- You do not need to hold the lock to call this function.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue.</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref_and_unlock"
- c:identifier="g_async_queue_unref_and_unlock"
- deprecated="1"
- deprecated-version="2.8">
- <doc xml:space="preserve">Decreases the reference count of the asynchronous @queue by 1
- and releases the lock. This function must be called while holding
- the @queue's lock. If the reference count went to 0, the @queue
- will be destroyed and the memory allocated will be freed.</doc>
- <doc-deprecated xml:space="preserve">Reference counting is done atomically.
- so g_async_queue_unref() can be used regardless of the @queue's
- lock.</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GAsyncQueue</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="new" c:identifier="g_async_queue_new" introspectable="0">
- <doc xml:space="preserve">Creates a new asynchronous queue.</doc>
- <return-value>
- <doc xml:space="preserve">a new #GAsyncQueue. Free with g_async_queue_unref()</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </return-value>
- </function>
- <function name="new_full"
- c:identifier="g_async_queue_new_full"
- version="2.16"
- introspectable="0">
- <doc xml:space="preserve">Creates a new asynchronous queue and sets up a destroy notify
- function that is used to free any remaining queue items when
- the queue is destroyed after the final unref.</doc>
- <return-value>
- <doc xml:space="preserve">a new #GAsyncQueue. Free with g_async_queue_unref()</doc>
- <type name="AsyncQueue" c:type="GAsyncQueue*"/>
- </return-value>
- <parameters>
- <parameter name="item_free_func"
- transfer-ownership="none"
- scope="async">
- <doc xml:space="preserve">function to free queue elements</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <constant name="BIG_ENDIAN" value="4321" c:type="G_BIG_ENDIAN">
- <doc xml:space="preserve">Specifies one of the possible types of byte order.
- See #G_BYTE_ORDER.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <record name="BookmarkFile" c:type="GBookmarkFile" disguised="1">
- <doc xml:space="preserve">The `GBookmarkFile` structure contains only
- private data and should not be directly accessed.</doc>
- <method name="add_application"
- c:identifier="g_bookmark_file_add_application"
- version="2.12">
- <doc xml:space="preserve">Adds the application with @name and @exec to the list of
- applications that have registered a bookmark for @uri into
- @bookmark.
- Every bookmark inside a #GBookmarkFile must have at least an
- application registered. Each application must provide a name, a
- command line useful for launching the bookmark, the number of times
- the bookmark has been registered by the application and the last
- time the application registered this bookmark.
- If @name is %NULL, the name of the application will be the
- same returned by g_get_application_name(); if @exec is %NULL, the
- command line will be a composition of the program name as
- returned by g_get_prgname() and the "\%u" modifier, which will be
- expanded to the bookmark's URI.
- This function will automatically take care of updating the
- registrations count and timestamping in case an application
- with the same @name had already registered a bookmark for
- @uri inside @bookmark.
- If no bookmark for @uri is found, one is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="name"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the name of the application registering the bookmark
- or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="exec"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">command line to be used to launch the bookmark or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_group"
- c:identifier="g_bookmark_file_add_group"
- version="2.12">
- <doc xml:space="preserve">Adds @group to the list of groups to which the bookmark for @uri
- belongs to.
- If no bookmark for @uri is found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="group" transfer-ownership="none">
- <doc xml:space="preserve">the group name to be added</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_bookmark_file_free" version="2.12">
- <doc xml:space="preserve">Frees a #GBookmarkFile.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_added"
- c:identifier="g_bookmark_file_get_added"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Gets the time the bookmark for @uri was added to @bookmark
- In the event the URI cannot be found, -1 is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a timestamp</doc>
- <type name="glong" c:type="time_t"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_app_info"
- c:identifier="g_bookmark_file_get_app_info"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Gets the registration informations of @app_name for the bookmark for
- @uri. See g_bookmark_file_set_app_info() for more informations about
- the returned data.
- The string returned in @app_exec must be freed.
- In the event the URI cannot be found, %FALSE is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the
- event that no application with name @app_name has registered a bookmark
- for @uri, %FALSE is returned and error is set to
- #G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED. In the event that unquoting
- the command line fails, an error of the #G_SHELL_ERROR domain is
- set and %FALSE is returned.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on success.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="name" transfer-ownership="none">
- <doc xml:space="preserve">an application's name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="exec"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the command line of the application, or %NULL</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- <parameter name="count"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the registration count, or %NULL</doc>
- <type name="guint" c:type="guint*"/>
- </parameter>
- <parameter name="stamp"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the last registration time, or %NULL</doc>
- <type name="glong" c:type="time_t*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_applications"
- c:identifier="g_bookmark_file_get_applications"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Retrieves the names of the applications that have registered the
- bookmark for @uri.
- In the event the URI cannot be found, %NULL is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated %NULL-terminated array of strings.
- Use g_strfreev() to free it.</doc>
- <array length="1" zero-terminated="0" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location of the length of the returned list, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_description"
- c:identifier="g_bookmark_file_get_description"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Retrieves the description of the bookmark for @uri.
- In the event the URI cannot be found, %NULL is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string or %NULL if the specified
- URI cannot be found.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_groups"
- c:identifier="g_bookmark_file_get_groups"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Retrieves the list of group names of the bookmark for @uri.
- In the event the URI cannot be found, %NULL is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- The returned array is %NULL terminated, so @length may optionally
- be %NULL.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated %NULL-terminated array of group names.
- Use g_strfreev() to free it.</doc>
- <array length="1" zero-terminated="0" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the length of the returned string, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_icon"
- c:identifier="g_bookmark_file_get_icon"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Gets the icon of the bookmark for @uri.
- In the event the URI cannot be found, %FALSE is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the icon for the bookmark for the URI was found.
- You should free the returned strings.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="href"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the icon's location or %NULL</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- <parameter name="mime_type"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the icon's MIME type or %NULL</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_is_private"
- c:identifier="g_bookmark_file_get_is_private"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Gets whether the private flag of the bookmark for @uri is set.
- In the event the URI cannot be found, %FALSE is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the
- event that the private flag cannot be found, %FALSE is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_INVALID_VALUE.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the private flag is set, %FALSE otherwise.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_mime_type"
- c:identifier="g_bookmark_file_get_mime_type"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Retrieves the MIME type of the resource pointed by @uri.
- In the event the URI cannot be found, %NULL is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. In the
- event that the MIME type cannot be found, %NULL is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_INVALID_VALUE.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string or %NULL if the specified
- URI cannot be found.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_modified"
- c:identifier="g_bookmark_file_get_modified"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Gets the time when the bookmark for @uri was last modified.
- In the event the URI cannot be found, -1 is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a timestamp</doc>
- <type name="glong" c:type="time_t"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_size"
- c:identifier="g_bookmark_file_get_size"
- version="2.12">
- <doc xml:space="preserve">Gets the number of bookmarks inside @bookmark.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of bookmarks</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_title"
- c:identifier="g_bookmark_file_get_title"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Returns the title of the bookmark for @uri.
- If @uri is %NULL, the title of @bookmark is returned.
- In the event the URI cannot be found, %NULL is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string or %NULL if the specified
- URI cannot be found.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a valid URI or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_uris"
- c:identifier="g_bookmark_file_get_uris"
- version="2.12">
- <doc xml:space="preserve">Returns all URIs of the bookmarks in the bookmark file @bookmark.
- The array of returned URIs will be %NULL-terminated, so @length may
- optionally be %NULL.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated %NULL-terminated array of strings.
- Use g_strfreev() to free it.</doc>
- <array length="0" zero-terminated="0" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the number of returned URIs, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_visited"
- c:identifier="g_bookmark_file_get_visited"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Gets the time the bookmark for @uri was last visited.
- In the event the URI cannot be found, -1 is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a timestamp.</doc>
- <type name="glong" c:type="time_t"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="has_application"
- c:identifier="g_bookmark_file_has_application"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Checks whether the bookmark for @uri inside @bookmark has been
- registered by application @name.
- In the event the URI cannot be found, %FALSE is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the application @name was found</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="name" transfer-ownership="none">
- <doc xml:space="preserve">the name of the application</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="has_group"
- c:identifier="g_bookmark_file_has_group"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Checks whether @group appears in the list of groups to which
- the bookmark for @uri belongs to.
- In the event the URI cannot be found, %FALSE is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @group was found.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="group" transfer-ownership="none">
- <doc xml:space="preserve">the group name to be searched</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="has_item"
- c:identifier="g_bookmark_file_has_item"
- version="2.12">
- <doc xml:space="preserve">Looks whether the desktop bookmark has an item with its URI set to @uri.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @uri is inside @bookmark, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="load_from_data"
- c:identifier="g_bookmark_file_load_from_data"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Loads a bookmark file from memory into an empty #GBookmarkFile
- structure. If the object cannot be created then @error is set to a
- #GBookmarkFileError.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a desktop bookmark could be loaded.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">an empty #GBookmarkFile struct</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">desktop bookmarks loaded in memory</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of @data in bytes</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </method>
- <method name="load_from_data_dirs"
- c:identifier="g_bookmark_file_load_from_data_dirs"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">This function looks for a desktop bookmark file named @file in the
- paths returned from g_get_user_data_dir() and g_get_system_data_dirs(),
- loads the file into @bookmark and returns the file's full path in
- @full_path. If the file could not be loaded then an %error is
- set to either a #GFileError or #GBookmarkFileError.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a key file could be loaded, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="file" transfer-ownership="none">
- <doc xml:space="preserve">a relative path to a filename to open and parse</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="full_path"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">return location for a string containing the full path
- of the file, or %NULL</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- </parameters>
- </method>
- <method name="load_from_file"
- c:identifier="g_bookmark_file_load_from_file"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Loads a desktop bookmark file into an empty #GBookmarkFile structure.
- If the file could not be loaded then @error is set to either a #GFileError
- or #GBookmarkFileError.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a desktop bookmark file could be loaded</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">an empty #GBookmarkFile struct</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">the path of a filename to load, in the GLib file name encoding</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="move_item"
- c:identifier="g_bookmark_file_move_item"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Changes the URI of a bookmark item from @old_uri to @new_uri. Any
- existing bookmark for @new_uri will be overwritten. If @new_uri is
- %NULL, then the bookmark is removed.
- In the event the URI cannot be found, %FALSE is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the URI was successfully changed</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="old_uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="new_uri"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a valid URI, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="remove_application"
- c:identifier="g_bookmark_file_remove_application"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Removes application registered with @name from the list of applications
- that have registered a bookmark for @uri inside @bookmark.
- In the event the URI cannot be found, %FALSE is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- In the event that no application with name @app_name has registered
- a bookmark for @uri, %FALSE is returned and error is set to
- #G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the application was successfully removed.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="name" transfer-ownership="none">
- <doc xml:space="preserve">the name of the application</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="remove_group"
- c:identifier="g_bookmark_file_remove_group"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Removes @group from the list of groups to which the bookmark
- for @uri belongs to.
- In the event the URI cannot be found, %FALSE is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND.
- In the event no group was defined, %FALSE is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_INVALID_VALUE.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @group was successfully removed.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="group" transfer-ownership="none">
- <doc xml:space="preserve">the group name to be removed</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="remove_item"
- c:identifier="g_bookmark_file_remove_item"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Removes the bookmark for @uri from the bookmark file @bookmark.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the bookmark was removed successfully.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_added"
- c:identifier="g_bookmark_file_set_added"
- version="2.12">
- <doc xml:space="preserve">Sets the time the bookmark for @uri was added into @bookmark.
- If no bookmark for @uri is found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="added" transfer-ownership="none">
- <doc xml:space="preserve">a timestamp or -1 to use the current time</doc>
- <type name="glong" c:type="time_t"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_app_info"
- c:identifier="g_bookmark_file_set_app_info"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Sets the meta-data of application @name inside the list of
- applications that have registered a bookmark for @uri inside
- @bookmark.
- You should rarely use this function; use g_bookmark_file_add_application()
- and g_bookmark_file_remove_application() instead.
- @name can be any UTF-8 encoded string used to identify an
- application.
- @exec can have one of these two modifiers: "\%f", which will
- be expanded as the local file name retrieved from the bookmark's
- URI; "\%u", which will be expanded as the bookmark's URI.
- The expansion is done automatically when retrieving the stored
- command line using the g_bookmark_file_get_app_info() function.
- @count is the number of times the application has registered the
- bookmark; if is < 0, the current registration count will be increased
- by one, if is 0, the application with @name will be removed from
- the list of registered applications.
- @stamp is the Unix time of the last registration; if it is -1, the
- current time will be used.
- If you try to remove an application by setting its registration count to
- zero, and no bookmark for @uri is found, %FALSE is returned and
- @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND; similarly,
- in the event that no application @name has registered a bookmark
- for @uri, %FALSE is returned and error is set to
- #G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED. Otherwise, if no bookmark
- for @uri is found, one is created.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the application's meta-data was successfully
- changed.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="name" transfer-ownership="none">
- <doc xml:space="preserve">an application's name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="exec" transfer-ownership="none">
- <doc xml:space="preserve">an application's command line</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="count" transfer-ownership="none">
- <doc xml:space="preserve">the number of registrations done for this application</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="stamp" transfer-ownership="none">
- <doc xml:space="preserve">the time of the last registration for this application</doc>
- <type name="glong" c:type="time_t"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_description"
- c:identifier="g_bookmark_file_set_description"
- version="2.12">
- <doc xml:space="preserve">Sets @description as the description of the bookmark for @uri.
- If @uri is %NULL, the description of @bookmark is set.
- If a bookmark for @uri cannot be found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a valid URI or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="description" transfer-ownership="none">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_groups"
- c:identifier="g_bookmark_file_set_groups"
- version="2.12">
- <doc xml:space="preserve">Sets a list of group names for the item with URI @uri. Each previously
- set group name list is removed.
- If @uri cannot be found then an item for it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">an item's URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="groups"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">an array of group names, or %NULL to remove all groups</doc>
- <type name="utf8" c:type="const gchar**"/>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">number of group name values in @groups</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_icon"
- c:identifier="g_bookmark_file_set_icon"
- version="2.12">
- <doc xml:space="preserve">Sets the icon for the bookmark for @uri. If @href is %NULL, unsets
- the currently set icon. @href can either be a full URL for the icon
- file or the icon name following the Icon Naming specification.
- If no bookmark for @uri is found one is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="href"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the URI of the icon for the bookmark, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="mime_type" transfer-ownership="none">
- <doc xml:space="preserve">the MIME type of the icon for the bookmark</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_is_private"
- c:identifier="g_bookmark_file_set_is_private"
- version="2.12">
- <doc xml:space="preserve">Sets the private flag of the bookmark for @uri.
- If a bookmark for @uri cannot be found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="is_private" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the bookmark should be marked as private</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_mime_type"
- c:identifier="g_bookmark_file_set_mime_type"
- version="2.12">
- <doc xml:space="preserve">Sets @mime_type as the MIME type of the bookmark for @uri.
- If a bookmark for @uri cannot be found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="mime_type" transfer-ownership="none">
- <doc xml:space="preserve">a MIME type</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_modified"
- c:identifier="g_bookmark_file_set_modified"
- version="2.12">
- <doc xml:space="preserve">Sets the last time the bookmark for @uri was last modified.
- If no bookmark for @uri is found then it is created.
- The "modified" time should only be set when the bookmark's meta-data
- was actually changed. Every function of #GBookmarkFile that
- modifies a bookmark also changes the modification time, except for
- g_bookmark_file_set_visited().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="modified" transfer-ownership="none">
- <doc xml:space="preserve">a timestamp or -1 to use the current time</doc>
- <type name="glong" c:type="time_t"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_title"
- c:identifier="g_bookmark_file_set_title"
- version="2.12">
- <doc xml:space="preserve">Sets @title as the title of the bookmark for @uri inside the
- bookmark file @bookmark.
- If @uri is %NULL, the title of @bookmark is set.
- If a bookmark for @uri cannot be found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a valid URI or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="title" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_visited"
- c:identifier="g_bookmark_file_set_visited"
- version="2.12">
- <doc xml:space="preserve">Sets the time the bookmark for @uri was last visited.
- If no bookmark for @uri is found then it is created.
- The "visited" time should only be set if the bookmark was launched,
- either using the command line retrieved by g_bookmark_file_get_app_info()
- or by the default application for the bookmark's MIME type, retrieved
- using g_bookmark_file_get_mime_type(). Changing the "visited" time
- does not affect the "modified" time.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="visited" transfer-ownership="none">
- <doc xml:space="preserve">a timestamp or -1 to use the current time</doc>
- <type name="glong" c:type="time_t"/>
- </parameter>
- </parameters>
- </method>
- <method name="to_data"
- c:identifier="g_bookmark_file_to_data"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">This function outputs @bookmark as a string.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string holding
- the contents of the #GBookmarkFile</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the length of the returned string, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="to_file"
- c:identifier="g_bookmark_file_to_file"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">This function outputs @bookmark into a file. The write process is
- guaranteed to be atomic by using g_file_set_contents() internally.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the file was successfully written.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bookmark" transfer-ownership="none">
- <doc xml:space="preserve">a #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </instance-parameter>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">path of the output file</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <function name="error_quark" c:identifier="g_bookmark_file_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="new"
- c:identifier="g_bookmark_file_new"
- version="2.12"
- introspectable="0">
- <doc xml:space="preserve">Creates a new empty #GBookmarkFile object.
- Use g_bookmark_file_load_from_file(), g_bookmark_file_load_from_data()
- or g_bookmark_file_load_from_data_dirs() to read an existing bookmark
- file.</doc>
- <return-value>
- <doc xml:space="preserve">an empty #GBookmarkFile</doc>
- <type name="BookmarkFile" c:type="GBookmarkFile*"/>
- </return-value>
- </function>
- </record>
- <enumeration name="BookmarkFileError"
- c:type="GBookmarkFileError"
- glib:error-domain="g-bookmark-file-error-quark">
- <doc xml:space="preserve">Error codes returned by bookmark file parsing.</doc>
- <member name="invalid_uri"
- value="0"
- c:identifier="G_BOOKMARK_FILE_ERROR_INVALID_URI">
- <doc xml:space="preserve">URI was ill-formed</doc>
- </member>
- <member name="invalid_value"
- value="1"
- c:identifier="G_BOOKMARK_FILE_ERROR_INVALID_VALUE">
- <doc xml:space="preserve">a requested field was not found</doc>
- </member>
- <member name="app_not_registered"
- value="2"
- c:identifier="G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED">
- <doc xml:space="preserve">a requested application did
- not register a bookmark</doc>
- </member>
- <member name="uri_not_found"
- value="3"
- c:identifier="G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND">
- <doc xml:space="preserve">a requested URI was not found</doc>
- </member>
- <member name="read" value="4" c:identifier="G_BOOKMARK_FILE_ERROR_READ">
- <doc xml:space="preserve">document was ill formed</doc>
- </member>
- <member name="unknown_encoding"
- value="5"
- c:identifier="G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING">
- <doc xml:space="preserve">the text being parsed was
- in an unknown encoding</doc>
- </member>
- <member name="write"
- value="6"
- c:identifier="G_BOOKMARK_FILE_ERROR_WRITE">
- <doc xml:space="preserve">an error occurred while writing</doc>
- </member>
- <member name="file_not_found"
- value="7"
- c:identifier="G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND">
- <doc xml:space="preserve">requested file was not found</doc>
- </member>
- </enumeration>
- <record name="ByteArray"
- c:type="GByteArray"
- glib:type-name="GByteArray"
- glib:get-type="g_byte_array_get_type"
- c:symbol-prefix="byte_array">
- <doc xml:space="preserve">Contains the public fields of a GByteArray.</doc>
- <field name="data" writable="1">
- <doc xml:space="preserve">a pointer to the element data. The data may be moved as
- elements are added to the #GByteArray</doc>
- <type name="guint8" c:type="guint8*"/>
- </field>
- <field name="len" writable="1">
- <doc xml:space="preserve">the number of elements in the #GByteArray</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <function name="append"
- c:identifier="g_byte_array_append"
- introspectable="0">
- <doc xml:space="preserve">Adds the given bytes to the end of the #GByteArray.
- The array will grow in size automatically if necessary.</doc>
- <return-value>
- <doc xml:space="preserve">the #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">the byte data to be added</doc>
- <type name="guint8" c:type="const guint8*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes to add</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="free" c:identifier="g_byte_array_free">
- <doc xml:space="preserve">Frees the memory allocated by the #GByteArray. If @free_segment is
- %TRUE it frees the actual byte data. If the reference count of
- @array is greater than one, the #GByteArray wrapper is preserved but
- the size of @array will be set to zero.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the element data if @free_segment is %FALSE, otherwise
- %NULL. The element data should be freed using g_free().</doc>
- <type name="guint8" c:type="guint8*"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- <parameter name="free_segment" transfer-ownership="none">
- <doc xml:space="preserve">if %TRUE the actual byte data is freed as well</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </function>
- <function name="free_to_bytes"
- c:identifier="g_byte_array_free_to_bytes"
- version="2.32">
- <doc xml:space="preserve">Transfers the data from the #GByteArray into a new immutable #GBytes.
- The #GByteArray is freed unless the reference count of @array is greater
- than one, the #GByteArray wrapper is preserved but the size of @array
- will be set to zero.
- This is identical to using g_bytes_new_take() and g_byte_array_free()
- together.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new immutable #GBytes representing same
- byte data that was in the array</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="full">
- <doc xml:space="preserve">a #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- </parameters>
- </function>
- <function name="new" c:identifier="g_byte_array_new">
- <doc xml:space="preserve">Creates a new #GByteArray with a reference count of 1.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the new #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </return-value>
- </function>
- <function name="new_take"
- c:identifier="g_byte_array_new_take"
- version="2.32">
- <doc xml:space="preserve">Create byte array containing the data. The data will be owned by the array
- and will be freed with g_free(), i.e. it could be allocated using g_strdup().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="data" transfer-ownership="full">
- <doc xml:space="preserve">byte data for the array</doc>
- <array length="1" zero-terminated="0" c:type="guint8*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">length of @data</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="prepend"
- c:identifier="g_byte_array_prepend"
- introspectable="0">
- <doc xml:space="preserve">Adds the given data to the start of the #GByteArray.
- The array will grow in size automatically if necessary.</doc>
- <return-value>
- <doc xml:space="preserve">the #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">the byte data to be added</doc>
- <type name="guint8" c:type="const guint8*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes to add</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="ref"
- c:identifier="g_byte_array_ref"
- version="2.22"
- introspectable="0">
- <doc xml:space="preserve">Atomically increments the reference count of @array by one.
- This function is thread-safe and may be called from any thread.</doc>
- <return-value>
- <doc xml:space="preserve">The passed in #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">A #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- </parameters>
- </function>
- <function name="remove_index"
- c:identifier="g_byte_array_remove_index"
- introspectable="0">
- <doc xml:space="preserve">Removes the byte at the given index from a #GByteArray.
- The following bytes are moved down one place.</doc>
- <return-value>
- <doc xml:space="preserve">the #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- <parameter name="index_" transfer-ownership="none">
- <doc xml:space="preserve">the index of the byte to remove</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_index_fast"
- c:identifier="g_byte_array_remove_index_fast"
- introspectable="0">
- <doc xml:space="preserve">Removes the byte at the given index from a #GByteArray. The last
- element in the array is used to fill in the space, so this function
- does not preserve the order of the #GByteArray. But it is faster
- than g_byte_array_remove_index().</doc>
- <return-value>
- <doc xml:space="preserve">the #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- <parameter name="index_" transfer-ownership="none">
- <doc xml:space="preserve">the index of the byte to remove</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_range"
- c:identifier="g_byte_array_remove_range"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Removes the given number of bytes starting at the given index from a
- #GByteArray. The following elements are moved to close the gap.</doc>
- <return-value>
- <doc xml:space="preserve">the #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a @GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- <parameter name="index_" transfer-ownership="none">
- <doc xml:space="preserve">the index of the first byte to remove</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes to remove</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="set_size"
- c:identifier="g_byte_array_set_size"
- introspectable="0">
- <doc xml:space="preserve">Sets the size of the #GByteArray, expanding it if necessary.</doc>
- <return-value>
- <doc xml:space="preserve">the #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the new size of the #GByteArray</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="sized_new"
- c:identifier="g_byte_array_sized_new"
- introspectable="0">
- <doc xml:space="preserve">Creates a new #GByteArray with @reserved_size bytes preallocated.
- This avoids frequent reallocation, if you are going to add many
- bytes to the array. Note however that the size of the array is still
- 0.</doc>
- <return-value>
- <doc xml:space="preserve">the new #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="reserved_size" transfer-ownership="none">
- <doc xml:space="preserve">number of bytes preallocated</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="sort"
- c:identifier="g_byte_array_sort"
- introspectable="0">
- <doc xml:space="preserve">Sorts a byte array, using @compare_func which should be a
- qsort()-style comparison function (returns less than zero for first
- arg is less than second arg, zero for equal, greater than zero if
- first arg is greater than second arg).
- If two array elements compare equal, their order in the sorted array
- is undefined. If you want equal elements to keep their order (i.e.
- you want a stable sort) you can write a comparison function that,
- if two elements would otherwise compare equal, compares them by
- their addresses.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- <parameter name="compare_func" transfer-ownership="none">
- <doc xml:space="preserve">comparison function</doc>
- <type name="CompareFunc" c:type="GCompareFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="sort_with_data"
- c:identifier="g_byte_array_sort_with_data"
- introspectable="0">
- <doc xml:space="preserve">Like g_byte_array_sort(), but the comparison function takes an extra
- user data argument.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- <parameter name="compare_func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">comparison function</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @compare_func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="unref" c:identifier="g_byte_array_unref" version="2.22">
- <doc xml:space="preserve">Atomically decrements the reference count of @array by one. If the
- reference count drops to 0, all memory allocated by the array is
- released. This function is thread-safe and may be called from any
- thread.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">A #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- </parameters>
- </function>
- </record>
- <record name="Bytes"
- c:type="GBytes"
- version="2.32"
- glib:type-name="GBytes"
- glib:get-type="g_bytes_get_type"
- c:symbol-prefix="bytes">
- <doc xml:space="preserve">A simple refcounted data type representing an immutable sequence of zero or
- more bytes from an unspecified origin.
- The purpose of a #GBytes is to keep the memory region that it holds
- alive for as long as anyone holds a reference to the bytes. When
- the last reference count is dropped, the memory is released. Multiple
- unrelated callers can use byte data in the #GBytes without coordinating
- their activities, resting assured that the byte data will not change or
- move while they hold a reference.
- A #GBytes can come from many different origins that may have
- different procedures for freeing the memory region. Examples are
- memory from g_malloc(), from memory slices, from a #GMappedFile or
- memory from other allocators.
- #GBytes work well as keys in #GHashTable. Use g_bytes_equal() and
- g_bytes_hash() as parameters to g_hash_table_new() or g_hash_table_new_full().
- #GBytes can also be used as keys in a #GTree by passing the g_bytes_compare()
- function to g_tree_new().
- The data pointed to by this bytes must not be modified. For a mutable
- array of bytes see #GByteArray. Use g_bytes_unref_to_array() to create a
- mutable array for a #GBytes sequence. To create an immutable #GBytes from
- a mutable #GByteArray, use the g_byte_array_free_to_bytes() function.</doc>
- <constructor name="new" c:identifier="g_bytes_new" version="2.32">
- <doc xml:space="preserve">Creates a new #GBytes from @data.
- @data is copied. If @size is 0, @data may be %NULL.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GBytes</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </return-value>
- <parameters>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">
- the data to be used for the bytes</doc>
- <array length="1" zero-terminated="0" c:type="gconstpointer">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="size" transfer-ownership="none">
- <doc xml:space="preserve">the size of @data</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_static"
- c:identifier="g_bytes_new_static"
- version="2.32"
- introspectable="0">
- <doc xml:space="preserve">Creates a new #GBytes from static data.
- @data must be static (ie: never modified or freed). It may be %NULL if @size
- is 0.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GBytes</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </return-value>
- <parameters>
- <parameter name="data"
- transfer-ownership="full"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">
- the data to be used for the bytes</doc>
- <array length="1" zero-terminated="0" c:type="gconstpointer">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="size" transfer-ownership="none">
- <doc xml:space="preserve">the size of @data</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_take"
- c:identifier="g_bytes_new_take"
- version="2.32">
- <doc xml:space="preserve">Creates a new #GBytes from @data.
- After this call, @data belongs to the bytes and may no longer be
- modified by the caller. g_free() will be called on @data when the
- bytes is no longer in use. Because of this @data must have been created by
- a call to g_malloc(), g_malloc0() or g_realloc() or by one of the many
- functions that wrap these calls (such as g_new(), g_strdup(), etc).
- For creating #GBytes with memory from other allocators, see
- g_bytes_new_with_free_func().
- @data may be %NULL if @size is 0.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GBytes</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </return-value>
- <parameters>
- <parameter name="data"
- transfer-ownership="full"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">
- the data to be used for the bytes</doc>
- <array length="1" zero-terminated="0" c:type="gpointer">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="size" transfer-ownership="none">
- <doc xml:space="preserve">the size of @data</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_with_free_func"
- c:identifier="g_bytes_new_with_free_func"
- version="2.32"
- introspectable="0">
- <doc xml:space="preserve">Creates a #GBytes from @data.
- When the last reference is dropped, @free_func will be called with the
- @user_data argument.
- @data must not be modified after this call is made until @free_func has
- been called to indicate that the bytes is no longer in use.
- @data may be %NULL if @size is 0.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GBytes</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </return-value>
- <parameters>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">
- the data to be used for the bytes</doc>
- <array length="1" zero-terminated="0" c:type="gconstpointer">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="size" transfer-ownership="none">
- <doc xml:space="preserve">the size of @data</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="free_func" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">the function to call to release the data</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @free_func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="compare" c:identifier="g_bytes_compare" version="2.32">
- <doc xml:space="preserve">Compares the two #GBytes values.
- This function can be used to sort GBytes instances in lexographical order.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a negative value if bytes2 is lesser, a positive value if bytes2 is
- greater, and zero if bytes2 is equal to bytes1</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="bytes1" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GBytes</doc>
- <type name="Bytes" c:type="gconstpointer"/>
- </instance-parameter>
- <parameter name="bytes2" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GBytes to compare with @bytes1</doc>
- <type name="Bytes" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="equal" c:identifier="g_bytes_equal" version="2.32">
- <doc xml:space="preserve">Compares the two #GBytes values being pointed to and returns
- %TRUE if they are equal.
- This function can be passed to g_hash_table_new() as the @key_equal_func
- parameter, when using non-%NULL #GBytes pointers as keys in a #GHashTable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the two keys match.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="bytes1" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GBytes</doc>
- <type name="Bytes" c:type="gconstpointer"/>
- </instance-parameter>
- <parameter name="bytes2" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GBytes to compare with @bytes1</doc>
- <type name="Bytes" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_data" c:identifier="g_bytes_get_data" version="2.32">
- <doc xml:space="preserve">Get the byte data in the #GBytes. This data should not be modified.
- This function will always return the same pointer for a given #GBytes.
- %NULL may be returned if @size is 0. This is not guaranteed, as the #GBytes
- may represent an empty string with @data non-%NULL and @size as 0. %NULL will
- not be returned if @size is non-zero.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">
- a pointer to the byte data, or %NULL</doc>
- <array length="0" zero-terminated="0" c:type="gconstpointer">
- <type name="guint8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="bytes" transfer-ownership="none">
- <doc xml:space="preserve">a #GBytes</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </instance-parameter>
- <parameter name="size"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to return size of byte data</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_size" c:identifier="g_bytes_get_size" version="2.32">
- <doc xml:space="preserve">Get the size of the byte data in the #GBytes.
- This function will always return the same value for a given #GBytes.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the size</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <instance-parameter name="bytes" transfer-ownership="none">
- <doc xml:space="preserve">a #GBytes</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="hash" c:identifier="g_bytes_hash" version="2.32">
- <doc xml:space="preserve">Creates an integer hash code for the byte data in the #GBytes.
- This function can be passed to g_hash_table_new() as the @key_hash_func
- parameter, when using non-%NULL #GBytes pointers as keys in a #GHashTable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a hash value corresponding to the key.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="bytes" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GBytes key</doc>
- <type name="Bytes" c:type="gconstpointer"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="new_from_bytes"
- c:identifier="g_bytes_new_from_bytes"
- version="2.32">
- <doc xml:space="preserve">Creates a #GBytes which is a subsection of another #GBytes. The @offset +
- @length may not be longer than the size of @bytes.
- A reference to @bytes will be held by the newly created #GBytes until
- the byte data is no longer needed.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GBytes</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </return-value>
- <parameters>
- <instance-parameter name="bytes" transfer-ownership="none">
- <doc xml:space="preserve">a #GBytes</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </instance-parameter>
- <parameter name="offset" transfer-ownership="none">
- <doc xml:space="preserve">offset which subsection starts at</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">length of subsection</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_bytes_ref" version="2.32">
- <doc xml:space="preserve">Increase the reference count on @bytes.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the #GBytes</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </return-value>
- <parameters>
- <instance-parameter name="bytes" transfer-ownership="none">
- <doc xml:space="preserve">a #GBytes</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_bytes_unref" version="2.32">
- <doc xml:space="preserve">Releases a reference on @bytes. This may result in the bytes being
- freed.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="bytes"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GBytes</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref_to_array"
- c:identifier="g_bytes_unref_to_array"
- version="2.32">
- <doc xml:space="preserve">Unreferences the bytes, and returns a new mutable #GByteArray containing
- the same byte data.
- As an optimization, the byte data is transferred to the array without copying
- if this was the last reference to bytes and bytes was created with
- g_bytes_new(), g_bytes_new_take() or g_byte_array_free_to_bytes(). In all
- other cases the data is copied.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new mutable #GByteArray containing the same byte data</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="bytes" transfer-ownership="full">
- <doc xml:space="preserve">a #GBytes</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref_to_data"
- c:identifier="g_bytes_unref_to_data"
- version="2.32">
- <doc xml:space="preserve">Unreferences the bytes, and returns a pointer the same byte data
- contents.
- As an optimization, the byte data is returned without copying if this was
- the last reference to bytes and bytes was created with g_bytes_new(),
- g_bytes_new_take() or g_byte_array_free_to_bytes(). In all other cases the
- data is copied.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a pointer to the same byte data, which should be
- freed with g_free()</doc>
- <array length="0" zero-terminated="0" c:type="gpointer">
- <type name="guint8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="bytes" transfer-ownership="full">
- <doc xml:space="preserve">a #GBytes</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </instance-parameter>
- <parameter name="size"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">location to place the length of the returned data</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- </record>
- <constant name="CSET_A_2_Z"
- value="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- c:type="G_CSET_A_2_Z">
- <doc xml:space="preserve">The set of uppercase ASCII alphabet characters.
- Used for specifying valid identifier characters
- in #GScannerConfig.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="CSET_DIGITS" value="0123456789" c:type="G_CSET_DIGITS">
- <doc xml:space="preserve">The set of ASCII digits.
- Used for specifying valid identifier characters
- in #GScannerConfig.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="CSET_a_2_z"
- value="abcdefghijklmnopqrstuvwxyz"
- c:type="G_CSET_a_2_z">
- <doc xml:space="preserve">The set of lowercase ASCII alphabet characters.
- Used for specifying valid identifier characters
- in #GScannerConfig.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <record name="Checksum"
- c:type="GChecksum"
- version="2.16"
- glib:type-name="GChecksum"
- glib:get-type="g_checksum_get_type"
- c:symbol-prefix="checksum">
- <doc xml:space="preserve">An opaque structure representing a checksumming operation.
- To create a new GChecksum, use g_checksum_new(). To free
- a GChecksum, use g_checksum_free().</doc>
- <constructor name="new" c:identifier="g_checksum_new" version="2.16">
- <doc xml:space="preserve">Creates a new #GChecksum, using the checksum algorithm @checksum_type.
- If the @checksum_type is not known, %NULL is returned.
- A #GChecksum can be used to compute the checksum, or digest, of an
- arbitrary binary blob, using different hashing algorithms.
- A #GChecksum works by feeding a binary blob through g_checksum_update()
- until there is data to be checked; the digest can then be extracted
- using g_checksum_get_string(), which will return the checksum as a
- hexadecimal string; or g_checksum_get_digest(), which will return a
- vector of raw bytes. Once either g_checksum_get_string() or
- g_checksum_get_digest() have been called on a #GChecksum, the checksum
- will be closed and it won't be possible to call g_checksum_update()
- on it anymore.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly created #GChecksum, or %NULL.
- Use g_checksum_free() to free the memory allocated by it.</doc>
- <type name="Checksum" c:type="GChecksum*"/>
- </return-value>
- <parameters>
- <parameter name="checksum_type" transfer-ownership="none">
- <doc xml:space="preserve">the desired type of checksum</doc>
- <type name="ChecksumType" c:type="GChecksumType"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="copy" c:identifier="g_checksum_copy" version="2.16">
- <doc xml:space="preserve">Copies a #GChecksum. If @checksum has been closed, by calling
- g_checksum_get_string() or g_checksum_get_digest(), the copied
- checksum will be closed as well.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the copy of the passed #GChecksum. Use g_checksum_free()
- when finished using it.</doc>
- <type name="Checksum" c:type="GChecksum*"/>
- </return-value>
- <parameters>
- <instance-parameter name="checksum" transfer-ownership="none">
- <doc xml:space="preserve">the #GChecksum to copy</doc>
- <type name="Checksum" c:type="const GChecksum*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_checksum_free" version="2.16">
- <doc xml:space="preserve">Frees the memory allocated for @checksum.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="checksum" transfer-ownership="none">
- <doc xml:space="preserve">a #GChecksum</doc>
- <type name="Checksum" c:type="GChecksum*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_digest"
- c:identifier="g_checksum_get_digest"
- version="2.16"
- introspectable="0">
- <doc xml:space="preserve">Gets the digest from @checksum as a raw binary vector and places it
- into @buffer. The size of the digest depends on the type of checksum.
- Once this function has been called, the #GChecksum is closed and can
- no longer be updated with g_checksum_update().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="checksum" transfer-ownership="none">
- <doc xml:space="preserve">a #GChecksum</doc>
- <type name="Checksum" c:type="GChecksum*"/>
- </instance-parameter>
- <parameter name="buffer" transfer-ownership="none">
- <doc xml:space="preserve">output buffer</doc>
- <type name="guint8" c:type="guint8*"/>
- </parameter>
- <parameter name="digest_len" transfer-ownership="none">
- <doc xml:space="preserve">an inout parameter. The caller initializes it to the size of @buffer.
- After the call it contains the length of the digest.</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_string"
- c:identifier="g_checksum_get_string"
- version="2.16">
- <doc xml:space="preserve">Gets the digest as an hexadecimal string.
- Once this function has been called the #GChecksum can no longer be
- updated with g_checksum_update().
- The hexadecimal characters will be lower case.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the hexadecimal representation of the checksum. The
- returned string is owned by the checksum and should not be modified
- or freed.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="checksum" transfer-ownership="none">
- <doc xml:space="preserve">a #GChecksum</doc>
- <type name="Checksum" c:type="GChecksum*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="reset" c:identifier="g_checksum_reset" version="2.18">
- <doc xml:space="preserve">Resets the state of the @checksum back to its initial state.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="checksum" transfer-ownership="none">
- <doc xml:space="preserve">the #GChecksum to reset</doc>
- <type name="Checksum" c:type="GChecksum*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="update" c:identifier="g_checksum_update" version="2.16">
- <doc xml:space="preserve">Feeds @data into an existing #GChecksum. The checksum must still be
- open, that is g_checksum_get_string() or g_checksum_get_digest() must
- not have been called on @checksum.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="checksum" transfer-ownership="none">
- <doc xml:space="preserve">a #GChecksum</doc>
- <type name="Checksum" c:type="GChecksum*"/>
- </instance-parameter>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">buffer used to compute the checksum</doc>
- <array length="1" zero-terminated="0" c:type="guchar*">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">size of the buffer, or -1 if it is a null-terminated string.</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </method>
- <function name="type_get_length"
- c:identifier="g_checksum_type_get_length"
- version="2.16">
- <doc xml:space="preserve">Gets the length in bytes of digests of type @checksum_type</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the checksum length, or -1 if @checksum_type is
- not supported.</doc>
- <type name="gssize" c:type="gssize"/>
- </return-value>
- <parameters>
- <parameter name="checksum_type" transfer-ownership="none">
- <doc xml:space="preserve">a #GChecksumType</doc>
- <type name="ChecksumType" c:type="GChecksumType"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <enumeration name="ChecksumType" version="2.16" c:type="GChecksumType">
- <doc xml:space="preserve">The hashing algorithm to be used by #GChecksum when performing the
- digest of some data.
- Note that the #GChecksumType enumeration may be extended at a later
- date to include new hashing algorithm types.</doc>
- <member name="md5" value="0" c:identifier="G_CHECKSUM_MD5">
- <doc xml:space="preserve">Use the MD5 hashing algorithm</doc>
- </member>
- <member name="sha1" value="1" c:identifier="G_CHECKSUM_SHA1">
- <doc xml:space="preserve">Use the SHA-1 hashing algorithm</doc>
- </member>
- <member name="sha256" value="2" c:identifier="G_CHECKSUM_SHA256">
- <doc xml:space="preserve">Use the SHA-256 hashing algorithm</doc>
- </member>
- <member name="sha512" value="3" c:identifier="G_CHECKSUM_SHA512">
- <doc xml:space="preserve">Use the SHA-512 hashing algorithm (Since: 2.36)</doc>
- </member>
- </enumeration>
- <callback name="ChildWatchFunc" c:type="GChildWatchFunc">
- <doc xml:space="preserve">Prototype of a #GChildWatchSource callback, called when a child
- process has exited. To interpret @status, see the documentation
- for g_spawn_check_exit_status().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="pid" transfer-ownership="none">
- <doc xml:space="preserve">the process id of the child process</doc>
- <type name="Pid" c:type="GPid"/>
- </parameter>
- <parameter name="status" transfer-ownership="none">
- <doc xml:space="preserve">Status information about the child process, encoded
- in a platform-specific manner</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="2">
- <doc xml:space="preserve">user data passed to g_child_watch_add()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <callback name="CompareDataFunc" c:type="GCompareDataFunc">
- <doc xml:space="preserve">Specifies the type of a comparison function used to compare two
- values. The function should return a negative integer if the first
- value comes before the second, 0 if they are equal, or a positive
- integer if the first value comes after the second.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">negative value if @a < @b; zero if @a = @b; positive
- value if @a > @b</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="a"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a value</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="b"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a value to compare with</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="2">
- <doc xml:space="preserve">user data</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <callback name="CompareFunc" c:type="GCompareFunc">
- <doc xml:space="preserve">Specifies the type of a comparison function used to compare two
- values. The function should return a negative integer if the first
- value comes before the second, 0 if they are equal, or a positive
- integer if the first value comes after the second.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">negative value if @a < @b; zero if @a = @b; positive
- value if @a > @b</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="a"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a value</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="b"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a value to compare with</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </callback>
- <record name="Cond" c:type="GCond">
- <doc xml:space="preserve">The #GCond struct is an opaque data structure that represents a
- condition. Threads can block on a #GCond if they find a certain
- condition to be false. If other threads change the state of this
- condition they signal the #GCond, and that causes the waiting
- threads to be woken up.
- Consider the following example of a shared variable. One or more
- threads can wait for data to be published to the variable and when
- another thread publishes the data, it can signal one of the waiting
- threads to wake up to collect the data.
- Here is an example for using GCond to block a thread until a condition
- is satisfied:
- |[<!-- language="C" -->
- gpointer current_data = NULL;
- GMutex data_mutex;
- GCond data_cond;
- void
- push_data (gpointer data)
- {
- g_mutex_lock (&data_mutex);
- current_data = data;
- g_cond_signal (&data_cond);
- g_mutex_unlock (&data_mutex);
- }
- gpointer
- pop_data (void)
- {
- gpointer data;
- g_mutex_lock (&data_mutex);
- while (!current_data)
- g_cond_wait (&data_cond, &data_mutex);
- data = current_data;
- current_data = NULL;
- g_mutex_unlock (&data_mutex);
- return data;
- }
- ]|
- Whenever a thread calls pop_data() now, it will wait until
- current_data is non-%NULL, i.e. until some other thread
- has called push_data().
- The example shows that use of a condition variable must always be
- paired with a mutex. Without the use of a mutex, there would be a
- race between the check of @current_data by the while loop in
- pop_data() and waiting. Specifically, another thread could set
- @current_data after the check, and signal the cond (with nobody
- waiting on it) before the first thread goes to sleep. #GCond is
- specifically useful for its ability to release the mutex and go
- to sleep atomically.
- It is also important to use the g_cond_wait() and g_cond_wait_until()
- functions only inside a loop which checks for the condition to be
- true. See g_cond_wait() for an explanation of why the condition may
- not be true even after it returns.
- If a #GCond is allocated in static storage then it can be used
- without initialisation. Otherwise, you should call g_cond_init()
- on it and g_cond_clear() when done.
- A #GCond should only be accessed via the g_cond_ functions.</doc>
- <field name="p" readable="0" private="1">
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="i" readable="0" private="1">
- <array zero-terminated="0" c:type="guint" fixed-size="2">
- <type name="guint" c:type="guint"/>
- </array>
- </field>
- <method name="broadcast" c:identifier="g_cond_broadcast">
- <doc xml:space="preserve">If threads are waiting for @cond, all of them are unblocked.
- If no threads are waiting for @cond, this function has no effect.
- It is good practice to lock the same mutex as the waiting threads
- while calling this function, though not required.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="cond" transfer-ownership="none">
- <doc xml:space="preserve">a #GCond</doc>
- <type name="Cond" c:type="GCond*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="clear" c:identifier="g_cond_clear" version="2.32">
- <doc xml:space="preserve">Frees the resources allocated to a #GCond with g_cond_init().
- This function should not be used with a #GCond that has been
- statically allocated.
- Calling g_cond_clear() for a #GCond on which threads are
- blocking leads to undefined behaviour.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="cond" transfer-ownership="none">
- <doc xml:space="preserve">an initialised #GCond</doc>
- <type name="Cond" c:type="GCond*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="init" c:identifier="g_cond_init" version="2.32">
- <doc xml:space="preserve">Initialises a #GCond so that it can be used.
- This function is useful to initialise a #GCond that has been
- allocated as part of a larger structure. It is not necessary to
- initialise a #GCond that has been statically allocated.
- To undo the effect of g_cond_init() when a #GCond is no longer
- needed, use g_cond_clear().
- Calling g_cond_init() on an already-initialised #GCond leads
- to undefined behaviour.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="cond" transfer-ownership="none">
- <doc xml:space="preserve">an uninitialized #GCond</doc>
- <type name="Cond" c:type="GCond*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="signal" c:identifier="g_cond_signal">
- <doc xml:space="preserve">If threads are waiting for @cond, at least one of them is unblocked.
- If no threads are waiting for @cond, this function has no effect.
- It is good practice to hold the same lock as the waiting thread
- while calling this function, though not required.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="cond" transfer-ownership="none">
- <doc xml:space="preserve">a #GCond</doc>
- <type name="Cond" c:type="GCond*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="wait" c:identifier="g_cond_wait">
- <doc xml:space="preserve">Atomically releases @mutex and waits until @cond is signalled.
- When this function returns, @mutex is locked again and owned by the
- calling thread.
- When using condition variables, it is possible that a spurious wakeup
- may occur (ie: g_cond_wait() returns even though g_cond_signal() was
- not called). It's also possible that a stolen wakeup may occur.
- This is when g_cond_signal() is called, but another thread acquires
- @mutex before this thread and modifies the state of the program in
- such a way that when g_cond_wait() is able to return, the expected
- condition is no longer met.
- For this reason, g_cond_wait() must always be used in a loop. See
- the documentation for #GCond for a complete example.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="cond" transfer-ownership="none">
- <doc xml:space="preserve">a #GCond</doc>
- <type name="Cond" c:type="GCond*"/>
- </instance-parameter>
- <parameter name="mutex" transfer-ownership="none">
- <doc xml:space="preserve">a #GMutex that is currently locked</doc>
- <type name="Mutex" c:type="GMutex*"/>
- </parameter>
- </parameters>
- </method>
- <method name="wait_until"
- c:identifier="g_cond_wait_until"
- version="2.32">
- <doc xml:space="preserve">Waits until either @cond is signalled or @end_time has passed.
- As with g_cond_wait() it is possible that a spurious or stolen wakeup
- could occur. For that reason, waiting on a condition variable should
- always be in a loop, based on an explicitly-checked predicate.
- %TRUE is returned if the condition variable was signalled (or in the
- case of a spurious wakeup). %FALSE is returned if @end_time has
- passed.
- The following code shows how to correctly perform a timed wait on a
- condition variable (extending the example presented in the
- documentation for #GCond):
- |[<!-- language="C" -->
- gpointer
- pop_data_timed (void)
- {
- gint64 end_time;
- gpointer data;
- g_mutex_lock (&data_mutex);
- end_time = g_get_monotonic_time () + 5 * G_TIME_SPAN_SECOND;
- while (!current_data)
- if (!g_cond_wait_until (&data_cond, &data_mutex, end_time))
- {
- // timeout has passed.
- g_mutex_unlock (&data_mutex);
- return NULL;
- }
- // there is data for us
- data = current_data;
- current_data = NULL;
- g_mutex_unlock (&data_mutex);
- return data;
- }
- ]|
- Notice that the end time is calculated once, before entering the
- loop and reused. This is the motivation behind the use of absolute
- time on this API -- if a relative time of 5 seconds were passed
- directly to the call and a spurious wakeup occurred, the program would
- have to start over waiting again (which would lead to a total wait
- time of more than 5 seconds).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on a signal, %FALSE on a timeout</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="cond" transfer-ownership="none">
- <doc xml:space="preserve">a #GCond</doc>
- <type name="Cond" c:type="GCond*"/>
- </instance-parameter>
- <parameter name="mutex" transfer-ownership="none">
- <doc xml:space="preserve">a #GMutex that is currently locked</doc>
- <type name="Mutex" c:type="GMutex*"/>
- </parameter>
- <parameter name="end_time" transfer-ownership="none">
- <doc xml:space="preserve">the monotonic time to wait until</doc>
- <type name="gint64" c:type="gint64"/>
- </parameter>
- </parameters>
- </method>
- </record>
- <enumeration name="ConvertError"
- c:type="GConvertError"
- glib:error-domain="g_convert_error">
- <doc xml:space="preserve">Error codes returned by character set conversion routines.</doc>
- <member name="no_conversion"
- value="0"
- c:identifier="G_CONVERT_ERROR_NO_CONVERSION">
- <doc xml:space="preserve">Conversion between the requested character
- sets is not supported.</doc>
- </member>
- <member name="illegal_sequence"
- value="1"
- c:identifier="G_CONVERT_ERROR_ILLEGAL_SEQUENCE">
- <doc xml:space="preserve">Invalid byte sequence in conversion input.</doc>
- </member>
- <member name="failed" value="2" c:identifier="G_CONVERT_ERROR_FAILED">
- <doc xml:space="preserve">Conversion failed for some reason.</doc>
- </member>
- <member name="partial_input"
- value="3"
- c:identifier="G_CONVERT_ERROR_PARTIAL_INPUT">
- <doc xml:space="preserve">Partial character sequence at end of input.</doc>
- </member>
- <member name="bad_uri" value="4" c:identifier="G_CONVERT_ERROR_BAD_URI">
- <doc xml:space="preserve">URI is invalid.</doc>
- </member>
- <member name="not_absolute_path"
- value="5"
- c:identifier="G_CONVERT_ERROR_NOT_ABSOLUTE_PATH">
- <doc xml:space="preserve">Pathname is not an absolute path.</doc>
- </member>
- <member name="no_memory"
- value="6"
- c:identifier="G_CONVERT_ERROR_NO_MEMORY">
- <doc xml:space="preserve">No memory available. Since: 2.40</doc>
- </member>
- </enumeration>
- <callback name="CopyFunc" c:type="GCopyFunc" version="2.4">
- <doc xml:space="preserve">A function of this signature is used to copy the node data
- when doing a deep-copy of a tree.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">A pointer to the copy</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="src" transfer-ownership="none">
- <doc xml:space="preserve">A pointer to the data which should be copied</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">Additional data</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <constant name="DATALIST_FLAGS_MASK"
- value="3"
- c:type="G_DATALIST_FLAGS_MASK">
- <doc xml:space="preserve">A bitmask that restricts the possible flags passed to
- g_datalist_set_flags(). Passing a flags value where
- flags & ~G_DATALIST_FLAGS_MASK != 0 is an error.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="DATE_BAD_DAY" value="0" c:type="G_DATE_BAD_DAY">
- <doc xml:space="preserve">Represents an invalid #GDateDay.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="DATE_BAD_JULIAN" value="0" c:type="G_DATE_BAD_JULIAN">
- <doc xml:space="preserve">Represents an invalid Julian day number.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="DATE_BAD_YEAR" value="0" c:type="G_DATE_BAD_YEAR">
- <doc xml:space="preserve">Represents an invalid year.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="DIR_SEPARATOR" value="92" c:type="G_DIR_SEPARATOR">
- <doc xml:space="preserve">The directory separator character.
- This is '/' on UNIX machines and '\' under Windows.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="DIR_SEPARATOR_S" value="\" c:type="G_DIR_SEPARATOR_S">
- <doc xml:space="preserve">The directory separator as a string.
- This is "/" on UNIX machines and "\" under Windows.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <record name="Data" c:type="GData" disguised="1">
- <doc xml:space="preserve">The #GData struct is an opaque data structure to represent a
- [Keyed Data List][glib-Keyed-Data-Lists]. It should only be
- accessed via the following functions.</doc>
- </record>
- <callback name="DataForeachFunc" c:type="GDataForeachFunc">
- <doc xml:space="preserve">Specifies the type of function passed to g_dataset_foreach(). It is
- called with each #GQuark id and associated data element, together
- with the @user_data parameter supplied to g_dataset_foreach().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="key_id" transfer-ownership="none">
- <doc xml:space="preserve">the #GQuark id to identifying the data element.</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data element.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="2">
- <doc xml:space="preserve">user data passed to g_dataset_foreach().</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <record name="Date"
- c:type="GDate"
- glib:type-name="GDate"
- glib:get-type="g_date_get_type"
- c:symbol-prefix="date">
- <doc xml:space="preserve">Represents a day between January 1, Year 1 and a few thousand years in
- the future. None of its members should be accessed directly.
- If the #GDate-struct is obtained from g_date_new(), it will be safe
- to mutate but invalid and thus not safe for calendrical computations.
- If it's declared on the stack, it will contain garbage so must be
- initialized with g_date_clear(). g_date_clear() makes the date invalid
- but sane. An invalid date doesn't represent a day, it's "empty." A date
- becomes valid after you set it to a Julian day or you set a day, month,
- and year.</doc>
- <field name="julian_days" writable="1" bits="32">
- <doc xml:space="preserve">the Julian representation of the date</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="julian" writable="1" bits="1">
- <doc xml:space="preserve">this bit is set if @julian_days is valid</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="dmy" writable="1" bits="1">
- <doc xml:space="preserve">this is set if @day, @month and @year are valid</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="day" writable="1" bits="6">
- <doc xml:space="preserve">the day of the day-month-year representation of the date,
- as a number between 1 and 31</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="month" writable="1" bits="4">
- <doc xml:space="preserve">the day of the day-month-year representation of the date,
- as a number between 1 and 12</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="year" writable="1" bits="16">
- <doc xml:space="preserve">the day of the day-month-year representation of the date</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <constructor name="new" c:identifier="g_date_new">
- <doc xml:space="preserve">Allocates a #GDate and initializes
- it to a sane state. The new date will
- be cleared (as if you'd called g_date_clear()) but invalid (it won't
- represent an existing day). Free the return value with g_date_free().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated #GDate</doc>
- <type name="Date" c:type="GDate*"/>
- </return-value>
- </constructor>
- <constructor name="new_dmy" c:identifier="g_date_new_dmy">
- <doc xml:space="preserve">Like g_date_new(), but also sets the value of the date. Assuming the
- day-month-year triplet you pass in represents an existing day, the
- returned date will be valid.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated #GDate initialized with @day, @month, and @year</doc>
- <type name="Date" c:type="GDate*"/>
- </return-value>
- <parameters>
- <parameter name="day" transfer-ownership="none">
- <doc xml:space="preserve">day of the month</doc>
- <type name="DateDay" c:type="GDateDay"/>
- </parameter>
- <parameter name="month" transfer-ownership="none">
- <doc xml:space="preserve">month of the year</doc>
- <type name="DateMonth" c:type="GDateMonth"/>
- </parameter>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">year</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_julian" c:identifier="g_date_new_julian">
- <doc xml:space="preserve">Like g_date_new(), but also sets the value of the date. Assuming the
- Julian day number you pass in is valid (greater than 0, less than an
- unreasonably large number), the returned date will be valid.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated #GDate initialized with @julian_day</doc>
- <type name="Date" c:type="GDate*"/>
- </return-value>
- <parameters>
- <parameter name="julian_day" transfer-ownership="none">
- <doc xml:space="preserve">days since January 1, Year 1</doc>
- <type name="guint32" c:type="guint32"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="add_days" c:identifier="g_date_add_days">
- <doc xml:space="preserve">Increments a date some number of days.
- To move forward by weeks, add weeks*7 days.
- The date must be valid.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to increment</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="n_days" transfer-ownership="none">
- <doc xml:space="preserve">number of days to move the date forward</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_months" c:identifier="g_date_add_months">
- <doc xml:space="preserve">Increments a date by some number of months.
- If the day of the month is greater than 28,
- this routine may change the day of the month
- (because the destination month may not have
- the current day in it). The date must be valid.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to increment</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="n_months" transfer-ownership="none">
- <doc xml:space="preserve">number of months to move forward</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_years" c:identifier="g_date_add_years">
- <doc xml:space="preserve">Increments a date by some number of years.
- If the date is February 29, and the destination
- year is not a leap year, the date will be changed
- to February 28. The date must be valid.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to increment</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="n_years" transfer-ownership="none">
- <doc xml:space="preserve">number of years to move forward</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="clamp" c:identifier="g_date_clamp">
- <doc xml:space="preserve">If @date is prior to @min_date, sets @date equal to @min_date.
- If @date falls after @max_date, sets @date equal to @max_date.
- Otherwise, @date is unchanged.
- Either of @min_date and @max_date may be %NULL.
- All non-%NULL dates must be valid.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to clamp</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="min_date" transfer-ownership="none">
- <doc xml:space="preserve">minimum accepted value for @date</doc>
- <type name="Date" c:type="const GDate*"/>
- </parameter>
- <parameter name="max_date" transfer-ownership="none">
- <doc xml:space="preserve">maximum accepted value for @date</doc>
- <type name="Date" c:type="const GDate*"/>
- </parameter>
- </parameters>
- </method>
- <method name="clear" c:identifier="g_date_clear">
- <doc xml:space="preserve">Initializes one or more #GDate structs to a sane but invalid
- state. The cleared dates will not represent an existing date, but will
- not contain garbage. Useful to init a date declared on the stack.
- Validity can be tested with g_date_valid().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">pointer to one or more dates to clear</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="n_dates" transfer-ownership="none">
- <doc xml:space="preserve">number of dates to clear</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="compare" c:identifier="g_date_compare">
- <doc xml:space="preserve">qsort()-style comparison function for dates.
- Both dates must be valid.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">0 for equal, less than zero if @lhs is less than @rhs,
- greater than zero if @lhs is greater than @rhs</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="lhs" transfer-ownership="none">
- <doc xml:space="preserve">first date to compare</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- <parameter name="rhs" transfer-ownership="none">
- <doc xml:space="preserve">second date to compare</doc>
- <type name="Date" c:type="const GDate*"/>
- </parameter>
- </parameters>
- </method>
- <method name="days_between" c:identifier="g_date_days_between">
- <doc xml:space="preserve">Computes the number of days between two dates.
- If @date2 is prior to @date1, the returned value is negative.
- Both dates must be valid.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of days between @date1 and @date2</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="date1" transfer-ownership="none">
- <doc xml:space="preserve">the first date</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- <parameter name="date2" transfer-ownership="none">
- <doc xml:space="preserve">the second date</doc>
- <type name="Date" c:type="const GDate*"/>
- </parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_date_free">
- <doc xml:space="preserve">Frees a #GDate returned from g_date_new().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to free</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_day" c:identifier="g_date_get_day">
- <doc xml:space="preserve">Returns the day of the month. The date must be valid.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">day of the month</doc>
- <type name="DateDay" c:type="GDateDay"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to extract the day of the month from</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_day_of_year" c:identifier="g_date_get_day_of_year">
- <doc xml:space="preserve">Returns the day of the year, where Jan 1 is the first day of the
- year. The date must be valid.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">day of the year</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to extract day of year from</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_iso8601_week_of_year"
- c:identifier="g_date_get_iso8601_week_of_year"
- version="2.6">
- <doc xml:space="preserve">Returns the week of the year, where weeks are interpreted according
- to ISO 8601.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">ISO 8601 week number of the year.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a valid #GDate</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_julian" c:identifier="g_date_get_julian">
- <doc xml:space="preserve">Returns the Julian day or "serial number" of the #GDate. The
- Julian day is simply the number of days since January 1, Year 1; i.e.,
- January 1, Year 1 is Julian day 1; January 2, Year 1 is Julian day 2,
- etc. The date must be valid.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">Julian day</doc>
- <type name="guint32" c:type="guint32"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to extract the Julian day from</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_monday_week_of_year"
- c:identifier="g_date_get_monday_week_of_year">
- <doc xml:space="preserve">Returns the week of the year, where weeks are understood to start on
- Monday. If the date is before the first Monday of the year, return 0.
- The date must be valid.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">week of the year</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_month" c:identifier="g_date_get_month">
- <doc xml:space="preserve">Returns the month of the year. The date must be valid.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">month of the year as a #GDateMonth</doc>
- <type name="DateMonth" c:type="GDateMonth"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to get the month from</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_sunday_week_of_year"
- c:identifier="g_date_get_sunday_week_of_year">
- <doc xml:space="preserve">Returns the week of the year during which this date falls, if
- weeks are understood to being on Sunday. The date must be valid.
- Can return 0 if the day is before the first Sunday of the year.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">week number</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_weekday" c:identifier="g_date_get_weekday">
- <doc xml:space="preserve">Returns the day of the week for a #GDate. The date must be valid.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">day of the week as a #GDateWeekday.</doc>
- <type name="DateWeekday" c:type="GDateWeekday"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_year" c:identifier="g_date_get_year">
- <doc xml:space="preserve">Returns the year of a #GDate. The date must be valid.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">year in which the date falls</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_first_of_month" c:identifier="g_date_is_first_of_month">
- <doc xml:space="preserve">Returns %TRUE if the date is on the first of a month.
- The date must be valid.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the date is the first of the month</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to check</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_last_of_month" c:identifier="g_date_is_last_of_month">
- <doc xml:space="preserve">Returns %TRUE if the date is the last day of the month.
- The date must be valid.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the date is the last day of the month</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to check</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="order" c:identifier="g_date_order">
- <doc xml:space="preserve">Checks if @date1 is less than or equal to @date2,
- and swap the values if this is not the case.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date1" transfer-ownership="none">
- <doc xml:space="preserve">the first date</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="date2" transfer-ownership="none">
- <doc xml:space="preserve">the second date</doc>
- <type name="Date" c:type="GDate*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_day" c:identifier="g_date_set_day">
- <doc xml:space="preserve">Sets the day of the month for a #GDate. If the resulting
- day-month-year triplet is invalid, the date will be invalid.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="day" transfer-ownership="none">
- <doc xml:space="preserve">day to set</doc>
- <type name="DateDay" c:type="GDateDay"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_dmy" c:identifier="g_date_set_dmy">
- <doc xml:space="preserve">Sets the value of a #GDate from a day, month, and year.
- The day-month-year triplet must be valid; if you aren't
- sure it is, call g_date_valid_dmy() to check before you
- set it.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="day" transfer-ownership="none">
- <doc xml:space="preserve">day</doc>
- <type name="DateDay" c:type="GDateDay"/>
- </parameter>
- <parameter name="month" transfer-ownership="none">
- <doc xml:space="preserve">month</doc>
- <type name="DateMonth" c:type="GDateMonth"/>
- </parameter>
- <parameter name="y" transfer-ownership="none">
- <doc xml:space="preserve">year</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_julian" c:identifier="g_date_set_julian">
- <doc xml:space="preserve">Sets the value of a #GDate from a Julian day number.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="julian_date" transfer-ownership="none">
- <doc xml:space="preserve">Julian day number (days since January 1, Year 1)</doc>
- <type name="guint32" c:type="guint32"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_month" c:identifier="g_date_set_month">
- <doc xml:space="preserve">Sets the month of the year for a #GDate. If the resulting
- day-month-year triplet is invalid, the date will be invalid.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="month" transfer-ownership="none">
- <doc xml:space="preserve">month to set</doc>
- <type name="DateMonth" c:type="GDateMonth"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_parse" c:identifier="g_date_set_parse">
- <doc xml:space="preserve">Parses a user-inputted string @str, and try to figure out what date it
- represents, taking the [current locale][setlocale] into account. If the
- string is successfully parsed, the date will be valid after the call.
- Otherwise, it will be invalid. You should check using g_date_valid()
- to see whether the parsing succeeded.
- This function is not appropriate for file formats and the like; it
- isn't very precise, and its exact behavior varies with the locale.
- It's intended to be a heuristic routine that guesses what the user
- means by a given string (and it does work pretty well in that
- capacity).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to fill in</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">string to parse</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_time"
- c:identifier="g_date_set_time"
- deprecated="1"
- deprecated-version="2.10">
- <doc xml:space="preserve">Sets the value of a date from a #GTime value.
- The time to date conversion is done using the user's current timezone.</doc>
- <doc-deprecated xml:space="preserve">Use g_date_set_time_t() instead.</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate.</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="time_" transfer-ownership="none">
- <doc xml:space="preserve">#GTime value to set.</doc>
- <type name="Time" c:type="GTime"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_time_t"
- c:identifier="g_date_set_time_t"
- version="2.10">
- <doc xml:space="preserve">Sets the value of a date to the date corresponding to a time
- specified as a time_t. The time to date conversion is done using
- the user's current timezone.
- To set the value of a date to the current day, you could write:
- |[<!-- language="C" -->
- g_date_set_time_t (date, time (NULL));
- ]|</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="timet" transfer-ownership="none">
- <doc xml:space="preserve">time_t value to set</doc>
- <type name="glong" c:type="time_t"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_time_val"
- c:identifier="g_date_set_time_val"
- version="2.10">
- <doc xml:space="preserve">Sets the value of a date from a #GTimeVal value. Note that the
- @tv_usec member is ignored, because #GDate can't make use of the
- additional precision.
- The time to date conversion is done using the user's current timezone.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="timeval" transfer-ownership="none">
- <doc xml:space="preserve">#GTimeVal value to set</doc>
- <type name="TimeVal" c:type="GTimeVal*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_year" c:identifier="g_date_set_year">
- <doc xml:space="preserve">Sets the year for a #GDate. If the resulting day-month-year
- triplet is invalid, the date will be invalid.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">year to set</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </method>
- <method name="subtract_days" c:identifier="g_date_subtract_days">
- <doc xml:space="preserve">Moves a date some number of days into the past.
- To move by weeks, just move by weeks*7 days.
- The date must be valid.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to decrement</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="n_days" transfer-ownership="none">
- <doc xml:space="preserve">number of days to move</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="subtract_months" c:identifier="g_date_subtract_months">
- <doc xml:space="preserve">Moves a date some number of months into the past.
- If the current day of the month doesn't exist in
- the destination month, the day of the month
- may change. The date must be valid.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to decrement</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="n_months" transfer-ownership="none">
- <doc xml:space="preserve">number of months to move</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="subtract_years" c:identifier="g_date_subtract_years">
- <doc xml:space="preserve">Moves a date some number of years into the past.
- If the current day doesn't exist in the destination
- year (i.e. it's February 29 and you move to a non-leap-year)
- then the day is changed to February 29. The date
- must be valid.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to decrement</doc>
- <type name="Date" c:type="GDate*"/>
- </instance-parameter>
- <parameter name="n_years" transfer-ownership="none">
- <doc xml:space="preserve">number of years to move</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="to_struct_tm" c:identifier="g_date_to_struct_tm">
- <doc xml:space="preserve">Fills in the date-related bits of a struct tm using the @date value.
- Initializes the non-date parts with something sane but meaningless.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to set the struct tm from</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- <parameter name="tm" transfer-ownership="none">
- <doc xml:space="preserve">struct tm to fill</doc>
- <type name="gpointer" c:type="tm*"/>
- </parameter>
- </parameters>
- </method>
- <method name="valid" c:identifier="g_date_valid">
- <doc xml:space="preserve">Returns %TRUE if the #GDate represents an existing day. The date must not
- contain garbage; it should have been initialized with g_date_clear()
- if it wasn't allocated by one of the g_date_new() variants.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">Whether the date is valid</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">a #GDate to check</doc>
- <type name="Date" c:type="const GDate*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="get_days_in_month"
- c:identifier="g_date_get_days_in_month">
- <doc xml:space="preserve">Returns the number of days in a month, taking leap
- years into account.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">number of days in @month during the @year</doc>
- <type name="guint8" c:type="guint8"/>
- </return-value>
- <parameters>
- <parameter name="month" transfer-ownership="none">
- <doc xml:space="preserve">month</doc>
- <type name="DateMonth" c:type="GDateMonth"/>
- </parameter>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">year</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </function>
- <function name="get_monday_weeks_in_year"
- c:identifier="g_date_get_monday_weeks_in_year">
- <doc xml:space="preserve">Returns the number of weeks in the year, where weeks
- are taken to start on Monday. Will be 52 or 53. The
- date must be valid. (Years always have 52 7-day periods,
- plus 1 or 2 extra days depending on whether it's a leap
- year. This function is basically telling you how many
- Mondays are in the year, i.e. there are 53 Mondays if
- one of the extra days happens to be a Monday.)</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">number of Mondays in the year</doc>
- <type name="guint8" c:type="guint8"/>
- </return-value>
- <parameters>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">a year</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </function>
- <function name="get_sunday_weeks_in_year"
- c:identifier="g_date_get_sunday_weeks_in_year">
- <doc xml:space="preserve">Returns the number of weeks in the year, where weeks
- are taken to start on Sunday. Will be 52 or 53. The
- date must be valid. (Years always have 52 7-day periods,
- plus 1 or 2 extra days depending on whether it's a leap
- year. This function is basically telling you how many
- Sundays are in the year, i.e. there are 53 Sundays if
- one of the extra days happens to be a Sunday.)</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of weeks in @year</doc>
- <type name="guint8" c:type="guint8"/>
- </return-value>
- <parameters>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">year to count weeks in</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </function>
- <function name="is_leap_year" c:identifier="g_date_is_leap_year">
- <doc xml:space="preserve">Returns %TRUE if the year is a leap year.
- For the purposes of this function, leap year is every year
- divisible by 4 unless that year is divisible by 100. If it
- is divisible by 100 it would be a leap year only if that year
- is also divisible by 400.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the year is a leap year</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">year to check</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </function>
- <function name="strftime" c:identifier="g_date_strftime">
- <doc xml:space="preserve">Generates a printed representation of the date, in a
- [locale][setlocale]-specific way.
- Works just like the platform's C library strftime() function,
- but only accepts date-related formats; time-related formats
- give undefined results. Date must be valid. Unlike strftime()
- (which uses the locale encoding), works on a UTF-8 format
- string and stores a UTF-8 result.
- This function does not provide any conversion specifiers in
- addition to those implemented by the platform's C library.
- For example, don't expect that using g_date_strftime() would
- make the \%F provided by the C99 strftime() work on Windows
- where the C library only complies to C89.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">number of characters written to the buffer, or 0 the buffer was too small</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <parameter name="s" transfer-ownership="none">
- <doc xml:space="preserve">destination buffer</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="slen" transfer-ownership="none">
- <doc xml:space="preserve">buffer size</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">valid #GDate</doc>
- <type name="Date" c:type="const GDate*"/>
- </parameter>
- </parameters>
- </function>
- <function name="valid_day" c:identifier="g_date_valid_day">
- <doc xml:space="preserve">Returns %TRUE if the day of the month is valid (a day is valid if it's
- between 1 and 31 inclusive).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the day is valid</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="day" transfer-ownership="none">
- <doc xml:space="preserve">day to check</doc>
- <type name="DateDay" c:type="GDateDay"/>
- </parameter>
- </parameters>
- </function>
- <function name="valid_dmy" c:identifier="g_date_valid_dmy">
- <doc xml:space="preserve">Returns %TRUE if the day-month-year triplet forms a valid, existing day
- in the range of days #GDate understands (Year 1 or later, no more than
- a few thousand years in the future).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the date is a valid one</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="day" transfer-ownership="none">
- <doc xml:space="preserve">day</doc>
- <type name="DateDay" c:type="GDateDay"/>
- </parameter>
- <parameter name="month" transfer-ownership="none">
- <doc xml:space="preserve">month</doc>
- <type name="DateMonth" c:type="GDateMonth"/>
- </parameter>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">year</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </function>
- <function name="valid_julian" c:identifier="g_date_valid_julian">
- <doc xml:space="preserve">Returns %TRUE if the Julian day is valid. Anything greater than zero
- is basically a valid Julian, though there is a 32-bit limit.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the Julian day is valid</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="julian_date" transfer-ownership="none">
- <doc xml:space="preserve">Julian day to check</doc>
- <type name="guint32" c:type="guint32"/>
- </parameter>
- </parameters>
- </function>
- <function name="valid_month" c:identifier="g_date_valid_month">
- <doc xml:space="preserve">Returns %TRUE if the month value is valid. The 12 #GDateMonth
- enumeration values are the only valid months.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the month is valid</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="month" transfer-ownership="none">
- <doc xml:space="preserve">month</doc>
- <type name="DateMonth" c:type="GDateMonth"/>
- </parameter>
- </parameters>
- </function>
- <function name="valid_weekday" c:identifier="g_date_valid_weekday">
- <doc xml:space="preserve">Returns %TRUE if the weekday is valid. The seven #GDateWeekday enumeration
- values are the only valid weekdays.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the weekday is valid</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="weekday" transfer-ownership="none">
- <doc xml:space="preserve">weekday</doc>
- <type name="DateWeekday" c:type="GDateWeekday"/>
- </parameter>
- </parameters>
- </function>
- <function name="valid_year" c:identifier="g_date_valid_year">
- <doc xml:space="preserve">Returns %TRUE if the year is valid. Any year greater than 0 is valid,
- though there is a 16-bit limit to what #GDate will understand.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the year is valid</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">year</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <enumeration name="DateDMY" c:type="GDateDMY">
- <doc xml:space="preserve">This enumeration isn't used in the API, but may be useful if you need
- to mark a number as a day, month, or year.</doc>
- <member name="day" value="0" c:identifier="G_DATE_DAY">
- <doc xml:space="preserve">a day</doc>
- </member>
- <member name="month" value="1" c:identifier="G_DATE_MONTH">
- <doc xml:space="preserve">a month</doc>
- </member>
- <member name="year" value="2" c:identifier="G_DATE_YEAR">
- <doc xml:space="preserve">a year</doc>
- </member>
- </enumeration>
- <enumeration name="DateMonth" c:type="GDateMonth">
- <doc xml:space="preserve">Enumeration representing a month; values are #G_DATE_JANUARY,
- #G_DATE_FEBRUARY, etc. #G_DATE_BAD_MONTH is the invalid value.</doc>
- <member name="bad_month" value="0" c:identifier="G_DATE_BAD_MONTH">
- <doc xml:space="preserve">invalid value</doc>
- </member>
- <member name="january" value="1" c:identifier="G_DATE_JANUARY">
- <doc xml:space="preserve">January</doc>
- </member>
- <member name="february" value="2" c:identifier="G_DATE_FEBRUARY">
- <doc xml:space="preserve">February</doc>
- </member>
- <member name="march" value="3" c:identifier="G_DATE_MARCH">
- <doc xml:space="preserve">March</doc>
- </member>
- <member name="april" value="4" c:identifier="G_DATE_APRIL">
- <doc xml:space="preserve">April</doc>
- </member>
- <member name="may" value="5" c:identifier="G_DATE_MAY">
- <doc xml:space="preserve">May</doc>
- </member>
- <member name="june" value="6" c:identifier="G_DATE_JUNE">
- <doc xml:space="preserve">June</doc>
- </member>
- <member name="july" value="7" c:identifier="G_DATE_JULY">
- <doc xml:space="preserve">July</doc>
- </member>
- <member name="august" value="8" c:identifier="G_DATE_AUGUST">
- <doc xml:space="preserve">August</doc>
- </member>
- <member name="september" value="9" c:identifier="G_DATE_SEPTEMBER">
- <doc xml:space="preserve">September</doc>
- </member>
- <member name="october" value="10" c:identifier="G_DATE_OCTOBER">
- <doc xml:space="preserve">October</doc>
- </member>
- <member name="november" value="11" c:identifier="G_DATE_NOVEMBER">
- <doc xml:space="preserve">November</doc>
- </member>
- <member name="december" value="12" c:identifier="G_DATE_DECEMBER">
- <doc xml:space="preserve">December</doc>
- </member>
- </enumeration>
- <record name="DateTime"
- c:type="GDateTime"
- version="2.26"
- glib:type-name="GDateTime"
- glib:get-type="g_date_time_get_type"
- c:symbol-prefix="date_time">
- <doc xml:space="preserve">`GDateTime` is an opaque structure whose members
- cannot be accessed directly.</doc>
- <constructor name="new" c:identifier="g_date_time_new" version="2.26">
- <doc xml:space="preserve">Creates a new #GDateTime corresponding to the given date and time in
- the time zone @tz.
- The @year must be between 1 and 9999, @month between 1 and 12 and @day
- between 1 and 28, 29, 30 or 31 depending on the month and the year.
- @hour must be between 0 and 23 and @minute must be between 0 and 59.
- @seconds must be at least 0.0 and must be strictly less than 60.0.
- It will be rounded down to the nearest microsecond.
- If the given time is not representable in the given time zone (for
- example, 02:30 on March 14th 2010 in Toronto, due to daylight savings
- time) then the time will be rounded up to the nearest existing time
- (in this case, 03:00). If this matters to you then you should verify
- the return value for containing the same as the numbers you gave.
- In the case that the given time is ambiguous in the given time zone
- (for example, 01:30 on November 7th 2010 in Toronto, due to daylight
- savings time) then the time falling within standard (ie:
- non-daylight) time is taken.
- It not considered a programmer error for the values to this function
- to be out of range, but in the case that they are, the function will
- return %NULL.
- You should release the return value by calling g_date_time_unref()
- when you are done with it.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <parameter name="tz" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeZone</doc>
- <type name="TimeZone" c:type="GTimeZone*"/>
- </parameter>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">the year component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="month" transfer-ownership="none">
- <doc xml:space="preserve">the month component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="day" transfer-ownership="none">
- <doc xml:space="preserve">the day component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="hour" transfer-ownership="none">
- <doc xml:space="preserve">the hour component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="minute" transfer-ownership="none">
- <doc xml:space="preserve">the minute component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="seconds" transfer-ownership="none">
- <doc xml:space="preserve">the number of seconds past the minute</doc>
- <type name="gdouble" c:type="gdouble"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_from_timeval_local"
- c:identifier="g_date_time_new_from_timeval_local"
- version="2.26">
- <doc xml:space="preserve">Creates a #GDateTime corresponding to the given #GTimeVal @tv in the
- local time zone.
- The time contained in a #GTimeVal is always stored in the form of
- seconds elapsed since 1970-01-01 00:00:00 UTC, regardless of the
- local time offset.
- This call can fail (returning %NULL) if @tv represents a time outside
- of the supported range of #GDateTime.
- You should release the return value by calling g_date_time_unref()
- when you are done with it.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <parameter name="tv" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeVal</doc>
- <type name="TimeVal" c:type="const GTimeVal*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_from_timeval_utc"
- c:identifier="g_date_time_new_from_timeval_utc"
- version="2.26">
- <doc xml:space="preserve">Creates a #GDateTime corresponding to the given #GTimeVal @tv in UTC.
- The time contained in a #GTimeVal is always stored in the form of
- seconds elapsed since 1970-01-01 00:00:00 UTC.
- This call can fail (returning %NULL) if @tv represents a time outside
- of the supported range of #GDateTime.
- You should release the return value by calling g_date_time_unref()
- when you are done with it.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <parameter name="tv" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeVal</doc>
- <type name="TimeVal" c:type="const GTimeVal*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_from_unix_local"
- c:identifier="g_date_time_new_from_unix_local"
- version="2.26">
- <doc xml:space="preserve">Creates a #GDateTime corresponding to the given Unix time @t in the
- local time zone.
- Unix time is the number of seconds that have elapsed since 1970-01-01
- 00:00:00 UTC, regardless of the local time offset.
- This call can fail (returning %NULL) if @t represents a time outside
- of the supported range of #GDateTime.
- You should release the return value by calling g_date_time_unref()
- when you are done with it.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <parameter name="t" transfer-ownership="none">
- <doc xml:space="preserve">the Unix time</doc>
- <type name="gint64" c:type="gint64"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_from_unix_utc"
- c:identifier="g_date_time_new_from_unix_utc"
- version="2.26">
- <doc xml:space="preserve">Creates a #GDateTime corresponding to the given Unix time @t in UTC.
- Unix time is the number of seconds that have elapsed since 1970-01-01
- 00:00:00 UTC.
- This call can fail (returning %NULL) if @t represents a time outside
- of the supported range of #GDateTime.
- You should release the return value by calling g_date_time_unref()
- when you are done with it.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <parameter name="t" transfer-ownership="none">
- <doc xml:space="preserve">the Unix time</doc>
- <type name="gint64" c:type="gint64"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_local"
- c:identifier="g_date_time_new_local"
- version="2.26">
- <doc xml:space="preserve">Creates a new #GDateTime corresponding to the given date and time in
- the local time zone.
- This call is equivalent to calling g_date_time_new() with the time
- zone returned by g_time_zone_new_local().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a #GDateTime, or %NULL</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">the year component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="month" transfer-ownership="none">
- <doc xml:space="preserve">the month component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="day" transfer-ownership="none">
- <doc xml:space="preserve">the day component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="hour" transfer-ownership="none">
- <doc xml:space="preserve">the hour component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="minute" transfer-ownership="none">
- <doc xml:space="preserve">the minute component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="seconds" transfer-ownership="none">
- <doc xml:space="preserve">the number of seconds past the minute</doc>
- <type name="gdouble" c:type="gdouble"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_now"
- c:identifier="g_date_time_new_now"
- version="2.26">
- <doc xml:space="preserve">Creates a #GDateTime corresponding to this exact instant in the given
- time zone @tz. The time is as accurate as the system allows, to a
- maximum accuracy of 1 microsecond.
- This function will always succeed unless the system clock is set to
- truly insane values (or unless GLib is still being used after the
- year 9999).
- You should release the return value by calling g_date_time_unref()
- when you are done with it.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <parameter name="tz" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeZone</doc>
- <type name="TimeZone" c:type="GTimeZone*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_now_local"
- c:identifier="g_date_time_new_now_local"
- version="2.26">
- <doc xml:space="preserve">Creates a #GDateTime corresponding to this exact instant in the local
- time zone.
- This is equivalent to calling g_date_time_new_now() with the time
- zone returned by g_time_zone_new_local().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- </constructor>
- <constructor name="new_now_utc"
- c:identifier="g_date_time_new_now_utc"
- version="2.26">
- <doc xml:space="preserve">Creates a #GDateTime corresponding to this exact instant in UTC.
- This is equivalent to calling g_date_time_new_now() with the time
- zone returned by g_time_zone_new_utc().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- </constructor>
- <constructor name="new_utc"
- c:identifier="g_date_time_new_utc"
- version="2.26">
- <doc xml:space="preserve">Creates a new #GDateTime corresponding to the given date and time in
- UTC.
- This call is equivalent to calling g_date_time_new() with the time
- zone returned by g_time_zone_new_utc().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a #GDateTime, or %NULL</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">the year component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="month" transfer-ownership="none">
- <doc xml:space="preserve">the month component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="day" transfer-ownership="none">
- <doc xml:space="preserve">the day component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="hour" transfer-ownership="none">
- <doc xml:space="preserve">the hour component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="minute" transfer-ownership="none">
- <doc xml:space="preserve">the minute component of the date</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="seconds" transfer-ownership="none">
- <doc xml:space="preserve">the number of seconds past the minute</doc>
- <type name="gdouble" c:type="gdouble"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="add" c:identifier="g_date_time_add" version="2.26">
- <doc xml:space="preserve">Creates a copy of @datetime and adds the specified timespan to the copy.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly created #GDateTime which should be freed with
- g_date_time_unref().</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- <parameter name="timespan" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeSpan</doc>
- <type name="TimeSpan" c:type="GTimeSpan"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_days"
- c:identifier="g_date_time_add_days"
- version="2.26">
- <doc xml:space="preserve">Creates a copy of @datetime and adds the specified number of days to the
- copy. Add negative values to subtract days.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly created #GDateTime which should be freed with
- g_date_time_unref().</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- <parameter name="days" transfer-ownership="none">
- <doc xml:space="preserve">the number of days</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_full"
- c:identifier="g_date_time_add_full"
- version="2.26">
- <doc xml:space="preserve">Creates a new #GDateTime adding the specified values to the current date and
- time in @datetime. Add negative values to subtract.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly created #GDateTime that should be freed with
- g_date_time_unref().</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- <parameter name="years" transfer-ownership="none">
- <doc xml:space="preserve">the number of years to add</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="months" transfer-ownership="none">
- <doc xml:space="preserve">the number of months to add</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="days" transfer-ownership="none">
- <doc xml:space="preserve">the number of days to add</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="hours" transfer-ownership="none">
- <doc xml:space="preserve">the number of hours to add</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="minutes" transfer-ownership="none">
- <doc xml:space="preserve">the number of minutes to add</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="seconds" transfer-ownership="none">
- <doc xml:space="preserve">the number of seconds to add</doc>
- <type name="gdouble" c:type="gdouble"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_hours"
- c:identifier="g_date_time_add_hours"
- version="2.26">
- <doc xml:space="preserve">Creates a copy of @datetime and adds the specified number of hours.
- Add negative values to subtract hours.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly created #GDateTime which should be freed with
- g_date_time_unref().</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- <parameter name="hours" transfer-ownership="none">
- <doc xml:space="preserve">the number of hours to add</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_minutes"
- c:identifier="g_date_time_add_minutes"
- version="2.26">
- <doc xml:space="preserve">Creates a copy of @datetime adding the specified number of minutes.
- Add negative values to subtract minutes.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly created #GDateTime which should be freed with
- g_date_time_unref().</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- <parameter name="minutes" transfer-ownership="none">
- <doc xml:space="preserve">the number of minutes to add</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_months"
- c:identifier="g_date_time_add_months"
- version="2.26">
- <doc xml:space="preserve">Creates a copy of @datetime and adds the specified number of months to the
- copy. Add negative values to subtract months.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly created #GDateTime which should be freed with
- g_date_time_unref().</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- <parameter name="months" transfer-ownership="none">
- <doc xml:space="preserve">the number of months</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_seconds"
- c:identifier="g_date_time_add_seconds"
- version="2.26">
- <doc xml:space="preserve">Creates a copy of @datetime and adds the specified number of seconds.
- Add negative values to subtract seconds.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly created #GDateTime which should be freed with
- g_date_time_unref().</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- <parameter name="seconds" transfer-ownership="none">
- <doc xml:space="preserve">the number of seconds to add</doc>
- <type name="gdouble" c:type="gdouble"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_weeks"
- c:identifier="g_date_time_add_weeks"
- version="2.26">
- <doc xml:space="preserve">Creates a copy of @datetime and adds the specified number of weeks to the
- copy. Add negative values to subtract weeks.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly created #GDateTime which should be freed with
- g_date_time_unref().</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- <parameter name="weeks" transfer-ownership="none">
- <doc xml:space="preserve">the number of weeks</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_years"
- c:identifier="g_date_time_add_years"
- version="2.26">
- <doc xml:space="preserve">Creates a copy of @datetime and adds the specified number of years to the
- copy. Add negative values to subtract years.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly created #GDateTime which should be freed with
- g_date_time_unref().</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- <parameter name="years" transfer-ownership="none">
- <doc xml:space="preserve">the number of years</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="difference"
- c:identifier="g_date_time_difference"
- version="2.26">
- <doc xml:space="preserve">Calculates the difference in time between @end and @begin. The
- #GTimeSpan that is returned is effectively @end - @begin (ie:
- positive if the first parameter is larger).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the difference between the two #GDateTime, as a time
- span expressed in microseconds.</doc>
- <type name="TimeSpan" c:type="GTimeSpan"/>
- </return-value>
- <parameters>
- <instance-parameter name="end" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- <parameter name="begin" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </parameter>
- </parameters>
- </method>
- <method name="format" c:identifier="g_date_time_format" version="2.26">
- <doc xml:space="preserve">Creates a newly allocated string representing the requested @format.
- The format strings understood by this function are a subset of the
- strftime() format language as specified by C99. The \%D, \%U and \%W
- conversions are not supported, nor is the 'E' modifier. The GNU
- extensions \%k, \%l, \%s and \%P are supported, however, as are the
- '0', '_' and '-' modifiers.
- In contrast to strftime(), this function always produces a UTF-8
- string, regardless of the current locale. Note that the rendering of
- many formats is locale-dependent and may not match the strftime()
- output exactly.
- The following format specifiers are supported:
- - \%a: the abbreviated weekday name according to the current locale
- - \%A: the full weekday name according to the current locale
- - \%b: the abbreviated month name according to the current locale
- - \%B: the full month name according to the current locale
- - \%c: the preferred date and time representation for the current locale
- - \%C: the century number (year/100) as a 2-digit integer (00-99)
- - \%d: the day of the month as a decimal number (range 01 to 31)
- - \%e: the day of the month as a decimal number (range 1 to 31)
- - \%F: equivalent to `%Y-%m-%d` (the ISO 8601 date format)
- - \%g: the last two digits of the ISO 8601 week-based year as a
- decimal number (00-99). This works well with \%V and \%u.
- - \%G: the ISO 8601 week-based year as a decimal number. This works
- well with \%V and \%u.
- - \%h: equivalent to \%b
- - \%H: the hour as a decimal number using a 24-hour clock (range 00 to 23)
- - \%I: the hour as a decimal number using a 12-hour clock (range 01 to 12)
- - \%j: the day of the year as a decimal number (range 001 to 366)
- - \%k: the hour (24-hour clock) as a decimal number (range 0 to 23);
- single digits are preceded by a blank
- - \%l: the hour (12-hour clock) as a decimal number (range 1 to 12);
- single digits are preceded by a blank
- - \%m: the month as a decimal number (range 01 to 12)
- - \%M: the minute as a decimal number (range 00 to 59)
- - \%p: either "AM" or "PM" according to the given time value, or the
- corresponding strings for the current locale. Noon is treated as
- "PM" and midnight as "AM".
- - \%P: like \%p but lowercase: "am" or "pm" or a corresponding string for
- the current locale
- - \%r: the time in a.m. or p.m. notation
- - \%R: the time in 24-hour notation (\%H:\%M)
- - \%s: the number of seconds since the Epoch, that is, since 1970-01-01
- 00:00:00 UTC
- - \%S: the second as a decimal number (range 00 to 60)
- - \%t: a tab character
- - \%T: the time in 24-hour notation with seconds (\%H:\%M:\%S)
- - \%u: the ISO 8601 standard day of the week as a decimal, range 1 to 7,
- Monday being 1. This works well with \%G and \%V.
- - \%V: the ISO 8601 standard week number of the current year as a decimal
- number, range 01 to 53, where week 1 is the first week that has at
- least 4 days in the new year. See g_date_time_get_week_of_year().
- This works well with \%G and \%u.
- - \%w: the day of the week as a decimal, range 0 to 6, Sunday being 0.
- This is not the ISO 8601 standard format -- use \%u instead.
- - \%x: the preferred date representation for the current locale without
- the time
- - \%X: the preferred time representation for the current locale without
- the date
- - \%y: the year as a decimal number without the century
- - \%Y: the year as a decimal number including the century
- - \%z: the time zone as an offset from UTC (+hhmm)
- - \%:z: the time zone as an offset from UTC (+hh:mm).
- This is a gnulib strftime() extension. Since: 2.38
- - \%::z: the time zone as an offset from UTC (+hh:mm:ss). This is a
- gnulib strftime() extension. Since: 2.38
- - \%:::z: the time zone as an offset from UTC, with : to necessary
- precision (e.g., -04, +05:30). This is a gnulib strftime() extension. Since: 2.38
- - \%Z: the time zone or name or abbreviation
- - \%\%: a literal \% character
- Some conversion specifications can be modified by preceding the
- conversion specifier by one or more modifier characters. The
- following modifiers are supported for many of the numeric
- conversions:
- - O: Use alternative numeric symbols, if the current locale supports those.
- - _: Pad a numeric result with spaces. This overrides the default padding
- for the specifier.
- - -: Do not pad a numeric result. This overrides the default padding
- for the specifier.
- - 0: Pad a numeric result with zeros. This overrides the default padding
- for the specifier.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string formatted to the requested format
- or %NULL in the case that there was an error. The string
- should be freed with g_free().</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">A #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a valid UTF-8 string, containing the format for the
- #GDateTime</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_day_of_month"
- c:identifier="g_date_time_get_day_of_month"
- version="2.26">
- <doc xml:space="preserve">Retrieves the day of the month represented by @datetime in the gregorian
- calendar.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the day of the month</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_day_of_week"
- c:identifier="g_date_time_get_day_of_week"
- version="2.26">
- <doc xml:space="preserve">Retrieves the ISO 8601 day of the week on which @datetime falls (1 is
- Monday, 2 is Tuesday... 7 is Sunday).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the day of the week</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_day_of_year"
- c:identifier="g_date_time_get_day_of_year"
- version="2.26">
- <doc xml:space="preserve">Retrieves the day of the year represented by @datetime in the Gregorian
- calendar.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the day of the year</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_hour"
- c:identifier="g_date_time_get_hour"
- version="2.26">
- <doc xml:space="preserve">Retrieves the hour of the day represented by @datetime</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the hour of the day</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_microsecond"
- c:identifier="g_date_time_get_microsecond"
- version="2.26">
- <doc xml:space="preserve">Retrieves the microsecond of the date represented by @datetime</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the microsecond of the second</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_minute"
- c:identifier="g_date_time_get_minute"
- version="2.26">
- <doc xml:space="preserve">Retrieves the minute of the hour represented by @datetime</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the minute of the hour</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_month"
- c:identifier="g_date_time_get_month"
- version="2.26">
- <doc xml:space="preserve">Retrieves the month of the year represented by @datetime in the Gregorian
- calendar.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the month represented by @datetime</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_second"
- c:identifier="g_date_time_get_second"
- version="2.26">
- <doc xml:space="preserve">Retrieves the second of the minute represented by @datetime</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the second represented by @datetime</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_seconds"
- c:identifier="g_date_time_get_seconds"
- version="2.26">
- <doc xml:space="preserve">Retrieves the number of seconds since the start of the last minute,
- including the fractional part.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of seconds</doc>
- <type name="gdouble" c:type="gdouble"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_timezone_abbreviation"
- c:identifier="g_date_time_get_timezone_abbreviation"
- version="2.26">
- <doc xml:space="preserve">Determines the time zone abbreviation to be used at the time and in
- the time zone of @datetime.
- For example, in Toronto this is currently "EST" during the winter
- months and "EDT" during the summer months when daylight savings
- time is in effect.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the time zone abbreviation. The returned
- string is owned by the #GDateTime and it should not be
- modified or freed</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_utc_offset"
- c:identifier="g_date_time_get_utc_offset"
- version="2.26">
- <doc xml:space="preserve">Determines the offset to UTC in effect at the time and in the time
- zone of @datetime.
- The offset is the number of microseconds that you add to UTC time to
- arrive at local time for the time zone (ie: negative numbers for time
- zones west of GMT, positive numbers for east).
- If @datetime represents UTC time, then the offset is always zero.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of microseconds that should be added to UTC to
- get the local time</doc>
- <type name="TimeSpan" c:type="GTimeSpan"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_week_numbering_year"
- c:identifier="g_date_time_get_week_numbering_year"
- version="2.26">
- <doc xml:space="preserve">Returns the ISO 8601 week-numbering year in which the week containing
- @datetime falls.
- This function, taken together with g_date_time_get_week_of_year() and
- g_date_time_get_day_of_week() can be used to determine the full ISO
- week date on which @datetime falls.
- This is usually equal to the normal Gregorian year (as returned by
- g_date_time_get_year()), except as detailed below:
- For Thursday, the week-numbering year is always equal to the usual
- calendar year. For other days, the number is such that every day
- within a complete week (Monday to Sunday) is contained within the
- same week-numbering year.
- For Monday, Tuesday and Wednesday occurring near the end of the year,
- this may mean that the week-numbering year is one greater than the
- calendar year (so that these days have the same week-numbering year
- as the Thursday occurring early in the next year).
- For Friday, Saturday and Sunday occurring near the start of the year,
- this may mean that the week-numbering year is one less than the
- calendar year (so that these days have the same week-numbering year
- as the Thursday occurring late in the previous year).
- An equivalent description is that the week-numbering year is equal to
- the calendar year containing the majority of the days in the current
- week (Monday to Sunday).
- Note that January 1 0001 in the proleptic Gregorian calendar is a
- Monday, so this function never returns 0.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ISO 8601 week-numbering year for @datetime</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_week_of_year"
- c:identifier="g_date_time_get_week_of_year"
- version="2.26">
- <doc xml:space="preserve">Returns the ISO 8601 week number for the week containing @datetime.
- The ISO 8601 week number is the same for every day of the week (from
- Moday through Sunday). That can produce some unusual results
- (described below).
- The first week of the year is week 1. This is the week that contains
- the first Thursday of the year. Equivalently, this is the first week
- that has more than 4 of its days falling within the calendar year.
- The value 0 is never returned by this function. Days contained
- within a year but occurring before the first ISO 8601 week of that
- year are considered as being contained in the last week of the
- previous year. Similarly, the final days of a calendar year may be
- considered as being part of the first ISO 8601 week of the next year
- if 4 or more days of that week are contained within the new year.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ISO 8601 week number for @datetime.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_year"
- c:identifier="g_date_time_get_year"
- version="2.26">
- <doc xml:space="preserve">Retrieves the year represented by @datetime in the Gregorian calendar.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the year represented by @datetime</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">A #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_ymd" c:identifier="g_date_time_get_ymd" version="2.26">
- <doc xml:space="preserve">Retrieves the Gregorian day, month, and year of a given #GDateTime.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime.</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- <parameter name="year"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">the return location for the gregorian year, or %NULL.</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- <parameter name="month"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">the return location for the month of the year, or %NULL.</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- <parameter name="day"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">the return location for the day of the month, or %NULL.</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- </parameters>
- </method>
- <method name="is_daylight_savings"
- c:identifier="g_date_time_is_daylight_savings"
- version="2.26">
- <doc xml:space="preserve">Determines if daylight savings time is in effect at the time and in
- the time zone of @datetime.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if daylight savings time is in effect</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_date_time_ref" version="2.26">
- <doc xml:space="preserve">Atomically increments the reference count of @datetime by one.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the #GDateTime with the reference count increased</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="to_local"
- c:identifier="g_date_time_to_local"
- version="2.26">
- <doc xml:space="preserve">Creates a new #GDateTime corresponding to the same instant in time as
- @datetime, but in the local time zone.
- This call is equivalent to calling g_date_time_to_timezone() with the
- time zone returned by g_time_zone_new_local().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly created #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="to_timeval"
- c:identifier="g_date_time_to_timeval"
- version="2.26">
- <doc xml:space="preserve">Stores the instant in time that @datetime represents into @tv.
- The time contained in a #GTimeVal is always stored in the form of
- seconds elapsed since 1970-01-01 00:00:00 UTC, regardless of the time
- zone associated with @datetime.
- On systems where 'long' is 32bit (ie: all 32bit systems and all
- Windows systems), a #GTimeVal is incapable of storing the entire
- range of values that #GDateTime is capable of expressing. On those
- systems, this function returns %FALSE to indicate that the time is
- out of range.
- On systems where 'long' is 64bit, this function never fails.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if successful, else %FALSE</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- <parameter name="tv" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeVal to modify</doc>
- <type name="TimeVal" c:type="GTimeVal*"/>
- </parameter>
- </parameters>
- </method>
- <method name="to_timezone"
- c:identifier="g_date_time_to_timezone"
- version="2.26">
- <doc xml:space="preserve">Create a new #GDateTime corresponding to the same instant in time as
- @datetime, but in the time zone @tz.
- This call can fail in the case that the time goes out of bounds. For
- example, converting 0001-01-01 00:00:00 UTC to a time zone west of
- Greenwich will fail (due to the year 0 being out of range).
- You should release the return value by calling g_date_time_unref()
- when you are done with it.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GDateTime, or %NULL</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- <parameter name="tz" transfer-ownership="none">
- <doc xml:space="preserve">the new #GTimeZone</doc>
- <type name="TimeZone" c:type="GTimeZone*"/>
- </parameter>
- </parameters>
- </method>
- <method name="to_unix" c:identifier="g_date_time_to_unix" version="2.26">
- <doc xml:space="preserve">Gives the Unix time corresponding to @datetime, rounding down to the
- nearest second.
- Unix time is the number of seconds that have elapsed since 1970-01-01
- 00:00:00 UTC, regardless of the time zone associated with @datetime.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the Unix time corresponding to @datetime</doc>
- <type name="gint64" c:type="gint64"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="to_utc" c:identifier="g_date_time_to_utc" version="2.26">
- <doc xml:space="preserve">Creates a new #GDateTime corresponding to the same instant in time as
- @datetime, but in UTC.
- This call is equivalent to calling g_date_time_to_timezone() with the
- time zone returned by g_time_zone_new_utc().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly created #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_date_time_unref" version="2.26">
- <doc xml:space="preserve">Atomically decrements the reference count of @datetime by one.
- When the reference count reaches zero, the resources allocated by
- @datetime are freed</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="DateTime" c:type="GDateTime*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="compare"
- c:identifier="g_date_time_compare"
- version="2.26">
- <doc xml:space="preserve">A comparison function for #GDateTimes that is suitable
- as a #GCompareFunc. Both #GDateTimes must be non-%NULL.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">-1, 0 or 1 if @dt1 is less than, equal to or greater
- than @dt2.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="dt1" transfer-ownership="none">
- <doc xml:space="preserve">first #GDateTime to compare</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="dt2" transfer-ownership="none">
- <doc xml:space="preserve">second #GDateTime to compare</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="equal" c:identifier="g_date_time_equal" version="2.26">
- <doc xml:space="preserve">Checks to see if @dt1 and @dt2 are equal.
- Equal here means that they represent the same moment after converting
- them to the same time zone.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @dt1 and @dt2 are equal</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="dt1" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="dt2" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="hash" c:identifier="g_date_time_hash" version="2.26">
- <doc xml:space="preserve">Hashes @datetime into a #guint, suitable for use within #GHashTable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #guint containing the hash</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <enumeration name="DateWeekday" c:type="GDateWeekday">
- <doc xml:space="preserve">Enumeration representing a day of the week; #G_DATE_MONDAY,
- #G_DATE_TUESDAY, etc. #G_DATE_BAD_WEEKDAY is an invalid weekday.</doc>
- <member name="bad_weekday" value="0" c:identifier="G_DATE_BAD_WEEKDAY">
- <doc xml:space="preserve">invalid value</doc>
- </member>
- <member name="monday" value="1" c:identifier="G_DATE_MONDAY">
- <doc xml:space="preserve">Monday</doc>
- </member>
- <member name="tuesday" value="2" c:identifier="G_DATE_TUESDAY">
- <doc xml:space="preserve">Tuesday</doc>
- </member>
- <member name="wednesday" value="3" c:identifier="G_DATE_WEDNESDAY">
- <doc xml:space="preserve">Wednesday</doc>
- </member>
- <member name="thursday" value="4" c:identifier="G_DATE_THURSDAY">
- <doc xml:space="preserve">Thursday</doc>
- </member>
- <member name="friday" value="5" c:identifier="G_DATE_FRIDAY">
- <doc xml:space="preserve">Friday</doc>
- </member>
- <member name="saturday" value="6" c:identifier="G_DATE_SATURDAY">
- <doc xml:space="preserve">Saturday</doc>
- </member>
- <member name="sunday" value="7" c:identifier="G_DATE_SUNDAY">
- <doc xml:space="preserve">Sunday</doc>
- </member>
- </enumeration>
- <record name="DebugKey" c:type="GDebugKey">
- <doc xml:space="preserve">Associates a string with a bit flag.
- Used in g_parse_debug_string().</doc>
- <field name="key" writable="1">
- <doc xml:space="preserve">the string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </field>
- <field name="value" writable="1">
- <doc xml:space="preserve">the flag</doc>
- <type name="guint" c:type="guint"/>
- </field>
- </record>
- <callback name="DestroyNotify" c:type="GDestroyNotify">
- <doc xml:space="preserve">Specifies the type of function which is called when a data element
- is destroyed. It is passed the pointer to the data element and
- should free any memory and resources allocated for it.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data element.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <record name="Dir" c:type="GDir" disguised="1">
- <doc xml:space="preserve">An opaque structure representing an opened directory.</doc>
- <method name="close" c:identifier="g_dir_close">
- <doc xml:space="preserve">Closes the directory and deallocates all related resources.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="dir" transfer-ownership="none">
- <doc xml:space="preserve">a #GDir* created by g_dir_open()</doc>
- <type name="Dir" c:type="GDir*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="read_name" c:identifier="g_dir_read_name">
- <doc xml:space="preserve">Retrieves the name of another entry in the directory, or %NULL.
- The order of entries returned from this function is not defined,
- and may vary by file system or other operating-system dependent
- factors.
- %NULL may also be returned in case of errors. On Unix, you can
- check `errno` to find out if %NULL was returned because of an error.
- On Unix, the '.' and '..' entries are omitted, and the returned
- name is in the on-disk encoding.
- On Windows, as is true of all GLib functions which operate on
- filenames, the returned name is in UTF-8.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">The entry's name or %NULL if there are no
- more entries. The return value is owned by GLib and
- must not be modified or freed.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="dir" transfer-ownership="none">
- <doc xml:space="preserve">a #GDir* created by g_dir_open()</doc>
- <type name="Dir" c:type="GDir*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="rewind" c:identifier="g_dir_rewind">
- <doc xml:space="preserve">Resets the given directory. The next call to g_dir_read_name()
- will return the first entry again.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="dir" transfer-ownership="none">
- <doc xml:space="preserve">a #GDir* created by g_dir_open()</doc>
- <type name="Dir" c:type="GDir*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="make_tmp"
- c:identifier="g_dir_make_tmp"
- version="2.30"
- throws="1">
- <doc xml:space="preserve">Creates a subdirectory in the preferred directory for temporary
- files (as returned by g_get_tmp_dir()).
- @tmpl should be a string in the GLib file name encoding containing
- a sequence of six 'X' characters, as the parameter to g_mkstemp().
- However, unlike these functions, the template should only be a
- basename, no directory components are allowed. If template is
- %NULL, a default template is used.
- Note that in contrast to g_mkdtemp() (and mkdtemp()) @tmpl is not
- modified, and might thus be a read-only literal string.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">The actual name used. This string
- should be freed with g_free() when not needed any longer and is
- is in the GLib file name encoding. In case of errors, %NULL is
- returned and @error will be set.</doc>
- <type name="filename" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="tmpl"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">Template for directory name,
- as in g_mkdtemp(), basename only, or %NULL for a default template</doc>
- <type name="filename" c:type="gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="open"
- c:identifier="g_dir_open"
- introspectable="0"
- throws="1">
- <doc xml:space="preserve">Opens a directory for reading. The names of the files in the
- directory can then be retrieved using g_dir_read_name(). Note
- that the ordering is not defined.</doc>
- <return-value>
- <doc xml:space="preserve">a newly allocated #GDir on success, %NULL on failure.
- If non-%NULL, you must free the result with g_dir_close()
- when you are finished with it.</doc>
- <type name="Dir" c:type="GDir*"/>
- </return-value>
- <parameters>
- <parameter name="path" transfer-ownership="none">
- <doc xml:space="preserve">the path to the directory you are interested in. On Unix
- in the on-disk encoding. On Windows in UTF-8</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">Currently must be set to 0. Reserved for future use.</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <union name="DoubleIEEE754" c:type="GDoubleIEEE754">
- <doc xml:space="preserve">The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the sign,
- mantissa and exponent of IEEE floats and doubles. These unions are defined
- as appropriate for a given platform. IEEE floats and doubles are supported
- (used for storage) by at least Intel, PPC and Sparc.</doc>
- <field name="v_double" writable="1">
- <doc xml:space="preserve">the double value</doc>
- <type name="gdouble" c:type="gdouble"/>
- </field>
- <record name="mpn" c:type="mpn">
- <field name="mantissa_low" writable="1" bits="32">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="mantissa_high" writable="1" bits="20">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="biased_exponent" writable="1" bits="11">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="sign" writable="1" bits="1">
- <type name="guint" c:type="guint"/>
- </field>
- </record>
- </union>
- <callback name="DuplicateFunc" c:type="GDuplicateFunc">
- <doc xml:space="preserve">The type of functions that are used to 'duplicate' an object.
- What this means depends on the context, it could just be
- incrementing the reference count, if @data is a ref-counted
- object.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">a duplicate of data</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to duplicate</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="1">
- <doc xml:space="preserve">user data that was specified in g_datalist_id_dup_data()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <constant name="E" value="2.718282" c:type="G_E">
- <doc xml:space="preserve">The base of natural logarithms.</doc>
- <type name="gdouble" c:type="gdouble"/>
- </constant>
- <callback name="EqualFunc" c:type="GEqualFunc">
- <doc xml:space="preserve">Specifies the type of a function used to test two values for
- equality. The function should return %TRUE if both values are equal
- and %FALSE otherwise.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @a = @b; %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="a"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a value</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="b"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a value to compare with</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </callback>
- <record name="Error"
- c:type="GError"
- glib:type-name="GError"
- glib:get-type="g_error_get_type"
- c:symbol-prefix="error">
- <doc xml:space="preserve">The `GError` structure contains information about
- an error that has occurred.</doc>
- <field name="domain" writable="1">
- <doc xml:space="preserve">error domain, e.g. #G_FILE_ERROR</doc>
- <type name="Quark" c:type="GQuark"/>
- </field>
- <field name="code" writable="1">
- <doc xml:space="preserve">error code, e.g. %G_FILE_ERROR_NOENT</doc>
- <type name="gint" c:type="gint"/>
- </field>
- <field name="message" writable="1">
- <doc xml:space="preserve">human-readable informative error message</doc>
- <type name="utf8" c:type="gchar*"/>
- </field>
- <constructor name="new" c:identifier="g_error_new" introspectable="0">
- <doc xml:space="preserve">Creates a new #GError with the given @domain and @code,
- and a message formatted with @format.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GError</doc>
- <type name="Error" c:type="GError*"/>
- </return-value>
- <parameters>
- <parameter name="domain" transfer-ownership="none">
- <doc xml:space="preserve">error domain</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- <parameter name="code" transfer-ownership="none">
- <doc xml:space="preserve">error code</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">printf()-style format for error message</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">parameters for message format</doc>
- <varargs/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_literal" c:identifier="g_error_new_literal">
- <doc xml:space="preserve">Creates a new #GError; unlike g_error_new(), @message is
- not a printf()-style format string. Use this function if
- @message contains text you don't have control over,
- that could include printf() escape sequences.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GError</doc>
- <type name="Error" c:type="GError*"/>
- </return-value>
- <parameters>
- <parameter name="domain" transfer-ownership="none">
- <doc xml:space="preserve">error domain</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- <parameter name="code" transfer-ownership="none">
- <doc xml:space="preserve">error code</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="message" transfer-ownership="none">
- <doc xml:space="preserve">error message</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_valist"
- c:identifier="g_error_new_valist"
- version="2.22"
- introspectable="0">
- <doc xml:space="preserve">Creates a new #GError with the given @domain and @code,
- and a message formatted with @format.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GError</doc>
- <type name="Error" c:type="GError*"/>
- </return-value>
- <parameters>
- <parameter name="domain" transfer-ownership="none">
- <doc xml:space="preserve">error domain</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- <parameter name="code" transfer-ownership="none">
- <doc xml:space="preserve">error code</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">printf()-style format for error message</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="args" transfer-ownership="none">
- <doc xml:space="preserve">#va_list of parameters for the message format</doc>
- <type name="va_list" c:type="va_list"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="copy" c:identifier="g_error_copy">
- <doc xml:space="preserve">Makes a copy of @error.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GError</doc>
- <type name="Error" c:type="GError*"/>
- </return-value>
- <parameters>
- <instance-parameter name="error" transfer-ownership="none">
- <doc xml:space="preserve">a #GError</doc>
- <type name="Error" c:type="const GError*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_error_free">
- <doc xml:space="preserve">Frees a #GError and associated resources.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="error" transfer-ownership="none">
- <doc xml:space="preserve">a #GError</doc>
- <type name="Error" c:type="GError*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="matches" c:identifier="g_error_matches">
- <doc xml:space="preserve">Returns %TRUE if @error matches @domain and @code, %FALSE
- otherwise. In particular, when @error is %NULL, %FALSE will
- be returned.
- If @domain contains a `FAILED` (or otherwise generic) error code,
- you should generally not check for it explicitly, but should
- instead treat any not-explicitly-recognized error code as being
- equivalent to the `FAILED` code. This way, if the domain is
- extended in the future to provide a more specific error code for
- a certain case, your code will still work.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">whether @error has @domain and @code</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="error"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GError</doc>
- <type name="Error" c:type="const GError*"/>
- </instance-parameter>
- <parameter name="domain" transfer-ownership="none">
- <doc xml:space="preserve">an error domain</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- <parameter name="code" transfer-ownership="none">
- <doc xml:space="preserve">an error code</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- </record>
- <enumeration name="ErrorType" c:type="GErrorType">
- <doc xml:space="preserve">The possible errors, used in the @v_error field
- of #GTokenValue, when the token is a %G_TOKEN_ERROR.</doc>
- <member name="unknown" value="0" c:identifier="G_ERR_UNKNOWN">
- <doc xml:space="preserve">unknown error</doc>
- </member>
- <member name="unexp_eof" value="1" c:identifier="G_ERR_UNEXP_EOF">
- <doc xml:space="preserve">unexpected end of file</doc>
- </member>
- <member name="unexp_eof_in_string"
- value="2"
- c:identifier="G_ERR_UNEXP_EOF_IN_STRING">
- <doc xml:space="preserve">unterminated string constant</doc>
- </member>
- <member name="unexp_eof_in_comment"
- value="3"
- c:identifier="G_ERR_UNEXP_EOF_IN_COMMENT">
- <doc xml:space="preserve">unterminated comment</doc>
- </member>
- <member name="non_digit_in_const"
- value="4"
- c:identifier="G_ERR_NON_DIGIT_IN_CONST">
- <doc xml:space="preserve">non-digit character in a number</doc>
- </member>
- <member name="digit_radix" value="5" c:identifier="G_ERR_DIGIT_RADIX">
- <doc xml:space="preserve">digit beyond radix in a number</doc>
- </member>
- <member name="float_radix" value="6" c:identifier="G_ERR_FLOAT_RADIX">
- <doc xml:space="preserve">non-decimal floating point number</doc>
- </member>
- <member name="float_malformed"
- value="7"
- c:identifier="G_ERR_FLOAT_MALFORMED">
- <doc xml:space="preserve">malformed floating point number</doc>
- </member>
- </enumeration>
- <enumeration name="FileError"
- c:type="GFileError"
- glib:error-domain="g-file-error-quark">
- <doc xml:space="preserve">Values corresponding to @errno codes returned from file operations
- on UNIX. Unlike @errno codes, GFileError values are available on
- all systems, even Windows. The exact meaning of each code depends
- on what sort of file operation you were performing; the UNIX
- documentation gives more details. The following error code descriptions
- come from the GNU C Library manual, and are under the copyright
- of that manual.
- It's not very portable to make detailed assumptions about exactly
- which errors will be returned from a given operation. Some errors
- don't occur on some systems, etc., sometimes there are subtle
- differences in when a system will report a given error, etc.</doc>
- <member name="exist" value="0" c:identifier="G_FILE_ERROR_EXIST">
- <doc xml:space="preserve">Operation not permitted; only the owner of
- the file (or other resource) or processes with special privileges
- can perform the operation.</doc>
- </member>
- <member name="isdir" value="1" c:identifier="G_FILE_ERROR_ISDIR">
- <doc xml:space="preserve">File is a directory; you cannot open a directory
- for writing, or create or remove hard links to it.</doc>
- </member>
- <member name="acces" value="2" c:identifier="G_FILE_ERROR_ACCES">
- <doc xml:space="preserve">Permission denied; the file permissions do not
- allow the attempted operation.</doc>
- </member>
- <member name="nametoolong"
- value="3"
- c:identifier="G_FILE_ERROR_NAMETOOLONG">
- <doc xml:space="preserve">Filename too long.</doc>
- </member>
- <member name="noent" value="4" c:identifier="G_FILE_ERROR_NOENT">
- <doc xml:space="preserve">No such file or directory. This is a "file
- doesn't exist" error for ordinary files that are referenced in
- contexts where they are expected to already exist.</doc>
- </member>
- <member name="notdir" value="5" c:identifier="G_FILE_ERROR_NOTDIR">
- <doc xml:space="preserve">A file that isn't a directory was specified when
- a directory is required.</doc>
- </member>
- <member name="nxio" value="6" c:identifier="G_FILE_ERROR_NXIO">
- <doc xml:space="preserve">No such device or address. The system tried to
- use the device represented by a file you specified, and it
- couldn't find the device. This can mean that the device file was
- installed incorrectly, or that the physical device is missing or
- not correctly attached to the computer.</doc>
- </member>
- <member name="nodev" value="7" c:identifier="G_FILE_ERROR_NODEV">
- <doc xml:space="preserve">The underlying file system of the specified file
- does not support memory mapping.</doc>
- </member>
- <member name="rofs" value="8" c:identifier="G_FILE_ERROR_ROFS">
- <doc xml:space="preserve">The directory containing the new link can't be
- modified because it's on a read-only file system.</doc>
- </member>
- <member name="txtbsy" value="9" c:identifier="G_FILE_ERROR_TXTBSY">
- <doc xml:space="preserve">Text file busy.</doc>
- </member>
- <member name="fault" value="10" c:identifier="G_FILE_ERROR_FAULT">
- <doc xml:space="preserve">You passed in a pointer to bad memory.
- (GLib won't reliably return this, don't pass in pointers to bad
- memory.)</doc>
- </member>
- <member name="loop" value="11" c:identifier="G_FILE_ERROR_LOOP">
- <doc xml:space="preserve">Too many levels of symbolic links were encountered
- in looking up a file name. This often indicates a cycle of symbolic
- links.</doc>
- </member>
- <member name="nospc" value="12" c:identifier="G_FILE_ERROR_NOSPC">
- <doc xml:space="preserve">No space left on device; write operation on a
- file failed because the disk is full.</doc>
- </member>
- <member name="nomem" value="13" c:identifier="G_FILE_ERROR_NOMEM">
- <doc xml:space="preserve">No memory available. The system cannot allocate
- more virtual memory because its capacity is full.</doc>
- </member>
- <member name="mfile" value="14" c:identifier="G_FILE_ERROR_MFILE">
- <doc xml:space="preserve">The current process has too many files open and
- can't open any more. Duplicate descriptors do count toward this
- limit.</doc>
- </member>
- <member name="nfile" value="15" c:identifier="G_FILE_ERROR_NFILE">
- <doc xml:space="preserve">There are too many distinct file openings in the
- entire system.</doc>
- </member>
- <member name="badf" value="16" c:identifier="G_FILE_ERROR_BADF">
- <doc xml:space="preserve">Bad file descriptor; for example, I/O on a
- descriptor that has been closed or reading from a descriptor open
- only for writing (or vice versa).</doc>
- </member>
- <member name="inval" value="17" c:identifier="G_FILE_ERROR_INVAL">
- <doc xml:space="preserve">Invalid argument. This is used to indicate
- various kinds of problems with passing the wrong argument to a
- library function.</doc>
- </member>
- <member name="pipe" value="18" c:identifier="G_FILE_ERROR_PIPE">
- <doc xml:space="preserve">Broken pipe; there is no process reading from the
- other end of a pipe. Every library function that returns this
- error code also generates a 'SIGPIPE' signal; this signal
- terminates the program if not handled or blocked. Thus, your
- program will never actually see this code unless it has handled
- or blocked 'SIGPIPE'.</doc>
- </member>
- <member name="again" value="19" c:identifier="G_FILE_ERROR_AGAIN">
- <doc xml:space="preserve">Resource temporarily unavailable; the call might
- work if you try again later.</doc>
- </member>
- <member name="intr" value="20" c:identifier="G_FILE_ERROR_INTR">
- <doc xml:space="preserve">Interrupted function call; an asynchronous signal
- occurred and prevented completion of the call. When this
- happens, you should try the call again.</doc>
- </member>
- <member name="io" value="21" c:identifier="G_FILE_ERROR_IO">
- <doc xml:space="preserve">Input/output error; usually used for physical read
- or write errors. i.e. the disk or other physical device hardware
- is returning errors.</doc>
- </member>
- <member name="perm" value="22" c:identifier="G_FILE_ERROR_PERM">
- <doc xml:space="preserve">Operation not permitted; only the owner of the
- file (or other resource) or processes with special privileges can
- perform the operation.</doc>
- </member>
- <member name="nosys" value="23" c:identifier="G_FILE_ERROR_NOSYS">
- <doc xml:space="preserve">Function not implemented; this indicates that
- the system is missing some functionality.</doc>
- </member>
- <member name="failed" value="24" c:identifier="G_FILE_ERROR_FAILED">
- <doc xml:space="preserve">Does not correspond to a UNIX error code; this
- is the standard "failed for unspecified reason" error code present
- in all #GError error code enumerations. Returned if no specific
- code applies.</doc>
- </member>
- </enumeration>
- <bitfield name="FileTest" c:type="GFileTest">
- <doc xml:space="preserve">A test to perform on a file using g_file_test().</doc>
- <member name="is_regular"
- value="1"
- c:identifier="G_FILE_TEST_IS_REGULAR">
- <doc xml:space="preserve">%TRUE if the file is a regular file
- (not a directory). Note that this test will also return %TRUE
- if the tested file is a symlink to a regular file.</doc>
- </member>
- <member name="is_symlink"
- value="2"
- c:identifier="G_FILE_TEST_IS_SYMLINK">
- <doc xml:space="preserve">%TRUE if the file is a symlink.</doc>
- </member>
- <member name="is_dir" value="4" c:identifier="G_FILE_TEST_IS_DIR">
- <doc xml:space="preserve">%TRUE if the file is a directory.</doc>
- </member>
- <member name="is_executable"
- value="8"
- c:identifier="G_FILE_TEST_IS_EXECUTABLE">
- <doc xml:space="preserve">%TRUE if the file is executable.</doc>
- </member>
- <member name="exists" value="16" c:identifier="G_FILE_TEST_EXISTS">
- <doc xml:space="preserve">%TRUE if the file exists. It may or may not
- be a regular file.</doc>
- </member>
- </bitfield>
- <union name="FloatIEEE754" c:type="GFloatIEEE754">
- <doc xml:space="preserve">The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the sign,
- mantissa and exponent of IEEE floats and doubles. These unions are defined
- as appropriate for a given platform. IEEE floats and doubles are supported
- (used for storage) by at least Intel, PPC and Sparc.</doc>
- <field name="v_float" writable="1">
- <doc xml:space="preserve">the double value</doc>
- <type name="gfloat" c:type="gfloat"/>
- </field>
- <record name="mpn" c:type="mpn">
- <field name="mantissa" writable="1" bits="23">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="biased_exponent" writable="1" bits="8">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="sign" writable="1" bits="1">
- <type name="guint" c:type="guint"/>
- </field>
- </record>
- </union>
- <bitfield name="FormatSizeFlags" c:type="GFormatSizeFlags">
- <doc xml:space="preserve">Flags to modify the format of the string returned by g_format_size_full().</doc>
- <member name="default" value="0" c:identifier="G_FORMAT_SIZE_DEFAULT">
- <doc xml:space="preserve">behave the same as g_format_size()</doc>
- </member>
- <member name="long_format"
- value="1"
- c:identifier="G_FORMAT_SIZE_LONG_FORMAT">
- <doc xml:space="preserve">include the exact number of bytes as part
- of the returned string. For example, "45.6 kB (45,612 bytes)".</doc>
- </member>
- <member name="iec_units"
- value="2"
- c:identifier="G_FORMAT_SIZE_IEC_UNITS">
- <doc xml:space="preserve">use IEC (base 1024) units with "KiB"-style
- suffixes. IEC units should only be used for reporting things with
- a strong "power of 2" basis, like RAM sizes or RAID stripe sizes.
- Network and storage sizes should be reported in the normal SI units.</doc>
- </member>
- </bitfield>
- <callback name="FreeFunc" c:type="GFreeFunc">
- <doc xml:space="preserve">Declares a type of function which takes an arbitrary
- data pointer argument and has no return value. It is
- not currently used in GLib or GTK+.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a data pointer</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <callback name="Func" c:type="GFunc">
- <doc xml:space="preserve">Specifies the type of functions passed to g_list_foreach() and
- g_slist_foreach().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the element's data</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="1">
- <doc xml:space="preserve">user data passed to g_list_foreach() or g_slist_foreach()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <constant name="GINT16_FORMAT" value="hi" c:type="G_GINT16_FORMAT">
- <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning and
- printing values of type #gint16. It is a string literal, but doesn't
- include the percent-sign, such that you can add precision and length
- modifiers between percent-sign and conversion specifier.
- |[<!-- language="C" -->
- gint16 in;
- gint32 out;
- sscanf ("42", "%" G_GINT16_FORMAT, &in)
- out = in * 1000;
- g_print ("%" G_GINT32_FORMAT, out);
- ]|</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GINT16_MODIFIER"
- value="h"
- c:type="G_GINT16_MODIFIER"
- version="2.4">
- <doc xml:space="preserve">The platform dependent length modifier for conversion specifiers
- for scanning and printing values of type #gint16 or #guint16. It
- is a string literal, but doesn't include the percent-sign, such
- that you can add precision and length modifiers between percent-sign
- and conversion specifier and append a conversion specifier.
- The following example prints "0x7b";
- |[<!-- language="C" -->
- gint16 value = 123;
- g_print ("%#" G_GINT16_MODIFIER "x", value);
- ]|</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GINT32_FORMAT" value="i" c:type="G_GINT32_FORMAT">
- <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
- and printing values of type #gint32. See also #G_GINT16_FORMAT.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GINT32_MODIFIER"
- value=""
- c:type="G_GINT32_MODIFIER"
- version="2.4">
- <doc xml:space="preserve">The platform dependent length modifier for conversion specifiers
- for scanning and printing values of type #gint32 or #guint32. It
- is a string literal. See also #G_GINT16_MODIFIER.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GINT64_FORMAT" value="lli" c:type="G_GINT64_FORMAT">
- <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
- and printing values of type #gint64. See also #G_GINT16_FORMAT.
- Some platforms do not support scanning and printing 64-bit integers,
- even though the types are supported. On such platforms %G_GINT64_FORMAT
- is not defined. Note that scanf() may not support 64-bit integers, even
- if %G_GINT64_FORMAT is defined. Due to its weak error handling, scanf()
- is not recommended for parsing anyway; consider using g_ascii_strtoull()
- instead.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GINT64_MODIFIER"
- value="ll"
- c:type="G_GINT64_MODIFIER"
- version="2.4">
- <doc xml:space="preserve">The platform dependent length modifier for conversion specifiers
- for scanning and printing values of type #gint64 or #guint64.
- It is a string literal.
- Some platforms do not support printing 64-bit integers, even
- though the types are supported. On such platforms %G_GINT64_MODIFIER
- is not defined.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GINTPTR_FORMAT"
- value="i"
- c:type="G_GINTPTR_FORMAT"
- version="2.22">
- <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
- and printing values of type #gintptr.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GINTPTR_MODIFIER"
- value=""
- c:type="G_GINTPTR_MODIFIER"
- version="2.22">
- <doc xml:space="preserve">The platform dependent length modifier for conversion specifiers
- for scanning and printing values of type #gintptr or #guintptr.
- It is a string literal.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GNUC_FUNCTION"
- value=""
- c:type="G_GNUC_FUNCTION"
- deprecated="1"
- deprecated-version="2.16">
- <doc xml:space="preserve">Expands to "" on all modern compilers, and to __FUNCTION__ on gcc
- version 2.x. Don't use it.</doc>
- <doc-deprecated xml:space="preserve">Use G_STRFUNC() instead</doc-deprecated>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GNUC_PRETTY_FUNCTION"
- value=""
- c:type="G_GNUC_PRETTY_FUNCTION"
- deprecated="1"
- deprecated-version="2.16">
- <doc xml:space="preserve">Expands to "" on all modern compilers, and to __PRETTY_FUNCTION__
- on gcc version 2.x. Don't use it.</doc>
- <doc-deprecated xml:space="preserve">Use G_STRFUNC() instead</doc-deprecated>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GSIZE_FORMAT"
- value="u"
- c:type="G_GSIZE_FORMAT"
- version="2.6">
- <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
- and printing values of type #gsize. See also #G_GINT16_FORMAT.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GSIZE_MODIFIER"
- value=""
- c:type="G_GSIZE_MODIFIER"
- version="2.6">
- <doc xml:space="preserve">The platform dependent length modifier for conversion specifiers
- for scanning and printing values of type #gsize. It
- is a string literal.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GSSIZE_FORMAT"
- value="i"
- c:type="G_GSSIZE_FORMAT"
- version="2.6">
- <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
- and printing values of type #gssize. See also #G_GINT16_FORMAT.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GSSIZE_MODIFIER"
- value=""
- c:type="G_GSSIZE_MODIFIER"
- version="2.6">
- <doc xml:space="preserve">The platform dependent length modifier for conversion specifiers
- for scanning and printing values of type #gssize. It
- is a string literal.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GUINT16_FORMAT" value="hu" c:type="G_GUINT16_FORMAT">
- <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
- and printing values of type #guint16. See also #G_GINT16_FORMAT</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GUINT32_FORMAT" value="u" c:type="G_GUINT32_FORMAT">
- <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
- and printing values of type #guint32. See also #G_GINT16_FORMAT.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GUINT64_FORMAT" value="llu" c:type="G_GUINT64_FORMAT">
- <doc xml:space="preserve">This is the platform dependent conversion specifier for scanning
- and printing values of type #guint64. See also #G_GINT16_FORMAT.
- Some platforms do not support scanning and printing 64-bit integers,
- even though the types are supported. On such platforms %G_GUINT64_FORMAT
- is not defined. Note that scanf() may not support 64-bit integers, even
- if %G_GINT64_FORMAT is defined. Due to its weak error handling, scanf()
- is not recommended for parsing anyway; consider using g_ascii_strtoull()
- instead.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="GUINTPTR_FORMAT"
- value="u"
- c:type="G_GUINTPTR_FORMAT"
- version="2.22">
- <doc xml:space="preserve">This is the platform dependent conversion specifier
- for scanning and printing values of type #guintptr.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="HAVE_GINT64" value="1" c:type="G_HAVE_GINT64">
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="HAVE_GNUC_VARARGS" value="1" c:type="G_HAVE_GNUC_VARARGS">
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="HAVE_GNUC_VISIBILITY"
- value="1"
- c:type="G_HAVE_GNUC_VISIBILITY">
- <doc xml:space="preserve">Defined to 1 if gcc-style visibility handling is supported.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="HAVE_GROWING_STACK"
- value="0"
- c:type="G_HAVE_GROWING_STACK">
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="HAVE_ISO_VARARGS" value="1" c:type="G_HAVE_ISO_VARARGS">
- <type name="gint" c:type="gint"/>
- </constant>
- <callback name="HFunc" c:type="GHFunc">
- <doc xml:space="preserve">Specifies the type of the function passed to g_hash_table_foreach().
- It is called with each key/value pair, together with the @user_data
- parameter which is passed to g_hash_table_foreach().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="value"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the value corresponding to the key</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="2">
- <doc xml:space="preserve">user data passed to g_hash_table_foreach()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <constant name="HOOK_FLAG_USER_SHIFT"
- value="4"
- c:type="G_HOOK_FLAG_USER_SHIFT">
- <doc xml:space="preserve">The position of the first bit which is not reserved for internal
- use be the #GHook implementation, i.e.
- `1 << G_HOOK_FLAG_USER_SHIFT` is the first
- bit which can be used for application-defined flags.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <callback name="HRFunc" c:type="GHRFunc">
- <doc xml:space="preserve">Specifies the type of the function passed to
- g_hash_table_foreach_remove(). It is called with each key/value
- pair, together with the @user_data parameter passed to
- g_hash_table_foreach_remove(). It should return %TRUE if the
- key/value pair should be removed from the #GHashTable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key/value pair should be removed from the
- #GHashTable</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="value"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the value associated with the key</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="2">
- <doc xml:space="preserve">user data passed to g_hash_table_remove()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <callback name="HashFunc" c:type="GHashFunc">
- <doc xml:space="preserve">Specifies the type of the hash function which is passed to
- g_hash_table_new() when a #GHashTable is created.
- The function is passed a key and should return a #guint hash value.
- The functions g_direct_hash(), g_int_hash() and g_str_hash() provide
- hash functions which can be used when the key is a #gpointer, #gint*,
- and #gchar* respectively.
- g_direct_hash() is also the appropriate hash function for keys
- of the form `GINT_TO_POINTER (n)` (or similar macros).
- <!-- FIXME: Need more here. --> A good hash functions should produce
- hash values that are evenly distributed over a fairly large range.
- The modulus is taken with the hash table size (a prime number) to
- find the 'bucket' to place each key into. The function should also
- be very fast, since it is called for each key lookup.
- Note that the hash functions provided by GLib have these qualities,
- but are not particularly robust against manufactured keys that
- cause hash collisions. Therefore, you should consider choosing
- a more secure hash function when using a GHashTable with keys
- that originate in untrusted data (such as HTTP requests).
- Using g_str_hash() in that situation might make your application
- vulerable to
- [Algorithmic Complexity Attacks](https://lwn.net/Articles/474912/).
- The key to choosing a good hash is unpredictability. Even
- cryptographic hashes are very easy to find collisions for when the
- remainder is taken modulo a somewhat predictable prime number. There
- must be an element of randomness that an attacker is unable to guess.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the hash value corresponding to the key</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </callback>
- <record name="HashTable"
- c:type="GHashTable"
- glib:type-name="GHashTable"
- glib:get-type="g_hash_table_get_type"
- c:symbol-prefix="hash_table">
- <doc xml:space="preserve">The #GHashTable struct is an opaque data structure to represent a
- [Hash Table][glib-Hash-Tables]. It should only be accessed via the
- following functions.</doc>
- <function name="add" c:identifier="g_hash_table_add" version="2.32">
- <doc xml:space="preserve">This is a convenience function for using a #GHashTable as a set. It
- is equivalent to calling g_hash_table_replace() with @key as both the
- key and the value.
- When a hash table only ever contains keys that have themselves as the
- corresponding value it is able to be stored more efficiently. See
- the discussion in the section description.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key did not exist yet</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key to insert</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="contains"
- c:identifier="g_hash_table_contains"
- version="2.32">
- <doc xml:space="preserve">Checks if @key is in @hash_table.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @key is in @hash_table, %FALSE otherwise.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key to check</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="destroy" c:identifier="g_hash_table_destroy">
- <doc xml:space="preserve">Destroys all keys and values in the #GHashTable and decrements its
- reference count by 1. If keys and/or values are dynamically allocated,
- you should either free them first or create the #GHashTable with destroy
- notifiers using g_hash_table_new_full(). In the latter case the destroy
- functions you supplied will be called on all keys and values during the
- destruction phase.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="find"
- c:identifier="g_hash_table_find"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Calls the given function for key/value pairs in the #GHashTable
- until @predicate returns %TRUE. The function is passed the key
- and value of each pair, and the given @user_data parameter. The
- hash table may not be modified while iterating over it (you can't
- add/remove items).
- Note, that hash tables are really only optimized for forward
- lookups, i.e. g_hash_table_lookup(). So code that frequently issues
- g_hash_table_find() or g_hash_table_foreach() (e.g. in the order of
- once per every entry in a hash table) should probably be reworked
- to use additional or different data structures for reverse lookups
- (keep in mind that an O(n) find/foreach operation issued for all n
- values in a hash table ends up needing O(n*n) operations).</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">The value of the first key/value pair is returned,
- for which @predicate evaluates to %TRUE. If no pair with the
- requested property is found, %NULL is returned.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="predicate" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">function to test the key/value pairs for a certain property</doc>
- <type name="HRFunc" c:type="GHRFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="foreach"
- c:identifier="g_hash_table_foreach"
- introspectable="0">
- <doc xml:space="preserve">Calls the given function for each of the key/value pairs in the
- #GHashTable. The function is passed the key and value of each
- pair, and the given @user_data parameter. The hash table may not
- be modified while iterating over it (you can't add/remove
- items). To remove all items matching a predicate, use
- g_hash_table_foreach_remove().
- See g_hash_table_find() for performance caveats for linear
- order searches in contrast to g_hash_table_lookup().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function to call for each key/value pair</doc>
- <type name="HFunc" c:type="GHFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="foreach_remove"
- c:identifier="g_hash_table_foreach_remove"
- introspectable="0">
- <doc xml:space="preserve">Calls the given function for each key/value pair in the
- #GHashTable. If the function returns %TRUE, then the key/value
- pair is removed from the #GHashTable. If you supplied key or
- value destroy functions when creating the #GHashTable, they are
- used to free the memory allocated for the removed keys and values.
- See #GHashTableIter for an alternative way to loop over the
- key/value pairs in the hash table.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of key/value pairs removed</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function to call for each key/value pair</doc>
- <type name="HRFunc" c:type="GHRFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="foreach_steal"
- c:identifier="g_hash_table_foreach_steal"
- introspectable="0">
- <doc xml:space="preserve">Calls the given function for each key/value pair in the
- #GHashTable. If the function returns %TRUE, then the key/value
- pair is removed from the #GHashTable, but no key or value
- destroy functions are called.
- See #GHashTableIter for an alternative way to loop over the
- key/value pairs in the hash table.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of key/value pairs removed.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function to call for each key/value pair</doc>
- <type name="HRFunc" c:type="GHRFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="get_keys"
- c:identifier="g_hash_table_get_keys"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Retrieves every key inside @hash_table. The returned data is valid
- until changes to the hash release those keys.
- This iterates over every entry in the hash table to build its return value.
- To iterate over the entries in a #GHashTable more efficiently, use a
- #GHashTableIter.</doc>
- <return-value transfer-ownership="container">
- <doc xml:space="preserve">a #GList containing all the keys
- inside the hash table. The content of the list is owned by the
- hash table and should not be modified or freed. Use g_list_free()
- when done using the list.</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="get_keys_as_array"
- c:identifier="g_hash_table_get_keys_as_array"
- version="2.40"
- introspectable="0">
- <doc xml:space="preserve">Retrieves every key inside @hash_table, as an array.
- The returned array is %NULL-terminated but may contain %NULL as a
- key. Use @length to determine the true length if it's possible that
- %NULL was used as the value for a key.
- Note: in the common case of a string-keyed #GHashTable, the return
- value of this function can be conveniently cast to (const gchar **).
- This iterates over every entry in the hash table to build its return value.
- To iterate over the entries in a #GHashTable more efficiently, use a
- #GHashTableIter.
- You should always free the return result with g_free(). In the
- above-mentioned case of a string-keyed hash table, it may be
- appropriate to use g_strfreev() if you call g_hash_table_steal_all()
- first to transfer ownership of the keys.</doc>
- <return-value transfer-ownership="container">
- <doc xml:space="preserve">a
- %NULL-terminated array containing each key from the table.</doc>
- <array length="1" zero-terminated="0" c:type="gpointer*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">the length of the returned array</doc>
- <type name="guint" c:type="guint*"/>
- </parameter>
- </parameters>
- </function>
- <function name="get_values"
- c:identifier="g_hash_table_get_values"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Retrieves every value inside @hash_table. The returned data
- is valid until @hash_table is modified.
- This iterates over every entry in the hash table to build its return value.
- To iterate over the entries in a #GHashTable more efficiently, use a
- #GHashTableIter.</doc>
- <return-value transfer-ownership="container">
- <doc xml:space="preserve">a #GList containing all the values
- inside the hash table. The content of the list is owned by the
- hash table and should not be modified or freed. Use g_list_free()
- when done using the list.</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="insert" c:identifier="g_hash_table_insert">
- <doc xml:space="preserve">Inserts a new key and value into a #GHashTable.
- If the key already exists in the #GHashTable its current
- value is replaced with the new value. If you supplied a
- @value_destroy_func when creating the #GHashTable, the old
- value is freed using that function. If you supplied a
- @key_destroy_func when creating the #GHashTable, the passed
- key is freed using that function.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key did not exist yet</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key to insert</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="value"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the value to associate with the key</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="lookup" c:identifier="g_hash_table_lookup">
- <doc xml:space="preserve">Looks up a key in a #GHashTable. Note that this function cannot
- distinguish between a key that is not present and one which is present
- and has the value %NULL. If you need this distinction, use
- g_hash_table_lookup_extended().</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the associated value, or %NULL if the key is not found</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the key to look up</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="lookup_extended"
- c:identifier="g_hash_table_lookup_extended">
- <doc xml:space="preserve">Looks up a key in the #GHashTable, returning the original key and the
- associated value and a #gboolean which is %TRUE if the key was found. This
- is useful if you need to free the memory allocated for the original key,
- for example before calling g_hash_table_remove().
- You can actually pass %NULL for @lookup_key to test
- whether the %NULL key exists, provided the hash and equal functions
- of @hash_table are %NULL-safe.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key was found in the #GHashTable</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="lookup_key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the key to look up</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="orig_key"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- nullable="1"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the original key</doc>
- <type name="gpointer" c:type="gpointer*"/>
- </parameter>
- <parameter name="value"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- nullable="1"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the value associated
- with the key</doc>
- <type name="gpointer" c:type="gpointer*"/>
- </parameter>
- </parameters>
- </function>
- <function name="new" c:identifier="g_hash_table_new" introspectable="0">
- <doc xml:space="preserve">Creates a new #GHashTable with a reference count of 1.
- Hash values returned by @hash_func are used to determine where keys
- are stored within the #GHashTable data structure. The g_direct_hash(),
- g_int_hash(), g_int64_hash(), g_double_hash() and g_str_hash()
- functions are provided for some common types of keys.
- If @hash_func is %NULL, g_direct_hash() is used.
- @key_equal_func is used when looking up keys in the #GHashTable.
- The g_direct_equal(), g_int_equal(), g_int64_equal(), g_double_equal()
- and g_str_equal() functions are provided for the most common types
- of keys. If @key_equal_func is %NULL, keys are compared directly in
- a similar fashion to g_direct_equal(), but without the overhead of
- a function call.</doc>
- <return-value>
- <doc xml:space="preserve">a new #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="hash_func" transfer-ownership="none">
- <doc xml:space="preserve">a function to create a hash value from a key</doc>
- <type name="HashFunc" c:type="GHashFunc"/>
- </parameter>
- <parameter name="key_equal_func" transfer-ownership="none">
- <doc xml:space="preserve">a function to check two keys for equality</doc>
- <type name="EqualFunc" c:type="GEqualFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="new_full"
- c:identifier="g_hash_table_new_full"
- introspectable="0">
- <doc xml:space="preserve">Creates a new #GHashTable like g_hash_table_new() with a reference
- count of 1 and allows to specify functions to free the memory
- allocated for the key and value that get called when removing the
- entry from the #GHashTable.
- Since version 2.42 it is permissible for destroy notify functions to
- recursively remove further items from the hash table. This is only
- permissible if the application still holds a reference to the hash table.
- This means that you may need to ensure that the hash table is empty by
- calling g_hash_table_remove_all before releasing the last reference using
- g_hash_table_unref().</doc>
- <return-value>
- <doc xml:space="preserve">a new #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="hash_func" transfer-ownership="none">
- <doc xml:space="preserve">a function to create a hash value from a key</doc>
- <type name="HashFunc" c:type="GHashFunc"/>
- </parameter>
- <parameter name="key_equal_func"
- transfer-ownership="none"
- scope="notified"
- destroy="3">
- <doc xml:space="preserve">a function to check two keys for equality</doc>
- <type name="EqualFunc" c:type="GEqualFunc"/>
- </parameter>
- <parameter name="key_destroy_func"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">a function to free the memory allocated for the key
- used when removing the entry from the #GHashTable, or %NULL
- if you don't want to supply such a function.</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- <parameter name="value_destroy_func"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">a function to free the memory allocated for the
- value used when removing the entry from the #GHashTable, or %NULL
- if you don't want to supply such a function.</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="ref"
- c:identifier="g_hash_table_ref"
- version="2.10"
- introspectable="0">
- <doc xml:space="preserve">Atomically increments the reference count of @hash_table by one.
- This function is MT-safe and may be called from any thread.</doc>
- <return-value>
- <doc xml:space="preserve">the passed in #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a valid #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="remove" c:identifier="g_hash_table_remove">
- <doc xml:space="preserve">Removes a key and its associated value from a #GHashTable.
- If the #GHashTable was created using g_hash_table_new_full(), the
- key and value are freed using the supplied destroy functions, otherwise
- you have to make sure that any dynamically allocated values are freed
- yourself.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key was found and removed from the #GHashTable</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the key to remove</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_all"
- c:identifier="g_hash_table_remove_all"
- version="2.12">
- <doc xml:space="preserve">Removes all keys and their associated values from a #GHashTable.
- If the #GHashTable was created using g_hash_table_new_full(),
- the keys and values are freed using the supplied destroy functions,
- otherwise you have to make sure that any dynamically allocated
- values are freed yourself.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="replace" c:identifier="g_hash_table_replace">
- <doc xml:space="preserve">Inserts a new key and value into a #GHashTable similar to
- g_hash_table_insert(). The difference is that if the key
- already exists in the #GHashTable, it gets replaced by the
- new key. If you supplied a @value_destroy_func when creating
- the #GHashTable, the old value is freed using that function.
- If you supplied a @key_destroy_func when creating the
- #GHashTable, the old key is freed using that function.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key did not exist yet</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key to insert</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="value"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the value to associate with the key</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="size" c:identifier="g_hash_table_size">
- <doc xml:space="preserve">Returns the number of elements contained in the #GHashTable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of key/value pairs in the #GHashTable.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="steal" c:identifier="g_hash_table_steal">
- <doc xml:space="preserve">Removes a key and its associated value from a #GHashTable without
- calling the key and value destroy functions.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key was found and removed from the #GHashTable</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the key to remove</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="steal_all"
- c:identifier="g_hash_table_steal_all"
- version="2.12">
- <doc xml:space="preserve">Removes all keys and their associated values from a #GHashTable
- without calling the key and value destroy functions.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="unref" c:identifier="g_hash_table_unref" version="2.10">
- <doc xml:space="preserve">Atomically decrements the reference count of @hash_table by one.
- If the reference count drops to 0, all keys and values will be
- destroyed, and all memory allocated by the hash table is released.
- This function is MT-safe and may be called from any thread.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a valid #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- </record>
- <record name="HashTableIter" c:type="GHashTableIter">
- <doc xml:space="preserve">A GHashTableIter structure represents an iterator that can be used
- to iterate over the elements of a #GHashTable. GHashTableIter
- structures are typically allocated on the stack and then initialized
- with g_hash_table_iter_init().</doc>
- <field name="dummy1" readable="0" private="1">
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="dummy2" readable="0" private="1">
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="dummy3" readable="0" private="1">
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="dummy4" readable="0" private="1">
- <type name="gint" c:type="int"/>
- </field>
- <field name="dummy5" readable="0" private="1">
- <type name="gboolean" c:type="gboolean"/>
- </field>
- <field name="dummy6" readable="0" private="1">
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <method name="get_hash_table"
- c:identifier="g_hash_table_iter_get_hash_table"
- version="2.16"
- introspectable="0">
- <doc xml:space="preserve">Returns the #GHashTable associated with @iter.</doc>
- <return-value>
- <doc xml:space="preserve">the #GHashTable associated with @iter.</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">an initialized #GHashTableIter</doc>
- <type name="HashTableIter" c:type="GHashTableIter*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="init" c:identifier="g_hash_table_iter_init" version="2.16">
- <doc xml:space="preserve">Initializes a key/value pair iterator and associates it with
- @hash_table. Modifying the hash table after calling this function
- invalidates the returned iterator.
- |[<!-- language="C" -->
- GHashTableIter iter;
- gpointer key, value;
- g_hash_table_iter_init (&iter, hash_table);
- while (g_hash_table_iter_next (&iter, &key, &value))
- {
- // do something with key and value
- }
- ]|</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">an uninitialized #GHashTableIter</doc>
- <type name="HashTableIter" c:type="GHashTableIter*"/>
- </instance-parameter>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </method>
- <method name="next" c:identifier="g_hash_table_iter_next" version="2.16">
- <doc xml:space="preserve">Advances @iter and retrieves the key and/or value that are now
- pointed to as a result of this advancement. If %FALSE is returned,
- @key and @value are not set, and the iterator becomes invalid.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%FALSE if the end of the #GHashTable has been reached.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">an initialized #GHashTableIter</doc>
- <type name="HashTableIter" c:type="GHashTableIter*"/>
- </instance-parameter>
- <parameter name="key"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- nullable="1"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">a location to store the key</doc>
- <type name="gpointer" c:type="gpointer*"/>
- </parameter>
- <parameter name="value"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- nullable="1"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">a location to store the value</doc>
- <type name="gpointer" c:type="gpointer*"/>
- </parameter>
- </parameters>
- </method>
- <method name="remove"
- c:identifier="g_hash_table_iter_remove"
- version="2.16">
- <doc xml:space="preserve">Removes the key/value pair currently pointed to by the iterator
- from its associated #GHashTable. Can only be called after
- g_hash_table_iter_next() returned %TRUE, and cannot be called
- more than once for the same key/value pair.
- If the #GHashTable was created using g_hash_table_new_full(),
- the key and value are freed using the supplied destroy functions,
- otherwise you have to make sure that any dynamically allocated
- values are freed yourself.
- It is safe to continue iterating the #GHashTable afterward:
- |[<!-- language="C" -->
- while (g_hash_table_iter_next (&iter, &key, &value))
- {
- if (condition)
- g_hash_table_iter_remove (&iter);
- }
- ]|</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">an initialized #GHashTableIter</doc>
- <type name="HashTableIter" c:type="GHashTableIter*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="replace"
- c:identifier="g_hash_table_iter_replace"
- version="2.30">
- <doc xml:space="preserve">Replaces the value currently pointed to by the iterator
- from its associated #GHashTable. Can only be called after
- g_hash_table_iter_next() returned %TRUE.
- If you supplied a @value_destroy_func when creating the
- #GHashTable, the old value is freed using that function.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">an initialized #GHashTableIter</doc>
- <type name="HashTableIter" c:type="GHashTableIter*"/>
- </instance-parameter>
- <parameter name="value"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the value to replace with</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="steal"
- c:identifier="g_hash_table_iter_steal"
- version="2.16">
- <doc xml:space="preserve">Removes the key/value pair currently pointed to by the
- iterator from its associated #GHashTable, without calling
- the key and value destroy functions. Can only be called
- after g_hash_table_iter_next() returned %TRUE, and cannot
- be called more than once for the same key/value pair.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">an initialized #GHashTableIter</doc>
- <type name="HashTableIter" c:type="GHashTableIter*"/>
- </instance-parameter>
- </parameters>
- </method>
- </record>
- <record name="Hmac" c:type="GHmac" disguised="1" version="2.30">
- <doc xml:space="preserve">An opaque structure representing a HMAC operation.
- To create a new GHmac, use g_hmac_new(). To free
- a GHmac, use g_hmac_unref().</doc>
- <method name="copy"
- c:identifier="g_hmac_copy"
- version="2.30"
- introspectable="0">
- <doc xml:space="preserve">Copies a #GHmac. If @hmac has been closed, by calling
- g_hmac_get_string() or g_hmac_get_digest(), the copied
- HMAC will be closed as well.</doc>
- <return-value>
- <doc xml:space="preserve">the copy of the passed #GHmac. Use g_hmac_unref()
- when finished using it.</doc>
- <type name="Hmac" c:type="GHmac*"/>
- </return-value>
- <parameters>
- <instance-parameter name="hmac" transfer-ownership="none">
- <doc xml:space="preserve">the #GHmac to copy</doc>
- <type name="Hmac" c:type="const GHmac*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_digest"
- c:identifier="g_hmac_get_digest"
- version="2.30">
- <doc xml:space="preserve">Gets the digest from @checksum as a raw binary array and places it
- into @buffer. The size of the digest depends on the type of checksum.
- Once this function has been called, the #GHmac is closed and can
- no longer be updated with g_checksum_update().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="hmac" transfer-ownership="none">
- <doc xml:space="preserve">a #GHmac</doc>
- <type name="Hmac" c:type="GHmac*"/>
- </instance-parameter>
- <parameter name="buffer" transfer-ownership="none">
- <doc xml:space="preserve">output buffer</doc>
- <type name="guint8" c:type="guint8*"/>
- </parameter>
- <parameter name="digest_len" transfer-ownership="none">
- <doc xml:space="preserve">an inout parameter. The caller initializes it to the
- size of @buffer. After the call it contains the length of the digest</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_string"
- c:identifier="g_hmac_get_string"
- version="2.30">
- <doc xml:space="preserve">Gets the HMAC as an hexadecimal string.
- Once this function has been called the #GHmac can no longer be
- updated with g_hmac_update().
- The hexadecimal characters will be lower case.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the hexadecimal representation of the HMAC. The
- returned string is owned by the HMAC and should not be modified
- or freed.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="hmac" transfer-ownership="none">
- <doc xml:space="preserve">a #GHmac</doc>
- <type name="Hmac" c:type="GHmac*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="ref"
- c:identifier="g_hmac_ref"
- version="2.30"
- introspectable="0">
- <doc xml:space="preserve">Atomically increments the reference count of @hmac by one.
- This function is MT-safe and may be called from any thread.</doc>
- <return-value>
- <doc xml:space="preserve">the passed in #GHmac.</doc>
- <type name="Hmac" c:type="GHmac*"/>
- </return-value>
- <parameters>
- <instance-parameter name="hmac" transfer-ownership="none">
- <doc xml:space="preserve">a valid #GHmac</doc>
- <type name="Hmac" c:type="GHmac*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_hmac_unref" version="2.30">
- <doc xml:space="preserve">Atomically decrements the reference count of @hmac by one.
- If the reference count drops to 0, all keys and values will be
- destroyed, and all memory allocated by the hash table is released.
- This function is MT-safe and may be called from any thread.
- Frees the memory allocated for @hmac.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="hmac" transfer-ownership="none">
- <doc xml:space="preserve">a #GHmac</doc>
- <type name="Hmac" c:type="GHmac*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="update" c:identifier="g_hmac_update" version="2.30">
- <doc xml:space="preserve">Feeds @data into an existing #GHmac.
- The HMAC must still be open, that is g_hmac_get_string() or
- g_hmac_get_digest() must not have been called on @hmac.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="hmac" transfer-ownership="none">
- <doc xml:space="preserve">a #GHmac</doc>
- <type name="Hmac" c:type="GHmac*"/>
- </instance-parameter>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">buffer used to compute the checksum</doc>
- <array length="1" zero-terminated="0" c:type="guchar*">
- <type name="guint8" c:type="guchar"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">size of the buffer, or -1 if it is a nul-terminated string</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </method>
- <function name="new"
- c:identifier="g_hmac_new"
- version="2.30"
- introspectable="0">
- <doc xml:space="preserve">Creates a new #GHmac, using the digest algorithm @digest_type.
- If the @digest_type is not known, %NULL is returned.
- A #GHmac can be used to compute the HMAC of a key and an
- arbitrary binary blob, using different hashing algorithms.
- A #GHmac works by feeding a binary blob through g_hmac_update()
- until the data is complete; the digest can then be extracted
- using g_hmac_get_string(), which will return the checksum as a
- hexadecimal string; or g_hmac_get_digest(), which will return a
- array of raw bytes. Once either g_hmac_get_string() or
- g_hmac_get_digest() have been called on a #GHmac, the HMAC
- will be closed and it won't be possible to call g_hmac_update()
- on it anymore.
- Support for digests of type %G_CHECKSUM_SHA512 has been added in GLib 2.42.</doc>
- <return-value>
- <doc xml:space="preserve">the newly created #GHmac, or %NULL.
- Use g_hmac_unref() to free the memory allocated by it.</doc>
- <type name="Hmac" c:type="GHmac*"/>
- </return-value>
- <parameters>
- <parameter name="digest_type" transfer-ownership="none">
- <doc xml:space="preserve">the desired type of digest</doc>
- <type name="ChecksumType" c:type="GChecksumType"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">the key for the HMAC</doc>
- <array length="2" zero-terminated="0" c:type="guchar*">
- <type name="guint8" c:type="guchar"/>
- </array>
- </parameter>
- <parameter name="key_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of the keys</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <record name="Hook" c:type="GHook">
- <doc xml:space="preserve">The #GHook struct represents a single hook function in a #GHookList.</doc>
- <field name="data" writable="1">
- <doc xml:space="preserve">data which is passed to func when this hook is invoked</doc>
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="next" writable="1">
- <doc xml:space="preserve">pointer to the next hook in the list</doc>
- <type name="Hook" c:type="GHook*"/>
- </field>
- <field name="prev" writable="1">
- <doc xml:space="preserve">pointer to the previous hook in the list</doc>
- <type name="Hook" c:type="GHook*"/>
- </field>
- <field name="ref_count" writable="1">
- <doc xml:space="preserve">the reference count of this hook</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="hook_id" writable="1">
- <doc xml:space="preserve">the id of this hook, which is unique within its list</doc>
- <type name="gulong" c:type="gulong"/>
- </field>
- <field name="flags" writable="1">
- <doc xml:space="preserve">flags which are set for this hook. See #GHookFlagMask for
- predefined flags</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="func" writable="1">
- <doc xml:space="preserve">the function to call when this hook is invoked. The possible
- signatures for this function are #GHookFunc and #GHookCheckFunc</doc>
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="destroy" writable="1">
- <doc xml:space="preserve">the default @finalize_hook function of a #GHookList calls
- this member of the hook that is being finalized</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </field>
- <method name="compare_ids" c:identifier="g_hook_compare_ids">
- <doc xml:space="preserve">Compares the ids of two #GHook elements, returning a negative value
- if the second id is greater than the first.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a value <= 0 if the id of @sibling is >= the id of @new_hook</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="new_hook" transfer-ownership="none">
- <doc xml:space="preserve">a #GHook</doc>
- <type name="Hook" c:type="GHook*"/>
- </instance-parameter>
- <parameter name="sibling" transfer-ownership="none">
- <doc xml:space="preserve">a #GHook to compare with @new_hook</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- </parameters>
- </method>
- <function name="alloc" c:identifier="g_hook_alloc" introspectable="0">
- <doc xml:space="preserve">Allocates space for a #GHook and initializes it.</doc>
- <return-value>
- <doc xml:space="preserve">a new #GHook</doc>
- <type name="Hook" c:type="GHook*"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- </parameters>
- </function>
- <function name="destroy" c:identifier="g_hook_destroy">
- <doc xml:space="preserve">Destroys a #GHook, given its ID.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the #GHook was found in the #GHookList and destroyed</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook_id" transfer-ownership="none">
- <doc xml:space="preserve">a hook ID</doc>
- <type name="gulong" c:type="gulong"/>
- </parameter>
- </parameters>
- </function>
- <function name="destroy_link" c:identifier="g_hook_destroy_link">
- <doc xml:space="preserve">Removes one #GHook from a #GHookList, marking it
- inactive and calling g_hook_unref() on it.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">the #GHook to remove</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- </parameters>
- </function>
- <function name="find" c:identifier="g_hook_find" introspectable="0">
- <doc xml:space="preserve">Finds a #GHook in a #GHookList using the given function to
- test for a match.</doc>
- <return-value>
- <doc xml:space="preserve">the found #GHook or %NULL if no matching #GHook is found</doc>
- <type name="Hook" c:type="GHook*"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="need_valids" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if #GHook elements which have been destroyed
- should be skipped</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="3">
- <doc xml:space="preserve">the function to call for each #GHook, which should return
- %TRUE when the #GHook has been found</doc>
- <type name="HookFindFunc" c:type="GHookFindFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to pass to @func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="find_data"
- c:identifier="g_hook_find_data"
- introspectable="0">
- <doc xml:space="preserve">Finds a #GHook in a #GHookList with the given data.</doc>
- <return-value>
- <doc xml:space="preserve">the #GHook with the given @data or %NULL if no matching
- #GHook is found</doc>
- <type name="Hook" c:type="GHook*"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="need_valids" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if #GHook elements which have been destroyed
- should be skipped</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to find</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="find_func"
- c:identifier="g_hook_find_func"
- introspectable="0">
- <doc xml:space="preserve">Finds a #GHook in a #GHookList with the given function.</doc>
- <return-value>
- <doc xml:space="preserve">the #GHook with the given @func or %NULL if no matching
- #GHook is found</doc>
- <type name="Hook" c:type="GHook*"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="need_valids" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if #GHook elements which have been destroyed
- should be skipped</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="func"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the function to find</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="find_func_data"
- c:identifier="g_hook_find_func_data"
- introspectable="0">
- <doc xml:space="preserve">Finds a #GHook in a #GHookList with the given function and data.</doc>
- <return-value>
- <doc xml:space="preserve">the #GHook with the given @func and @data or %NULL if
- no matching #GHook is found</doc>
- <type name="Hook" c:type="GHook*"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="need_valids" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if #GHook elements which have been destroyed
- should be skipped</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <doc xml:space="preserve">the function to find</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to find</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="first_valid"
- c:identifier="g_hook_first_valid"
- introspectable="0">
- <doc xml:space="preserve">Returns the first #GHook in a #GHookList which has not been destroyed.
- The reference count for the #GHook is incremented, so you must call
- g_hook_unref() to restore it when no longer needed. (Or call
- g_hook_next_valid() if you are stepping through the #GHookList.)</doc>
- <return-value>
- <doc xml:space="preserve">the first valid #GHook, or %NULL if none are valid</doc>
- <type name="Hook" c:type="GHook*"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="may_be_in_call" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if hooks which are currently running
- (e.g. in another thread) are considered valid. If set to %FALSE,
- these are skipped</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </function>
- <function name="free" c:identifier="g_hook_free">
- <doc xml:space="preserve">Calls the #GHookList @finalize_hook function if it exists,
- and frees the memory allocated for the #GHook.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">the #GHook to free</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- </parameters>
- </function>
- <function name="get" c:identifier="g_hook_get" introspectable="0">
- <doc xml:space="preserve">Returns the #GHook with the given id, or %NULL if it is not found.</doc>
- <return-value>
- <doc xml:space="preserve">the #GHook with the given id, or %NULL if it is not found</doc>
- <type name="Hook" c:type="GHook*"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook_id" transfer-ownership="none">
- <doc xml:space="preserve">a hook id</doc>
- <type name="gulong" c:type="gulong"/>
- </parameter>
- </parameters>
- </function>
- <function name="insert_before" c:identifier="g_hook_insert_before">
- <doc xml:space="preserve">Inserts a #GHook into a #GHookList, before a given #GHook.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="sibling"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the #GHook to insert the new #GHook before</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">the #GHook to insert</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- </parameters>
- </function>
- <function name="insert_sorted"
- c:identifier="g_hook_insert_sorted"
- introspectable="0">
- <doc xml:space="preserve">Inserts a #GHook into a #GHookList, sorted by the given function.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">the #GHook to insert</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <doc xml:space="preserve">the comparison function used to sort the #GHook elements</doc>
- <type name="HookCompareFunc" c:type="GHookCompareFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="next_valid"
- c:identifier="g_hook_next_valid"
- introspectable="0">
- <doc xml:space="preserve">Returns the next #GHook in a #GHookList which has not been destroyed.
- The reference count for the #GHook is incremented, so you must call
- g_hook_unref() to restore it when no longer needed. (Or continue to call
- g_hook_next_valid() until %NULL is returned.)</doc>
- <return-value>
- <doc xml:space="preserve">the next valid #GHook, or %NULL if none are valid</doc>
- <type name="Hook" c:type="GHook*"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">the current #GHook</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- <parameter name="may_be_in_call" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if hooks which are currently running
- (e.g. in another thread) are considered valid. If set to %FALSE,
- these are skipped</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </function>
- <function name="prepend" c:identifier="g_hook_prepend">
- <doc xml:space="preserve">Prepends a #GHook on the start of a #GHookList.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">the #GHook to add to the start of @hook_list</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- </parameters>
- </function>
- <function name="ref" c:identifier="g_hook_ref" introspectable="0">
- <doc xml:space="preserve">Increments the reference count for a #GHook.</doc>
- <return-value>
- <doc xml:space="preserve">the @hook that was passed in (since 2.6)</doc>
- <type name="Hook" c:type="GHook*"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">the #GHook to increment the reference count of</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- </parameters>
- </function>
- <function name="unref" c:identifier="g_hook_unref">
- <doc xml:space="preserve">Decrements the reference count of a #GHook.
- If the reference count falls to 0, the #GHook is removed
- from the #GHookList and g_hook_free() is called to free it.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">the #GHook to unref</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <callback name="HookCheckFunc" c:type="GHookCheckFunc">
- <doc xml:space="preserve">Defines the type of a hook function that can be invoked
- by g_hook_list_invoke_check().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%FALSE if the #GHook should be destroyed</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data field of the #GHook is passed to the hook function here</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <callback name="HookCheckMarshaller" c:type="GHookCheckMarshaller">
- <doc xml:space="preserve">Defines the type of function used by g_hook_list_marshal_check().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%FALSE if @hook should be destroyed</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">a #GHook</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- <parameter name="marshal_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <callback name="HookCompareFunc" c:type="GHookCompareFunc">
- <doc xml:space="preserve">Defines the type of function used to compare #GHook elements in
- g_hook_insert_sorted().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a value <= 0 if @new_hook should be before @sibling</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="new_hook" transfer-ownership="none">
- <doc xml:space="preserve">the #GHook being inserted</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- <parameter name="sibling" transfer-ownership="none">
- <doc xml:space="preserve">the #GHook to compare with @new_hook</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- </parameters>
- </callback>
- <callback name="HookFinalizeFunc" c:type="GHookFinalizeFunc">
- <doc xml:space="preserve">Defines the type of function to be called when a hook in a
- list of hooks gets finalized.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">the hook in @hook_list that gets finalized</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- </parameters>
- </callback>
- <callback name="HookFindFunc" c:type="GHookFindFunc">
- <doc xml:space="preserve">Defines the type of the function passed to g_hook_find().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the required #GHook has been found</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">a #GHook</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to g_hook_find_func()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <bitfield name="HookFlagMask" c:type="GHookFlagMask">
- <doc xml:space="preserve">Flags used internally in the #GHook implementation.</doc>
- <member name="active" value="1" c:identifier="G_HOOK_FLAG_ACTIVE">
- <doc xml:space="preserve">set if the hook has not been destroyed</doc>
- </member>
- <member name="in_call" value="2" c:identifier="G_HOOK_FLAG_IN_CALL">
- <doc xml:space="preserve">set if the hook is currently being run</doc>
- </member>
- <member name="mask" value="15" c:identifier="G_HOOK_FLAG_MASK">
- <doc xml:space="preserve">A mask covering all bits reserved for
- hook flags; see %G_HOOK_FLAG_USER_SHIFT</doc>
- </member>
- </bitfield>
- <callback name="HookFunc" c:type="GHookFunc">
- <doc xml:space="preserve">Defines the type of a hook function that can be invoked
- by g_hook_list_invoke().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data field of the #GHook is passed to the hook function here</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <record name="HookList" c:type="GHookList">
- <doc xml:space="preserve">The #GHookList struct represents a list of hook functions.</doc>
- <field name="seq_id" writable="1">
- <doc xml:space="preserve">the next free #GHook id</doc>
- <type name="gulong" c:type="gulong"/>
- </field>
- <field name="hook_size" writable="1" bits="16">
- <doc xml:space="preserve">the size of the #GHookList elements, in bytes</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="is_setup" writable="1" bits="1">
- <doc xml:space="preserve">1 if the #GHookList has been initialized</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="hooks" writable="1">
- <doc xml:space="preserve">the first #GHook element in the list</doc>
- <type name="Hook" c:type="GHook*"/>
- </field>
- <field name="dummy3" writable="1">
- <doc xml:space="preserve">unused</doc>
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="finalize_hook" writable="1">
- <doc xml:space="preserve">the function to call to finalize a #GHook element.
- The default behaviour is to call the hooks @destroy function</doc>
- <type name="HookFinalizeFunc" c:type="GHookFinalizeFunc"/>
- </field>
- <field name="dummy" writable="1">
- <doc xml:space="preserve">unused</doc>
- <array zero-terminated="0" c:type="gpointer" fixed-size="2">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </field>
- <method name="clear" c:identifier="g_hook_list_clear">
- <doc xml:space="preserve">Removes all the #GHook elements from a #GHookList.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="init" c:identifier="g_hook_list_init">
- <doc xml:space="preserve">Initializes a #GHookList.
- This must be called before the #GHookList is used.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </instance-parameter>
- <parameter name="hook_size" transfer-ownership="none">
- <doc xml:space="preserve">the size of each element in the #GHookList,
- typically `sizeof (GHook)`.</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="invoke" c:identifier="g_hook_list_invoke">
- <doc xml:space="preserve">Calls all of the #GHook functions in a #GHookList.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </instance-parameter>
- <parameter name="may_recurse" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if functions which are already running
- (e.g. in another thread) can be called. If set to %FALSE,
- these are skipped</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="invoke_check" c:identifier="g_hook_list_invoke_check">
- <doc xml:space="preserve">Calls all of the #GHook functions in a #GHookList.
- Any function which returns %FALSE is removed from the #GHookList.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </instance-parameter>
- <parameter name="may_recurse" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if functions which are already running
- (e.g. in another thread) can be called. If set to %FALSE,
- these are skipped</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="marshal"
- c:identifier="g_hook_list_marshal"
- introspectable="0">
- <doc xml:space="preserve">Calls a function on each valid #GHook.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </instance-parameter>
- <parameter name="may_recurse" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if hooks which are currently running
- (e.g. in another thread) are considered valid. If set to %FALSE,
- these are skipped</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="marshaller" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function to call for each #GHook</doc>
- <type name="HookMarshaller" c:type="GHookMarshaller"/>
- </parameter>
- <parameter name="marshal_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @marshaller</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="marshal_check"
- c:identifier="g_hook_list_marshal_check"
- introspectable="0">
- <doc xml:space="preserve">Calls a function on each valid #GHook and destroys it if the
- function returns %FALSE.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </instance-parameter>
- <parameter name="may_recurse" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if hooks which are currently running
- (e.g. in another thread) are considered valid. If set to %FALSE,
- these are skipped</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="marshaller" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function to call for each #GHook</doc>
- <type name="HookCheckMarshaller" c:type="GHookCheckMarshaller"/>
- </parameter>
- <parameter name="marshal_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @marshaller</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- </record>
- <callback name="HookMarshaller" c:type="GHookMarshaller">
- <doc xml:space="preserve">Defines the type of function used by g_hook_list_marshal().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">a #GHook</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- <parameter name="marshal_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <record name="IConv" c:type="GIConv" disguised="1">
- <doc xml:space="preserve">The GIConv struct wraps an iconv() conversion descriptor. It contains
- private data and should only be accessed using the following functions.</doc>
- <method name="" c:identifier="g_iconv" moved-to="iconv">
- <doc xml:space="preserve">Same as the standard UNIX routine iconv(), but
- may be implemented via libiconv on UNIX flavors that lack
- a native implementation.
- GLib provides g_convert() and g_locale_to_utf8() which are likely
- more convenient than the raw iconv wrappers.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">count of non-reversible conversions, or -1 on error</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <instance-parameter name="converter" transfer-ownership="none">
- <doc xml:space="preserve">conversion descriptor from g_iconv_open()</doc>
- <type name="IConv" c:type="GIConv"/>
- </instance-parameter>
- <parameter name="inbuf" transfer-ownership="none">
- <doc xml:space="preserve">bytes to convert</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- <parameter name="inbytes_left" transfer-ownership="none">
- <doc xml:space="preserve">inout parameter, bytes remaining to convert in @inbuf</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- <parameter name="outbuf" transfer-ownership="none">
- <doc xml:space="preserve">converted output bytes</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- <parameter name="outbytes_left" transfer-ownership="none">
- <doc xml:space="preserve">inout parameter, bytes available to fill in @outbuf</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="close" c:identifier="g_iconv_close">
- <doc xml:space="preserve">Same as the standard UNIX routine iconv_close(), but
- may be implemented via libiconv on UNIX flavors that lack
- a native implementation. Should be called to clean up
- the conversion descriptor from g_iconv_open() when
- you are done converting things.
- GLib provides g_convert() and g_locale_to_utf8() which are likely
- more convenient than the raw iconv wrappers.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">-1 on error, 0 on success</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="converter" transfer-ownership="none">
- <doc xml:space="preserve">a conversion descriptor from g_iconv_open()</doc>
- <type name="IConv" c:type="GIConv"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="open" c:identifier="g_iconv_open" introspectable="0">
- <doc xml:space="preserve">Same as the standard UNIX routine iconv_open(), but
- may be implemented via libiconv on UNIX flavors that lack
- a native implementation.
- GLib provides g_convert() and g_locale_to_utf8() which are likely
- more convenient than the raw iconv wrappers.</doc>
- <return-value>
- <doc xml:space="preserve">a "conversion descriptor", or (GIConv)-1 if
- opening the converter failed.</doc>
- <type name="IConv" c:type="GIConv"/>
- </return-value>
- <parameters>
- <parameter name="to_codeset" transfer-ownership="none">
- <doc xml:space="preserve">destination codeset</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="from_codeset" transfer-ownership="none">
- <doc xml:space="preserve">source codeset</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <constant name="IEEE754_DOUBLE_BIAS"
- value="1023"
- c:type="G_IEEE754_DOUBLE_BIAS">
- <doc xml:space="preserve">The bias by which exponents in double-precision floats are offset.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="IEEE754_FLOAT_BIAS"
- value="127"
- c:type="G_IEEE754_FLOAT_BIAS">
- <doc xml:space="preserve">The bias by which exponents in single-precision floats are offset.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <record name="IOChannel"
- c:type="GIOChannel"
- glib:type-name="GIOChannel"
- glib:get-type="g_io_channel_get_type"
- c:symbol-prefix="io_channel">
- <doc xml:space="preserve">A data structure representing an IO Channel. The fields should be
- considered private and should only be accessed with the following
- functions.</doc>
- <field name="ref_count" readable="0" private="1">
- <type name="gint" c:type="gint"/>
- </field>
- <field name="funcs" readable="0" private="1">
- <type name="IOFuncs" c:type="GIOFuncs*"/>
- </field>
- <field name="encoding" readable="0" private="1">
- <type name="utf8" c:type="gchar*"/>
- </field>
- <field name="read_cd" readable="0" private="1">
- <type name="IConv" c:type="GIConv"/>
- </field>
- <field name="write_cd" readable="0" private="1">
- <type name="IConv" c:type="GIConv"/>
- </field>
- <field name="line_term" readable="0" private="1">
- <type name="utf8" c:type="gchar*"/>
- </field>
- <field name="line_term_len" readable="0" private="1">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="buf_size" readable="0" private="1">
- <type name="gsize" c:type="gsize"/>
- </field>
- <field name="read_buf" readable="0" private="1">
- <type name="String" c:type="GString*"/>
- </field>
- <field name="encoded_read_buf" readable="0" private="1">
- <type name="String" c:type="GString*"/>
- </field>
- <field name="write_buf" readable="0" private="1">
- <type name="String" c:type="GString*"/>
- </field>
- <field name="partial_write_buf" readable="0" private="1">
- <array zero-terminated="0" c:type="gchar" fixed-size="6">
- <type name="gchar" c:type="gchar"/>
- </array>
- </field>
- <field name="use_buffer" readable="0" bits="1" private="1">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="do_encode" readable="0" bits="1" private="1">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="close_on_unref" readable="0" bits="1" private="1">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="is_readable" readable="0" bits="1" private="1">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="is_writeable" readable="0" bits="1" private="1">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="is_seekable" readable="0" bits="1" private="1">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="reserved1" readable="0" private="1">
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="reserved2" readable="0" private="1">
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <constructor name="new_file"
- c:identifier="g_io_channel_new_file"
- throws="1">
- <doc xml:space="preserve">Open a file @filename as a #GIOChannel using mode @mode. This
- channel will be closed when the last reference to it is dropped,
- so there is no need to call g_io_channel_close() (though doing
- so will not cause problems, as long as no attempt is made to
- access the channel after it is closed).</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">A #GIOChannel on success, %NULL on failure.</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </return-value>
- <parameters>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">A string containing the name of a file</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="mode" transfer-ownership="none">
- <doc xml:space="preserve">One of "r", "w", "a", "r+", "w+", "a+". These have
- the same meaning as in fopen()</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="unix_new" c:identifier="g_io_channel_unix_new">
- <doc xml:space="preserve">Creates a new #GIOChannel given a file descriptor. On UNIX systems
- this works for plain files, pipes, and sockets.
- The returned #GIOChannel has a reference count of 1.
- The default encoding for #GIOChannel is UTF-8. If your application
- is reading output from a command using via pipe, you may need to set
- the encoding to the encoding of the current locale (see
- g_get_charset()) with the g_io_channel_set_encoding() function.
- If you want to read raw binary data without interpretation, then
- call the g_io_channel_set_encoding() function with %NULL for the
- encoding argument.
- This function is available in GLib on Windows, too, but you should
- avoid using it on Windows. The domain of file descriptors and
- sockets overlap. There is no way for GLib to know which one you mean
- in case the argument you pass to this function happens to be both a
- valid file descriptor and socket. If that happens a warning is
- issued, and GLib assumes that it is the file descriptor you mean.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GIOChannel.</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </return-value>
- <parameters>
- <parameter name="fd" transfer-ownership="none">
- <doc xml:space="preserve">a file descriptor.</doc>
- <type name="gint" c:type="int"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="close"
- c:identifier="g_io_channel_close"
- deprecated="1"
- deprecated-version="2.2">
- <doc xml:space="preserve">Close an IO channel. Any pending data to be written will be
- flushed, ignoring errors. The channel will not be freed until the
- last reference is dropped using g_io_channel_unref().</doc>
- <doc-deprecated xml:space="preserve">Use g_io_channel_shutdown() instead.</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">A #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="flush" c:identifier="g_io_channel_flush" throws="1">
- <doc xml:space="preserve">Flushes the write buffer for the GIOChannel.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the status of the operation: One of
- #G_IO_STATUS_NORMAL, #G_IO_STATUS_AGAIN, or
- #G_IO_STATUS_ERROR.</doc>
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_buffer_condition"
- c:identifier="g_io_channel_get_buffer_condition">
- <doc xml:space="preserve">This function returns a #GIOCondition depending on whether there
- is data to be read/space to write data in the internal buffers in
- the #GIOChannel. Only the flags %G_IO_IN and %G_IO_OUT may be set.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">A #GIOCondition</doc>
- <type name="IOCondition" c:type="GIOCondition"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">A #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_buffer_size"
- c:identifier="g_io_channel_get_buffer_size">
- <doc xml:space="preserve">Gets the buffer size.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the size of the buffer.</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_buffered" c:identifier="g_io_channel_get_buffered">
- <doc xml:space="preserve">Returns whether @channel is buffered.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the @channel is buffered.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_close_on_unref"
- c:identifier="g_io_channel_get_close_on_unref">
- <doc xml:space="preserve">Returns whether the file/socket/whatever associated with @channel
- will be closed when @channel receives its final unref and is
- destroyed. The default value of this is %TRUE for channels created
- by g_io_channel_new_file (), and %FALSE for all other channels.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">Whether the channel will be closed on the final unref of
- the GIOChannel data structure.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel.</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_encoding" c:identifier="g_io_channel_get_encoding">
- <doc xml:space="preserve">Gets the encoding for the input/output of the channel.
- The internal encoding is always UTF-8. The encoding %NULL
- makes the channel safe for binary data.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">A string containing the encoding, this string is
- owned by GLib and must not be freed.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_flags" c:identifier="g_io_channel_get_flags">
- <doc xml:space="preserve">Gets the current flags for a #GIOChannel, including read-only
- flags such as %G_IO_FLAG_IS_READABLE.
- The values of the flags %G_IO_FLAG_IS_READABLE and %G_IO_FLAG_IS_WRITABLE
- are cached for internal use by the channel when it is created.
- If they should change at some later point (e.g. partial shutdown
- of a socket with the UNIX shutdown() function), the user
- should immediately call g_io_channel_get_flags() to update
- the internal values of these flags.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the flags which are set on the channel</doc>
- <type name="IOFlags" c:type="GIOFlags"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_line_term" c:identifier="g_io_channel_get_line_term">
- <doc xml:space="preserve">This returns the string that #GIOChannel uses to determine
- where in the file a line break occurs. A value of %NULL
- indicates autodetection.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">The line termination string. This value
- is owned by GLib and must not be freed.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">a location to return the length of the line terminator</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- </parameters>
- </method>
- <method name="init" c:identifier="g_io_channel_init">
- <doc xml:space="preserve">Initializes a #GIOChannel struct.
- This is called by each of the above functions when creating a
- #GIOChannel, and so is not often needed by the application
- programmer (unless you are creating a new type of #GIOChannel).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="read"
- c:identifier="g_io_channel_read"
- deprecated="1"
- deprecated-version="2.2">
- <doc xml:space="preserve">Reads data from a #GIOChannel.</doc>
- <doc-deprecated xml:space="preserve">Use g_io_channel_read_chars() instead.</doc-deprecated>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%G_IO_ERROR_NONE if the operation was successful.</doc>
- <type name="IOError" c:type="GIOError"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="buf" transfer-ownership="none">
- <doc xml:space="preserve">a buffer to read the data into (which should be at least
- count bytes long)</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="count" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes to read from the #GIOChannel</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="bytes_read" transfer-ownership="none">
- <doc xml:space="preserve">returns the number of bytes actually read</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="read_chars"
- c:identifier="g_io_channel_read_chars"
- throws="1">
- <doc xml:space="preserve">Replacement for g_io_channel_read() with the new API.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the status of the operation.</doc>
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="buf"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none">
- <doc xml:space="preserve">
- a buffer to read data into</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="count" transfer-ownership="none">
- <doc xml:space="preserve">the size of the buffer. Note that the buffer may not be
- complelely filled even if there is data in the buffer if the
- remaining data is not a complete character.</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="bytes_read"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">The number of bytes read. This may be
- zero even on success if count < 6 and the channel's encoding
- is non-%NULL. This indicates that the next UTF-8 character is
- too wide for the buffer.</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="read_line"
- c:identifier="g_io_channel_read_line"
- throws="1">
- <doc xml:space="preserve">Reads a line, including the terminating character(s),
- from a #GIOChannel into a newly-allocated string.
- @str_return will contain allocated memory if the return
- is %G_IO_STATUS_NORMAL.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the status of the operation.</doc>
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="str_return"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">The line read from the #GIOChannel, including the
- line terminator. This data should be freed with g_free()
- when no longer needed. This is a nul-terminated string.
- If a @length of zero is returned, this will be %NULL instead.</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store length of the read data, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- <parameter name="terminator_pos"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store position of line terminator, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="read_line_string"
- c:identifier="g_io_channel_read_line_string"
- throws="1">
- <doc xml:space="preserve">Reads a line from a #GIOChannel, using a #GString as a buffer.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the status of the operation.</doc>
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="buffer" transfer-ownership="none">
- <doc xml:space="preserve">a #GString into which the line will be written.
- If @buffer already contains data, the old data will
- be overwritten.</doc>
- <type name="String" c:type="GString*"/>
- </parameter>
- <parameter name="terminator_pos"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">location to store position of line terminator, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="read_to_end"
- c:identifier="g_io_channel_read_to_end"
- throws="1">
- <doc xml:space="preserve">Reads all the remaining data from the file.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%G_IO_STATUS_NORMAL on success.
- This function never returns %G_IO_STATUS_EOF.</doc>
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="str_return"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">Location to
- store a pointer to a string holding the remaining data in the
- #GIOChannel. This data should be freed with g_free() when no
- longer needed. This data is terminated by an extra nul
- character, but there may be other nuls in the intervening data.</doc>
- <array length="1" zero-terminated="0" c:type="gchar**">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">location to store length of the data</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="read_unichar"
- c:identifier="g_io_channel_read_unichar"
- throws="1">
- <doc xml:space="preserve">Reads a Unicode character from @channel.
- This function cannot be called on a channel with %NULL encoding.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #GIOStatus</doc>
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="thechar"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">a location to return a character</doc>
- <type name="gunichar" c:type="gunichar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_io_channel_ref">
- <doc xml:space="preserve">Increments the reference count of a #GIOChannel.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the @channel that was passed in (since 2.6)</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="seek"
- c:identifier="g_io_channel_seek"
- deprecated="1"
- deprecated-version="2.2">
- <doc xml:space="preserve">Sets the current position in the #GIOChannel, similar to the standard
- library function fseek().</doc>
- <doc-deprecated xml:space="preserve">Use g_io_channel_seek_position() instead.</doc-deprecated>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%G_IO_ERROR_NONE if the operation was successful.</doc>
- <type name="IOError" c:type="GIOError"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="offset" transfer-ownership="none">
- <doc xml:space="preserve">an offset, in bytes, which is added to the position specified
- by @type</doc>
- <type name="gint64" c:type="gint64"/>
- </parameter>
- <parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">the position in the file, which can be %G_SEEK_CUR (the current
- position), %G_SEEK_SET (the start of the file), or %G_SEEK_END
- (the end of the file)</doc>
- <type name="SeekType" c:type="GSeekType"/>
- </parameter>
- </parameters>
- </method>
- <method name="seek_position"
- c:identifier="g_io_channel_seek_position"
- throws="1">
- <doc xml:space="preserve">Replacement for g_io_channel_seek() with the new API.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the status of the operation.</doc>
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="offset" transfer-ownership="none">
- <doc xml:space="preserve">The offset in bytes from the position specified by @type</doc>
- <type name="gint64" c:type="gint64"/>
- </parameter>
- <parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GSeekType. The type %G_SEEK_CUR is only allowed in those
- cases where a call to g_io_channel_set_encoding ()
- is allowed. See the documentation for
- g_io_channel_set_encoding () for details.</doc>
- <type name="SeekType" c:type="GSeekType"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_buffer_size"
- c:identifier="g_io_channel_set_buffer_size">
- <doc xml:space="preserve">Sets the buffer size.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="size" transfer-ownership="none">
- <doc xml:space="preserve">the size of the buffer, or 0 to let GLib pick a good size</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_buffered" c:identifier="g_io_channel_set_buffered">
- <doc xml:space="preserve">The buffering state can only be set if the channel's encoding
- is %NULL. For any other encoding, the channel must be buffered.
- A buffered channel can only be set unbuffered if the channel's
- internal buffers have been flushed. Newly created channels or
- channels which have returned %G_IO_STATUS_EOF
- not require such a flush. For write-only channels, a call to
- g_io_channel_flush () is sufficient. For all other channels,
- the buffers may be flushed by a call to g_io_channel_seek_position ().
- This includes the possibility of seeking with seek type %G_SEEK_CUR
- and an offset of zero. Note that this means that socket-based
- channels cannot be set unbuffered once they have had data
- read from them.
- On unbuffered channels, it is safe to mix read and write
- calls from the new and old APIs, if this is necessary for
- maintaining old code.
- The default state of the channel is buffered.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="buffered" transfer-ownership="none">
- <doc xml:space="preserve">whether to set the channel buffered or unbuffered</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_close_on_unref"
- c:identifier="g_io_channel_set_close_on_unref">
- <doc xml:space="preserve">Setting this flag to %TRUE for a channel you have already closed
- can cause problems.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="do_close" transfer-ownership="none">
- <doc xml:space="preserve">Whether to close the channel on the final unref of
- the GIOChannel data structure. The default value of
- this is %TRUE for channels created by g_io_channel_new_file (),
- and %FALSE for all other channels.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_encoding"
- c:identifier="g_io_channel_set_encoding"
- throws="1">
- <doc xml:space="preserve">Sets the encoding for the input/output of the channel.
- The internal encoding is always UTF-8. The default encoding
- for the external file is UTF-8.
- The encoding %NULL is safe to use with binary data.
- The encoding can only be set if one of the following conditions
- is true:
- - The channel was just created, and has not been written to or read from yet.
- - The channel is write-only.
- - The channel is a file, and the file pointer was just repositioned
- by a call to g_io_channel_seek_position(). (This flushes all the
- internal buffers.)
- - The current encoding is %NULL or UTF-8.
- - One of the (new API) read functions has just returned %G_IO_STATUS_EOF
- (or, in the case of g_io_channel_read_to_end(), %G_IO_STATUS_NORMAL).
- - One of the functions g_io_channel_read_chars() or
- g_io_channel_read_unichar() has returned %G_IO_STATUS_AGAIN or
- %G_IO_STATUS_ERROR. This may be useful in the case of
- %G_CONVERT_ERROR_ILLEGAL_SEQUENCE.
- Returning one of these statuses from g_io_channel_read_line(),
- g_io_channel_read_line_string(), or g_io_channel_read_to_end()
- does not guarantee that the encoding can be changed.
- Channels which do not meet one of the above conditions cannot call
- g_io_channel_seek_position() with an offset of %G_SEEK_CUR, and, if
- they are "seekable", cannot call g_io_channel_write_chars() after
- calling one of the API "read" functions.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%G_IO_STATUS_NORMAL if the encoding was successfully set</doc>
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="encoding"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the encoding type</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_flags"
- c:identifier="g_io_channel_set_flags"
- throws="1">
- <doc xml:space="preserve">Sets the (writeable) flags in @channel to (@flags & %G_IO_FLAG_SET_MASK).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the status of the operation.</doc>
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">the flags to set on the IO channel</doc>
- <type name="IOFlags" c:type="GIOFlags"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_line_term" c:identifier="g_io_channel_set_line_term">
- <doc xml:space="preserve">This sets the string that #GIOChannel uses to determine
- where in the file a line break occurs.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="line_term"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">The line termination string. Use %NULL for
- autodetect. Autodetection breaks on "\n", "\r\n", "\r", "\0",
- and the Unicode paragraph separator. Autodetection should not be
- used for anything other than file-based channels.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">The length of the termination string. If -1 is passed, the
- string is assumed to be nul-terminated. This option allows
- termination strings with embedded nuls.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="shutdown" c:identifier="g_io_channel_shutdown" throws="1">
- <doc xml:space="preserve">Close an IO channel. Any pending data to be written will be
- flushed if @flush is %TRUE. The channel will not be freed until the
- last reference is dropped using g_io_channel_unref().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the status of the operation.</doc>
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="flush" transfer-ownership="none">
- <doc xml:space="preserve">if %TRUE, flush pending</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="unix_get_fd" c:identifier="g_io_channel_unix_get_fd">
- <doc xml:space="preserve">Returns the file descriptor of the #GIOChannel.
- On Windows this function returns the file descriptor or socket of
- the #GIOChannel.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the file descriptor of the #GIOChannel.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel, created with g_io_channel_unix_new().</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_io_channel_unref">
- <doc xml:space="preserve">Decrements the reference count of a #GIOChannel.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="write"
- c:identifier="g_io_channel_write"
- deprecated="1"
- deprecated-version="2.2">
- <doc xml:space="preserve">Writes data to a #GIOChannel.</doc>
- <doc-deprecated xml:space="preserve">Use g_io_channel_write_chars() instead.</doc-deprecated>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%G_IO_ERROR_NONE if the operation was successful.</doc>
- <type name="IOError" c:type="GIOError"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="buf" transfer-ownership="none">
- <doc xml:space="preserve">the buffer containing the data to write</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="count" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes to write</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="bytes_written" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes actually written</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="write_chars"
- c:identifier="g_io_channel_write_chars"
- throws="1">
- <doc xml:space="preserve">Replacement for g_io_channel_write() with the new API.
- On seekable channels with encodings other than %NULL or UTF-8, generic
- mixing of reading and writing is not allowed. A call to g_io_channel_write_chars ()
- may only be made on a channel from which data has been read in the
- cases described in the documentation for g_io_channel_set_encoding ().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the status of the operation.</doc>
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="buf" transfer-ownership="none">
- <doc xml:space="preserve">a buffer to write data from</doc>
- <array zero-terminated="0" c:type="gchar*">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="count" transfer-ownership="none">
- <doc xml:space="preserve">the size of the buffer. If -1, the buffer
- is taken to be a nul-terminated string.</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="bytes_written"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">The number of bytes written. This can be nonzero
- even if the return value is not %G_IO_STATUS_NORMAL.
- If the return value is %G_IO_STATUS_NORMAL and the
- channel is blocking, this will always be equal
- to @count if @count >= 0.</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="write_unichar"
- c:identifier="g_io_channel_write_unichar"
- throws="1">
- <doc xml:space="preserve">Writes a Unicode character to @channel.
- This function cannot be called on a channel with %NULL encoding.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #GIOStatus</doc>
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <instance-parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </instance-parameter>
- <parameter name="thechar" transfer-ownership="none">
- <doc xml:space="preserve">a character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </method>
- <function name="error_from_errno"
- c:identifier="g_io_channel_error_from_errno">
- <doc xml:space="preserve">Converts an `errno` error number to a #GIOChannelError.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannelError error number, e.g.
- %G_IO_CHANNEL_ERROR_INVAL.</doc>
- <type name="IOChannelError" c:type="GIOChannelError"/>
- </return-value>
- <parameters>
- <parameter name="en" transfer-ownership="none">
- <doc xml:space="preserve">an `errno` error number, e.g. `EINVAL`</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="error_quark" c:identifier="g_io_channel_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- </record>
- <enumeration name="IOChannelError"
- c:type="GIOChannelError"
- glib:error-domain="g-io-channel-error-quark">
- <doc xml:space="preserve">Error codes returned by #GIOChannel operations.</doc>
- <member name="fbig" value="0" c:identifier="G_IO_CHANNEL_ERROR_FBIG">
- <doc xml:space="preserve">File too large.</doc>
- </member>
- <member name="inval" value="1" c:identifier="G_IO_CHANNEL_ERROR_INVAL">
- <doc xml:space="preserve">Invalid argument.</doc>
- </member>
- <member name="io" value="2" c:identifier="G_IO_CHANNEL_ERROR_IO">
- <doc xml:space="preserve">IO error.</doc>
- </member>
- <member name="isdir" value="3" c:identifier="G_IO_CHANNEL_ERROR_ISDIR">
- <doc xml:space="preserve">File is a directory.</doc>
- </member>
- <member name="nospc" value="4" c:identifier="G_IO_CHANNEL_ERROR_NOSPC">
- <doc xml:space="preserve">No space left on device.</doc>
- </member>
- <member name="nxio" value="5" c:identifier="G_IO_CHANNEL_ERROR_NXIO">
- <doc xml:space="preserve">No such device or address.</doc>
- </member>
- <member name="overflow"
- value="6"
- c:identifier="G_IO_CHANNEL_ERROR_OVERFLOW">
- <doc xml:space="preserve">Value too large for defined datatype.</doc>
- </member>
- <member name="pipe" value="7" c:identifier="G_IO_CHANNEL_ERROR_PIPE">
- <doc xml:space="preserve">Broken pipe.</doc>
- </member>
- <member name="failed" value="8" c:identifier="G_IO_CHANNEL_ERROR_FAILED">
- <doc xml:space="preserve">Some other error.</doc>
- </member>
- </enumeration>
- <bitfield name="IOCondition"
- glib:type-name="GIOCondition"
- glib:get-type="g_io_condition_get_type"
- c:type="GIOCondition">
- <doc xml:space="preserve">A bitwise combination representing a condition to watch for on an
- event source.</doc>
- <member name="in" value="1" c:identifier="G_IO_IN" glib:nick="in">
- <doc xml:space="preserve">There is data to read.</doc>
- </member>
- <member name="out" value="4" c:identifier="G_IO_OUT" glib:nick="out">
- <doc xml:space="preserve">Data can be written (without blocking).</doc>
- </member>
- <member name="pri" value="2" c:identifier="G_IO_PRI" glib:nick="pri">
- <doc xml:space="preserve">There is urgent data to read.</doc>
- </member>
- <member name="err" value="8" c:identifier="G_IO_ERR" glib:nick="err">
- <doc xml:space="preserve">Error condition.</doc>
- </member>
- <member name="hup" value="16" c:identifier="G_IO_HUP" glib:nick="hup">
- <doc xml:space="preserve">Hung up (the connection has been broken, usually for
- pipes and sockets).</doc>
- </member>
- <member name="nval" value="32" c:identifier="G_IO_NVAL" glib:nick="nval">
- <doc xml:space="preserve">Invalid request. The file descriptor is not open.</doc>
- </member>
- </bitfield>
- <enumeration name="IOError" c:type="GIOError">
- <doc xml:space="preserve">#GIOError is only used by the deprecated functions
- g_io_channel_read(), g_io_channel_write(), and g_io_channel_seek().</doc>
- <member name="none" value="0" c:identifier="G_IO_ERROR_NONE">
- <doc xml:space="preserve">no error</doc>
- </member>
- <member name="again" value="1" c:identifier="G_IO_ERROR_AGAIN">
- <doc xml:space="preserve">an EAGAIN error occurred</doc>
- </member>
- <member name="inval" value="2" c:identifier="G_IO_ERROR_INVAL">
- <doc xml:space="preserve">an EINVAL error occurred</doc>
- </member>
- <member name="unknown" value="3" c:identifier="G_IO_ERROR_UNKNOWN">
- <doc xml:space="preserve">another error occurred</doc>
- </member>
- </enumeration>
- <bitfield name="IOFlags" c:type="GIOFlags">
- <doc xml:space="preserve">Specifies properties of a #GIOChannel. Some of the flags can only be
- read with g_io_channel_get_flags(), but not changed with
- g_io_channel_set_flags().</doc>
- <member name="append" value="1" c:identifier="G_IO_FLAG_APPEND">
- <doc xml:space="preserve">turns on append mode, corresponds to %O_APPEND
- (see the documentation of the UNIX open() syscall)</doc>
- </member>
- <member name="nonblock" value="2" c:identifier="G_IO_FLAG_NONBLOCK">
- <doc xml:space="preserve">turns on nonblocking mode, corresponds to
- %O_NONBLOCK/%O_NDELAY (see the documentation of the UNIX open()
- syscall)</doc>
- </member>
- <member name="is_readable"
- value="4"
- c:identifier="G_IO_FLAG_IS_READABLE">
- <doc xml:space="preserve">indicates that the io channel is readable.
- This flag cannot be changed.</doc>
- </member>
- <member name="is_writable"
- value="8"
- c:identifier="G_IO_FLAG_IS_WRITABLE">
- <doc xml:space="preserve">indicates that the io channel is writable.
- This flag cannot be changed.</doc>
- </member>
- <member name="is_writeable"
- value="8"
- c:identifier="G_IO_FLAG_IS_WRITEABLE">
- <doc xml:space="preserve">a misspelled version of @G_IO_FLAG_IS_WRITABLE
- that existed before the spelling was fixed in GLib 2.30. It is kept
- here for compatibility reasons. Deprecated since 2.30</doc>
- </member>
- <member name="is_seekable"
- value="16"
- c:identifier="G_IO_FLAG_IS_SEEKABLE">
- <doc xml:space="preserve">indicates that the io channel is seekable,
- i.e. that g_io_channel_seek_position() can be used on it.
- This flag cannot be changed.</doc>
- </member>
- <member name="mask" value="31" c:identifier="G_IO_FLAG_MASK">
- <doc xml:space="preserve">the mask that specifies all the valid flags.</doc>
- </member>
- <member name="get_mask" value="31" c:identifier="G_IO_FLAG_GET_MASK">
- <doc xml:space="preserve">the mask of the flags that are returned from
- g_io_channel_get_flags()</doc>
- </member>
- <member name="set_mask" value="3" c:identifier="G_IO_FLAG_SET_MASK">
- <doc xml:space="preserve">the mask of the flags that the user can modify
- with g_io_channel_set_flags()</doc>
- </member>
- </bitfield>
- <callback name="IOFunc" c:type="GIOFunc">
- <doc xml:space="preserve">Specifies the type of function passed to g_io_add_watch() or
- g_io_add_watch_full(), which is called when the requested condition
- on a #GIOChannel is satisfied.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the function should return %FALSE if the event source
- should be removed</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">the #GIOChannel event source</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </parameter>
- <parameter name="condition" transfer-ownership="none">
- <doc xml:space="preserve">the condition which has been satisfied</doc>
- <type name="IOCondition" c:type="GIOCondition"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data set in g_io_add_watch() or g_io_add_watch_full()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <record name="IOFuncs" c:type="GIOFuncs">
- <doc xml:space="preserve">A table of functions used to handle different types of #GIOChannel
- in a generic way.</doc>
- <field name="io_read">
- <callback name="io_read" throws="1">
- <return-value transfer-ownership="none">
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <parameter name="channel" transfer-ownership="none">
- <type name="IOChannel" c:type="GIOChannel*"/>
- </parameter>
- <parameter name="buf" transfer-ownership="none">
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="count" transfer-ownership="none">
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="bytes_read" transfer-ownership="none">
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="io_write">
- <callback name="io_write" throws="1">
- <return-value transfer-ownership="none">
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <parameter name="channel" transfer-ownership="none">
- <type name="IOChannel" c:type="GIOChannel*"/>
- </parameter>
- <parameter name="buf" transfer-ownership="none">
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="count" transfer-ownership="none">
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="bytes_written" transfer-ownership="none">
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="io_seek">
- <callback name="io_seek" throws="1">
- <return-value transfer-ownership="none">
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <parameter name="channel" transfer-ownership="none">
- <type name="IOChannel" c:type="GIOChannel*"/>
- </parameter>
- <parameter name="offset" transfer-ownership="none">
- <type name="gint64" c:type="gint64"/>
- </parameter>
- <parameter name="type" transfer-ownership="none">
- <type name="SeekType" c:type="GSeekType"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="io_close">
- <callback name="io_close" throws="1">
- <return-value transfer-ownership="none">
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <parameter name="channel" transfer-ownership="none">
- <type name="IOChannel" c:type="GIOChannel*"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="io_create_watch">
- <callback name="io_create_watch">
- <return-value transfer-ownership="full">
- <type name="Source" c:type="GSource*"/>
- </return-value>
- <parameters>
- <parameter name="channel" transfer-ownership="none">
- <type name="IOChannel" c:type="GIOChannel*"/>
- </parameter>
- <parameter name="condition" transfer-ownership="none">
- <type name="IOCondition" c:type="GIOCondition"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="io_free">
- <callback name="io_free">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="channel" transfer-ownership="none">
- <type name="IOChannel" c:type="GIOChannel*"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="io_set_flags">
- <callback name="io_set_flags" throws="1">
- <return-value transfer-ownership="none">
- <type name="IOStatus" c:type="GIOStatus"/>
- </return-value>
- <parameters>
- <parameter name="channel" transfer-ownership="none">
- <type name="IOChannel" c:type="GIOChannel*"/>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <type name="IOFlags" c:type="GIOFlags"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="io_get_flags">
- <callback name="io_get_flags">
- <return-value transfer-ownership="none">
- <type name="IOFlags" c:type="GIOFlags"/>
- </return-value>
- <parameters>
- <parameter name="channel" transfer-ownership="none">
- <type name="IOChannel" c:type="GIOChannel*"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- </record>
- <enumeration name="IOStatus" c:type="GIOStatus">
- <doc xml:space="preserve">Stati returned by most of the #GIOFuncs functions.</doc>
- <member name="error" value="0" c:identifier="G_IO_STATUS_ERROR">
- <doc xml:space="preserve">An error occurred.</doc>
- </member>
- <member name="normal" value="1" c:identifier="G_IO_STATUS_NORMAL">
- <doc xml:space="preserve">Success.</doc>
- </member>
- <member name="eof" value="2" c:identifier="G_IO_STATUS_EOF">
- <doc xml:space="preserve">End of file.</doc>
- </member>
- <member name="again" value="3" c:identifier="G_IO_STATUS_AGAIN">
- <doc xml:space="preserve">Resource temporarily unavailable.</doc>
- </member>
- </enumeration>
- <constant name="KEY_FILE_DESKTOP_GROUP"
- value="Desktop Entry"
- c:type="G_KEY_FILE_DESKTOP_GROUP"
- version="2.14">
- <doc xml:space="preserve">The name of the main group of a desktop entry file, as defined in the
- [Desktop Entry Specification](http://freedesktop.org/Standards/desktop-entry-spec).
- Consult the specification for more
- details about the meanings of the keys below.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_ACTIONS"
- value="Actions"
- c:type="G_KEY_FILE_DESKTOP_KEY_ACTIONS"
- version="2.38">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a string list
- giving the available application actions.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_CATEGORIES"
- value="Categories"
- c:type="G_KEY_FILE_DESKTOP_KEY_CATEGORIES"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a list
- of strings giving the categories in which the desktop entry
- should be shown in a menu.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_COMMENT"
- value="Comment"
- c:type="G_KEY_FILE_DESKTOP_KEY_COMMENT"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
- string giving the tooltip for the desktop entry.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE"
- value="DBusActivatable"
- c:type="G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE"
- version="2.38">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean set to true
- if the application is D-Bus activatable.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_EXEC"
- value="Exec"
- c:type="G_KEY_FILE_DESKTOP_KEY_EXEC"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a string
- giving the command line to execute. It is only valid for desktop
- entries with the `Application` type.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_GENERIC_NAME"
- value="GenericName"
- c:type="G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
- string giving the generic name of the desktop entry.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_HIDDEN"
- value="Hidden"
- c:type="G_KEY_FILE_DESKTOP_KEY_HIDDEN"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
- stating whether the desktop entry has been deleted by the user.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_ICON"
- value="Icon"
- c:type="G_KEY_FILE_DESKTOP_KEY_ICON"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
- string giving the name of the icon to be displayed for the desktop
- entry.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_MIME_TYPE"
- value="MimeType"
- c:type="G_KEY_FILE_DESKTOP_KEY_MIME_TYPE"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a list
- of strings giving the MIME types supported by this desktop entry.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_NAME"
- value="Name"
- c:type="G_KEY_FILE_DESKTOP_KEY_NAME"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
- string giving the specific name of the desktop entry.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN"
- value="NotShowIn"
- c:type="G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a list of
- strings identifying the environments that should not display the
- desktop entry.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_NO_DISPLAY"
- value="NoDisplay"
- c:type="G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
- stating whether the desktop entry should be shown in menus.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN"
- value="OnlyShowIn"
- c:type="G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a list of
- strings identifying the environments that should display the
- desktop entry.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_PATH"
- value="Path"
- c:type="G_KEY_FILE_DESKTOP_KEY_PATH"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a string
- containing the working directory to run the program in. It is only
- valid for desktop entries with the `Application` type.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY"
- value="StartupNotify"
- c:type="G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
- stating whether the application supports the
- [Startup Notification Protocol Specification](http://www.freedesktop.org/Standards/startup-notification-spec).</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS"
- value="StartupWMClass"
- c:type="G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is string
- identifying the WM class or name hint of a window that the application
- will create, which can be used to emulate Startup Notification with
- older applications.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_TERMINAL"
- value="Terminal"
- c:type="G_KEY_FILE_DESKTOP_KEY_TERMINAL"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
- stating whether the program should be run in a terminal window.
- It is only valid for desktop entries with the
- `Application` type.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_TRY_EXEC"
- value="TryExec"
- c:type="G_KEY_FILE_DESKTOP_KEY_TRY_EXEC"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a string
- giving the file name of a binary on disk used to determine if the
- program is actually installed. It is only valid for desktop entries
- with the `Application` type.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_TYPE"
- value="Type"
- c:type="G_KEY_FILE_DESKTOP_KEY_TYPE"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a string
- giving the type of the desktop entry. Usually
- #G_KEY_FILE_DESKTOP_TYPE_APPLICATION,
- #G_KEY_FILE_DESKTOP_TYPE_LINK, or
- #G_KEY_FILE_DESKTOP_TYPE_DIRECTORY.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_URL"
- value="URL"
- c:type="G_KEY_FILE_DESKTOP_KEY_URL"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a string
- giving the URL to access. It is only valid for desktop entries
- with the `Link` type.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_KEY_VERSION"
- value="Version"
- c:type="G_KEY_FILE_DESKTOP_KEY_VERSION"
- version="2.14">
- <doc xml:space="preserve">A key under #G_KEY_FILE_DESKTOP_GROUP, whose value is a string
- giving the version of the Desktop Entry Specification used for
- the desktop entry file.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_TYPE_APPLICATION"
- value="Application"
- c:type="G_KEY_FILE_DESKTOP_TYPE_APPLICATION"
- version="2.14">
- <doc xml:space="preserve">The value of the #G_KEY_FILE_DESKTOP_KEY_TYPE, key for desktop
- entries representing applications.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_TYPE_DIRECTORY"
- value="Directory"
- c:type="G_KEY_FILE_DESKTOP_TYPE_DIRECTORY"
- version="2.14">
- <doc xml:space="preserve">The value of the #G_KEY_FILE_DESKTOP_KEY_TYPE, key for desktop
- entries representing directories.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="KEY_FILE_DESKTOP_TYPE_LINK"
- value="Link"
- c:type="G_KEY_FILE_DESKTOP_TYPE_LINK"
- version="2.14">
- <doc xml:space="preserve">The value of the #G_KEY_FILE_DESKTOP_KEY_TYPE, key for desktop
- entries representing links to documents.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <record name="KeyFile"
- c:type="GKeyFile"
- glib:type-name="GKeyFile"
- glib:get-type="g_key_file_get_type"
- c:symbol-prefix="key_file">
- <doc xml:space="preserve">The GKeyFile struct contains only private data
- and should not be accessed directly.</doc>
- <constructor name="new" c:identifier="g_key_file_new" version="2.6">
- <doc xml:space="preserve">Creates a new empty #GKeyFile object. Use
- g_key_file_load_from_file(), g_key_file_load_from_data(),
- g_key_file_load_from_dirs() or g_key_file_load_from_data_dirs() to
- read an existing key file.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">an empty #GKeyFile.</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </return-value>
- </constructor>
- <method name="free"
- c:identifier="g_key_file_free"
- version="2.6"
- introspectable="0">
- <doc xml:space="preserve">Clears all keys and groups from @key_file, and decreases the
- reference count by 1. If the reference count reaches zero,
- frees the key file and all its allocated memory.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_boolean"
- c:identifier="g_key_file_get_boolean"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Returns the value associated with @key under @group_name as a
- boolean.
- If @key cannot be found then %FALSE is returned and @error is set
- to #G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the value
- associated with @key cannot be interpreted as a boolean then %FALSE
- is returned and @error is set to #G_KEY_FILE_ERROR_INVALID_VALUE.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value associated with the key as a boolean,
- or %FALSE if the key was not found or could not be parsed.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_boolean_list"
- c:identifier="g_key_file_get_boolean_list"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Returns the values associated with @key under @group_name as
- booleans.
- If @key cannot be found then %NULL is returned and @error is set to
- #G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the values associated
- with @key cannot be interpreted as booleans then %NULL is returned
- and @error is set to #G_KEY_FILE_ERROR_INVALID_VALUE.</doc>
- <return-value transfer-ownership="container">
- <doc xml:space="preserve">
- the values associated with the key as a list of booleans, or %NULL if the
- key was not found or could not be parsed. The returned list of booleans
- should be freed with g_free() when no longer needed.</doc>
- <array length="2" zero-terminated="0" c:type="gboolean*">
- <type name="gboolean"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">the number of booleans returned</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_comment"
- c:identifier="g_key_file_get_comment"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Retrieves a comment above @key from @group_name.
- If @key is %NULL then @comment will be read from above
- @group_name. If both @key and @group_name are %NULL, then
- @comment will be read from above the first group in the file.
- Note that the returned string includes the '#' comment markers.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a comment that should be freed with g_free()</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a group name, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_double"
- c:identifier="g_key_file_get_double"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Returns the value associated with @key under @group_name as a
- double. If @group_name is %NULL, the start_group is used.
- If @key cannot be found then 0.0 is returned and @error is set to
- #G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the value associated
- with @key cannot be interpreted as a double then 0.0 is returned
- and @error is set to #G_KEY_FILE_ERROR_INVALID_VALUE.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value associated with the key as a double, or
- 0.0 if the key was not found or could not be parsed.</doc>
- <type name="gdouble" c:type="gdouble"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_double_list"
- c:identifier="g_key_file_get_double_list"
- version="2.12"
- throws="1">
- <doc xml:space="preserve">Returns the values associated with @key under @group_name as
- doubles.
- If @key cannot be found then %NULL is returned and @error is set to
- #G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the values associated
- with @key cannot be interpreted as doubles then %NULL is returned
- and @error is set to #G_KEY_FILE_ERROR_INVALID_VALUE.</doc>
- <return-value transfer-ownership="container">
- <doc xml:space="preserve">
- the values associated with the key as a list of doubles, or %NULL if the
- key was not found or could not be parsed. The returned list of doubles
- should be freed with g_free() when no longer needed.</doc>
- <array length="2" zero-terminated="0" c:type="gdouble*">
- <type name="gdouble"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">the number of doubles returned</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_groups"
- c:identifier="g_key_file_get_groups"
- version="2.6">
- <doc xml:space="preserve">Returns all groups in the key file loaded with @key_file.
- The array of returned groups will be %NULL-terminated, so
- @length may optionally be %NULL.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated %NULL-terminated array of strings.
- Use g_strfreev() to free it.</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the number of returned groups, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_int64"
- c:identifier="g_key_file_get_int64"
- version="2.26"
- throws="1">
- <doc xml:space="preserve">Returns the value associated with @key under @group_name as a signed
- 64-bit integer. This is similar to g_key_file_get_integer() but can return
- 64-bit results without truncation.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value associated with the key as a signed 64-bit integer, or
- 0 if the key was not found or could not be parsed.</doc>
- <type name="gint64" c:type="gint64"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a non-%NULL #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a non-%NULL group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a non-%NULL key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_integer"
- c:identifier="g_key_file_get_integer"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Returns the value associated with @key under @group_name as an
- integer.
- If @key cannot be found then 0 is returned and @error is set to
- #G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the value associated
- with @key cannot be interpreted as an integer then 0 is returned
- and @error is set to #G_KEY_FILE_ERROR_INVALID_VALUE.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value associated with the key as an integer, or
- 0 if the key was not found or could not be parsed.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_integer_list"
- c:identifier="g_key_file_get_integer_list"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Returns the values associated with @key under @group_name as
- integers.
- If @key cannot be found then %NULL is returned and @error is set to
- #G_KEY_FILE_ERROR_KEY_NOT_FOUND. Likewise, if the values associated
- with @key cannot be interpreted as integers then %NULL is returned
- and @error is set to #G_KEY_FILE_ERROR_INVALID_VALUE.</doc>
- <return-value transfer-ownership="container">
- <doc xml:space="preserve">
- the values associated with the key as a list of integers, or %NULL if
- the key was not found or could not be parsed. The returned list of
- integers should be freed with g_free() when no longer needed.</doc>
- <array length="2" zero-terminated="0" c:type="gint*">
- <type name="gint"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">the number of integers returned</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_keys"
- c:identifier="g_key_file_get_keys"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Returns all keys for the group name @group_name. The array of
- returned keys will be %NULL-terminated, so @length may
- optionally be %NULL. In the event that the @group_name cannot
- be found, %NULL is returned and @error is set to
- #G_KEY_FILE_ERROR_GROUP_NOT_FOUND.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated %NULL-terminated array of strings.
- Use g_strfreev() to free it.</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the number of keys returned, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_locale_string"
- c:identifier="g_key_file_get_locale_string"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Returns the value associated with @key under @group_name
- translated in the given @locale if available. If @locale is
- %NULL then the current locale is assumed.
- If @key cannot be found then %NULL is returned and @error is set
- to #G_KEY_FILE_ERROR_KEY_NOT_FOUND. If the value associated
- with @key cannot be interpreted or no suitable translation can
- be found then the untranslated value is returned.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string or %NULL if the specified
- key cannot be found.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="locale"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a locale identifier or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_locale_string_list"
- c:identifier="g_key_file_get_locale_string_list"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Returns the values associated with @key under @group_name
- translated in the given @locale if available. If @locale is
- %NULL then the current locale is assumed.
- If @key cannot be found then %NULL is returned and @error is set
- to #G_KEY_FILE_ERROR_KEY_NOT_FOUND. If the values associated
- with @key cannot be interpreted or no suitable translations
- can be found then the untranslated values are returned. The
- returned array is %NULL-terminated, so @length may optionally
- be %NULL.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated %NULL-terminated string array
- or %NULL if the key isn't found. The string array should be freed
- with g_strfreev().</doc>
- <array length="3" zero-terminated="1" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="locale"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a locale identifier or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the number of returned strings or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_start_group"
- c:identifier="g_key_file_get_start_group"
- version="2.6">
- <doc xml:space="preserve">Returns the name of the start group of the file.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">The start group of the key file.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_string"
- c:identifier="g_key_file_get_string"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Returns the string value associated with @key under @group_name.
- Unlike g_key_file_get_value(), this function handles escape sequences
- like \s.
- In the event the key cannot be found, %NULL is returned and
- @error is set to #G_KEY_FILE_ERROR_KEY_NOT_FOUND. In the
- event that the @group_name cannot be found, %NULL is returned
- and @error is set to #G_KEY_FILE_ERROR_GROUP_NOT_FOUND.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string or %NULL if the specified
- key cannot be found.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_string_list"
- c:identifier="g_key_file_get_string_list"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Returns the values associated with @key under @group_name.
- In the event the key cannot be found, %NULL is returned and
- @error is set to #G_KEY_FILE_ERROR_KEY_NOT_FOUND. In the
- event that the @group_name cannot be found, %NULL is returned
- and @error is set to #G_KEY_FILE_ERROR_GROUP_NOT_FOUND.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">
- a %NULL-terminated string array or %NULL if the specified
- key cannot be found. The array should be freed with g_strfreev().</doc>
- <array length="2" zero-terminated="1" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the number of returned strings, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_uint64"
- c:identifier="g_key_file_get_uint64"
- version="2.26"
- throws="1">
- <doc xml:space="preserve">Returns the value associated with @key under @group_name as an unsigned
- 64-bit integer. This is similar to g_key_file_get_integer() but can return
- large positive results without truncation.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value associated with the key as an unsigned 64-bit integer,
- or 0 if the key was not found or could not be parsed.</doc>
- <type name="guint64" c:type="guint64"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a non-%NULL #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a non-%NULL group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a non-%NULL key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_value"
- c:identifier="g_key_file_get_value"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Returns the raw value associated with @key under @group_name.
- Use g_key_file_get_string() to retrieve an unescaped UTF-8 string.
- In the event the key cannot be found, %NULL is returned and
- @error is set to #G_KEY_FILE_ERROR_KEY_NOT_FOUND. In the
- event that the @group_name cannot be found, %NULL is returned
- and @error is set to #G_KEY_FILE_ERROR_GROUP_NOT_FOUND.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string or %NULL if the specified
- key cannot be found.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="has_group"
- c:identifier="g_key_file_has_group"
- version="2.6">
- <doc xml:space="preserve">Looks whether the key file has the group @group_name.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @group_name is a part of @key_file, %FALSE
- otherwise.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="has_key"
- c:identifier="g_key_file_has_key"
- version="2.6"
- introspectable="0"
- throws="1">
- <doc xml:space="preserve">Looks whether the key file has the key @key in the group
- @group_name.
- Note that this function does not follow the rules for #GError strictly;
- the return value both carries meaning and signals an error. To use
- this function, you must pass a #GError pointer in @error, and check
- whether it is not %NULL to see if an error occurred.
- Language bindings should use g_key_file_get_value() to test whether
- or not a key exists.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @key is a part of @group_name, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="load_from_data"
- c:identifier="g_key_file_load_from_data"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Loads a key file from memory into an empty #GKeyFile structure.
- If the object cannot be created then %error is set to a #GKeyFileError.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a key file could be loaded, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">an empty #GKeyFile struct</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">key file loaded in memory</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of @data in bytes (or (gsize)-1 if data is nul-terminated)</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">flags from #GKeyFileFlags</doc>
- <type name="KeyFileFlags" c:type="GKeyFileFlags"/>
- </parameter>
- </parameters>
- </method>
- <method name="load_from_data_dirs"
- c:identifier="g_key_file_load_from_data_dirs"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">This function looks for a key file named @file in the paths
- returned from g_get_user_data_dir() and g_get_system_data_dirs(),
- loads the file into @key_file and returns the file's full path in
- @full_path. If the file could not be loaded then an %error is
- set to either a #GFileError or #GKeyFileError.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a key file could be loaded, %FALSE othewise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">an empty #GKeyFile struct</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="file" transfer-ownership="none">
- <doc xml:space="preserve">a relative path to a filename to open and parse</doc>
- <type name="filename" c:type="gchar*"/>
- </parameter>
- <parameter name="full_path"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for a string containing the full path
- of the file, or %NULL</doc>
- <type name="filename" c:type="gchar**"/>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">flags from #GKeyFileFlags</doc>
- <type name="KeyFileFlags" c:type="GKeyFileFlags"/>
- </parameter>
- </parameters>
- </method>
- <method name="load_from_dirs"
- c:identifier="g_key_file_load_from_dirs"
- version="2.14"
- throws="1">
- <doc xml:space="preserve">This function looks for a key file named @file in the paths
- specified in @search_dirs, loads the file into @key_file and
- returns the file's full path in @full_path. If the file could not
- be loaded then an %error is set to either a #GFileError or
- #GKeyFileError.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a key file could be loaded, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">an empty #GKeyFile struct</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="file" transfer-ownership="none">
- <doc xml:space="preserve">a relative path to a filename to open and parse</doc>
- <type name="filename" c:type="gchar*"/>
- </parameter>
- <parameter name="search_dirs" transfer-ownership="none">
- <doc xml:space="preserve">%NULL-terminated array of directories to search</doc>
- <array c:type="gchar**">
- <type name="filename"/>
- </array>
- </parameter>
- <parameter name="full_path"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for a string containing the full path
- of the file, or %NULL</doc>
- <type name="filename" c:type="gchar**"/>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">flags from #GKeyFileFlags</doc>
- <type name="KeyFileFlags" c:type="GKeyFileFlags"/>
- </parameter>
- </parameters>
- </method>
- <method name="load_from_file"
- c:identifier="g_key_file_load_from_file"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Loads a key file into an empty #GKeyFile structure.
- If the file could not be loaded then @error is set to
- either a #GFileError or #GKeyFileError.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a key file could be loaded, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">an empty #GKeyFile struct</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="file" transfer-ownership="none">
- <doc xml:space="preserve">the path of a filename to load, in the GLib filename encoding</doc>
- <type name="filename" c:type="gchar*"/>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">flags from #GKeyFileFlags</doc>
- <type name="KeyFileFlags" c:type="GKeyFileFlags"/>
- </parameter>
- </parameters>
- </method>
- <method name="ref"
- c:identifier="g_key_file_ref"
- version="2.32"
- introspectable="0">
- <doc xml:space="preserve">Increases the reference count of @key_file.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the same @key_file.</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="remove_comment"
- c:identifier="g_key_file_remove_comment"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Removes a comment above @key from @group_name.
- If @key is %NULL then @comment will be removed above @group_name.
- If both @key and @group_name are %NULL, then @comment will
- be removed above the first group in the file.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the comment was removed, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a group name, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="remove_group"
- c:identifier="g_key_file_remove_group"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Removes the specified group, @group_name,
- from the key file.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the group was removed, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="remove_key"
- c:identifier="g_key_file_remove_key"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Removes @key in @group_name from the key file.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key was removed, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key name to remove</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="save_to_file"
- c:identifier="g_key_file_save_to_file"
- version="2.40"
- throws="1">
- <doc xml:space="preserve">Writes the contents of @key_file to @filename using
- g_file_set_contents().
- This function can fail for any of the reasons that
- g_file_set_contents() may fail.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if successful, else %FALSE with @error set</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">the name of the file to write to</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_boolean"
- c:identifier="g_key_file_set_boolean"
- version="2.6">
- <doc xml:space="preserve">Associates a new boolean value with @key under @group_name.
- If @key cannot be found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE or %FALSE</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_boolean_list"
- c:identifier="g_key_file_set_boolean_list"
- version="2.6">
- <doc xml:space="preserve">Associates a list of boolean values with @key under @group_name.
- If @key cannot be found then it is created.
- If @group_name is %NULL, the start_group is used.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">an array of boolean values</doc>
- <array length="3" zero-terminated="0" c:type="gboolean">
- <type name="gboolean" c:type="gboolean"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">length of @list</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_comment"
- c:identifier="g_key_file_set_comment"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Places a comment above @key from @group_name.
- If @key is %NULL then @comment will be written above @group_name.
- If both @key and @group_name are %NULL, then @comment will be
- written above the first group in the file.
- Note that this function prepends a '#' comment marker to
- each line of @comment.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the comment was written, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a group name, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="comment" transfer-ownership="none">
- <doc xml:space="preserve">a comment</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_double"
- c:identifier="g_key_file_set_double"
- version="2.12">
- <doc xml:space="preserve">Associates a new double value with @key under @group_name.
- If @key cannot be found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">an double value</doc>
- <type name="gdouble" c:type="gdouble"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_double_list"
- c:identifier="g_key_file_set_double_list"
- version="2.12">
- <doc xml:space="preserve">Associates a list of double values with @key under
- @group_name. If @key cannot be found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">an array of double values</doc>
- <array length="3" zero-terminated="0" c:type="gdouble">
- <type name="gdouble" c:type="gdouble"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">number of double values in @list</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_int64"
- c:identifier="g_key_file_set_int64"
- version="2.26">
- <doc xml:space="preserve">Associates a new integer value with @key under @group_name.
- If @key cannot be found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">an integer value</doc>
- <type name="gint64" c:type="gint64"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_integer"
- c:identifier="g_key_file_set_integer"
- version="2.6">
- <doc xml:space="preserve">Associates a new integer value with @key under @group_name.
- If @key cannot be found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">an integer value</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_integer_list"
- c:identifier="g_key_file_set_integer_list"
- version="2.6">
- <doc xml:space="preserve">Associates a list of integer values with @key under @group_name.
- If @key cannot be found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">an array of integer values</doc>
- <array length="3" zero-terminated="0" c:type="gint">
- <type name="gint" c:type="gint"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">number of integer values in @list</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_list_separator"
- c:identifier="g_key_file_set_list_separator"
- version="2.6">
- <doc xml:space="preserve">Sets the character which is used to separate
- values in lists. Typically ';' or ',' are used
- as separators. The default list separator is ';'.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="separator" transfer-ownership="none">
- <doc xml:space="preserve">the separator</doc>
- <type name="gchar" c:type="gchar"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_locale_string"
- c:identifier="g_key_file_set_locale_string"
- version="2.6">
- <doc xml:space="preserve">Associates a string value for @key and @locale under @group_name.
- If the translation for @key cannot be found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="locale" transfer-ownership="none">
- <doc xml:space="preserve">a locale identifier</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_locale_string_list"
- c:identifier="g_key_file_set_locale_string_list"
- version="2.6">
- <doc xml:space="preserve">Associates a list of string values for @key and @locale under
- @group_name. If the translation for @key cannot be found then
- it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="locale" transfer-ownership="none">
- <doc xml:space="preserve">a locale identifier</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a %NULL-terminated array of locale string values</doc>
- <array length="4" zero-terminated="1" c:type="gchar*">
- <type name="utf8" c:type="gchar"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of @list</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_string"
- c:identifier="g_key_file_set_string"
- version="2.6">
- <doc xml:space="preserve">Associates a new string value with @key under @group_name.
- If @key cannot be found then it is created.
- If @group_name cannot be found then it is created.
- Unlike g_key_file_set_value(), this function handles characters
- that need escaping, such as newlines.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_string_list"
- c:identifier="g_key_file_set_string_list"
- version="2.6">
- <doc xml:space="preserve">Associates a list of string values for @key under @group_name.
- If @key cannot be found then it is created.
- If @group_name cannot be found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">an array of string values</doc>
- <array length="3" zero-terminated="1" c:type="gchar*">
- <type name="utf8"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">number of string values in @list</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_uint64"
- c:identifier="g_key_file_set_uint64"
- version="2.26">
- <doc xml:space="preserve">Associates a new integer value with @key under @group_name.
- If @key cannot be found then it is created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">an integer value</doc>
- <type name="guint64" c:type="guint64"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_value"
- c:identifier="g_key_file_set_value"
- version="2.6">
- <doc xml:space="preserve">Associates a new value with @key under @group_name.
- If @key cannot be found then it is created. If @group_name cannot
- be found then it is created. To set an UTF-8 string which may contain
- characters that need escaping (such as newlines or spaces), use
- g_key_file_set_string().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="group_name" transfer-ownership="none">
- <doc xml:space="preserve">a group name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="to_data"
- c:identifier="g_key_file_to_data"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">This function outputs @key_file as a string.
- Note that this function never reports an error,
- so it is safe to pass %NULL as @error.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string holding
- the contents of the #GKeyFile</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the length of the
- returned string, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_key_file_unref" version="2.32">
- <doc xml:space="preserve">Decreases the reference count of @key_file by 1. If the reference count
- reaches zero, frees the key file and all its allocated memory.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key_file" transfer-ownership="none">
- <doc xml:space="preserve">a #GKeyFile</doc>
- <type name="KeyFile" c:type="GKeyFile*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="error_quark" c:identifier="g_key_file_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- </record>
- <enumeration name="KeyFileError"
- c:type="GKeyFileError"
- glib:error-domain="g-key-file-error-quark">
- <doc xml:space="preserve">Error codes returned by key file parsing.</doc>
- <member name="unknown_encoding"
- value="0"
- c:identifier="G_KEY_FILE_ERROR_UNKNOWN_ENCODING">
- <doc xml:space="preserve">the text being parsed was in
- an unknown encoding</doc>
- </member>
- <member name="parse" value="1" c:identifier="G_KEY_FILE_ERROR_PARSE">
- <doc xml:space="preserve">document was ill-formed</doc>
- </member>
- <member name="not_found"
- value="2"
- c:identifier="G_KEY_FILE_ERROR_NOT_FOUND">
- <doc xml:space="preserve">the file was not found</doc>
- </member>
- <member name="key_not_found"
- value="3"
- c:identifier="G_KEY_FILE_ERROR_KEY_NOT_FOUND">
- <doc xml:space="preserve">a requested key was not found</doc>
- </member>
- <member name="group_not_found"
- value="4"
- c:identifier="G_KEY_FILE_ERROR_GROUP_NOT_FOUND">
- <doc xml:space="preserve">a requested group was not found</doc>
- </member>
- <member name="invalid_value"
- value="5"
- c:identifier="G_KEY_FILE_ERROR_INVALID_VALUE">
- <doc xml:space="preserve">a value could not be parsed</doc>
- </member>
- </enumeration>
- <bitfield name="KeyFileFlags" c:type="GKeyFileFlags">
- <doc xml:space="preserve">Flags which influence the parsing.</doc>
- <member name="none" value="0" c:identifier="G_KEY_FILE_NONE">
- <doc xml:space="preserve">No flags, default behaviour</doc>
- </member>
- <member name="keep_comments"
- value="1"
- c:identifier="G_KEY_FILE_KEEP_COMMENTS">
- <doc xml:space="preserve">Use this flag if you plan to write the
- (possibly modified) contents of the key file back to a file;
- otherwise all comments will be lost when the key file is
- written back.</doc>
- </member>
- <member name="keep_translations"
- value="2"
- c:identifier="G_KEY_FILE_KEEP_TRANSLATIONS">
- <doc xml:space="preserve">Use this flag if you plan to write the
- (possibly modified) contents of the key file back to a file;
- otherwise only the translations for the current language will be
- written back.</doc>
- </member>
- </bitfield>
- <constant name="LITTLE_ENDIAN" value="1234" c:type="G_LITTLE_ENDIAN">
- <doc xml:space="preserve">Specifies one of the possible types of byte order.
- See #G_BYTE_ORDER.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="LN10" value="2.302585" c:type="G_LN10">
- <doc xml:space="preserve">The natural logarithm of 10.</doc>
- <type name="gdouble" c:type="gdouble"/>
- </constant>
- <constant name="LN2" value="0.693147" c:type="G_LN2">
- <doc xml:space="preserve">The natural logarithm of 2.</doc>
- <type name="gdouble" c:type="gdouble"/>
- </constant>
- <constant name="LOG_2_BASE_10" value="0.301030" c:type="G_LOG_2_BASE_10">
- <doc xml:space="preserve">Multiplying the base 2 exponent by this number yields the base 10 exponent.</doc>
- <type name="gdouble" c:type="gdouble"/>
- </constant>
- <constant name="LOG_DOMAIN" value="0" c:type="G_LOG_DOMAIN">
- <doc xml:space="preserve">Defines the log domain.
- For applications, this is typically left as the default %NULL
- (or "") domain. Libraries should define this so that any messages
- which they log can be differentiated from messages from other
- libraries and application code. But be careful not to define
- it in any public header files.
- For example, GTK+ uses this in its Makefile.am:
- |[
- AM_CPPFLAGS = -DG_LOG_DOMAIN=\"Gtk\"
- ]|</doc>
- <type name="gchar" c:type="gchar"/>
- </constant>
- <constant name="LOG_FATAL_MASK" value="0" c:type="G_LOG_FATAL_MASK">
- <doc xml:space="preserve">GLib log levels that are considered fatal by default.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="LOG_LEVEL_USER_SHIFT"
- value="8"
- c:type="G_LOG_LEVEL_USER_SHIFT">
- <doc xml:space="preserve">Log levels below 1<<G_LOG_LEVEL_USER_SHIFT are used by GLib.
- Higher bits can be used for user-defined log levels.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <record name="List" c:type="GList">
- <doc xml:space="preserve">The #GList struct is used for each element in a doubly-linked list.</doc>
- <field name="data" writable="1">
- <doc xml:space="preserve">holds the element's data, which can be a pointer to any kind
- of data, or any integer value using the
- [Type Conversion Macros][glib-Type-Conversion-Macros]</doc>
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="next" writable="1">
- <doc xml:space="preserve">contains the link to the next element in the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </field>
- <field name="prev" writable="1">
- <doc xml:space="preserve">contains the link to the previous element in the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </field>
- <function name="alloc" c:identifier="g_list_alloc" introspectable="0">
- <doc xml:space="preserve">Allocates space for one #GList element. It is called by
- g_list_append(), g_list_prepend(), g_list_insert() and
- g_list_insert_sorted() and so is rarely used on its own.</doc>
- <return-value>
- <doc xml:space="preserve">a pointer to the newly-allocated #GList element</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- </function>
- <function name="append" c:identifier="g_list_append" introspectable="0">
- <doc xml:space="preserve">Adds a new element on to the end of the list.
- Note that the return value is the new start of the list,
- if @list was empty; make sure you store the new value.
- g_list_append() has to traverse the entire list to find the end,
- which is inefficient when adding multiple elements. A common idiom
- to avoid the inefficiency is to use g_list_prepend() and reverse
- the list with g_list_reverse() when all elements have been added.
- |[<!-- language="C" -->
- // Notice that these are initialized to the empty list.
- GList *string_list = NULL, *number_list = NULL;
- // This is a list of strings.
- string_list = g_list_append (string_list, "first");
- string_list = g_list_append (string_list, "second");
- // This is a list of integers.
- number_list = g_list_append (number_list, GINT_TO_POINTER (27));
- number_list = g_list_append (number_list, GINT_TO_POINTER (14));
- ]|</doc>
- <return-value>
- <doc xml:space="preserve">either @list or the new start of the #GList if @list was %NULL</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new element</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="concat" c:identifier="g_list_concat" introspectable="0">
- <doc xml:space="preserve">Adds the second #GList onto the end of the first #GList.
- Note that the elements of the second #GList are not copied.
- They are used directly.
- This function is for example used to move an element in the list.
- The following example moves an element to the top of the list:
- |[<!-- language="C" -->
- list = g_list_remove_link (list, llink);
- list = g_list_concat (llink, list);
- ]|</doc>
- <return-value>
- <doc xml:space="preserve">the start of the new #GList, which equals @list1 if not %NULL</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list1" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="list2" transfer-ownership="none">
- <doc xml:space="preserve">the #GList to add to the end of the first #GList,
- this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="copy" c:identifier="g_list_copy" introspectable="0">
- <doc xml:space="preserve">Copies a #GList.
- Note that this is a "shallow" copy. If the list elements
- consist of pointers to data, the pointers are copied but
- the actual data is not. See g_list_copy_deep() if you need
- to copy the data as well.</doc>
- <return-value>
- <doc xml:space="preserve">the start of the new list that holds the same data as @list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="copy_deep"
- c:identifier="g_list_copy_deep"
- version="2.34"
- introspectable="0">
- <doc xml:space="preserve">Makes a full (deep) copy of a #GList.
- In contrast with g_list_copy(), this function uses @func to make
- a copy of each list element, in addition to copying the list
- container itself.
- @func, as a #GCopyFunc, takes two arguments, the data to be copied
- and a @user_data pointer. It's safe to pass %NULL as user_data,
- if the copy function takes only one argument.
- For instance, if @list holds a list of GObjects, you can do:
- |[<!-- language="C" -->
- another_list = g_list_copy_deep (list, (GCopyFunc) g_object_ref, NULL);
- ]|
- And, to entirely free the new list, you could do:
- |[<!-- language="C" -->
- g_list_free_full (another_list, g_object_unref);
- ]|</doc>
- <return-value>
- <doc xml:space="preserve">the start of the new list that holds a full copy of @list,
- use g_list_free_full() to free it</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">a copy function used to copy every element in the list</doc>
- <type name="CopyFunc" c:type="GCopyFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to the copy function @func, or %NULL</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="delete_link"
- c:identifier="g_list_delete_link"
- introspectable="0">
- <doc xml:space="preserve">Removes the node link_ from the list and frees it.
- Compare this to g_list_remove_link() which removes the node
- without freeing it.</doc>
- <return-value>
- <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="link_" transfer-ownership="none">
- <doc xml:space="preserve">node to delete from @list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="find" c:identifier="g_list_find" introspectable="0">
- <doc xml:space="preserve">Finds the element in a #GList which contains the given data.</doc>
- <return-value>
- <doc xml:space="preserve">the found #GList element, or %NULL if it is not found</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the element data to find</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="find_custom"
- c:identifier="g_list_find_custom"
- introspectable="0">
- <doc xml:space="preserve">Finds an element in a #GList, using a supplied function to
- find the desired element. It iterates over the list, calling
- the given function which should return 0 when the desired
- element is found. The function takes two #gconstpointer arguments,
- the #GList element's data as the first argument and the
- given user data.</doc>
- <return-value>
- <doc xml:space="preserve">the found #GList element, or %NULL if it is not found</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to the function</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <doc xml:space="preserve">the function to call for each element.
- It should return 0 when the desired element is found</doc>
- <type name="CompareFunc" c:type="GCompareFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="first" c:identifier="g_list_first" introspectable="0">
- <doc xml:space="preserve">Gets the first element in a #GList.</doc>
- <return-value>
- <doc xml:space="preserve">the first element in the #GList,
- or %NULL if the #GList has no elements</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">any #GList element</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="foreach"
- c:identifier="g_list_foreach"
- introspectable="0">
- <doc xml:space="preserve">Calls a function for each element of a #GList.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function to call with each element's data</doc>
- <type name="Func" c:type="GFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="free" c:identifier="g_list_free" introspectable="0">
- <doc xml:space="preserve">Frees all of the memory used by a #GList.
- The freed elements are returned to the slice allocator.
- If list elements contain dynamically-allocated memory, you should
- either use g_list_free_full() or free them manually first.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="free_1" c:identifier="g_list_free_1" introspectable="0">
- <doc xml:space="preserve">Frees one #GList element, but does not update links from the next and
- previous elements in the list, so you should not call this function on an
- element that is currently part of a list.
- It is usually used after g_list_remove_link().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList element</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="free_full"
- c:identifier="g_list_free_full"
- version="2.28"
- introspectable="0">
- <doc xml:space="preserve">Convenience method, which frees all the memory used by a #GList,
- and calls @free_func on every element's data.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="free_func" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">the function to be called to free each element's data</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="index" c:identifier="g_list_index" introspectable="0">
- <doc xml:space="preserve">Gets the position of the element containing
- the given data (starting from 0).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the index of the element containing the data,
- or -1 if the data is not found</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to find</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="insert" c:identifier="g_list_insert" introspectable="0">
- <doc xml:space="preserve">Inserts a new element into the list at the given position.</doc>
- <return-value>
- <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new element</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="position" transfer-ownership="none">
- <doc xml:space="preserve">the position to insert the element. If this is
- negative, or is larger than the number of elements in the
- list, the new element is added on to the end of the list.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="insert_before"
- c:identifier="g_list_insert_before"
- introspectable="0">
- <doc xml:space="preserve">Inserts a new element into the list before the given position.</doc>
- <return-value>
- <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="sibling" transfer-ownership="none">
- <doc xml:space="preserve">the list element before which the new element
- is inserted or %NULL to insert at the end of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new element</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="insert_sorted"
- c:identifier="g_list_insert_sorted"
- introspectable="0">
- <doc xml:space="preserve">Inserts a new element into the list, using the given comparison
- function to determine its position.
- If you are adding many new elements to a list, and the number of
- new elements is much larger than the length of the list, use
- g_list_prepend() to add the new items and sort the list afterwards
- with g_list_sort().</doc>
- <return-value>
- <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GList, this must point to the top of the
- already sorted list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new element</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <doc xml:space="preserve">the function to compare elements in the list. It should
- return a number > 0 if the first parameter comes after the
- second parameter in the sort order.</doc>
- <type name="CompareFunc" c:type="GCompareFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="insert_sorted_with_data"
- c:identifier="g_list_insert_sorted_with_data"
- version="2.10"
- introspectable="0">
- <doc xml:space="preserve">Inserts a new element into the list, using the given comparison
- function to determine its position.
- If you are adding many new elements to a list, and the number of
- new elements is much larger than the length of the list, use
- g_list_prepend() to add the new items and sort the list afterwards
- with g_list_sort().</doc>
- <return-value>
- <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GList, this must point to the top of the
- already sorted list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new element</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="3">
- <doc xml:space="preserve">the function to compare elements in the list. It should
- return a number > 0 if the first parameter comes after the
- second parameter in the sort order.</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to comparison function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="last" c:identifier="g_list_last" introspectable="0">
- <doc xml:space="preserve">Gets the last element in a #GList.</doc>
- <return-value>
- <doc xml:space="preserve">the last element in the #GList,
- or %NULL if the #GList has no elements</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">any #GList element</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="length" c:identifier="g_list_length" introspectable="0">
- <doc xml:space="preserve">Gets the number of elements in a #GList.
- This function iterates over the whole list to count its elements.
- Use a #GQueue instead of a GList if you regularly need the number
- of items. To check whether the list is non-empty, it is faster to check
- @list against %NULL.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of elements in the #GList</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="nth" c:identifier="g_list_nth" introspectable="0">
- <doc xml:space="preserve">Gets the element at the given position in a #GList.
- This iterates over the list until it reaches the @n-th position. If you
- intend to iterate over every element, it is better to use a for-loop as
- described in the #GList introduction.</doc>
- <return-value>
- <doc xml:space="preserve">the element, or %NULL if the position is off
- the end of the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the position of the element, counting from 0</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="nth_data"
- c:identifier="g_list_nth_data"
- introspectable="0">
- <doc xml:space="preserve">Gets the data of the element at the given position.
- This iterates over the list until it reaches the @n-th position. If you
- intend to iterate over every element, it is better to use a for-loop as
- described in the #GList introduction.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the element's data, or %NULL if the position
- is off the end of the #GList</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the position of the element</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="nth_prev"
- c:identifier="g_list_nth_prev"
- introspectable="0">
- <doc xml:space="preserve">Gets the element @n places before @list.</doc>
- <return-value>
- <doc xml:space="preserve">the element, or %NULL if the position is
- off the end of the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the position of the element, counting from 0</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="position"
- c:identifier="g_list_position"
- introspectable="0">
- <doc xml:space="preserve">Gets the position of the given element
- in the #GList (starting from 0).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the position of the element in the #GList,
- or -1 if the element is not found</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="llink" transfer-ownership="none">
- <doc xml:space="preserve">an element in the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="prepend"
- c:identifier="g_list_prepend"
- introspectable="0">
- <doc xml:space="preserve">Prepends a new element on to the start of the list.
- Note that the return value is the new start of the list,
- which will have changed, so make sure you store the new value.
- |[<!-- language="C" -->
- // Notice that it is initialized to the empty list.
- GList *list = NULL;
- list = g_list_prepend (list, "last");
- list = g_list_prepend (list, "first");
- ]|
- Do not use this function to prepend a new element to a different
- element than the start of the list. Use g_list_insert_before() instead.</doc>
- <return-value>
- <doc xml:space="preserve">a pointer to the newly prepended element, which is the new
- start of the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new element</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove" c:identifier="g_list_remove" introspectable="0">
- <doc xml:space="preserve">Removes an element from a #GList.
- If two elements contain the same data, only the first is removed.
- If none of the elements contain the data, the #GList is unchanged.</doc>
- <return-value>
- <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data of the element to remove</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_all"
- c:identifier="g_list_remove_all"
- introspectable="0">
- <doc xml:space="preserve">Removes all list nodes with data equal to @data.
- Returns the new head of the list. Contrast with
- g_list_remove() which removes only the first node
- matching the given data.</doc>
- <return-value>
- <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to remove</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_link"
- c:identifier="g_list_remove_link"
- introspectable="0">
- <doc xml:space="preserve">Removes an element from a #GList, without freeing the element.
- The removed element's prev and next links are set to %NULL, so
- that it becomes a self-contained list with one element.
- This function is for example used to move an element in the list
- (see the example for g_list_concat()) or to remove an element in
- the list before freeing its data:
- |[<!-- language="C" -->
- list = g_list_remove_link (list, llink);
- free_some_data_that_may_access_the_list_again (llink->data);
- g_list_free (llink);
- ]|</doc>
- <return-value>
- <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="llink" transfer-ownership="none">
- <doc xml:space="preserve">an element in the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="reverse"
- c:identifier="g_list_reverse"
- introspectable="0">
- <doc xml:space="preserve">Reverses a #GList.
- It simply switches the next and prev pointers of each element.</doc>
- <return-value>
- <doc xml:space="preserve">the start of the reversed #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="sort" c:identifier="g_list_sort" introspectable="0">
- <doc xml:space="preserve">Sorts a #GList using the given comparison function. The algorithm
- used is a stable sort.</doc>
- <return-value>
- <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="compare_func" transfer-ownership="none">
- <doc xml:space="preserve">the comparison function used to sort the #GList.
- This function is passed the data from 2 elements of the #GList
- and should return 0 if they are equal, a negative value if the
- first element comes before the second, or a positive value if
- the first element comes after the second.</doc>
- <type name="CompareFunc" c:type="GCompareFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="sort_with_data"
- c:identifier="g_list_sort_with_data"
- introspectable="0">
- <doc xml:space="preserve">Like g_list_sort(), but the comparison function accepts
- a user data argument.</doc>
- <return-value>
- <doc xml:space="preserve">the (possibly changed) start of the #GList</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GList, this must point to the top of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="compare_func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">comparison function</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to comparison function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <callback name="LogFunc" c:type="GLogFunc">
- <doc xml:space="preserve">Specifies the prototype of log handler functions.
- The default log handler, g_log_default_handler(), automatically appends a
- new-line character to @message when printing it. It is advised that any
- custom log handler functions behave similarly, so that logging calls in user
- code do not need modifying to add a new-line character to the message if the
- log handler is changed.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="log_domain" transfer-ownership="none">
- <doc xml:space="preserve">the log domain of the message</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="log_level" transfer-ownership="none">
- <doc xml:space="preserve">the log level of the message (including the
- fatal and recursion flags)</doc>
- <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
- </parameter>
- <parameter name="message" transfer-ownership="none">
- <doc xml:space="preserve">the message to process</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="3">
- <doc xml:space="preserve">user data, set in g_log_set_handler()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <bitfield name="LogLevelFlags" c:type="GLogLevelFlags">
- <doc xml:space="preserve">Flags specifying the level of log messages.
- It is possible to change how GLib treats messages of the various
- levels using g_log_set_handler() and g_log_set_fatal_mask().</doc>
- <member name="flag_recursion"
- value="1"
- c:identifier="G_LOG_FLAG_RECURSION">
- <doc xml:space="preserve">internal flag</doc>
- </member>
- <member name="flag_fatal" value="2" c:identifier="G_LOG_FLAG_FATAL">
- <doc xml:space="preserve">internal flag</doc>
- </member>
- <member name="level_error" value="4" c:identifier="G_LOG_LEVEL_ERROR">
- <doc xml:space="preserve">log level for errors, see g_error().
- This level is also used for messages produced by g_assert().</doc>
- </member>
- <member name="level_critical"
- value="8"
- c:identifier="G_LOG_LEVEL_CRITICAL">
- <doc xml:space="preserve">log level for critical warning messages, see
- g_critical().
- This level is also used for messages produced by g_return_if_fail()
- and g_return_val_if_fail().</doc>
- </member>
- <member name="level_warning"
- value="16"
- c:identifier="G_LOG_LEVEL_WARNING">
- <doc xml:space="preserve">log level for warnings, see g_warning()</doc>
- </member>
- <member name="level_message"
- value="32"
- c:identifier="G_LOG_LEVEL_MESSAGE">
- <doc xml:space="preserve">log level for messages, see g_message()</doc>
- </member>
- <member name="level_info" value="64" c:identifier="G_LOG_LEVEL_INFO">
- <doc xml:space="preserve">log level for informational messages, see g_info()</doc>
- </member>
- <member name="level_debug" value="128" c:identifier="G_LOG_LEVEL_DEBUG">
- <doc xml:space="preserve">log level for debug messages, see g_debug()</doc>
- </member>
- <member name="level_mask" value="-4" c:identifier="G_LOG_LEVEL_MASK">
- <doc xml:space="preserve">a mask including all log levels</doc>
- </member>
- </bitfield>
- <constant name="MAJOR_VERSION" value="2" c:type="GLIB_MAJOR_VERSION">
- <doc xml:space="preserve">The major version number of the GLib library.
- Like #glib_major_version, but from the headers used at
- application compile time, rather than from the library
- linked against at application run time.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="MAXINT16" value="32767" c:type="G_MAXINT16" version="2.4">
- <doc xml:space="preserve">The maximum value which can be held in a #gint16.</doc>
- <type name="gint16" c:type="gint16"/>
- </constant>
- <constant name="MAXINT32"
- value="2147483647"
- c:type="G_MAXINT32"
- version="2.4">
- <doc xml:space="preserve">The maximum value which can be held in a #gint32.</doc>
- <type name="gint32" c:type="gint32"/>
- </constant>
- <constant name="MAXINT64" value="9223372036854775807" c:type="G_MAXINT64">
- <doc xml:space="preserve">The maximum value which can be held in a #gint64.</doc>
- <type name="gint64" c:type="gint64"/>
- </constant>
- <constant name="MAXINT8" value="127" c:type="G_MAXINT8" version="2.4">
- <doc xml:space="preserve">The maximum value which can be held in a #gint8.</doc>
- <type name="gint8" c:type="gint8"/>
- </constant>
- <constant name="MAXUINT16"
- value="65535"
- c:type="G_MAXUINT16"
- version="2.4">
- <doc xml:space="preserve">The maximum value which can be held in a #guint16.</doc>
- <type name="guint16" c:type="guint16"/>
- </constant>
- <constant name="MAXUINT32"
- value="4294967295"
- c:type="G_MAXUINT32"
- version="2.4">
- <doc xml:space="preserve">The maximum value which can be held in a #guint32.</doc>
- <type name="guint32" c:type="guint32"/>
- </constant>
- <constant name="MAXUINT64"
- value="18446744073709551615"
- c:type="G_MAXUINT64">
- <doc xml:space="preserve">The maximum value which can be held in a #guint64.</doc>
- <type name="guint64" c:type="guint64"/>
- </constant>
- <constant name="MAXUINT8" value="255" c:type="G_MAXUINT8" version="2.4">
- <doc xml:space="preserve">The maximum value which can be held in a #guint8.</doc>
- <type name="guint8" c:type="guint8"/>
- </constant>
- <constant name="MICRO_VERSION" value="2" c:type="GLIB_MICRO_VERSION">
- <doc xml:space="preserve">The micro version number of the GLib library.
- Like #gtk_micro_version, but from the headers used at
- application compile time, rather than from the library
- linked against at application run time.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="MININT16" value="-32768" c:type="G_MININT16" version="2.4">
- <doc xml:space="preserve">The minimum value which can be held in a #gint16.</doc>
- <type name="gint16" c:type="gint16"/>
- </constant>
- <constant name="MININT32"
- value="-2147483648"
- c:type="G_MININT32"
- version="2.4">
- <doc xml:space="preserve">The minimum value which can be held in a #gint32.</doc>
- <type name="gint32" c:type="gint32"/>
- </constant>
- <constant name="MININT64" value="-9223372036854775808" c:type="G_MININT64">
- <doc xml:space="preserve">The minimum value which can be held in a #gint64.</doc>
- <type name="gint64" c:type="gint64"/>
- </constant>
- <constant name="MININT8" value="-128" c:type="G_MININT8" version="2.4">
- <doc xml:space="preserve">The minimum value which can be held in a #gint8.</doc>
- <type name="gint8" c:type="gint8"/>
- </constant>
- <constant name="MINOR_VERSION" value="48" c:type="GLIB_MINOR_VERSION">
- <doc xml:space="preserve">The minor version number of the GLib library.
- Like #gtk_minor_version, but from the headers used at
- application compile time, rather than from the library
- linked against at application run time.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="MODULE_SUFFIX" value="so" c:type="G_MODULE_SUFFIX">
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <record name="MainContext"
- c:type="GMainContext"
- glib:type-name="GMainContext"
- glib:get-type="g_main_context_get_type"
- c:symbol-prefix="main_context">
- <doc xml:space="preserve">The `GMainContext` struct is an opaque data
- type representing a set of sources to be handled in a main loop.</doc>
- <constructor name="new" c:identifier="g_main_context_new">
- <doc xml:space="preserve">Creates a new #GMainContext structure.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the new #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </return-value>
- </constructor>
- <method name="acquire" c:identifier="g_main_context_acquire">
- <doc xml:space="preserve">Tries to become the owner of the specified context.
- If some other thread is the owner of the context,
- returns %FALSE immediately. Ownership is properly
- recursive: the owner can require ownership again
- and will release ownership when g_main_context_release()
- is called as many times as g_main_context_acquire().
- You must be the owner of a context before you
- can call g_main_context_prepare(), g_main_context_query(),
- g_main_context_check(), g_main_context_dispatch().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the operation succeeded, and
- this thread is now the owner of @context.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="add_poll" c:identifier="g_main_context_add_poll">
- <doc xml:space="preserve">Adds a file descriptor to the set of file descriptors polled for
- this context. This will very seldom be used directly. Instead
- a typical event source will use g_source_add_unix_fd() instead.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GMainContext (or %NULL for the default context)</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- <parameter name="fd" transfer-ownership="none">
- <doc xml:space="preserve">a #GPollFD structure holding information about a file
- descriptor to watch.</doc>
- <type name="PollFD" c:type="GPollFD*"/>
- </parameter>
- <parameter name="priority" transfer-ownership="none">
- <doc xml:space="preserve">the priority for this file descriptor which should be
- the same as the priority used for g_source_attach() to ensure that the
- file descriptor is polled whenever the results may be needed.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="check" c:identifier="g_main_context_check">
- <doc xml:space="preserve">Passes the results of polling back to the main loop.
- You must have successfully acquired the context with
- g_main_context_acquire() before you may call this function.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if some sources are ready to be dispatched.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- <parameter name="max_priority" transfer-ownership="none">
- <doc xml:space="preserve">the maximum numerical priority of sources to check</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="fds" transfer-ownership="none">
- <doc xml:space="preserve">array of #GPollFD's that was passed to
- the last call to g_main_context_query()</doc>
- <array length="2" zero-terminated="0" c:type="GPollFD*">
- <type name="PollFD" c:type="GPollFD"/>
- </array>
- </parameter>
- <parameter name="n_fds" transfer-ownership="none">
- <doc xml:space="preserve">return value of g_main_context_query()</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="dispatch" c:identifier="g_main_context_dispatch">
- <doc xml:space="preserve">Dispatches all pending sources.
- You must have successfully acquired the context with
- g_main_context_acquire() before you may call this function.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="find_source_by_funcs_user_data"
- c:identifier="g_main_context_find_source_by_funcs_user_data">
- <doc xml:space="preserve">Finds a source with the given source functions and user data. If
- multiple sources exist with the same source function and user data,
- the first one found will be returned.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the source, if one was found, otherwise %NULL</doc>
- <type name="Source" c:type="GSource*"/>
- </return-value>
- <parameters>
- <instance-parameter name="context"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GMainContext (if %NULL, the default context will be used).</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- <parameter name="funcs" transfer-ownership="none">
- <doc xml:space="preserve">the @source_funcs passed to g_source_new().</doc>
- <type name="SourceFuncs" c:type="GSourceFuncs*"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the user data from the callback.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="find_source_by_id"
- c:identifier="g_main_context_find_source_by_id">
- <doc xml:space="preserve">Finds a #GSource given a pair of context and ID.
- It is a programmer error to attempt to lookup a non-existent source.
- More specifically: source IDs can be reissued after a source has been
- destroyed and therefore it is never valid to use this function with a
- source ID which may have already been removed. An example is when
- scheduling an idle to run in another thread with g_idle_add(): the
- idle may already have run and been removed by the time this function
- is called on its (now invalid) source ID. This source ID may have
- been reissued, leading to the operation being performed against the
- wrong source.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </return-value>
- <parameters>
- <instance-parameter name="context"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GMainContext (if %NULL, the default context will be used)</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- <parameter name="source_id" transfer-ownership="none">
- <doc xml:space="preserve">the source ID, as returned by g_source_get_id().</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="find_source_by_user_data"
- c:identifier="g_main_context_find_source_by_user_data">
- <doc xml:space="preserve">Finds a source with the given user data for the callback. If
- multiple sources exist with the same user data, the first
- one found will be returned.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the source, if one was found, otherwise %NULL</doc>
- <type name="Source" c:type="GSource*"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the user_data for the callback.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_poll_func"
- c:identifier="g_main_context_get_poll_func"
- introspectable="0">
- <doc xml:space="preserve">Gets the poll function set by g_main_context_set_poll_func().</doc>
- <return-value>
- <doc xml:space="preserve">the poll function</doc>
- <type name="PollFunc" c:type="GPollFunc"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="invoke"
- c:identifier="g_main_context_invoke"
- version="2.28"
- introspectable="0">
- <doc xml:space="preserve">Invokes a function in such a way that @context is owned during the
- invocation of @function.
- If @context is %NULL then the global default main context — as
- returned by g_main_context_default() — is used.
- If @context is owned by the current thread, @function is called
- directly. Otherwise, if @context is the thread-default main context
- of the current thread and g_main_context_acquire() succeeds, then
- @function is called and g_main_context_release() is called
- afterwards.
- In any other case, an idle source is created to call @function and
- that source is attached to @context (presumably to be run in another
- thread). The idle source is attached with #G_PRIORITY_DEFAULT
- priority. If you want a different priority, use
- g_main_context_invoke_full().
- Note that, as with normal idle functions, @function should probably
- return %FALSE. If it returns %TRUE, it will be continuously run in a
- loop (and may prevent this call from returning).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GMainContext, or %NULL</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- <parameter name="function" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">function to call</doc>
- <type name="SourceFunc" c:type="GSourceFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="invoke_full"
- c:identifier="g_main_context_invoke_full"
- version="2.28">
- <doc xml:space="preserve">Invokes a function in such a way that @context is owned during the
- invocation of @function.
- This function is the same as g_main_context_invoke() except that it
- lets you specify the priority incase @function ends up being
- scheduled as an idle and also lets you give a #GDestroyNotify for @data.
- @notify should not assume that it is called from any particular
- thread or with any particular context acquired.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GMainContext, or %NULL</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- <parameter name="priority" transfer-ownership="none">
- <doc xml:space="preserve">the priority at which to run @function</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="function"
- transfer-ownership="none"
- scope="notified"
- closure="2"
- destroy="3">
- <doc xml:space="preserve">function to call</doc>
- <type name="SourceFunc" c:type="GSourceFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="notify"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">a function to call when @data is no longer in use, or %NULL.</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </method>
- <method name="is_owner"
- c:identifier="g_main_context_is_owner"
- version="2.10">
- <doc xml:space="preserve">Determines whether this thread holds the (recursive)
- ownership of this #GMainContext. This is useful to
- know before waiting on another thread that may be
- blocking to get ownership of @context.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if current thread is owner of @context.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="iteration" c:identifier="g_main_context_iteration">
- <doc xml:space="preserve">Runs a single iteration for the given main loop. This involves
- checking to see if any event sources are ready to be processed,
- then if no events sources are ready and @may_block is %TRUE, waiting
- for a source to become ready, then dispatching the highest priority
- events sources that are ready. Otherwise, if @may_block is %FALSE
- sources are not waited to become ready, only those highest priority
- events sources will be dispatched (if any), that are ready at this
- given moment without further waiting.
- Note that even when @may_block is %TRUE, it is still possible for
- g_main_context_iteration() to return %FALSE, since the wait may
- be interrupted for other reasons than an event source becoming ready.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if events were dispatched.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="context"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GMainContext (if %NULL, the default context will be used)</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- <parameter name="may_block" transfer-ownership="none">
- <doc xml:space="preserve">whether the call may block.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="pending" c:identifier="g_main_context_pending">
- <doc xml:space="preserve">Checks if any sources have pending events for the given context.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if events are pending.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="context"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GMainContext (if %NULL, the default context will be used)</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="pop_thread_default"
- c:identifier="g_main_context_pop_thread_default"
- version="2.22">
- <doc xml:space="preserve">Pops @context off the thread-default context stack (verifying that
- it was on the top of the stack).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GMainContext object, or %NULL</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="prepare" c:identifier="g_main_context_prepare">
- <doc xml:space="preserve">Prepares to poll sources within a main loop. The resulting information
- for polling is determined by calling g_main_context_query ().
- You must have successfully acquired the context with
- g_main_context_acquire() before you may call this function.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if some source is ready to be dispatched
- prior to polling.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- <parameter name="priority" transfer-ownership="none">
- <doc xml:space="preserve">location to store priority of highest priority
- source already ready.</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- </parameters>
- </method>
- <method name="push_thread_default"
- c:identifier="g_main_context_push_thread_default"
- version="2.22">
- <doc xml:space="preserve">Acquires @context and sets it as the thread-default context for the
- current thread. This will cause certain asynchronous operations
- (such as most [gio][gio]-based I/O) which are
- started in this thread to run under @context and deliver their
- results to its main loop, rather than running under the global
- default context in the main thread. Note that calling this function
- changes the context returned by g_main_context_get_thread_default(),
- not the one returned by g_main_context_default(), so it does not affect
- the context used by functions like g_idle_add().
- Normally you would call this function shortly after creating a new
- thread, passing it a #GMainContext which will be run by a
- #GMainLoop in that thread, to set a new default context for all
- async operations in that thread. (In this case, you don't need to
- ever call g_main_context_pop_thread_default().) In some cases
- however, you may want to schedule a single operation in a
- non-default context, or temporarily use a non-default context in
- the main thread. In that case, you can wrap the call to the
- asynchronous operation inside a
- g_main_context_push_thread_default() /
- g_main_context_pop_thread_default() pair, but it is up to you to
- ensure that no other asynchronous operations accidentally get
- started while the non-default context is active.
- Beware that libraries that predate this function may not correctly
- handle being used from a thread with a thread-default context. Eg,
- see g_file_supports_thread_contexts().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GMainContext, or %NULL for the global default context</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="query" c:identifier="g_main_context_query">
- <doc xml:space="preserve">Determines information necessary to poll this main loop.
- You must have successfully acquired the context with
- g_main_context_acquire() before you may call this function.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of records actually stored in @fds,
- or, if more than @n_fds records need to be stored, the number
- of records that need to be stored.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- <parameter name="max_priority" transfer-ownership="none">
- <doc xml:space="preserve">maximum priority source to check</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="timeout_"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">location to store timeout to be used in polling</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- <parameter name="fds"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none">
- <doc xml:space="preserve">location to
- store #GPollFD records that need to be polled.</doc>
- <array length="3" zero-terminated="0" c:type="GPollFD*">
- <type name="PollFD" c:type="GPollFD"/>
- </array>
- </parameter>
- <parameter name="n_fds" transfer-ownership="none">
- <doc xml:space="preserve">length of @fds.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_main_context_ref">
- <doc xml:space="preserve">Increases the reference count on a #GMainContext object by one.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the @context that was passed in (since 2.6)</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="release" c:identifier="g_main_context_release">
- <doc xml:space="preserve">Releases ownership of a context previously acquired by this thread
- with g_main_context_acquire(). If the context was acquired multiple
- times, the ownership will be released only when g_main_context_release()
- is called as many times as it was acquired.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="remove_poll" c:identifier="g_main_context_remove_poll">
- <doc xml:space="preserve">Removes file descriptor from the set of file descriptors to be
- polled for a particular context.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- <parameter name="fd" transfer-ownership="none">
- <doc xml:space="preserve">a #GPollFD descriptor previously added with g_main_context_add_poll()</doc>
- <type name="PollFD" c:type="GPollFD*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_poll_func"
- c:identifier="g_main_context_set_poll_func"
- introspectable="0">
- <doc xml:space="preserve">Sets the function to use to handle polling of file descriptors. It
- will be used instead of the poll() system call
- (or GLib's replacement function, which is used where
- poll() isn't available).
- This function could possibly be used to integrate the GLib event
- loop with an external event loop.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- <parameter name="func" transfer-ownership="none">
- <doc xml:space="preserve">the function to call to poll all file descriptors</doc>
- <type name="PollFunc" c:type="GPollFunc"/>
- </parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_main_context_unref">
- <doc xml:space="preserve">Decreases the reference count on a #GMainContext object by one. If
- the result is zero, free the context and free all associated memory.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="wait" c:identifier="g_main_context_wait">
- <doc xml:space="preserve">Tries to become the owner of the specified context,
- as with g_main_context_acquire(). But if another thread
- is the owner, atomically drop @mutex and wait on @cond until
- that owner releases ownership or until @cond is signaled, then
- try again (once) to become the owner.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the operation succeeded, and
- this thread is now the owner of @context.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- <parameter name="cond" transfer-ownership="none">
- <doc xml:space="preserve">a condition variable</doc>
- <type name="Cond" c:type="GCond*"/>
- </parameter>
- <parameter name="mutex" transfer-ownership="none">
- <doc xml:space="preserve">a mutex, currently held</doc>
- <type name="Mutex" c:type="GMutex*"/>
- </parameter>
- </parameters>
- </method>
- <method name="wakeup" c:identifier="g_main_context_wakeup">
- <doc xml:space="preserve">If @context is currently blocking in g_main_context_iteration()
- waiting for a source to become ready, cause it to stop blocking
- and return. Otherwise, cause the next invocation of
- g_main_context_iteration() to return without blocking.
- This API is useful for low-level control over #GMainContext; for
- example, integrating it with main loop implementations such as
- #GMainLoop.
- Another related use for this function is when implementing a main
- loop with a termination condition, computed from multiple threads:
- |[<!-- language="C" -->
- #define NUM_TASKS 10
- static volatile gint tasks_remaining = NUM_TASKS;
- ...
-
- while (g_atomic_int_get (&tasks_remaining) != 0)
- g_main_context_iteration (NULL, TRUE);
- ]|
-
- Then in a thread:
- |[<!-- language="C" -->
- perform_work();
- if (g_atomic_int_dec_and_test (&tasks_remaining))
- g_main_context_wakeup (NULL);
- ]|</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainContext</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="default" c:identifier="g_main_context_default">
- <doc xml:space="preserve">Returns the global default main context. This is the main context
- used for main loop functions when a main loop is not explicitly
- specified, and corresponds to the "main" main loop. See also
- g_main_context_get_thread_default().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the global default main context.</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </return-value>
- </function>
- <function name="get_thread_default"
- c:identifier="g_main_context_get_thread_default"
- version="2.22">
- <doc xml:space="preserve">Gets the thread-default #GMainContext for this thread. Asynchronous
- operations that want to be able to be run in contexts other than
- the default one should call this method or
- g_main_context_ref_thread_default() to get a #GMainContext to add
- their #GSources to. (Note that even in single-threaded
- programs applications may sometimes want to temporarily push a
- non-default context, so it is not safe to assume that this will
- always return %NULL if you are running in the default thread.)
- If you need to hold a reference on the context, use
- g_main_context_ref_thread_default() instead.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the thread-default #GMainContext, or
- %NULL if the thread-default context is the global default context.</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </return-value>
- </function>
- <function name="ref_thread_default"
- c:identifier="g_main_context_ref_thread_default"
- version="2.32">
- <doc xml:space="preserve">Gets the thread-default #GMainContext for this thread, as with
- g_main_context_get_thread_default(), but also adds a reference to
- it with g_main_context_ref(). In addition, unlike
- g_main_context_get_thread_default(), if the thread-default context
- is the global default context, this will return that #GMainContext
- (with a ref added to it) rather than returning %NULL.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the thread-default #GMainContext. Unref
- with g_main_context_unref() when you are done with it.</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </return-value>
- </function>
- </record>
- <record name="MainLoop"
- c:type="GMainLoop"
- glib:type-name="GMainLoop"
- glib:get-type="g_main_loop_get_type"
- c:symbol-prefix="main_loop">
- <doc xml:space="preserve">The `GMainLoop` struct is an opaque data type
- representing the main event loop of a GLib or GTK+ application.</doc>
- <constructor name="new" c:identifier="g_main_loop_new">
- <doc xml:space="preserve">Creates a new #GMainLoop structure.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GMainLoop.</doc>
- <type name="MainLoop" c:type="GMainLoop*"/>
- </return-value>
- <parameters>
- <parameter name="context"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GMainContext (if %NULL, the default context will be used).</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </parameter>
- <parameter name="is_running" transfer-ownership="none">
- <doc xml:space="preserve">set to %TRUE to indicate that the loop is running. This
- is not very important since calling g_main_loop_run() will set this to
- %TRUE anyway.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="get_context" c:identifier="g_main_loop_get_context">
- <doc xml:space="preserve">Returns the #GMainContext of @loop.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the #GMainContext of @loop</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </return-value>
- <parameters>
- <instance-parameter name="loop" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainLoop.</doc>
- <type name="MainLoop" c:type="GMainLoop*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_running" c:identifier="g_main_loop_is_running">
- <doc xml:space="preserve">Checks to see if the main loop is currently being run via g_main_loop_run().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the mainloop is currently being run.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="loop" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainLoop.</doc>
- <type name="MainLoop" c:type="GMainLoop*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="quit" c:identifier="g_main_loop_quit">
- <doc xml:space="preserve">Stops a #GMainLoop from running. Any calls to g_main_loop_run()
- for the loop will return.
- Note that sources that have already been dispatched when
- g_main_loop_quit() is called will still be executed.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="loop" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainLoop</doc>
- <type name="MainLoop" c:type="GMainLoop*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_main_loop_ref">
- <doc xml:space="preserve">Increases the reference count on a #GMainLoop object by one.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">@loop</doc>
- <type name="MainLoop" c:type="GMainLoop*"/>
- </return-value>
- <parameters>
- <instance-parameter name="loop" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainLoop</doc>
- <type name="MainLoop" c:type="GMainLoop*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="run" c:identifier="g_main_loop_run">
- <doc xml:space="preserve">Runs a main loop until g_main_loop_quit() is called on the loop.
- If this is called for the thread of the loop's #GMainContext,
- it will process events from the loop, otherwise it will
- simply wait.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="loop" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainLoop</doc>
- <type name="MainLoop" c:type="GMainLoop*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_main_loop_unref">
- <doc xml:space="preserve">Decreases the reference count on a #GMainLoop object by one. If
- the result is zero, free the loop and free all associated memory.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="loop" transfer-ownership="none">
- <doc xml:space="preserve">a #GMainLoop</doc>
- <type name="MainLoop" c:type="GMainLoop*"/>
- </instance-parameter>
- </parameters>
- </method>
- </record>
- <record name="MappedFile"
- c:type="GMappedFile"
- glib:type-name="GMappedFile"
- glib:get-type="g_mapped_file_get_type"
- c:symbol-prefix="mapped_file">
- <doc xml:space="preserve">The #GMappedFile represents a file mapping created with
- g_mapped_file_new(). It has only private members and should
- not be accessed directly.</doc>
- <constructor name="new"
- c:identifier="g_mapped_file_new"
- version="2.8"
- throws="1">
- <doc xml:space="preserve">Maps a file into memory. On UNIX, this is using the mmap() function.
- If @writable is %TRUE, the mapped buffer may be modified, otherwise
- it is an error to modify the mapped buffer. Modifications to the buffer
- are not visible to other processes mapping the same file, and are not
- written back to the file.
- Note that modifications of the underlying file might affect the contents
- of the #GMappedFile. Therefore, mapping should only be used if the file
- will not be modified, or if all modifications of the file are done
- atomically (e.g. using g_file_set_contents()).
- If @filename is the name of an empty, regular file, the function
- will successfully return an empty #GMappedFile. In other cases of
- size 0 (e.g. device files such as /dev/null), @error will be set
- to the #GFileError value #G_FILE_ERROR_INVAL.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated #GMappedFile which must be unref'd
- with g_mapped_file_unref(), or %NULL if the mapping failed.</doc>
- <type name="MappedFile" c:type="GMappedFile*"/>
- </return-value>
- <parameters>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">The path of the file to load, in the GLib filename encoding</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="writable" transfer-ownership="none">
- <doc xml:space="preserve">whether the mapping should be writable</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_from_fd"
- c:identifier="g_mapped_file_new_from_fd"
- version="2.32"
- throws="1">
- <doc xml:space="preserve">Maps a file into memory. On UNIX, this is using the mmap() function.
- If @writable is %TRUE, the mapped buffer may be modified, otherwise
- it is an error to modify the mapped buffer. Modifications to the buffer
- are not visible to other processes mapping the same file, and are not
- written back to the file.
- Note that modifications of the underlying file might affect the contents
- of the #GMappedFile. Therefore, mapping should only be used if the file
- will not be modified, or if all modifications of the file are done
- atomically (e.g. using g_file_set_contents()).</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated #GMappedFile which must be unref'd
- with g_mapped_file_unref(), or %NULL if the mapping failed.</doc>
- <type name="MappedFile" c:type="GMappedFile*"/>
- </return-value>
- <parameters>
- <parameter name="fd" transfer-ownership="none">
- <doc xml:space="preserve">The file descriptor of the file to load</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="writable" transfer-ownership="none">
- <doc xml:space="preserve">whether the mapping should be writable</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="free"
- c:identifier="g_mapped_file_free"
- version="2.8"
- deprecated="1"
- deprecated-version="2.22">
- <doc xml:space="preserve">This call existed before #GMappedFile had refcounting and is currently
- exactly the same as g_mapped_file_unref().</doc>
- <doc-deprecated xml:space="preserve">Use g_mapped_file_unref() instead.</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="file" transfer-ownership="none">
- <doc xml:space="preserve">a #GMappedFile</doc>
- <type name="MappedFile" c:type="GMappedFile*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_bytes"
- c:identifier="g_mapped_file_get_bytes"
- version="2.34">
- <doc xml:space="preserve">Creates a new #GBytes which references the data mapped from @file.
- The mapped contents of the file must not be modified after creating this
- bytes object, because a #GBytes should be immutable.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">A newly allocated #GBytes referencing data
- from @file</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </return-value>
- <parameters>
- <instance-parameter name="file" transfer-ownership="none">
- <doc xml:space="preserve">a #GMappedFile</doc>
- <type name="MappedFile" c:type="GMappedFile*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_contents"
- c:identifier="g_mapped_file_get_contents"
- version="2.8">
- <doc xml:space="preserve">Returns the contents of a #GMappedFile.
- Note that the contents may not be zero-terminated,
- even if the #GMappedFile is backed by a text file.
- If the file is empty then %NULL is returned.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the contents of @file, or %NULL.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="file" transfer-ownership="none">
- <doc xml:space="preserve">a #GMappedFile</doc>
- <type name="MappedFile" c:type="GMappedFile*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_length"
- c:identifier="g_mapped_file_get_length"
- version="2.8">
- <doc xml:space="preserve">Returns the length of the contents of a #GMappedFile.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the length of the contents of @file.</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <instance-parameter name="file" transfer-ownership="none">
- <doc xml:space="preserve">a #GMappedFile</doc>
- <type name="MappedFile" c:type="GMappedFile*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_mapped_file_ref" version="2.22">
- <doc xml:space="preserve">Increments the reference count of @file by one. It is safe to call
- this function from any thread.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the passed in #GMappedFile.</doc>
- <type name="MappedFile" c:type="GMappedFile*"/>
- </return-value>
- <parameters>
- <instance-parameter name="file" transfer-ownership="none">
- <doc xml:space="preserve">a #GMappedFile</doc>
- <type name="MappedFile" c:type="GMappedFile*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_mapped_file_unref">
- <doc xml:space="preserve">Decrements the reference count of @file by one. If the reference count
- drops to 0, unmaps the buffer of @file and frees it.
- It is safe to call this function from any thread.
- Since 2.22</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="file" transfer-ownership="none">
- <doc xml:space="preserve">a #GMappedFile</doc>
- <type name="MappedFile" c:type="GMappedFile*"/>
- </instance-parameter>
- </parameters>
- </method>
- </record>
- <bitfield name="MarkupCollectType" c:type="GMarkupCollectType">
- <doc xml:space="preserve">A mixed enumerated type and flags field. You must specify one type
- (string, strdup, boolean, tristate). Additionally, you may optionally
- bitwise OR the type with the flag %G_MARKUP_COLLECT_OPTIONAL.
- It is likely that this enum will be extended in the future to
- support other types.</doc>
- <member name="invalid" value="0" c:identifier="G_MARKUP_COLLECT_INVALID">
- <doc xml:space="preserve">used to terminate the list of attributes
- to collect</doc>
- </member>
- <member name="string" value="1" c:identifier="G_MARKUP_COLLECT_STRING">
- <doc xml:space="preserve">collect the string pointer directly from
- the attribute_values[] array. Expects a parameter of type (const
- char **). If %G_MARKUP_COLLECT_OPTIONAL is specified and the
- attribute isn't present then the pointer will be set to %NULL</doc>
- </member>
- <member name="strdup" value="2" c:identifier="G_MARKUP_COLLECT_STRDUP">
- <doc xml:space="preserve">as with %G_MARKUP_COLLECT_STRING, but
- expects a parameter of type (char **) and g_strdup()s the
- returned pointer. The pointer must be freed with g_free()</doc>
- </member>
- <member name="boolean" value="3" c:identifier="G_MARKUP_COLLECT_BOOLEAN">
- <doc xml:space="preserve">expects a parameter of type (gboolean *)
- and parses the attribute value as a boolean. Sets %FALSE if the
- attribute isn't present. Valid boolean values consist of
- (case-insensitive) "false", "f", "no", "n", "0" and "true", "t",
- "yes", "y", "1"</doc>
- </member>
- <member name="tristate"
- value="4"
- c:identifier="G_MARKUP_COLLECT_TRISTATE">
- <doc xml:space="preserve">as with %G_MARKUP_COLLECT_BOOLEAN, but
- in the case of a missing attribute a value is set that compares
- equal to neither %FALSE nor %TRUE G_MARKUP_COLLECT_OPTIONAL is
- implied</doc>
- </member>
- <member name="optional"
- value="65536"
- c:identifier="G_MARKUP_COLLECT_OPTIONAL">
- <doc xml:space="preserve">can be bitwise ORed with the other fields.
- If present, allows the attribute not to appear. A default value
- is set depending on what value type is used</doc>
- </member>
- </bitfield>
- <enumeration name="MarkupError"
- c:type="GMarkupError"
- glib:error-domain="g-markup-error-quark">
- <doc xml:space="preserve">Error codes returned by markup parsing.</doc>
- <member name="bad_utf8" value="0" c:identifier="G_MARKUP_ERROR_BAD_UTF8">
- <doc xml:space="preserve">text being parsed was not valid UTF-8</doc>
- </member>
- <member name="empty" value="1" c:identifier="G_MARKUP_ERROR_EMPTY">
- <doc xml:space="preserve">document contained nothing, or only whitespace</doc>
- </member>
- <member name="parse" value="2" c:identifier="G_MARKUP_ERROR_PARSE">
- <doc xml:space="preserve">document was ill-formed</doc>
- </member>
- <member name="unknown_element"
- value="3"
- c:identifier="G_MARKUP_ERROR_UNKNOWN_ELEMENT">
- <doc xml:space="preserve">error should be set by #GMarkupParser
- functions; element wasn't known</doc>
- </member>
- <member name="unknown_attribute"
- value="4"
- c:identifier="G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE">
- <doc xml:space="preserve">error should be set by #GMarkupParser
- functions; attribute wasn't known</doc>
- </member>
- <member name="invalid_content"
- value="5"
- c:identifier="G_MARKUP_ERROR_INVALID_CONTENT">
- <doc xml:space="preserve">error should be set by #GMarkupParser
- functions; content was invalid</doc>
- </member>
- <member name="missing_attribute"
- value="6"
- c:identifier="G_MARKUP_ERROR_MISSING_ATTRIBUTE">
- <doc xml:space="preserve">error should be set by #GMarkupParser
- functions; a required attribute was missing</doc>
- </member>
- </enumeration>
- <record name="MarkupParseContext"
- c:type="GMarkupParseContext"
- glib:type-name="GMarkupParseContext"
- glib:get-type="g_markup_parse_context_get_type"
- c:symbol-prefix="markup_parse_context">
- <doc xml:space="preserve">A parse context is used to parse a stream of bytes that
- you expect to contain marked-up text.
- See g_markup_parse_context_new(), #GMarkupParser, and so
- on for more details.</doc>
- <constructor name="new" c:identifier="g_markup_parse_context_new">
- <doc xml:space="preserve">Creates a new parse context. A parse context is used to parse
- marked-up documents. You can feed any number of documents into
- a context, as long as no errors occur; once an error occurs,
- the parse context can't continue to parse text (you have to
- free it and create a new parse context).</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GMarkupParseContext</doc>
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </return-value>
- <parameters>
- <parameter name="parser" transfer-ownership="none">
- <doc xml:space="preserve">a #GMarkupParser</doc>
- <type name="MarkupParser" c:type="const GMarkupParser*"/>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">one or more #GMarkupParseFlags</doc>
- <type name="MarkupParseFlags" c:type="GMarkupParseFlags"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to #GMarkupParser functions</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="user_data_dnotify"
- transfer-ownership="none"
- scope="async">
- <doc xml:space="preserve">user data destroy notifier called when
- the parse context is freed</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="end_parse"
- c:identifier="g_markup_parse_context_end_parse"
- throws="1">
- <doc xml:space="preserve">Signals to the #GMarkupParseContext that all data has been
- fed into the parse context with g_markup_parse_context_parse().
- This function reports an error if the document isn't complete,
- for example if elements are still open.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on success, %FALSE if an error was set</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMarkupParseContext</doc>
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_markup_parse_context_free">
- <doc xml:space="preserve">Frees a #GMarkupParseContext.
- This function can't be called from inside one of the
- #GMarkupParser functions or while a subparser is pushed.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMarkupParseContext</doc>
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_element"
- c:identifier="g_markup_parse_context_get_element"
- version="2.2">
- <doc xml:space="preserve">Retrieves the name of the currently open element.
- If called from the start_element or end_element handlers this will
- give the element_name as passed to those functions. For the parent
- elements, see g_markup_parse_context_get_element_stack().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the name of the currently open element, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMarkupParseContext</doc>
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_element_stack"
- c:identifier="g_markup_parse_context_get_element_stack"
- version="2.16"
- introspectable="0">
- <doc xml:space="preserve">Retrieves the element stack from the internal state of the parser.
- The returned #GSList is a list of strings where the first item is
- the currently open tag (as would be returned by
- g_markup_parse_context_get_element()) and the next item is its
- immediate parent.
- This function is intended to be used in the start_element and
- end_element handlers where g_markup_parse_context_get_element()
- would merely return the name of the element that is being
- processed.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the element stack, which must not be modified</doc>
- <type name="GLib.SList" c:type="const GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMarkupParseContext</doc>
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_position"
- c:identifier="g_markup_parse_context_get_position">
- <doc xml:space="preserve">Retrieves the current line number and the number of the character on
- that line. Intended for use in error messages; there are no strict
- semantics for what constitutes the "current" line number other than
- "the best number we could come up with for error messages."</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMarkupParseContext</doc>
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </instance-parameter>
- <parameter name="line_number"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">return location for a line number, or %NULL</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- <parameter name="char_number"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">return location for a char-on-line number, or %NULL</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_user_data"
- c:identifier="g_markup_parse_context_get_user_data"
- version="2.18">
- <doc xml:space="preserve">Returns the user_data associated with @context.
- This will either be the user_data that was provided to
- g_markup_parse_context_new() or to the most recent call
- of g_markup_parse_context_push().</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the provided user_data. The returned data belongs to
- the markup context and will be freed when
- g_markup_parse_context_free() is called.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMarkupParseContext</doc>
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="parse"
- c:identifier="g_markup_parse_context_parse"
- throws="1">
- <doc xml:space="preserve">Feed some data to the #GMarkupParseContext.
- The data need not be valid UTF-8; an error will be signaled if
- it's invalid. The data need not be an entire document; you can
- feed a document into the parser incrementally, via multiple calls
- to this function. Typically, as you receive data from a network
- connection or file, you feed each received chunk of data into this
- function, aborting the process if an error occurs. Once an error
- is reported, no further data may be fed to the #GMarkupParseContext;
- all errors are fatal.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%FALSE if an error occurred, %TRUE on success</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMarkupParseContext</doc>
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </instance-parameter>
- <parameter name="text" transfer-ownership="none">
- <doc xml:space="preserve">chunk of text to parse</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="text_len" transfer-ownership="none">
- <doc xml:space="preserve">length of @text in bytes</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </method>
- <method name="pop"
- c:identifier="g_markup_parse_context_pop"
- version="2.18">
- <doc xml:space="preserve">Completes the process of a temporary sub-parser redirection.
- This function exists to collect the user_data allocated by a
- matching call to g_markup_parse_context_push(). It must be called
- in the end_element handler corresponding to the start_element
- handler during which g_markup_parse_context_push() was called.
- You must not call this function from the error callback -- the
- @user_data is provided directly to the callback in that case.
- This function is not intended to be directly called by users
- interested in invoking subparsers. Instead, it is intended to
- be used by the subparsers themselves to implement a higher-level
- interface.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the user data passed to g_markup_parse_context_push()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMarkupParseContext</doc>
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="push"
- c:identifier="g_markup_parse_context_push"
- version="2.18">
- <doc xml:space="preserve">Temporarily redirects markup data to a sub-parser.
- This function may only be called from the start_element handler of
- a #GMarkupParser. It must be matched with a corresponding call to
- g_markup_parse_context_pop() in the matching end_element handler
- (except in the case that the parser aborts due to an error).
- All tags, text and other data between the matching tags is
- redirected to the subparser given by @parser. @user_data is used
- as the user_data for that parser. @user_data is also passed to the
- error callback in the event that an error occurs. This includes
- errors that occur in subparsers of the subparser.
- The end tag matching the start tag for which this call was made is
- handled by the previous parser (which is given its own user_data)
- which is why g_markup_parse_context_pop() is provided to allow "one
- last access" to the @user_data provided to this function. In the
- case of error, the @user_data provided here is passed directly to
- the error callback of the subparser and g_markup_parse_context_pop()
- should not be called. In either case, if @user_data was allocated
- then it ought to be freed from both of these locations.
- This function is not intended to be directly called by users
- interested in invoking subparsers. Instead, it is intended to be
- used by the subparsers themselves to implement a higher-level
- interface.
- As an example, see the following implementation of a simple
- parser that counts the number of tags encountered.
- |[<!-- language="C" -->
- typedef struct
- {
- gint tag_count;
- } CounterData;
- static void
- counter_start_element (GMarkupParseContext *context,
- const gchar *element_name,
- const gchar **attribute_names,
- const gchar **attribute_values,
- gpointer user_data,
- GError **error)
- {
- CounterData *data = user_data;
- data->tag_count++;
- }
- static void
- counter_error (GMarkupParseContext *context,
- GError *error,
- gpointer user_data)
- {
- CounterData *data = user_data;
- g_slice_free (CounterData, data);
- }
- static GMarkupParser counter_subparser =
- {
- counter_start_element,
- NULL,
- NULL,
- NULL,
- counter_error
- };
- ]|
- In order to allow this parser to be easily used as a subparser, the
- following interface is provided:
- |[<!-- language="C" -->
- void
- start_counting (GMarkupParseContext *context)
- {
- CounterData *data = g_slice_new (CounterData);
- data->tag_count = 0;
- g_markup_parse_context_push (context, &counter_subparser, data);
- }
- gint
- end_counting (GMarkupParseContext *context)
- {
- CounterData *data = g_markup_parse_context_pop (context);
- int result;
- result = data->tag_count;
- g_slice_free (CounterData, data);
- return result;
- }
- ]|
- The subparser would then be used as follows:
- |[<!-- language="C" -->
- static void start_element (context, element_name, ...)
- {
- if (strcmp (element_name, "count-these") == 0)
- start_counting (context);
- // else, handle other tags...
- }
- static void end_element (context, element_name, ...)
- {
- if (strcmp (element_name, "count-these") == 0)
- g_print ("Counted %d tags\n", end_counting (context));
- // else, handle other tags...
- }
- ]|</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMarkupParseContext</doc>
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </instance-parameter>
- <parameter name="parser" transfer-ownership="none">
- <doc xml:space="preserve">a #GMarkupParser</doc>
- <type name="MarkupParser" c:type="const GMarkupParser*"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to #GMarkupParser functions</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="ref"
- c:identifier="g_markup_parse_context_ref"
- version="2.36">
- <doc xml:space="preserve">Increases the reference count of @context.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the same @context</doc>
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMarkupParseContext</doc>
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref"
- c:identifier="g_markup_parse_context_unref"
- version="2.36">
- <doc xml:space="preserve">Decreases the reference count of @context. When its reference count
- drops to 0, it is freed.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GMarkupParseContext</doc>
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- </record>
- <bitfield name="MarkupParseFlags" c:type="GMarkupParseFlags">
- <doc xml:space="preserve">Flags that affect the behaviour of the parser.</doc>
- <member name="do_not_use_this_unsupported_flag"
- value="1"
- c:identifier="G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG">
- <doc xml:space="preserve">flag you should not use</doc>
- </member>
- <member name="treat_cdata_as_text"
- value="2"
- c:identifier="G_MARKUP_TREAT_CDATA_AS_TEXT">
- <doc xml:space="preserve">When this flag is set, CDATA marked
- sections are not passed literally to the @passthrough function of
- the parser. Instead, the content of the section (without the
- `<![CDATA[` and `]]>`) is
- passed to the @text function. This flag was added in GLib 2.12</doc>
- </member>
- <member name="prefix_error_position"
- value="4"
- c:identifier="G_MARKUP_PREFIX_ERROR_POSITION">
- <doc xml:space="preserve">Normally errors caught by GMarkup
- itself have line/column information prefixed to them to let the
- caller know the location of the error. When this flag is set the
- location information is also prefixed to errors generated by the
- #GMarkupParser implementation functions</doc>
- </member>
- <member name="ignore_qualified"
- value="8"
- c:identifier="G_MARKUP_IGNORE_QUALIFIED">
- <doc xml:space="preserve">Ignore (don't report) qualified
- attributes and tags, along with their contents. A qualified
- attribute or tag is one that contains ':' in its name (ie: is in
- another namespace). Since: 2.40.</doc>
- </member>
- </bitfield>
- <record name="MarkupParser" c:type="GMarkupParser">
- <doc xml:space="preserve">Any of the fields in #GMarkupParser can be %NULL, in which case they
- will be ignored. Except for the @error function, any of these callbacks
- can set an error; in particular the %G_MARKUP_ERROR_UNKNOWN_ELEMENT,
- %G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, and %G_MARKUP_ERROR_INVALID_CONTENT
- errors are intended to be set from these callbacks. If you set an error
- from a callback, g_markup_parse_context_parse() will report that error
- back to its caller.</doc>
- <field name="start_element">
- <callback name="start_element" throws="1">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="context" transfer-ownership="none">
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </parameter>
- <parameter name="element_name" transfer-ownership="none">
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="attribute_names" transfer-ownership="none">
- <type name="utf8" c:type="const gchar**"/>
- </parameter>
- <parameter name="attribute_values" transfer-ownership="none">
- <type name="utf8" c:type="const gchar**"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="4">
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="end_element">
- <callback name="end_element" throws="1">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="context" transfer-ownership="none">
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </parameter>
- <parameter name="element_name" transfer-ownership="none">
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="2">
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="text">
- <callback name="text" throws="1">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="context" transfer-ownership="none">
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </parameter>
- <parameter name="text" transfer-ownership="none">
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="text_len" transfer-ownership="none">
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="3">
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="passthrough">
- <callback name="passthrough" throws="1">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="context" transfer-ownership="none">
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </parameter>
- <parameter name="passthrough_text" transfer-ownership="none">
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="text_len" transfer-ownership="none">
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="3">
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="error">
- <callback name="error">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="context" transfer-ownership="none">
- <type name="MarkupParseContext" c:type="GMarkupParseContext*"/>
- </parameter>
- <parameter name="error" transfer-ownership="none">
- <type name="Error" c:type="GError*"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="2">
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- </record>
- <record name="MatchInfo"
- c:type="GMatchInfo"
- glib:type-name="GMatchInfo"
- glib:get-type="g_match_info_get_type"
- c:symbol-prefix="match_info">
- <doc xml:space="preserve">A GMatchInfo is an opaque struct used to return information about
- matches.</doc>
- <method name="expand_references"
- c:identifier="g_match_info_expand_references"
- version="2.14"
- throws="1">
- <doc xml:space="preserve">Returns a new string containing the text in @string_to_expand with
- references and escape sequences expanded. References refer to the last
- match done with @string against @regex and have the same syntax used by
- g_regex_replace().
- The @string_to_expand must be UTF-8 encoded even if #G_REGEX_RAW was
- passed to g_regex_new().
- The backreferences are extracted from the string passed to the match
- function, so you cannot call this function after freeing the string.
- @match_info may be %NULL in which case @string_to_expand must not
- contain references. For instance "foo\n" does not refer to an actual
- pattern and '\n' merely will be replaced with \n character,
- while to expand "\0" (whole match) one needs the result of a match.
- Use g_regex_check_replacement() to find out whether @string_to_expand
- contains references.</doc>
- <return-value transfer-ownership="full" nullable="1">
- <doc xml:space="preserve">the expanded string, or %NULL if an error occurred</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="match_info"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GMatchInfo or %NULL</doc>
- <type name="MatchInfo" c:type="const GMatchInfo*"/>
- </instance-parameter>
- <parameter name="string_to_expand" transfer-ownership="none">
- <doc xml:space="preserve">the string to expand</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="fetch" c:identifier="g_match_info_fetch" version="2.14">
- <doc xml:space="preserve">Retrieves the text matching the @match_num'th capturing
- parentheses. 0 is the full text of the match, 1 is the first paren
- set, 2 the second, and so on.
- If @match_num is a valid sub pattern but it didn't match anything
- (e.g. sub pattern 1, matching "b" against "(a)?b") then an empty
- string is returned.
- If the match was obtained using the DFA algorithm, that is using
- g_regex_match_all() or g_regex_match_all_full(), the retrieved
- string is not that of a set of parentheses but that of a matched
- substring. Substrings are matched in reverse order of length, so
- 0 is the longest match.
- The string is fetched from the string passed to the match function,
- so you cannot call this function after freeing the string.</doc>
- <return-value transfer-ownership="full" nullable="1">
- <doc xml:space="preserve">The matched substring, or %NULL if an error
- occurred. You have to free the string yourself</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="match_info" transfer-ownership="none">
- <doc xml:space="preserve">#GMatchInfo structure</doc>
- <type name="MatchInfo" c:type="const GMatchInfo*"/>
- </instance-parameter>
- <parameter name="match_num" transfer-ownership="none">
- <doc xml:space="preserve">number of the sub expression</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="fetch_all"
- c:identifier="g_match_info_fetch_all"
- version="2.14">
- <doc xml:space="preserve">Bundles up pointers to each of the matching substrings from a match
- and stores them in an array of gchar pointers. The first element in
- the returned array is the match number 0, i.e. the entire matched
- text.
- If a sub pattern didn't match anything (e.g. sub pattern 1, matching
- "b" against "(a)?b") then an empty string is inserted.
- If the last match was obtained using the DFA algorithm, that is using
- g_regex_match_all() or g_regex_match_all_full(), the retrieved
- strings are not that matched by sets of parentheses but that of the
- matched substring. Substrings are matched in reverse order of length,
- so the first one is the longest match.
- The strings are fetched from the string passed to the match function,
- so you cannot call this function after freeing the string.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a %NULL-terminated array of gchar *
- pointers. It must be freed using g_strfreev(). If the previous
- match failed %NULL is returned</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="match_info" transfer-ownership="none">
- <doc xml:space="preserve">a #GMatchInfo structure</doc>
- <type name="MatchInfo" c:type="const GMatchInfo*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="fetch_named"
- c:identifier="g_match_info_fetch_named"
- version="2.14">
- <doc xml:space="preserve">Retrieves the text matching the capturing parentheses named @name.
- If @name is a valid sub pattern name but it didn't match anything
- (e.g. sub pattern "X", matching "b" against "(?P<X>a)?b")
- then an empty string is returned.
- The string is fetched from the string passed to the match function,
- so you cannot call this function after freeing the string.</doc>
- <return-value transfer-ownership="full" nullable="1">
- <doc xml:space="preserve">The matched substring, or %NULL if an error
- occurred. You have to free the string yourself</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="match_info" transfer-ownership="none">
- <doc xml:space="preserve">#GMatchInfo structure</doc>
- <type name="MatchInfo" c:type="const GMatchInfo*"/>
- </instance-parameter>
- <parameter name="name" transfer-ownership="none">
- <doc xml:space="preserve">name of the subexpression</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="fetch_named_pos"
- c:identifier="g_match_info_fetch_named_pos"
- version="2.14">
- <doc xml:space="preserve">Retrieves the position in bytes of the capturing parentheses named @name.
- If @name is a valid sub pattern name but it didn't match anything
- (e.g. sub pattern "X", matching "b" against "(?P<X>a)?b")
- then @start_pos and @end_pos are set to -1 and %TRUE is returned.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the position was fetched, %FALSE otherwise.
- If the position cannot be fetched, @start_pos and @end_pos
- are left unchanged.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="match_info" transfer-ownership="none">
- <doc xml:space="preserve">#GMatchInfo structure</doc>
- <type name="MatchInfo" c:type="const GMatchInfo*"/>
- </instance-parameter>
- <parameter name="name" transfer-ownership="none">
- <doc xml:space="preserve">name of the subexpression</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="start_pos"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">pointer to location where to store
- the start position, or %NULL</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- <parameter name="end_pos"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">pointer to location where to store
- the end position, or %NULL</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- </parameters>
- </method>
- <method name="fetch_pos"
- c:identifier="g_match_info_fetch_pos"
- version="2.14">
- <doc xml:space="preserve">Retrieves the position in bytes of the @match_num'th capturing
- parentheses. 0 is the full text of the match, 1 is the first
- paren set, 2 the second, and so on.
- If @match_num is a valid sub pattern but it didn't match anything
- (e.g. sub pattern 1, matching "b" against "(a)?b") then @start_pos
- and @end_pos are set to -1 and %TRUE is returned.
- If the match was obtained using the DFA algorithm, that is using
- g_regex_match_all() or g_regex_match_all_full(), the retrieved
- position is not that of a set of parentheses but that of a matched
- substring. Substrings are matched in reverse order of length, so
- 0 is the longest match.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the position was fetched, %FALSE otherwise. If
- the position cannot be fetched, @start_pos and @end_pos are left
- unchanged</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="match_info" transfer-ownership="none">
- <doc xml:space="preserve">#GMatchInfo structure</doc>
- <type name="MatchInfo" c:type="const GMatchInfo*"/>
- </instance-parameter>
- <parameter name="match_num" transfer-ownership="none">
- <doc xml:space="preserve">number of the sub expression</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="start_pos"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">pointer to location where to store
- the start position, or %NULL</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- <parameter name="end_pos"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">pointer to location where to store
- the end position, or %NULL</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_match_info_free" version="2.14">
- <doc xml:space="preserve">If @match_info is not %NULL, calls g_match_info_unref(); otherwise does
- nothing.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="match_info"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GMatchInfo, or %NULL</doc>
- <type name="MatchInfo" c:type="GMatchInfo*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_match_count"
- c:identifier="g_match_info_get_match_count"
- version="2.14">
- <doc xml:space="preserve">Retrieves the number of matched substrings (including substring 0,
- that is the whole matched text), so 1 is returned if the pattern
- has no substrings in it and 0 is returned if the match failed.
- If the last match was obtained using the DFA algorithm, that is
- using g_regex_match_all() or g_regex_match_all_full(), the retrieved
- count is not that of the number of capturing parentheses but that of
- the number of matched substrings.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">Number of matched substrings, or -1 if an error occurred</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="match_info" transfer-ownership="none">
- <doc xml:space="preserve">a #GMatchInfo structure</doc>
- <type name="MatchInfo" c:type="const GMatchInfo*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_regex"
- c:identifier="g_match_info_get_regex"
- version="2.14">
- <doc xml:space="preserve">Returns #GRegex object used in @match_info. It belongs to Glib
- and must not be freed. Use g_regex_ref() if you need to keep it
- after you free @match_info object.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">#GRegex object used in @match_info</doc>
- <type name="Regex" c:type="GRegex*"/>
- </return-value>
- <parameters>
- <instance-parameter name="match_info" transfer-ownership="none">
- <doc xml:space="preserve">a #GMatchInfo</doc>
- <type name="MatchInfo" c:type="const GMatchInfo*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_string"
- c:identifier="g_match_info_get_string"
- version="2.14">
- <doc xml:space="preserve">Returns the string searched with @match_info. This is the
- string passed to g_regex_match() or g_regex_replace() so
- you may not free it before calling this function.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the string searched with @match_info</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="match_info" transfer-ownership="none">
- <doc xml:space="preserve">a #GMatchInfo</doc>
- <type name="MatchInfo" c:type="const GMatchInfo*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_partial_match"
- c:identifier="g_match_info_is_partial_match"
- version="2.14">
- <doc xml:space="preserve">Usually if the string passed to g_regex_match*() matches as far as
- it goes, but is too short to match the entire pattern, %FALSE is
- returned. There are circumstances where it might be helpful to
- distinguish this case from other cases in which there is no match.
- Consider, for example, an application where a human is required to
- type in data for a field with specific formatting requirements. An
- example might be a date in the form ddmmmyy, defined by the pattern
- "^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$".
- If the application sees the user’s keystrokes one by one, and can
- check that what has been typed so far is potentially valid, it is
- able to raise an error as soon as a mistake is made.
- GRegex supports the concept of partial matching by means of the
- #G_REGEX_MATCH_PARTIAL_SOFT and #G_REGEX_MATCH_PARTIAL_HARD flags.
- When they are used, the return code for
- g_regex_match() or g_regex_match_full() is, as usual, %TRUE
- for a complete match, %FALSE otherwise. But, when these functions
- return %FALSE, you can check if the match was partial calling
- g_match_info_is_partial_match().
- The difference between #G_REGEX_MATCH_PARTIAL_SOFT and
- #G_REGEX_MATCH_PARTIAL_HARD is that when a partial match is encountered
- with #G_REGEX_MATCH_PARTIAL_SOFT, matching continues to search for a
- possible complete match, while with #G_REGEX_MATCH_PARTIAL_HARD matching
- stops at the partial match.
- When both #G_REGEX_MATCH_PARTIAL_SOFT and #G_REGEX_MATCH_PARTIAL_HARD
- are set, the latter takes precedence.
- There were formerly some restrictions on the pattern for partial matching.
- The restrictions no longer apply.
- See pcrepartial(3) for more information on partial matching.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the match was partial, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="match_info" transfer-ownership="none">
- <doc xml:space="preserve">a #GMatchInfo structure</doc>
- <type name="MatchInfo" c:type="const GMatchInfo*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="matches"
- c:identifier="g_match_info_matches"
- version="2.14">
- <doc xml:space="preserve">Returns whether the previous match operation succeeded.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the previous match operation succeeded,
- %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="match_info" transfer-ownership="none">
- <doc xml:space="preserve">a #GMatchInfo structure</doc>
- <type name="MatchInfo" c:type="const GMatchInfo*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="next"
- c:identifier="g_match_info_next"
- version="2.14"
- throws="1">
- <doc xml:space="preserve">Scans for the next match using the same parameters of the previous
- call to g_regex_match_full() or g_regex_match() that returned
- @match_info.
- The match is done on the string passed to the match function, so you
- cannot free it before calling this function.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE is the string matched, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="match_info" transfer-ownership="none">
- <doc xml:space="preserve">a #GMatchInfo structure</doc>
- <type name="MatchInfo" c:type="GMatchInfo*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_match_info_ref" version="2.30">
- <doc xml:space="preserve">Increases reference count of @match_info by 1.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">@match_info</doc>
- <type name="MatchInfo" c:type="GMatchInfo*"/>
- </return-value>
- <parameters>
- <instance-parameter name="match_info" transfer-ownership="none">
- <doc xml:space="preserve">a #GMatchInfo</doc>
- <type name="MatchInfo" c:type="GMatchInfo*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_match_info_unref" version="2.30">
- <doc xml:space="preserve">Decreases reference count of @match_info by 1. When reference count drops
- to zero, it frees all the memory associated with the match_info structure.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="match_info" transfer-ownership="none">
- <doc xml:space="preserve">a #GMatchInfo</doc>
- <type name="MatchInfo" c:type="GMatchInfo*"/>
- </instance-parameter>
- </parameters>
- </method>
- </record>
- <record name="MemVTable" c:type="GMemVTable">
- <doc xml:space="preserve">A set of functions used to perform memory allocation. The same #GMemVTable must
- be used for all allocations in the same program; a call to g_mem_set_vtable(),
- if it exists, should be prior to any use of GLib.
- This functions related to this has been deprecated in 2.46, and no longer work.</doc>
- <field name="malloc">
- <callback name="malloc">
- <return-value transfer-ownership="none">
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="n_bytes" transfer-ownership="none">
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="realloc">
- <callback name="realloc">
- <return-value transfer-ownership="none">
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="mem" transfer-ownership="none">
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="n_bytes" transfer-ownership="none">
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="free">
- <callback name="free">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="mem" transfer-ownership="none">
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="calloc">
- <callback name="calloc">
- <return-value transfer-ownership="none">
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="n_blocks" transfer-ownership="none">
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="n_block_bytes" transfer-ownership="none">
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="try_malloc">
- <callback name="try_malloc">
- <return-value transfer-ownership="none">
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="n_bytes" transfer-ownership="none">
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="try_realloc">
- <callback name="try_realloc">
- <return-value transfer-ownership="none">
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="mem" transfer-ownership="none">
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="n_bytes" transfer-ownership="none">
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- </record>
- <union name="Mutex" c:type="GMutex">
- <doc xml:space="preserve">The #GMutex struct is an opaque data structure to represent a mutex
- (mutual exclusion). It can be used to protect data against shared
- access.
- Take for example the following function:
- |[<!-- language="C" -->
- int
- give_me_next_number (void)
- {
- static int current_number = 0;
- // now do a very complicated calculation to calculate the new
- // number, this might for example be a random number generator
- current_number = calc_next_number (current_number);
- return current_number;
- }
- ]|
- It is easy to see that this won't work in a multi-threaded
- application. There current_number must be protected against shared
- access. A #GMutex can be used as a solution to this problem:
- |[<!-- language="C" -->
- int
- give_me_next_number (void)
- {
- static GMutex mutex;
- static int current_number = 0;
- int ret_val;
- g_mutex_lock (&mutex);
- ret_val = current_number = calc_next_number (current_number);
- g_mutex_unlock (&mutex);
- return ret_val;
- }
- ]|
- Notice that the #GMutex is not initialised to any particular value.
- Its placement in static storage ensures that it will be initialised
- to all-zeros, which is appropriate.
- If a #GMutex is placed in other contexts (eg: embedded in a struct)
- then it must be explicitly initialised using g_mutex_init().
- A #GMutex should only be accessed via g_mutex_ functions.</doc>
- <field name="p" readable="0" private="1">
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="i" readable="0" private="1">
- <array zero-terminated="0" c:type="guint" fixed-size="2">
- <type name="guint" c:type="guint"/>
- </array>
- </field>
- <method name="clear" c:identifier="g_mutex_clear">
- <doc xml:space="preserve">Frees the resources allocated to a mutex with g_mutex_init().
- This function should not be used with a #GMutex that has been
- statically allocated.
- Calling g_mutex_clear() on a locked mutex leads to undefined
- behaviour.
- Sine: 2.32</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="mutex" transfer-ownership="none">
- <doc xml:space="preserve">an initialized #GMutex</doc>
- <type name="Mutex" c:type="GMutex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="init" c:identifier="g_mutex_init" version="2.32">
- <doc xml:space="preserve">Initializes a #GMutex so that it can be used.
- This function is useful to initialize a mutex that has been
- allocated on the stack, or as part of a larger structure.
- It is not necessary to initialize a mutex that has been
- statically allocated.
- |[<!-- language="C" -->
- typedef struct {
- GMutex m;
- ...
- } Blob;
- Blob *b;
- b = g_new (Blob, 1);
- g_mutex_init (&b->m);
- ]|
- To undo the effect of g_mutex_init() when a mutex is no longer
- needed, use g_mutex_clear().
- Calling g_mutex_init() on an already initialized #GMutex leads
- to undefined behaviour.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="mutex" transfer-ownership="none">
- <doc xml:space="preserve">an uninitialized #GMutex</doc>
- <type name="Mutex" c:type="GMutex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="lock" c:identifier="g_mutex_lock">
- <doc xml:space="preserve">Locks @mutex. If @mutex is already locked by another thread, the
- current thread will block until @mutex is unlocked by the other
- thread.
- #GMutex is neither guaranteed to be recursive nor to be
- non-recursive. As such, calling g_mutex_lock() on a #GMutex that has
- already been locked by the same thread results in undefined behaviour
- (including but not limited to deadlocks).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="mutex" transfer-ownership="none">
- <doc xml:space="preserve">a #GMutex</doc>
- <type name="Mutex" c:type="GMutex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="trylock" c:identifier="g_mutex_trylock">
- <doc xml:space="preserve">Tries to lock @mutex. If @mutex is already locked by another thread,
- it immediately returns %FALSE. Otherwise it locks @mutex and returns
- %TRUE.
- #GMutex is neither guaranteed to be recursive nor to be
- non-recursive. As such, calling g_mutex_lock() on a #GMutex that has
- already been locked by the same thread results in undefined behaviour
- (including but not limited to deadlocks or arbitrary return values).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @mutex could be locked</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="mutex" transfer-ownership="none">
- <doc xml:space="preserve">a #GMutex</doc>
- <type name="Mutex" c:type="GMutex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unlock" c:identifier="g_mutex_unlock">
- <doc xml:space="preserve">Unlocks @mutex. If another thread is blocked in a g_mutex_lock()
- call for @mutex, it will become unblocked and can lock @mutex itself.
- Calling g_mutex_unlock() on a mutex that is not locked by the
- current thread leads to undefined behaviour.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="mutex" transfer-ownership="none">
- <doc xml:space="preserve">a #GMutex</doc>
- <type name="Mutex" c:type="GMutex*"/>
- </instance-parameter>
- </parameters>
- </method>
- </union>
- <record name="Node" c:type="GNode">
- <doc xml:space="preserve">The #GNode struct represents one node in a [n-ary tree][glib-N-ary-Trees].</doc>
- <field name="data" writable="1">
- <doc xml:space="preserve">contains the actual data of the node.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="next" writable="1">
- <doc xml:space="preserve">points to the node's next sibling (a sibling is another
- #GNode with the same parent).</doc>
- <type name="Node" c:type="GNode*"/>
- </field>
- <field name="prev" writable="1">
- <doc xml:space="preserve">points to the node's previous sibling.</doc>
- <type name="Node" c:type="GNode*"/>
- </field>
- <field name="parent" writable="1">
- <doc xml:space="preserve">points to the parent of the #GNode, or is %NULL if the
- #GNode is the root of the tree.</doc>
- <type name="Node" c:type="GNode*"/>
- </field>
- <field name="children" writable="1">
- <doc xml:space="preserve">points to the first child of the #GNode. The other
- children are accessed by using the @next pointer of each
- child.</doc>
- <type name="Node" c:type="GNode*"/>
- </field>
- <method name="child_index" c:identifier="g_node_child_index">
- <doc xml:space="preserve">Gets the position of the first child of a #GNode
- which contains the given data.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the index of the child of @node which contains
- @data, or -1 if the data is not found</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to find</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="child_position" c:identifier="g_node_child_position">
- <doc xml:space="preserve">Gets the position of a #GNode with respect to its siblings.
- @child must be a child of @node. The first child is numbered 0,
- the second 1, and so on.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the position of @child with respect to its siblings</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- <parameter name="child" transfer-ownership="none">
- <doc xml:space="preserve">a child of @node</doc>
- <type name="Node" c:type="GNode*"/>
- </parameter>
- </parameters>
- </method>
- <method name="children_foreach"
- c:identifier="g_node_children_foreach"
- introspectable="0">
- <doc xml:space="preserve">Calls a function for each of the children of a #GNode.
- Note that it doesn't descend beneath the child nodes.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">which types of children are to be visited, one of
- %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES</doc>
- <type name="TraverseFlags" c:type="GTraverseFlags"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function to call for each visited node</doc>
- <type name="NodeForeachFunc" c:type="GNodeForeachFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="copy" c:identifier="g_node_copy" introspectable="0">
- <doc xml:space="preserve">Recursively copies a #GNode (but does not deep-copy the data inside the
- nodes, see g_node_copy_deep() if you need that).</doc>
- <return-value>
- <doc xml:space="preserve">a new #GNode containing the same data pointers</doc>
- <type name="Node" c:type="GNode*"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="copy_deep"
- c:identifier="g_node_copy_deep"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Recursively copies a #GNode and its data.</doc>
- <return-value>
- <doc xml:space="preserve">a new #GNode containing copies of the data in @node.</doc>
- <type name="Node" c:type="GNode*"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- <parameter name="copy_func" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">the function which is called to copy the data inside each node,
- or %NULL to use the original data.</doc>
- <type name="CopyFunc" c:type="GCopyFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @copy_func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="depth" c:identifier="g_node_depth">
- <doc xml:space="preserve">Gets the depth of a #GNode.
- If @node is %NULL the depth is 0. The root node has a depth of 1.
- For the children of the root node the depth is 2. And so on.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the depth of the #GNode</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="destroy" c:identifier="g_node_destroy">
- <doc xml:space="preserve">Removes @root and its children from the tree, freeing any memory
- allocated.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="root" transfer-ownership="none">
- <doc xml:space="preserve">the root of the tree/subtree to destroy</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="find" c:identifier="g_node_find" introspectable="0">
- <doc xml:space="preserve">Finds a #GNode in a tree.</doc>
- <return-value>
- <doc xml:space="preserve">the found #GNode, or %NULL if the data is not found</doc>
- <type name="Node" c:type="GNode*"/>
- </return-value>
- <parameters>
- <instance-parameter name="root" transfer-ownership="none">
- <doc xml:space="preserve">the root #GNode of the tree to search</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- <parameter name="order" transfer-ownership="none">
- <doc xml:space="preserve">the order in which nodes are visited - %G_IN_ORDER,
- %G_PRE_ORDER, %G_POST_ORDER, or %G_LEVEL_ORDER</doc>
- <type name="TraverseType" c:type="GTraverseType"/>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">which types of children are to be searched, one of
- %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES</doc>
- <type name="TraverseFlags" c:type="GTraverseFlags"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to find</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="find_child"
- c:identifier="g_node_find_child"
- introspectable="0">
- <doc xml:space="preserve">Finds the first child of a #GNode with the given data.</doc>
- <return-value>
- <doc xml:space="preserve">the found child #GNode, or %NULL if the data is not found</doc>
- <type name="Node" c:type="GNode*"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">which types of children are to be searched, one of
- %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES</doc>
- <type name="TraverseFlags" c:type="GTraverseFlags"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to find</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="first_sibling"
- c:identifier="g_node_first_sibling"
- introspectable="0">
- <doc xml:space="preserve">Gets the first sibling of a #GNode.
- This could possibly be the node itself.</doc>
- <return-value>
- <doc xml:space="preserve">the first sibling of @node</doc>
- <type name="Node" c:type="GNode*"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_root"
- c:identifier="g_node_get_root"
- introspectable="0">
- <doc xml:space="preserve">Gets the root of a tree.</doc>
- <return-value>
- <doc xml:space="preserve">the root of the tree</doc>
- <type name="Node" c:type="GNode*"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="insert" c:identifier="g_node_insert" introspectable="0">
- <doc xml:space="preserve">Inserts a #GNode beneath the parent at the given position.</doc>
- <return-value>
- <doc xml:space="preserve">the inserted #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </return-value>
- <parameters>
- <instance-parameter name="parent" transfer-ownership="none">
- <doc xml:space="preserve">the #GNode to place @node under</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- <parameter name="position" transfer-ownership="none">
- <doc xml:space="preserve">the position to place @node at, with respect to its siblings
- If position is -1, @node is inserted as the last child of @parent</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">the #GNode to insert</doc>
- <type name="Node" c:type="GNode*"/>
- </parameter>
- </parameters>
- </method>
- <method name="insert_after"
- c:identifier="g_node_insert_after"
- introspectable="0">
- <doc xml:space="preserve">Inserts a #GNode beneath the parent after the given sibling.</doc>
- <return-value>
- <doc xml:space="preserve">the inserted #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </return-value>
- <parameters>
- <instance-parameter name="parent" transfer-ownership="none">
- <doc xml:space="preserve">the #GNode to place @node under</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- <parameter name="sibling" transfer-ownership="none">
- <doc xml:space="preserve">the sibling #GNode to place @node after.
- If sibling is %NULL, the node is inserted as the first child of @parent.</doc>
- <type name="Node" c:type="GNode*"/>
- </parameter>
- <parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">the #GNode to insert</doc>
- <type name="Node" c:type="GNode*"/>
- </parameter>
- </parameters>
- </method>
- <method name="insert_before"
- c:identifier="g_node_insert_before"
- introspectable="0">
- <doc xml:space="preserve">Inserts a #GNode beneath the parent before the given sibling.</doc>
- <return-value>
- <doc xml:space="preserve">the inserted #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </return-value>
- <parameters>
- <instance-parameter name="parent" transfer-ownership="none">
- <doc xml:space="preserve">the #GNode to place @node under</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- <parameter name="sibling" transfer-ownership="none">
- <doc xml:space="preserve">the sibling #GNode to place @node before.
- If sibling is %NULL, the node is inserted as the last child of @parent.</doc>
- <type name="Node" c:type="GNode*"/>
- </parameter>
- <parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">the #GNode to insert</doc>
- <type name="Node" c:type="GNode*"/>
- </parameter>
- </parameters>
- </method>
- <method name="is_ancestor" c:identifier="g_node_is_ancestor">
- <doc xml:space="preserve">Returns %TRUE if @node is an ancestor of @descendant.
- This is true if node is the parent of @descendant,
- or if node is the grandparent of @descendant etc.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @node is an ancestor of @descendant</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- <parameter name="descendant" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </parameter>
- </parameters>
- </method>
- <method name="last_child"
- c:identifier="g_node_last_child"
- introspectable="0">
- <doc xml:space="preserve">Gets the last child of a #GNode.</doc>
- <return-value>
- <doc xml:space="preserve">the last child of @node, or %NULL if @node has no children</doc>
- <type name="Node" c:type="GNode*"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode (must not be %NULL)</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="last_sibling"
- c:identifier="g_node_last_sibling"
- introspectable="0">
- <doc xml:space="preserve">Gets the last sibling of a #GNode.
- This could possibly be the node itself.</doc>
- <return-value>
- <doc xml:space="preserve">the last sibling of @node</doc>
- <type name="Node" c:type="GNode*"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="max_height" c:identifier="g_node_max_height">
- <doc xml:space="preserve">Gets the maximum height of all branches beneath a #GNode.
- This is the maximum distance from the #GNode to all leaf nodes.
- If @root is %NULL, 0 is returned. If @root has no children,
- 1 is returned. If @root has children, 2 is returned. And so on.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the maximum height of the tree beneath @root</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="root" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="n_children" c:identifier="g_node_n_children">
- <doc xml:space="preserve">Gets the number of children of a #GNode.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of children of @node</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="n_nodes" c:identifier="g_node_n_nodes">
- <doc xml:space="preserve">Gets the number of nodes in a tree.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of nodes in the tree</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="root" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">which types of children are to be counted, one of
- %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES</doc>
- <type name="TraverseFlags" c:type="GTraverseFlags"/>
- </parameter>
- </parameters>
- </method>
- <method name="nth_child"
- c:identifier="g_node_nth_child"
- introspectable="0">
- <doc xml:space="preserve">Gets a child of a #GNode, using the given index.
- The first child is at index 0. If the index is
- too big, %NULL is returned.</doc>
- <return-value>
- <doc xml:space="preserve">the child of @node at index @n</doc>
- <type name="Node" c:type="GNode*"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the index of the desired child</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="prepend" c:identifier="g_node_prepend" introspectable="0">
- <doc xml:space="preserve">Inserts a #GNode as the first child of the given parent.</doc>
- <return-value>
- <doc xml:space="preserve">the inserted #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </return-value>
- <parameters>
- <instance-parameter name="parent" transfer-ownership="none">
- <doc xml:space="preserve">the #GNode to place the new #GNode under</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- <parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">the #GNode to insert</doc>
- <type name="Node" c:type="GNode*"/>
- </parameter>
- </parameters>
- </method>
- <method name="reverse_children" c:identifier="g_node_reverse_children">
- <doc xml:space="preserve">Reverses the order of the children of a #GNode.
- (It doesn't change the order of the grandchildren.)</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode.</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="traverse"
- c:identifier="g_node_traverse"
- introspectable="0">
- <doc xml:space="preserve">Traverses a tree starting at the given root #GNode.
- It calls the given function for each node visited.
- The traversal can be halted at any point by returning %TRUE from @func.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="root" transfer-ownership="none">
- <doc xml:space="preserve">the root #GNode of the tree to traverse</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- <parameter name="order" transfer-ownership="none">
- <doc xml:space="preserve">the order in which nodes are visited - %G_IN_ORDER,
- %G_PRE_ORDER, %G_POST_ORDER, or %G_LEVEL_ORDER.</doc>
- <type name="TraverseType" c:type="GTraverseType"/>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">which types of children are to be visited, one of
- %G_TRAVERSE_ALL, %G_TRAVERSE_LEAVES and %G_TRAVERSE_NON_LEAVES</doc>
- <type name="TraverseFlags" c:type="GTraverseFlags"/>
- </parameter>
- <parameter name="max_depth" transfer-ownership="none">
- <doc xml:space="preserve">the maximum depth of the traversal. Nodes below this
- depth will not be visited. If max_depth is -1 all nodes in
- the tree are visited. If depth is 1, only the root is visited.
- If depth is 2, the root and its children are visited. And so on.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="4">
- <doc xml:space="preserve">the function to call for each visited #GNode</doc>
- <type name="NodeTraverseFunc" c:type="GNodeTraverseFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="unlink" c:identifier="g_node_unlink">
- <doc xml:space="preserve">Unlinks a #GNode from a tree, resulting in two separate trees.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">the #GNode to unlink, which becomes the root of a new tree</doc>
- <type name="Node" c:type="GNode*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="new" c:identifier="g_node_new" introspectable="0">
- <doc xml:space="preserve">Creates a new #GNode containing the given data.
- Used to create the first node in a tree.</doc>
- <return-value>
- <doc xml:space="preserve">a new #GNode</doc>
- <type name="Node" c:type="GNode*"/>
- </return-value>
- <parameters>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data of the new node</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <callback name="NodeForeachFunc" c:type="GNodeForeachFunc">
- <doc xml:space="preserve">Specifies the type of function passed to g_node_children_foreach().
- The function is called with each child node, together with the user
- data passed to g_node_children_foreach().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode.</doc>
- <type name="Node" c:type="GNode*"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to g_node_children_foreach().</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <callback name="NodeTraverseFunc" c:type="GNodeTraverseFunc">
- <doc xml:space="preserve">Specifies the type of function passed to g_node_traverse(). The
- function is called with each of the nodes visited, together with the
- user data passed to g_node_traverse(). If the function returns
- %TRUE, then the traversal is stopped.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE to stop the traversal.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="node" transfer-ownership="none">
- <doc xml:space="preserve">a #GNode.</doc>
- <type name="Node" c:type="GNode*"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to g_node_traverse().</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <enumeration name="NormalizeMode" c:type="GNormalizeMode">
- <doc xml:space="preserve">Defines how a Unicode string is transformed in a canonical
- form, standardizing such issues as whether a character with
- an accent is represented as a base character and combining
- accent or as a single precomposed character. Unicode strings
- should generally be normalized before comparing them.</doc>
- <member name="default" value="0" c:identifier="G_NORMALIZE_DEFAULT">
- <doc xml:space="preserve">standardize differences that do not affect the
- text content, such as the above-mentioned accent representation</doc>
- </member>
- <member name="nfd" value="0" c:identifier="G_NORMALIZE_NFD">
- <doc xml:space="preserve">another name for %G_NORMALIZE_DEFAULT</doc>
- </member>
- <member name="default_compose"
- value="1"
- c:identifier="G_NORMALIZE_DEFAULT_COMPOSE">
- <doc xml:space="preserve">like %G_NORMALIZE_DEFAULT, but with
- composed forms rather than a maximally decomposed form</doc>
- </member>
- <member name="nfc" value="1" c:identifier="G_NORMALIZE_NFC">
- <doc xml:space="preserve">another name for %G_NORMALIZE_DEFAULT_COMPOSE</doc>
- </member>
- <member name="all" value="2" c:identifier="G_NORMALIZE_ALL">
- <doc xml:space="preserve">beyond %G_NORMALIZE_DEFAULT also standardize the
- "compatibility" characters in Unicode, such as SUPERSCRIPT THREE
- to the standard forms (in this case DIGIT THREE). Formatting
- information may be lost but for most text operations such
- characters should be considered the same</doc>
- </member>
- <member name="nfkd" value="2" c:identifier="G_NORMALIZE_NFKD">
- <doc xml:space="preserve">another name for %G_NORMALIZE_ALL</doc>
- </member>
- <member name="all_compose"
- value="3"
- c:identifier="G_NORMALIZE_ALL_COMPOSE">
- <doc xml:space="preserve">like %G_NORMALIZE_ALL, but with composed
- forms rather than a maximally decomposed form</doc>
- </member>
- <member name="nfkc" value="3" c:identifier="G_NORMALIZE_NFKC">
- <doc xml:space="preserve">another name for %G_NORMALIZE_ALL_COMPOSE</doc>
- </member>
- </enumeration>
- <constant name="OPTION_REMAINING"
- value=""
- c:type="G_OPTION_REMAINING"
- version="2.6">
- <doc xml:space="preserve">If a long option in the main group has this name, it is not treated as a
- regular option. Instead it collects all non-option arguments which would
- otherwise be left in `argv`. The option must be of type
- %G_OPTION_ARG_CALLBACK, %G_OPTION_ARG_STRING_ARRAY
- or %G_OPTION_ARG_FILENAME_ARRAY.
- Using #G_OPTION_REMAINING instead of simply scanning `argv`
- for leftover arguments has the advantage that GOption takes care of
- necessary encoding conversions for strings or filenames.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <record name="Once" c:type="GOnce" version="2.4">
- <doc xml:space="preserve">A #GOnce struct controls a one-time initialization function. Any
- one-time initialization function must have its own unique #GOnce
- struct.</doc>
- <field name="status" writable="1">
- <doc xml:space="preserve">the status of the #GOnce</doc>
- <type name="OnceStatus" c:type="volatile GOnceStatus"/>
- </field>
- <field name="retval" writable="1">
- <doc xml:space="preserve">the value returned by the call to the function, if @status
- is %G_ONCE_STATUS_READY</doc>
- <type name="gpointer" c:type="volatile gpointer"/>
- </field>
- <method name="impl" c:identifier="g_once_impl" introspectable="0">
- <return-value transfer-ownership="none" nullable="1">
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="once" transfer-ownership="none">
- <type name="Once" c:type="GOnce*"/>
- </instance-parameter>
- <parameter name="func" transfer-ownership="none">
- <type name="ThreadFunc" c:type="GThreadFunc"/>
- </parameter>
- <parameter name="arg"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <function name="init_enter"
- c:identifier="g_once_init_enter"
- version="2.14">
- <doc xml:space="preserve">Function to be called when starting a critical initialization
- section. The argument @location must point to a static
- 0-initialized variable that will be set to a value other than 0 at
- the end of the initialization section. In combination with
- g_once_init_leave() and the unique address @value_location, it can
- be ensured that an initialization section will be executed only once
- during a program's life time, and that concurrent threads are
- blocked until initialization completed. To be used in constructs
- like this:
- |[<!-- language="C" -->
- static gsize initialization_value = 0;
- if (g_once_init_enter (&initialization_value))
- {
- gsize setup_value = 42; // initialization code here
- g_once_init_leave (&initialization_value, setup_value);
- }
- // use initialization_value here
- ]|</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the initialization section should be entered,
- %FALSE and blocks otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="location" transfer-ownership="none">
- <doc xml:space="preserve">location of a static initializable variable
- containing 0</doc>
- <type name="gpointer" c:type="void*"/>
- </parameter>
- </parameters>
- </function>
- <function name="init_leave"
- c:identifier="g_once_init_leave"
- version="2.14">
- <doc xml:space="preserve">Counterpart to g_once_init_enter(). Expects a location of a static
- 0-initialized initialization variable, and an initialization value
- other than 0. Sets the variable to the initialization value, and
- releases concurrent threads blocking in g_once_init_enter() on this
- initialization variable.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="location" transfer-ownership="none">
- <doc xml:space="preserve">location of a static initializable variable
- containing 0</doc>
- <type name="gpointer" c:type="void*"/>
- </parameter>
- <parameter name="result" transfer-ownership="none">
- <doc xml:space="preserve">new non-0 value for *@value_location</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <enumeration name="OnceStatus" version="2.4" c:type="GOnceStatus">
- <doc xml:space="preserve">The possible statuses of a one-time initialization function
- controlled by a #GOnce struct.</doc>
- <member name="notcalled"
- value="0"
- c:identifier="G_ONCE_STATUS_NOTCALLED">
- <doc xml:space="preserve">the function has not been called yet.</doc>
- </member>
- <member name="progress" value="1" c:identifier="G_ONCE_STATUS_PROGRESS">
- <doc xml:space="preserve">the function call is currently in progress.</doc>
- </member>
- <member name="ready" value="2" c:identifier="G_ONCE_STATUS_READY">
- <doc xml:space="preserve">the function has been called.</doc>
- </member>
- </enumeration>
- <enumeration name="OptionArg" c:type="GOptionArg">
- <doc xml:space="preserve">The #GOptionArg enum values determine which type of extra argument the
- options expect to find. If an option expects an extra argument, it can
- be specified in several ways; with a short option: `-x arg`, with a long
- option: `--name arg` or combined in a single argument: `--name=arg`.</doc>
- <member name="none" value="0" c:identifier="G_OPTION_ARG_NONE">
- <doc xml:space="preserve">No extra argument. This is useful for simple flags.</doc>
- </member>
- <member name="string" value="1" c:identifier="G_OPTION_ARG_STRING">
- <doc xml:space="preserve">The option takes a string argument.</doc>
- </member>
- <member name="int" value="2" c:identifier="G_OPTION_ARG_INT">
- <doc xml:space="preserve">The option takes an integer argument.</doc>
- </member>
- <member name="callback" value="3" c:identifier="G_OPTION_ARG_CALLBACK">
- <doc xml:space="preserve">The option provides a callback (of type
- #GOptionArgFunc) to parse the extra argument.</doc>
- </member>
- <member name="filename" value="4" c:identifier="G_OPTION_ARG_FILENAME">
- <doc xml:space="preserve">The option takes a filename as argument.</doc>
- </member>
- <member name="string_array"
- value="5"
- c:identifier="G_OPTION_ARG_STRING_ARRAY">
- <doc xml:space="preserve">The option takes a string argument, multiple
- uses of the option are collected into an array of strings.</doc>
- </member>
- <member name="filename_array"
- value="6"
- c:identifier="G_OPTION_ARG_FILENAME_ARRAY">
- <doc xml:space="preserve">The option takes a filename as argument,
- multiple uses of the option are collected into an array of strings.</doc>
- </member>
- <member name="double" value="7" c:identifier="G_OPTION_ARG_DOUBLE">
- <doc xml:space="preserve">The option takes a double argument. The argument
- can be formatted either for the user's locale or for the "C" locale.
- Since 2.12</doc>
- </member>
- <member name="int64" value="8" c:identifier="G_OPTION_ARG_INT64">
- <doc xml:space="preserve">The option takes a 64-bit integer. Like
- %G_OPTION_ARG_INT but for larger numbers. The number can be in
- decimal base, or in hexadecimal (when prefixed with `0x`, for
- example, `0xffffffff`). Since 2.12</doc>
- </member>
- </enumeration>
- <callback name="OptionArgFunc" c:type="GOptionArgFunc" throws="1">
- <doc xml:space="preserve">The type of function to be passed as callback for %G_OPTION_ARG_CALLBACK
- options.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the option was successfully parsed, %FALSE if an error
- occurred, in which case @error should be set with g_set_error()</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="option_name" transfer-ownership="none">
- <doc xml:space="preserve">The name of the option being parsed. This will be either a
- single dash followed by a single letter (for a short name) or two dashes
- followed by a long option name.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">The value to be parsed.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">User data added to the #GOptionGroup containing the option when it
- was created with g_option_group_new()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <record name="OptionContext" c:type="GOptionContext" disguised="1">
- <doc xml:space="preserve">A `GOptionContext` struct defines which options
- are accepted by the commandline option parser. The struct has only private
- fields and should not be directly accessed.</doc>
- <method name="add_group"
- c:identifier="g_option_context_add_group"
- version="2.6">
- <doc xml:space="preserve">Adds a #GOptionGroup to the @context, so that parsing with @context
- will recognize the options in the group. Note that this will take
- ownership of the @group and thus the @group should not be freed.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- <parameter name="group" transfer-ownership="full">
- <doc xml:space="preserve">the group to add</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_main_entries"
- c:identifier="g_option_context_add_main_entries"
- version="2.6">
- <doc xml:space="preserve">A convenience function which creates a main group if it doesn't
- exist, adds the @entries to it and sets the translation domain.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- <parameter name="entries" transfer-ownership="none">
- <doc xml:space="preserve">a %NULL-terminated array of #GOptionEntrys</doc>
- <type name="OptionEntry" c:type="const GOptionEntry*"/>
- </parameter>
- <parameter name="translation_domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a translation domain to use for translating
- the `--help` output for the options in @entries
- with gettext(), or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_option_context_free" version="2.6">
- <doc xml:space="preserve">Frees context and all the groups which have been
- added to it.
- Please note that parsed arguments need to be freed separately (see
- #GOptionEntry).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_description"
- c:identifier="g_option_context_get_description"
- version="2.12">
- <doc xml:space="preserve">Returns the description. See g_option_context_set_description().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the description</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_help"
- c:identifier="g_option_context_get_help"
- version="2.14">
- <doc xml:space="preserve">Returns a formatted, translated help text for the given context.
- To obtain the text produced by `--help`, call
- `g_option_context_get_help (context, TRUE, NULL)`.
- To obtain the text produced by `--help-all`, call
- `g_option_context_get_help (context, FALSE, NULL)`.
- To obtain the help text for an option group, call
- `g_option_context_get_help (context, FALSE, group)`.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">A newly allocated string containing the help text</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- <parameter name="main_help" transfer-ownership="none">
- <doc xml:space="preserve">if %TRUE, only include the main group</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="group"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the #GOptionGroup to create help for, or %NULL</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_help_enabled"
- c:identifier="g_option_context_get_help_enabled"
- version="2.6">
- <doc xml:space="preserve">Returns whether automatic `--help` generation
- is turned on for @context. See g_option_context_set_help_enabled().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if automatic help generation is turned on.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_ignore_unknown_options"
- c:identifier="g_option_context_get_ignore_unknown_options"
- version="2.6">
- <doc xml:space="preserve">Returns whether unknown options are ignored or not. See
- g_option_context_set_ignore_unknown_options().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if unknown options are ignored.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_main_group"
- c:identifier="g_option_context_get_main_group"
- version="2.6">
- <doc xml:space="preserve">Returns a pointer to the main group of @context.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the main group of @context, or %NULL if
- @context doesn't have a main group. Note that group belongs to
- @context and should not be modified or freed.</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_strict_posix"
- c:identifier="g_option_context_get_strict_posix"
- version="2.44">
- <doc xml:space="preserve">Returns whether strict POSIX code is enabled.
- See g_option_context_set_strict_posix() for more information.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if strict POSIX is enabled, %FALSE otherwise.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GoptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_summary"
- c:identifier="g_option_context_get_summary"
- version="2.12">
- <doc xml:space="preserve">Returns the summary. See g_option_context_set_summary().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the summary</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="parse"
- c:identifier="g_option_context_parse"
- version="2.6"
- throws="1">
- <doc xml:space="preserve">Parses the command line arguments, recognizing options
- which have been added to @context. A side-effect of
- calling this function is that g_set_prgname() will be
- called.
- If the parsing is successful, any parsed arguments are
- removed from the array and @argc and @argv are updated
- accordingly. A '--' option is stripped from @argv
- unless there are unparsed options before and after it,
- or some of the options after it start with '-'. In case
- of an error, @argc and @argv are left unmodified.
- If automatic `--help` support is enabled
- (see g_option_context_set_help_enabled()), and the
- @argv array contains one of the recognized help options,
- this function will produce help output to stdout and
- call `exit (0)`.
- Note that function depends on the [current locale][setlocale] for
- automatic character set conversion of string and filename
- arguments.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the parsing was successful,
- %FALSE if an error occurred</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- <parameter name="argc"
- direction="inout"
- caller-allocates="0"
- transfer-ownership="full"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a pointer to the number of command line arguments</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- <parameter name="argv"
- direction="inout"
- caller-allocates="0"
- transfer-ownership="full"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a pointer to the array of command line arguments</doc>
- <array length="0" zero-terminated="0" c:type="gchar***">
- <type name="utf8" c:type="gchar**"/>
- </array>
- </parameter>
- </parameters>
- </method>
- <method name="parse_strv"
- c:identifier="g_option_context_parse_strv"
- version="2.40"
- throws="1">
- <doc xml:space="preserve">Parses the command line arguments.
- This function is similar to g_option_context_parse() except that it
- respects the normal memory rules when dealing with a strv instead of
- assuming that the passed-in array is the argv of the main function.
- In particular, strings that are removed from the arguments list will
- be freed using g_free().
- On Windows, the strings are expected to be in UTF-8. This is in
- contrast to g_option_context_parse() which expects them to be in the
- system codepage, which is how they are passed as @argv to main().
- See g_win32_get_command_line() for a solution.
- This function is useful if you are trying to use #GOptionContext with
- #GApplication.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the parsing was successful,
- %FALSE if an error occurred</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- <parameter name="arguments"
- direction="inout"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">a pointer to the
- command line arguments (which must be in UTF-8 on Windows)</doc>
- <array zero-terminated="0" c:type="gchar***">
- <type name="utf8" c:type="gchar**"/>
- </array>
- </parameter>
- </parameters>
- </method>
- <method name="set_description"
- c:identifier="g_option_context_set_description"
- version="2.12">
- <doc xml:space="preserve">Adds a string to be displayed in `--help` output after the list
- of options. This text often includes a bug reporting address.
- Note that the summary is translated (see
- g_option_context_set_translate_func()).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- <parameter name="description"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a string to be shown in `--help` output
- after the list of options, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_help_enabled"
- c:identifier="g_option_context_set_help_enabled"
- version="2.6">
- <doc xml:space="preserve">Enables or disables automatic generation of `--help` output.
- By default, g_option_context_parse() recognizes `--help`, `-h`,
- `-?`, `--help-all` and `--help-groupname` and creates suitable
- output to stdout.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- <parameter name="help_enabled" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE to enable `--help`, %FALSE to disable it</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_ignore_unknown_options"
- c:identifier="g_option_context_set_ignore_unknown_options"
- version="2.6">
- <doc xml:space="preserve">Sets whether to ignore unknown options or not. If an argument is
- ignored, it is left in the @argv array after parsing. By default,
- g_option_context_parse() treats unknown options as error.
- This setting does not affect non-option arguments (i.e. arguments
- which don't start with a dash). But note that GOption cannot reliably
- determine whether a non-option belongs to a preceding unknown option.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- <parameter name="ignore_unknown" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE to ignore unknown options, %FALSE to produce
- an error when unknown options are met</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_main_group"
- c:identifier="g_option_context_set_main_group"
- version="2.6">
- <doc xml:space="preserve">Sets a #GOptionGroup as main group of the @context.
- This has the same effect as calling g_option_context_add_group(),
- the only difference is that the options in the main group are
- treated differently when generating `--help` output.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- <parameter name="group" transfer-ownership="full">
- <doc xml:space="preserve">the group to set as main group</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_strict_posix"
- c:identifier="g_option_context_set_strict_posix"
- version="2.44">
- <doc xml:space="preserve">Sets strict POSIX mode.
- By default, this mode is disabled.
- In strict POSIX mode, the first non-argument parameter encountered
- (eg: filename) terminates argument processing. Remaining arguments
- are treated as non-options and are not attempted to be parsed.
- If strict POSIX mode is disabled then parsing is done in the GNU way
- where option arguments can be freely mixed with non-options.
- As an example, consider "ls foo -l". With GNU style parsing, this
- will list "foo" in long mode. In strict POSIX style, this will list
- the files named "foo" and "-l".
- It may be useful to force strict POSIX mode when creating "verb
- style" command line tools. For example, the "gsettings" command line
- tool supports the global option "--schemadir" as well as many
- subcommands ("get", "set", etc.) which each have their own set of
- arguments. Using strict POSIX mode will allow parsing the global
- options up to the verb name while leaving the remaining options to be
- parsed by the relevant subcommand (which can be determined by
- examining the verb name, which should be present in argv[1] after
- parsing).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GoptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- <parameter name="strict_posix" transfer-ownership="none">
- <doc xml:space="preserve">the new value</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_summary"
- c:identifier="g_option_context_set_summary"
- version="2.12">
- <doc xml:space="preserve">Adds a string to be displayed in `--help` output before the list
- of options. This is typically a summary of the program functionality.
- Note that the summary is translated (see
- g_option_context_set_translate_func() and
- g_option_context_set_translation_domain()).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- <parameter name="summary"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a string to be shown in `--help` output
- before the list of options, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_translate_func"
- c:identifier="g_option_context_set_translate_func"
- version="2.12">
- <doc xml:space="preserve">Sets the function which is used to translate the contexts
- user-visible strings, for `--help` output. If @func is %NULL,
- strings are not translated.
- Note that option groups have their own translation functions,
- this function only affects the @parameter_string (see g_option_context_new()),
- the summary (see g_option_context_set_summary()) and the description
- (see g_option_context_set_description()).
- If you are using gettext(), you only need to set the translation
- domain, see g_option_context_set_translation_domain().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- <parameter name="func"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="notified"
- closure="1"
- destroy="2">
- <doc xml:space="preserve">the #GTranslateFunc, or %NULL</doc>
- <type name="TranslateFunc" c:type="GTranslateFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to @func, or %NULL</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="destroy_notify"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">a function which gets called to free @data, or %NULL</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_translation_domain"
- c:identifier="g_option_context_set_translation_domain"
- version="2.12">
- <doc xml:space="preserve">A convenience function to use gettext() for translating
- user-visible strings.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </instance-parameter>
- <parameter name="domain" transfer-ownership="none">
- <doc xml:space="preserve">the domain to use</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <function name="new"
- c:identifier="g_option_context_new"
- version="2.6"
- introspectable="0">
- <doc xml:space="preserve">Creates a new option context.
- The @parameter_string can serve multiple purposes. It can be used
- to add descriptions for "rest" arguments, which are not parsed by
- the #GOptionContext, typically something like "FILES" or
- "FILE1 FILE2...". If you are using #G_OPTION_REMAINING for
- collecting "rest" arguments, GLib handles this automatically by
- using the @arg_description of the corresponding #GOptionEntry in
- the usage summary.
- Another usage is to give a short summary of the program
- functionality, like " - frob the strings", which will be displayed
- in the same line as the usage. For a longer description of the
- program functionality that should be displayed as a paragraph
- below the usage line, use g_option_context_set_summary().
- Note that the @parameter_string is translated using the
- function set with g_option_context_set_translate_func(), so
- it should normally be passed untranslated.</doc>
- <return-value>
- <doc xml:space="preserve">a newly created #GOptionContext, which must be
- freed with g_option_context_free() after use.</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </return-value>
- <parameters>
- <parameter name="parameter_string"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a string which is displayed in
- the first line of `--help` output, after the usage summary
- `programname [OPTION...]`</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <record name="OptionEntry" c:type="GOptionEntry">
- <doc xml:space="preserve">A GOptionEntry struct defines a single option. To have an effect, they
- must be added to a #GOptionGroup with g_option_context_add_main_entries()
- or g_option_group_add_entries().</doc>
- <field name="long_name" writable="1">
- <doc xml:space="preserve">The long name of an option can be used to specify it
- in a commandline as `--long_name`. Every option must have a
- long name. To resolve conflicts if multiple option groups contain
- the same long name, it is also possible to specify the option as
- `--groupname-long_name`.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </field>
- <field name="short_name" writable="1">
- <doc xml:space="preserve">If an option has a short name, it can be specified
- `-short_name` in a commandline. @short_name must be a printable
- ASCII character different from '-', or zero if the option has no
- short name.</doc>
- <type name="gchar" c:type="gchar"/>
- </field>
- <field name="flags" writable="1">
- <doc xml:space="preserve">Flags from #GOptionFlags</doc>
- <type name="gint" c:type="gint"/>
- </field>
- <field name="arg" writable="1">
- <doc xml:space="preserve">The type of the option, as a #GOptionArg</doc>
- <type name="OptionArg" c:type="GOptionArg"/>
- </field>
- <field name="arg_data" writable="1">
- <doc xml:space="preserve">If the @arg type is %G_OPTION_ARG_CALLBACK, then @arg_data
- must point to a #GOptionArgFunc callback function, which will be
- called to handle the extra argument. Otherwise, @arg_data is a
- pointer to a location to store the value, the required type of
- the location depends on the @arg type:
- - %G_OPTION_ARG_NONE: %gboolean
- - %G_OPTION_ARG_STRING: %gchar*
- - %G_OPTION_ARG_INT: %gint
- - %G_OPTION_ARG_FILENAME: %gchar*
- - %G_OPTION_ARG_STRING_ARRAY: %gchar**
- - %G_OPTION_ARG_FILENAME_ARRAY: %gchar**
- - %G_OPTION_ARG_DOUBLE: %gdouble
- If @arg type is %G_OPTION_ARG_STRING or %G_OPTION_ARG_FILENAME,
- the location will contain a newly allocated string if the option
- was given. That string needs to be freed by the callee using g_free().
- Likewise if @arg type is %G_OPTION_ARG_STRING_ARRAY or
- %G_OPTION_ARG_FILENAME_ARRAY, the data should be freed using g_strfreev().</doc>
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="description" writable="1">
- <doc xml:space="preserve">the description for the option in `--help`
- output. The @description is translated using the @translate_func
- of the group, see g_option_group_set_translation_domain().</doc>
- <type name="utf8" c:type="const gchar*"/>
- </field>
- <field name="arg_description" writable="1">
- <doc xml:space="preserve">The placeholder to use for the extra argument parsed
- by the option in `--help` output. The @arg_description is translated
- using the @translate_func of the group, see
- g_option_group_set_translation_domain().</doc>
- <type name="utf8" c:type="const gchar*"/>
- </field>
- </record>
- <enumeration name="OptionError"
- c:type="GOptionError"
- glib:error-domain="g-option-context-error-quark">
- <doc xml:space="preserve">Error codes returned by option parsing.</doc>
- <member name="unknown_option"
- value="0"
- c:identifier="G_OPTION_ERROR_UNKNOWN_OPTION">
- <doc xml:space="preserve">An option was not known to the parser.
- This error will only be reported, if the parser hasn't been instructed
- to ignore unknown options, see g_option_context_set_ignore_unknown_options().</doc>
- </member>
- <member name="bad_value"
- value="1"
- c:identifier="G_OPTION_ERROR_BAD_VALUE">
- <doc xml:space="preserve">A value couldn't be parsed.</doc>
- </member>
- <member name="failed" value="2" c:identifier="G_OPTION_ERROR_FAILED">
- <doc xml:space="preserve">A #GOptionArgFunc callback failed.</doc>
- </member>
- </enumeration>
- <callback name="OptionErrorFunc" c:type="GOptionErrorFunc" throws="1">
- <doc xml:space="preserve">The type of function to be used as callback when a parse error occurs.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">The active #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </parameter>
- <parameter name="group" transfer-ownership="none">
- <doc xml:space="preserve">The group to which the function belongs</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">User data added to the #GOptionGroup containing the option when it
- was created with g_option_group_new()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <bitfield name="OptionFlags" c:type="GOptionFlags">
- <doc xml:space="preserve">Flags which modify individual options.</doc>
- <member name="none" value="0" c:identifier="G_OPTION_FLAG_NONE">
- <doc xml:space="preserve">No flags. Since: 2.42.</doc>
- </member>
- <member name="hidden" value="1" c:identifier="G_OPTION_FLAG_HIDDEN">
- <doc xml:space="preserve">The option doesn't appear in `--help` output.</doc>
- </member>
- <member name="in_main" value="2" c:identifier="G_OPTION_FLAG_IN_MAIN">
- <doc xml:space="preserve">The option appears in the main section of the
- `--help` output, even if it is defined in a group.</doc>
- </member>
- <member name="reverse" value="4" c:identifier="G_OPTION_FLAG_REVERSE">
- <doc xml:space="preserve">For options of the %G_OPTION_ARG_NONE kind, this
- flag indicates that the sense of the option is reversed.</doc>
- </member>
- <member name="no_arg" value="8" c:identifier="G_OPTION_FLAG_NO_ARG">
- <doc xml:space="preserve">For options of the %G_OPTION_ARG_CALLBACK kind,
- this flag indicates that the callback does not take any argument
- (like a %G_OPTION_ARG_NONE option). Since 2.8</doc>
- </member>
- <member name="filename" value="16" c:identifier="G_OPTION_FLAG_FILENAME">
- <doc xml:space="preserve">For options of the %G_OPTION_ARG_CALLBACK
- kind, this flag indicates that the argument should be passed to the
- callback in the GLib filename encoding rather than UTF-8. Since 2.8</doc>
- </member>
- <member name="optional_arg"
- value="32"
- c:identifier="G_OPTION_FLAG_OPTIONAL_ARG">
- <doc xml:space="preserve">For options of the %G_OPTION_ARG_CALLBACK
- kind, this flag indicates that the argument supply is optional.
- If no argument is given then data of %GOptionParseFunc will be
- set to NULL. Since 2.8</doc>
- </member>
- <member name="noalias" value="64" c:identifier="G_OPTION_FLAG_NOALIAS">
- <doc xml:space="preserve">This flag turns off the automatic conflict
- resolution which prefixes long option names with `groupname-` if
- there is a conflict. This option should only be used in situations
- where aliasing is necessary to model some legacy commandline interface.
- It is not safe to use this option, unless all option groups are under
- your direct control. Since 2.8.</doc>
- </member>
- </bitfield>
- <record name="OptionGroup"
- c:type="GOptionGroup"
- glib:type-name="GOptionGroup"
- glib:get-type="g_option_group_get_type"
- c:symbol-prefix="option_group">
- <doc xml:space="preserve">A `GOptionGroup` struct defines the options in a single
- group. The struct has only private fields and should not be directly accessed.
- All options in a group share the same translation function. Libraries which
- need to parse commandline options are expected to provide a function for
- getting a `GOptionGroup` holding their options, which
- the application can then add to its #GOptionContext.</doc>
- <constructor name="new" c:identifier="g_option_group_new" version="2.6">
- <doc xml:space="preserve">Creates a new #GOptionGroup.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly created option group. It should be added
- to a #GOptionContext or freed with g_option_group_unref().</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </return-value>
- <parameters>
- <parameter name="name" transfer-ownership="none">
- <doc xml:space="preserve">the name for the option group, this is used to provide
- help for the options in this group with `--help-`@name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="description" transfer-ownership="none">
- <doc xml:space="preserve">a description for this group to be shown in
- `--help`. This string is translated using the translation
- domain or translation function of the group</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="help_description" transfer-ownership="none">
- <doc xml:space="preserve">a description for the `--help-`@name option.
- This string is translated using the translation domain or translation function
- of the group</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data that will be passed to the pre- and post-parse hooks,
- the error hook and to callbacks of %G_OPTION_ARG_CALLBACK options, or %NULL</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="destroy"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">a function that will be called to free @user_data, or %NULL</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="add_entries"
- c:identifier="g_option_group_add_entries"
- version="2.6">
- <doc xml:space="preserve">Adds the options specified in @entries to @group.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="group" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionGroup</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </instance-parameter>
- <parameter name="entries" transfer-ownership="none">
- <doc xml:space="preserve">a %NULL-terminated array of #GOptionEntrys</doc>
- <type name="OptionEntry" c:type="const GOptionEntry*"/>
- </parameter>
- </parameters>
- </method>
- <method name="free"
- c:identifier="g_option_group_free"
- version="2.6"
- deprecated="1"
- deprecated-version="2.44">
- <doc xml:space="preserve">Frees a #GOptionGroup. Note that you must not free groups
- which have been added to a #GOptionContext.</doc>
- <doc-deprecated xml:space="preserve">Use g_option_group_unref() instead.</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="group" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionGroup</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_option_group_ref" version="2.44">
- <doc xml:space="preserve">Increments the reference count of @group by one.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a #GoptionGroup</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </return-value>
- <parameters>
- <instance-parameter name="group" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionGroup</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="set_error_hook"
- c:identifier="g_option_group_set_error_hook"
- version="2.6"
- introspectable="0">
- <doc xml:space="preserve">Associates a function with @group which will be called
- from g_option_context_parse() when an error occurs.
- Note that the user data to be passed to @error_func can be
- specified when constructing the group with g_option_group_new().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="group" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionGroup</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </instance-parameter>
- <parameter name="error_func" transfer-ownership="none">
- <doc xml:space="preserve">a function to call when an error occurs</doc>
- <type name="OptionErrorFunc" c:type="GOptionErrorFunc"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_parse_hooks"
- c:identifier="g_option_group_set_parse_hooks"
- version="2.6"
- introspectable="0">
- <doc xml:space="preserve">Associates two functions with @group which will be called
- from g_option_context_parse() before the first option is parsed
- and after the last option has been parsed, respectively.
- Note that the user data to be passed to @pre_parse_func and
- @post_parse_func can be specified when constructing the group
- with g_option_group_new().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="group" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionGroup</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </instance-parameter>
- <parameter name="pre_parse_func"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a function to call before parsing, or %NULL</doc>
- <type name="OptionParseFunc" c:type="GOptionParseFunc"/>
- </parameter>
- <parameter name="post_parse_func"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a function to call after parsing, or %NULL</doc>
- <type name="OptionParseFunc" c:type="GOptionParseFunc"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_translate_func"
- c:identifier="g_option_group_set_translate_func"
- version="2.6">
- <doc xml:space="preserve">Sets the function which is used to translate user-visible strings,
- for `--help` output. Different groups can use different
- #GTranslateFuncs. If @func is %NULL, strings are not translated.
- If you are using gettext(), you only need to set the translation
- domain, see g_option_group_set_translation_domain().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="group" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionGroup</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </instance-parameter>
- <parameter name="func"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="notified"
- closure="1"
- destroy="2">
- <doc xml:space="preserve">the #GTranslateFunc, or %NULL</doc>
- <type name="TranslateFunc" c:type="GTranslateFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to @func, or %NULL</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="destroy_notify"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">a function which gets called to free @data, or %NULL</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_translation_domain"
- c:identifier="g_option_group_set_translation_domain"
- version="2.6">
- <doc xml:space="preserve">A convenience function to use gettext() for translating
- user-visible strings.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="group" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionGroup</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </instance-parameter>
- <parameter name="domain" transfer-ownership="none">
- <doc xml:space="preserve">the domain to use</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_option_group_unref" version="2.44">
- <doc xml:space="preserve">Decrements the reference count of @group by one.
- If the reference count drops to 0, the @group will be freed.
- and all memory allocated by the @group is released.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="group" transfer-ownership="none">
- <doc xml:space="preserve">a #GOptionGroup</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </instance-parameter>
- </parameters>
- </method>
- </record>
- <callback name="OptionParseFunc" c:type="GOptionParseFunc" throws="1">
- <doc xml:space="preserve">The type of function that can be called before and after parsing.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the function completed successfully, %FALSE if an error
- occurred, in which case @error should be set with g_set_error()</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">The active #GOptionContext</doc>
- <type name="OptionContext" c:type="GOptionContext*"/>
- </parameter>
- <parameter name="group" transfer-ownership="none">
- <doc xml:space="preserve">The group to which the function belongs</doc>
- <type name="OptionGroup" c:type="GOptionGroup*"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">User data added to the #GOptionGroup containing the option when it
- was created with g_option_group_new()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <constant name="PDP_ENDIAN" value="3412" c:type="G_PDP_ENDIAN">
- <doc xml:space="preserve">Specifies one of the possible types of byte order
- (currently unused). See #G_BYTE_ORDER.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="PI" value="3.141593" c:type="G_PI">
- <doc xml:space="preserve">The value of pi (ratio of circle's circumference to its diameter).</doc>
- <type name="gdouble" c:type="gdouble"/>
- </constant>
- <constant name="PI_2" value="1.570796" c:type="G_PI_2">
- <doc xml:space="preserve">Pi divided by 2.</doc>
- <type name="gdouble" c:type="gdouble"/>
- </constant>
- <constant name="PI_4" value="0.785398" c:type="G_PI_4">
- <doc xml:space="preserve">Pi divided by 4.</doc>
- <type name="gdouble" c:type="gdouble"/>
- </constant>
- <constant name="POLLFD_FORMAT" value="%d" c:type="G_POLLFD_FORMAT">
- <doc xml:space="preserve">A format specifier that can be used in printf()-style format strings
- when printing the @fd member of a #GPollFD.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="PRIORITY_DEFAULT" value="0" c:type="G_PRIORITY_DEFAULT">
- <doc xml:space="preserve">Use this for default priority event sources.
- In GLib this priority is used when adding timeout functions
- with g_timeout_add(). In GDK this priority is used for events
- from the X server.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="PRIORITY_DEFAULT_IDLE"
- value="200"
- c:type="G_PRIORITY_DEFAULT_IDLE">
- <doc xml:space="preserve">Use this for default priority idle functions.
- In GLib this priority is used when adding idle functions with
- g_idle_add().</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="PRIORITY_HIGH" value="-100" c:type="G_PRIORITY_HIGH">
- <doc xml:space="preserve">Use this for high priority event sources.
- It is not used within GLib or GTK+.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="PRIORITY_HIGH_IDLE"
- value="100"
- c:type="G_PRIORITY_HIGH_IDLE">
- <doc xml:space="preserve">Use this for high priority idle functions.
- GTK+ uses #G_PRIORITY_HIGH_IDLE + 10 for resizing operations,
- and #G_PRIORITY_HIGH_IDLE + 20 for redrawing operations. (This is
- done to ensure that any pending resizes are processed before any
- pending redraws, so that widgets are not redrawn twice unnecessarily.)</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="PRIORITY_LOW" value="300" c:type="G_PRIORITY_LOW">
- <doc xml:space="preserve">Use this for very low priority background tasks.
- It is not used within GLib or GTK+.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <record name="PatternSpec" c:type="GPatternSpec" disguised="1">
- <doc xml:space="preserve">A GPatternSpec struct is the 'compiled' form of a pattern. This
- structure is opaque and its fields cannot be accessed directly.</doc>
- <method name="equal" c:identifier="g_pattern_spec_equal">
- <doc xml:space="preserve">Compares two compiled pattern specs and returns whether they will
- match the same set of strings.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">Whether the compiled patterns are equal</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="pspec1" transfer-ownership="none">
- <doc xml:space="preserve">a #GPatternSpec</doc>
- <type name="PatternSpec" c:type="GPatternSpec*"/>
- </instance-parameter>
- <parameter name="pspec2" transfer-ownership="none">
- <doc xml:space="preserve">another #GPatternSpec</doc>
- <type name="PatternSpec" c:type="GPatternSpec*"/>
- </parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_pattern_spec_free">
- <doc xml:space="preserve">Frees the memory allocated for the #GPatternSpec.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="pspec" transfer-ownership="none">
- <doc xml:space="preserve">a #GPatternSpec</doc>
- <type name="PatternSpec" c:type="GPatternSpec*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="new"
- c:identifier="g_pattern_spec_new"
- introspectable="0">
- <doc xml:space="preserve">Compiles a pattern to a #GPatternSpec.</doc>
- <return-value>
- <doc xml:space="preserve">a newly-allocated #GPatternSpec</doc>
- <type name="PatternSpec" c:type="GPatternSpec*"/>
- </return-value>
- <parameters>
- <parameter name="pattern" transfer-ownership="none">
- <doc xml:space="preserve">a zero-terminated UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <record name="PollFD"
- c:type="GPollFD"
- glib:type-name="GPollFD"
- glib:get-type="g_pollfd_get_type"
- c:symbol-prefix="pollfd">
- <doc xml:space="preserve">Represents a file descriptor, which events to poll for, and which events
- occurred.</doc>
- <field name="fd" writable="1">
- <doc xml:space="preserve">the file descriptor to poll (or a HANDLE on Win32)</doc>
- <type name="gint" c:type="gint"/>
- </field>
- <field name="events" writable="1">
- <doc xml:space="preserve">a bitwise combination from #GIOCondition, specifying which
- events should be polled for. Typically for reading from a file
- descriptor you would use %G_IO_IN | %G_IO_HUP | %G_IO_ERR, and
- for writing you would use %G_IO_OUT | %G_IO_ERR.</doc>
- <type name="gushort" c:type="gushort"/>
- </field>
- <field name="revents" writable="1">
- <doc xml:space="preserve">a bitwise combination of flags from #GIOCondition, returned
- from the poll() function to indicate which events occurred.</doc>
- <type name="gushort" c:type="gushort"/>
- </field>
- </record>
- <callback name="PollFunc" c:type="GPollFunc">
- <doc xml:space="preserve">Specifies the type of function passed to g_main_context_set_poll_func().
- The semantics of the function should match those of the poll() system call.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of #GPollFD elements which have events or errors
- reported, or -1 if an error occurred.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="ufds" transfer-ownership="none">
- <doc xml:space="preserve">an array of #GPollFD elements</doc>
- <type name="PollFD" c:type="GPollFD*"/>
- </parameter>
- <parameter name="nfsd" transfer-ownership="none">
- <doc xml:space="preserve">the number of elements in @ufds</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="timeout_" transfer-ownership="none">
- <doc xml:space="preserve">the maximum time to wait for an event of the file descriptors.
- A negative value indicates an infinite timeout.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </callback>
- <callback name="PrintFunc" c:type="GPrintFunc">
- <doc xml:space="preserve">Specifies the type of the print handler functions.
- These are called with the complete formatted string to output.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the message to output</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </callback>
- <record name="Private" c:type="GPrivate">
- <doc xml:space="preserve">The #GPrivate struct is an opaque data structure to represent a
- thread-local data key. It is approximately equivalent to the
- pthread_setspecific()/pthread_getspecific() APIs on POSIX and to
- TlsSetValue()/TlsGetValue() on Windows.
- If you don't already know why you might want this functionality,
- then you probably don't need it.
- #GPrivate is a very limited resource (as far as 128 per program,
- shared between all libraries). It is also not possible to destroy a
- #GPrivate after it has been used. As such, it is only ever acceptable
- to use #GPrivate in static scope, and even then sparingly so.
- See G_PRIVATE_INIT() for a couple of examples.
- The #GPrivate structure should be considered opaque. It should only
- be accessed via the g_private_ functions.</doc>
- <field name="p" readable="0" private="1">
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="notify" readable="0" private="1">
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </field>
- <field name="future" readable="0" private="1">
- <array zero-terminated="0" c:type="gpointer" fixed-size="2">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </field>
- <method name="get" c:identifier="g_private_get">
- <doc xml:space="preserve">Returns the current value of the thread local variable @key.
- If the value has not yet been set in this thread, %NULL is returned.
- Values are never copied between threads (when a new thread is
- created, for example).</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the thread-local value</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a #GPrivate</doc>
- <type name="Private" c:type="GPrivate*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="replace" c:identifier="g_private_replace" version="2.32">
- <doc xml:space="preserve">Sets the thread local variable @key to have the value @value in the
- current thread.
- This function differs from g_private_set() in the following way: if
- the previous value was non-%NULL then the #GDestroyNotify handler for
- @key is run on it.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a #GPrivate</doc>
- <type name="Private" c:type="GPrivate*"/>
- </instance-parameter>
- <parameter name="value"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the new value</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="set" c:identifier="g_private_set">
- <doc xml:space="preserve">Sets the thread local variable @key to have the value @value in the
- current thread.
- This function differs from g_private_replace() in the following way:
- the #GDestroyNotify for @key is not called on the old value.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a #GPrivate</doc>
- <type name="Private" c:type="GPrivate*"/>
- </instance-parameter>
- <parameter name="value"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the new value</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- </record>
- <record name="PtrArray"
- c:type="GPtrArray"
- glib:type-name="GPtrArray"
- glib:get-type="g_ptr_array_get_type"
- c:symbol-prefix="ptr_array">
- <doc xml:space="preserve">Contains the public fields of a pointer array.</doc>
- <field name="pdata" writable="1">
- <doc xml:space="preserve">points to the array of pointers, which may be moved when the
- array grows</doc>
- <type name="gpointer" c:type="gpointer*"/>
- </field>
- <field name="len" writable="1">
- <doc xml:space="preserve">number of pointers in the array</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <function name="add" c:identifier="g_ptr_array_add" introspectable="0">
- <doc xml:space="preserve">Adds a pointer to the end of the pointer array. The array will grow
- in size automatically if necessary.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the pointer to add</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="foreach"
- c:identifier="g_ptr_array_foreach"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Calls a function for each element of a #GPtrArray.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function to call for each array element</doc>
- <type name="Func" c:type="GFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="free" c:identifier="g_ptr_array_free" introspectable="0">
- <doc xml:space="preserve">Frees the memory allocated for the #GPtrArray. If @free_seg is %TRUE
- it frees the memory block holding the elements as well. Pass %FALSE
- if you want to free the #GPtrArray wrapper but preserve the
- underlying array for use elsewhere. If the reference count of @array
- is greater than one, the #GPtrArray wrapper is preserved but the
- size of @array will be set to zero.
- If array contents point to dynamically-allocated memory, they should
- be freed separately if @free_seg is %TRUE and no #GDestroyNotify
- function has been set for @array.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the pointer array if @free_seg is %FALSE, otherwise %NULL.
- The pointer array should be freed using g_free().</doc>
- <type name="gpointer" c:type="gpointer*"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="free_seg" transfer-ownership="none">
- <doc xml:space="preserve">if %TRUE the actual pointer array is freed as well</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </function>
- <function name="insert"
- c:identifier="g_ptr_array_insert"
- version="2.40"
- introspectable="0">
- <doc xml:space="preserve">Inserts an element into the pointer array at the given index. The
- array will grow in size automatically if necessary.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="index_" transfer-ownership="none">
- <doc xml:space="preserve">the index to place the new element at, or -1 to append</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the pointer to add.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="new" c:identifier="g_ptr_array_new" introspectable="0">
- <doc xml:space="preserve">Creates a new #GPtrArray with a reference count of 1.</doc>
- <return-value>
- <doc xml:space="preserve">the new #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- </function>
- <function name="new_full"
- c:identifier="g_ptr_array_new_full"
- version="2.30"
- introspectable="0">
- <doc xml:space="preserve">Creates a new #GPtrArray with @reserved_size pointers preallocated
- and a reference count of 1. This avoids frequent reallocation, if
- you are going to add many pointers to the array. Note however that
- the size of the array is still 0. It also set @element_free_func
- for freeing each element when the array is destroyed either via
- g_ptr_array_unref(), when g_ptr_array_free() is called with
- @free_segment set to %TRUE or when removing elements.</doc>
- <return-value>
- <doc xml:space="preserve">A new #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="reserved_size" transfer-ownership="none">
- <doc xml:space="preserve">number of pointers preallocated</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="element_free_func"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">A function to free elements with
- destroy @array or %NULL</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="new_with_free_func"
- c:identifier="g_ptr_array_new_with_free_func"
- version="2.22"
- introspectable="0">
- <doc xml:space="preserve">Creates a new #GPtrArray with a reference count of 1 and use
- @element_free_func for freeing each element when the array is destroyed
- either via g_ptr_array_unref(), when g_ptr_array_free() is called with
- @free_segment set to %TRUE or when removing elements.</doc>
- <return-value>
- <doc xml:space="preserve">A new #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="element_free_func"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">A function to free elements with
- destroy @array or %NULL</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="ref"
- c:identifier="g_ptr_array_ref"
- version="2.22"
- introspectable="0">
- <doc xml:space="preserve">Atomically increments the reference count of @array by one.
- This function is thread-safe and may be called from any thread.</doc>
- <return-value>
- <doc xml:space="preserve">The passed in #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- </parameters>
- </function>
- <function name="remove"
- c:identifier="g_ptr_array_remove"
- introspectable="0">
- <doc xml:space="preserve">Removes the first occurrence of the given pointer from the pointer
- array. The following elements are moved down one place. If @array
- has a non-%NULL #GDestroyNotify function it is called for the
- removed element.
- It returns %TRUE if the pointer was removed, or %FALSE if the
- pointer was not found.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the pointer is removed, %FALSE if the pointer
- is not found in the array</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the pointer to remove</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_fast"
- c:identifier="g_ptr_array_remove_fast"
- introspectable="0">
- <doc xml:space="preserve">Removes the first occurrence of the given pointer from the pointer
- array. The last element in the array is used to fill in the space,
- so this function does not preserve the order of the array. But it
- is faster than g_ptr_array_remove(). If @array has a non-%NULL
- #GDestroyNotify function it is called for the removed element.
- It returns %TRUE if the pointer was removed, or %FALSE if the
- pointer was not found.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the pointer was found in the array</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the pointer to remove</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_index"
- c:identifier="g_ptr_array_remove_index"
- introspectable="0">
- <doc xml:space="preserve">Removes the pointer at the given index from the pointer array.
- The following elements are moved down one place. If @array has
- a non-%NULL #GDestroyNotify function it is called for the removed
- element.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the pointer which was removed</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="index_" transfer-ownership="none">
- <doc xml:space="preserve">the index of the pointer to remove</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_index_fast"
- c:identifier="g_ptr_array_remove_index_fast"
- introspectable="0">
- <doc xml:space="preserve">Removes the pointer at the given index from the pointer array.
- The last element in the array is used to fill in the space, so
- this function does not preserve the order of the array. But it
- is faster than g_ptr_array_remove_index(). If @array has a non-%NULL
- #GDestroyNotify function it is called for the removed element.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the pointer which was removed</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="index_" transfer-ownership="none">
- <doc xml:space="preserve">the index of the pointer to remove</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_range"
- c:identifier="g_ptr_array_remove_range"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Removes the given number of pointers starting at the given index
- from a #GPtrArray. The following elements are moved to close the
- gap. If @array has a non-%NULL #GDestroyNotify function it is
- called for the removed elements.</doc>
- <return-value>
- <doc xml:space="preserve">the @array</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a @GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="index_" transfer-ownership="none">
- <doc xml:space="preserve">the index of the first pointer to remove</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the number of pointers to remove</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="set_free_func"
- c:identifier="g_ptr_array_set_free_func"
- version="2.22"
- introspectable="0">
- <doc xml:space="preserve">Sets a function for freeing each element when @array is destroyed
- either via g_ptr_array_unref(), when g_ptr_array_free() is called
- with @free_segment set to %TRUE or when removing elements.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">A #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="element_free_func"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">A function to free elements with
- destroy @array or %NULL</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="set_size"
- c:identifier="g_ptr_array_set_size"
- introspectable="0">
- <doc xml:space="preserve">Sets the size of the array. When making the array larger,
- newly-added elements will be set to %NULL. When making it smaller,
- if @array has a non-%NULL #GDestroyNotify function then it will be
- called for the removed elements.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the new length of the pointer array</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="sized_new"
- c:identifier="g_ptr_array_sized_new"
- introspectable="0">
- <doc xml:space="preserve">Creates a new #GPtrArray with @reserved_size pointers preallocated
- and a reference count of 1. This avoids frequent reallocation, if
- you are going to add many pointers to the array. Note however that
- the size of the array is still 0.</doc>
- <return-value>
- <doc xml:space="preserve">the new #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="reserved_size" transfer-ownership="none">
- <doc xml:space="preserve">number of pointers preallocated</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="sort" c:identifier="g_ptr_array_sort" introspectable="0">
- <doc xml:space="preserve">Sorts the array, using @compare_func which should be a qsort()-style
- comparison function (returns less than zero for first arg is less
- than second arg, zero for equal, greater than zero if irst arg is
- greater than second arg).
- Note that the comparison function for g_ptr_array_sort() doesn't
- take the pointers from the array as arguments, it takes pointers to
- the pointers in the array.
- This is guaranteed to be a stable sort since version 2.32.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="compare_func" transfer-ownership="none">
- <doc xml:space="preserve">comparison function</doc>
- <type name="CompareFunc" c:type="GCompareFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="sort_with_data"
- c:identifier="g_ptr_array_sort_with_data"
- introspectable="0">
- <doc xml:space="preserve">Like g_ptr_array_sort(), but the comparison function has an extra
- user data argument.
- Note that the comparison function for g_ptr_array_sort_with_data()
- doesn't take the pointers from the array as arguments, it takes
- pointers to the pointers in the array.
- This is guaranteed to be a stable sort since version 2.32.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- <parameter name="compare_func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">comparison function</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @compare_func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="unref"
- c:identifier="g_ptr_array_unref"
- version="2.22"
- introspectable="0">
- <doc xml:space="preserve">Atomically decrements the reference count of @array by one. If the
- reference count drops to 0, the effect is the same as calling
- g_ptr_array_free() with @free_segment set to %TRUE. This function
- is MT-safe and may be called from any thread.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">A #GPtrArray</doc>
- <array name="GLib.PtrArray" c:type="GPtrArray*">
- <type name="gpointer" c:type="gpointer"/>
- </array>
- </parameter>
- </parameters>
- </function>
- </record>
- <record name="Queue" c:type="GQueue">
- <doc xml:space="preserve">Contains the public fields of a
- [Queue][glib-Double-ended-Queues].</doc>
- <field name="head" writable="1">
- <doc xml:space="preserve">a pointer to the first element of the queue</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </field>
- <field name="tail" writable="1">
- <doc xml:space="preserve">a pointer to the last element of the queue</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </field>
- <field name="length" writable="1">
- <doc xml:space="preserve">the number of elements in the queue</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <method name="clear" c:identifier="g_queue_clear" version="2.14">
- <doc xml:space="preserve">Removes all the elements in @queue. If queue elements contain
- dynamically-allocated memory, they should be freed first.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="copy"
- c:identifier="g_queue_copy"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Copies a @queue. Note that is a shallow copy. If the elements in the
- queue consist of pointers to data, the pointers are copied, but the
- actual data is not.</doc>
- <return-value>
- <doc xml:space="preserve">a copy of @queue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="delete_link"
- c:identifier="g_queue_delete_link"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Removes @link_ from @queue and frees it.
- @link_ must be part of @queue.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="link_" transfer-ownership="none">
- <doc xml:space="preserve">a #GList link that must be part of @queue</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </method>
- <method name="find"
- c:identifier="g_queue_find"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Finds the first link in @queue which contains @data.</doc>
- <return-value>
- <doc xml:space="preserve">the first link in @queue which contains @data</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to find</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="find_custom"
- c:identifier="g_queue_find_custom"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Finds an element in a #GQueue, using a supplied function to find the
- desired element. It iterates over the queue, calling the given function
- which should return 0 when the desired element is found. The function
- takes two gconstpointer arguments, the #GQueue element's data as the
- first argument and the given user data as the second argument.</doc>
- <return-value>
- <doc xml:space="preserve">the found link, or %NULL if it wasn't found</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @func</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <doc xml:space="preserve">a #GCompareFunc to call for each element. It should return 0
- when the desired element is found</doc>
- <type name="CompareFunc" c:type="GCompareFunc"/>
- </parameter>
- </parameters>
- </method>
- <method name="foreach"
- c:identifier="g_queue_foreach"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Calls @func for each element in the queue passing @user_data to the
- function.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="func" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">the function to call for each element's data</doc>
- <type name="Func" c:type="GFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to @func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_queue_free">
- <doc xml:space="preserve">Frees the memory allocated for the #GQueue. Only call this function
- if @queue was created with g_queue_new(). If queue elements contain
- dynamically-allocated memory, they should be freed first.
- If queue elements contain dynamically-allocated memory, you should
- either use g_queue_free_full() or free them manually first.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="free_full" c:identifier="g_queue_free_full" version="2.32">
- <doc xml:space="preserve">Convenience method, which frees all the memory used by a #GQueue,
- and calls the specified destroy function on every element's data.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="free_func" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">the function to be called to free each element's data</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_length"
- c:identifier="g_queue_get_length"
- version="2.4">
- <doc xml:space="preserve">Returns the number of items in @queue.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of items in @queue</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="index" c:identifier="g_queue_index" version="2.4">
- <doc xml:space="preserve">Returns the position of the first element in @queue which contains @data.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the position of the first element in @queue which
- contains @data, or -1 if no element in @queue contains @data</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to find</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="init" c:identifier="g_queue_init" version="2.14">
- <doc xml:space="preserve">A statically-allocated #GQueue must be initialized with this function
- before it can be used. Alternatively you can initialize it with
- #G_QUEUE_INIT. It is not necessary to initialize queues created with
- g_queue_new().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">an uninitialized #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="insert_after"
- c:identifier="g_queue_insert_after"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Inserts @data into @queue after @sibling.
- @sibling must be part of @queue. Since GLib 2.44 a %NULL sibling pushes the
- data at the head of the queue.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="sibling"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GList link that must be part of @queue, or %NULL to
- push at the head of the queue.</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to insert</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="insert_before"
- c:identifier="g_queue_insert_before"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Inserts @data into @queue before @sibling.
- @sibling must be part of @queue. Since GLib 2.44 a %NULL sibling pushes the
- data at the tail of the queue.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="sibling"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GList link that must be part of @queue, or %NULL to
- push at the tail of the queue.</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to insert</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="insert_sorted"
- c:identifier="g_queue_insert_sorted"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Inserts @data into @queue using @func to determine the new position.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to insert</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the #GCompareDataFunc used to compare elements in the queue. It is
- called with two elements of the @queue and @user_data. It should
- return 0 if the elements are equal, a negative value if the first
- element comes before the second, and a positive value if the second
- element comes before the first.</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="is_empty" c:identifier="g_queue_is_empty">
- <doc xml:space="preserve">Returns %TRUE if the queue is empty.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the queue is empty</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue.</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="link_index"
- c:identifier="g_queue_link_index"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Returns the position of @link_ in @queue.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the position of @link_, or -1 if the link is
- not part of @queue</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="link_" transfer-ownership="none">
- <doc xml:space="preserve">a #GList link</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </method>
- <method name="peek_head" c:identifier="g_queue_peek_head">
- <doc xml:space="preserve">Returns the first element of the queue.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the data of the first element in the queue, or %NULL
- if the queue is empty</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="peek_head_link"
- c:identifier="g_queue_peek_head_link"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Returns the first link in @queue.</doc>
- <return-value>
- <doc xml:space="preserve">the first link in @queue, or %NULL if @queue is empty</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="peek_nth" c:identifier="g_queue_peek_nth" version="2.4">
- <doc xml:space="preserve">Returns the @n'th element of @queue.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the data for the @n'th element of @queue,
- or %NULL if @n is off the end of @queue</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the position of the element</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="peek_nth_link"
- c:identifier="g_queue_peek_nth_link"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Returns the link at the given position</doc>
- <return-value>
- <doc xml:space="preserve">the link at the @n'th position, or %NULL
- if @n is off the end of the list</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the position of the link</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="peek_tail" c:identifier="g_queue_peek_tail">
- <doc xml:space="preserve">Returns the last element of the queue.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the data of the last element in the queue, or %NULL
- if the queue is empty</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="peek_tail_link"
- c:identifier="g_queue_peek_tail_link"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Returns the last link in @queue.</doc>
- <return-value>
- <doc xml:space="preserve">the last link in @queue, or %NULL if @queue is empty</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="pop_head" c:identifier="g_queue_pop_head">
- <doc xml:space="preserve">Removes the first element of the queue and returns its data.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the data of the first element in the queue, or %NULL
- if the queue is empty</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="pop_head_link"
- c:identifier="g_queue_pop_head_link"
- introspectable="0">
- <doc xml:space="preserve">Removes and returns the first element of the queue.</doc>
- <return-value>
- <doc xml:space="preserve">the #GList element at the head of the queue, or %NULL
- if the queue is empty</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="pop_nth" c:identifier="g_queue_pop_nth" version="2.4">
- <doc xml:space="preserve">Removes the @n'th element of @queue and returns its data.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the element's data, or %NULL if @n is off the end of @queue</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the position of the element</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="pop_nth_link"
- c:identifier="g_queue_pop_nth_link"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Removes and returns the link at the given position.</doc>
- <return-value>
- <doc xml:space="preserve">the @n'th link, or %NULL if @n is off the end of @queue</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the link's position</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="pop_tail" c:identifier="g_queue_pop_tail">
- <doc xml:space="preserve">Removes the last element of the queue and returns its data.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the data of the last element in the queue, or %NULL
- if the queue is empty</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="pop_tail_link"
- c:identifier="g_queue_pop_tail_link"
- introspectable="0">
- <doc xml:space="preserve">Removes and returns the last element of the queue.</doc>
- <return-value>
- <doc xml:space="preserve">the #GList element at the tail of the queue, or %NULL
- if the queue is empty</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="push_head" c:identifier="g_queue_push_head">
- <doc xml:space="preserve">Adds a new element at the head of the queue.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue.</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new element.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="push_head_link"
- c:identifier="g_queue_push_head_link"
- introspectable="0">
- <doc xml:space="preserve">Adds a new element at the head of the queue.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="link_" transfer-ownership="none">
- <doc xml:space="preserve">a single #GList element, not a list with more than one element</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </method>
- <method name="push_nth" c:identifier="g_queue_push_nth" version="2.4">
- <doc xml:space="preserve">Inserts a new element into @queue at the given position.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new element</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the position to insert the new element. If @n is negative or
- larger than the number of elements in the @queue, the element is
- added to the end of the queue.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="push_nth_link"
- c:identifier="g_queue_push_nth_link"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Inserts @link into @queue at the given position.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the position to insert the link. If this is negative or larger than
- the number of elements in @queue, the link is added to the end of
- @queue.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="link_" transfer-ownership="none">
- <doc xml:space="preserve">the link to add to @queue</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </method>
- <method name="push_tail" c:identifier="g_queue_push_tail">
- <doc xml:space="preserve">Adds a new element at the tail of the queue.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new element</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="push_tail_link"
- c:identifier="g_queue_push_tail_link"
- introspectable="0">
- <doc xml:space="preserve">Adds a new element at the tail of the queue.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="link_" transfer-ownership="none">
- <doc xml:space="preserve">a single #GList element, not a list with more than one element</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </method>
- <method name="remove" c:identifier="g_queue_remove" version="2.4">
- <doc xml:space="preserve">Removes the first element in @queue that contains @data.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @data was found and removed from @queue</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to remove</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="remove_all"
- c:identifier="g_queue_remove_all"
- version="2.4">
- <doc xml:space="preserve">Remove all elements whose data equals @data from @queue.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of elements removed from @queue</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to remove</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="reverse" c:identifier="g_queue_reverse" version="2.4">
- <doc xml:space="preserve">Reverses the order of the items in @queue.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="sort"
- c:identifier="g_queue_sort"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Sorts @queue using @compare_func.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="compare_func" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">the #GCompareDataFunc used to sort @queue. This function
- is passed two elements of the queue and should return 0 if they are
- equal, a negative value if the first comes before the second, and
- a positive value if the second comes before the first.</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @compare_func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="unlink"
- c:identifier="g_queue_unlink"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Unlinks @link_ so that it will no longer be part of @queue.
- The link is not freed.
- @link_ must be part of @queue.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="queue" transfer-ownership="none">
- <doc xml:space="preserve">a #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </instance-parameter>
- <parameter name="link_" transfer-ownership="none">
- <doc xml:space="preserve">a #GList link that must be part of @queue</doc>
- <type name="GLib.List" c:type="GList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </method>
- <function name="new" c:identifier="g_queue_new" introspectable="0">
- <doc xml:space="preserve">Creates a new #GQueue.</doc>
- <return-value>
- <doc xml:space="preserve">a newly allocated #GQueue</doc>
- <type name="Queue" c:type="GQueue*"/>
- </return-value>
- </function>
- </record>
- <record name="RWLock" c:type="GRWLock" version="2.32">
- <doc xml:space="preserve">The GRWLock struct is an opaque data structure to represent a
- reader-writer lock. It is similar to a #GMutex in that it allows
- multiple threads to coordinate access to a shared resource.
- The difference to a mutex is that a reader-writer lock discriminates
- between read-only ('reader') and full ('writer') access. While only
- one thread at a time is allowed write access (by holding the 'writer'
- lock via g_rw_lock_writer_lock()), multiple threads can gain
- simultaneous read-only access (by holding the 'reader' lock via
- g_rw_lock_reader_lock()).
- Here is an example for an array with access functions:
- |[<!-- language="C" -->
- GRWLock lock;
- GPtrArray *array;
- gpointer
- my_array_get (guint index)
- {
- gpointer retval = NULL;
- if (!array)
- return NULL;
- g_rw_lock_reader_lock (&lock);
- if (index < array->len)
- retval = g_ptr_array_index (array, index);
- g_rw_lock_reader_unlock (&lock);
- return retval;
- }
- void
- my_array_set (guint index, gpointer data)
- {
- g_rw_lock_writer_lock (&lock);
- if (!array)
- array = g_ptr_array_new ();
- if (index >= array->len)
- g_ptr_array_set_size (array, index+1);
- g_ptr_array_index (array, index) = data;
- g_rw_lock_writer_unlock (&lock);
- }
- ]|
- This example shows an array which can be accessed by many readers
- (the my_array_get() function) simultaneously, whereas the writers
- (the my_array_set() function) will only be allowed one at a time
- and only if no readers currently access the array. This is because
- of the potentially dangerous resizing of the array. Using these
- functions is fully multi-thread safe now.
- If a #GRWLock is allocated in static storage then it can be used
- without initialisation. Otherwise, you should call
- g_rw_lock_init() on it and g_rw_lock_clear() when done.
- A GRWLock should only be accessed with the g_rw_lock_ functions.</doc>
- <field name="p" readable="0" private="1">
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="i" readable="0" private="1">
- <array zero-terminated="0" c:type="guint" fixed-size="2">
- <type name="guint" c:type="guint"/>
- </array>
- </field>
- <method name="clear" c:identifier="g_rw_lock_clear">
- <doc xml:space="preserve">Frees the resources allocated to a lock with g_rw_lock_init().
- This function should not be used with a #GRWLock that has been
- statically allocated.
- Calling g_rw_lock_clear() when any thread holds the lock
- leads to undefined behaviour.
- Sine: 2.32</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="rw_lock" transfer-ownership="none">
- <doc xml:space="preserve">an initialized #GRWLock</doc>
- <type name="RWLock" c:type="GRWLock*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="init" c:identifier="g_rw_lock_init" version="2.32">
- <doc xml:space="preserve">Initializes a #GRWLock so that it can be used.
- This function is useful to initialize a lock that has been
- allocated on the stack, or as part of a larger structure. It is not
- necessary to initialise a reader-writer lock that has been statically
- allocated.
- |[<!-- language="C" -->
- typedef struct {
- GRWLock l;
- ...
- } Blob;
- Blob *b;
- b = g_new (Blob, 1);
- g_rw_lock_init (&b->l);
- ]|
- To undo the effect of g_rw_lock_init() when a lock is no longer
- needed, use g_rw_lock_clear().
- Calling g_rw_lock_init() on an already initialized #GRWLock leads
- to undefined behaviour.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="rw_lock" transfer-ownership="none">
- <doc xml:space="preserve">an uninitialized #GRWLock</doc>
- <type name="RWLock" c:type="GRWLock*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="reader_lock"
- c:identifier="g_rw_lock_reader_lock"
- version="2.32">
- <doc xml:space="preserve">Obtain a read lock on @rw_lock. If another thread currently holds
- the write lock on @rw_lock or blocks waiting for it, the current
- thread will block. Read locks can be taken recursively.
- It is implementation-defined how many threads are allowed to
- hold read locks on the same lock simultaneously.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="rw_lock" transfer-ownership="none">
- <doc xml:space="preserve">a #GRWLock</doc>
- <type name="RWLock" c:type="GRWLock*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="reader_trylock"
- c:identifier="g_rw_lock_reader_trylock"
- version="2.32">
- <doc xml:space="preserve">Tries to obtain a read lock on @rw_lock and returns %TRUE if
- the read lock was successfully obtained. Otherwise it
- returns %FALSE.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @rw_lock could be locked</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="rw_lock" transfer-ownership="none">
- <doc xml:space="preserve">a #GRWLock</doc>
- <type name="RWLock" c:type="GRWLock*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="reader_unlock"
- c:identifier="g_rw_lock_reader_unlock"
- version="2.32">
- <doc xml:space="preserve">Release a read lock on @rw_lock.
- Calling g_rw_lock_reader_unlock() on a lock that is not held
- by the current thread leads to undefined behaviour.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="rw_lock" transfer-ownership="none">
- <doc xml:space="preserve">a #GRWLock</doc>
- <type name="RWLock" c:type="GRWLock*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="writer_lock"
- c:identifier="g_rw_lock_writer_lock"
- version="2.32">
- <doc xml:space="preserve">Obtain a write lock on @rw_lock. If any thread already holds
- a read or write lock on @rw_lock, the current thread will block
- until all other threads have dropped their locks on @rw_lock.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="rw_lock" transfer-ownership="none">
- <doc xml:space="preserve">a #GRWLock</doc>
- <type name="RWLock" c:type="GRWLock*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="writer_trylock"
- c:identifier="g_rw_lock_writer_trylock"
- version="2.32">
- <doc xml:space="preserve">Tries to obtain a write lock on @rw_lock. If any other thread holds
- a read or write lock on @rw_lock, it immediately returns %FALSE.
- Otherwise it locks @rw_lock and returns %TRUE.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @rw_lock could be locked</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="rw_lock" transfer-ownership="none">
- <doc xml:space="preserve">a #GRWLock</doc>
- <type name="RWLock" c:type="GRWLock*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="writer_unlock"
- c:identifier="g_rw_lock_writer_unlock"
- version="2.32">
- <doc xml:space="preserve">Release a write lock on @rw_lock.
- Calling g_rw_lock_writer_unlock() on a lock that is not held
- by the current thread leads to undefined behaviour.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="rw_lock" transfer-ownership="none">
- <doc xml:space="preserve">a #GRWLock</doc>
- <type name="RWLock" c:type="GRWLock*"/>
- </instance-parameter>
- </parameters>
- </method>
- </record>
- <record name="Rand" c:type="GRand" disguised="1">
- <doc xml:space="preserve">The GRand struct is an opaque data structure. It should only be
- accessed through the g_rand_* functions.</doc>
- <method name="copy"
- c:identifier="g_rand_copy"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Copies a #GRand into a new one with the same exact state as before.
- This way you can take a snapshot of the random number generator for
- replaying later.</doc>
- <return-value>
- <doc xml:space="preserve">the new #GRand</doc>
- <type name="Rand" c:type="GRand*"/>
- </return-value>
- <parameters>
- <instance-parameter name="rand_" transfer-ownership="none">
- <doc xml:space="preserve">a #GRand</doc>
- <type name="Rand" c:type="GRand*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="double" c:identifier="g_rand_double">
- <doc xml:space="preserve">Returns the next random #gdouble from @rand_ equally distributed over
- the range [0..1).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a random number</doc>
- <type name="gdouble" c:type="gdouble"/>
- </return-value>
- <parameters>
- <instance-parameter name="rand_" transfer-ownership="none">
- <doc xml:space="preserve">a #GRand</doc>
- <type name="Rand" c:type="GRand*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="double_range" c:identifier="g_rand_double_range">
- <doc xml:space="preserve">Returns the next random #gdouble from @rand_ equally distributed over
- the range [@begin..@end).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a random number</doc>
- <type name="gdouble" c:type="gdouble"/>
- </return-value>
- <parameters>
- <instance-parameter name="rand_" transfer-ownership="none">
- <doc xml:space="preserve">a #GRand</doc>
- <type name="Rand" c:type="GRand*"/>
- </instance-parameter>
- <parameter name="begin" transfer-ownership="none">
- <doc xml:space="preserve">lower closed bound of the interval</doc>
- <type name="gdouble" c:type="gdouble"/>
- </parameter>
- <parameter name="end" transfer-ownership="none">
- <doc xml:space="preserve">upper open bound of the interval</doc>
- <type name="gdouble" c:type="gdouble"/>
- </parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_rand_free">
- <doc xml:space="preserve">Frees the memory allocated for the #GRand.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="rand_" transfer-ownership="none">
- <doc xml:space="preserve">a #GRand</doc>
- <type name="Rand" c:type="GRand*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="int" c:identifier="g_rand_int">
- <doc xml:space="preserve">Returns the next random #guint32 from @rand_ equally distributed over
- the range [0..2^32-1].</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a random number</doc>
- <type name="guint32" c:type="guint32"/>
- </return-value>
- <parameters>
- <instance-parameter name="rand_" transfer-ownership="none">
- <doc xml:space="preserve">a #GRand</doc>
- <type name="Rand" c:type="GRand*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="int_range" c:identifier="g_rand_int_range">
- <doc xml:space="preserve">Returns the next random #gint32 from @rand_ equally distributed over
- the range [@begin..@end-1].</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a random number</doc>
- <type name="gint32" c:type="gint32"/>
- </return-value>
- <parameters>
- <instance-parameter name="rand_" transfer-ownership="none">
- <doc xml:space="preserve">a #GRand</doc>
- <type name="Rand" c:type="GRand*"/>
- </instance-parameter>
- <parameter name="begin" transfer-ownership="none">
- <doc xml:space="preserve">lower closed bound of the interval</doc>
- <type name="gint32" c:type="gint32"/>
- </parameter>
- <parameter name="end" transfer-ownership="none">
- <doc xml:space="preserve">upper open bound of the interval</doc>
- <type name="gint32" c:type="gint32"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_seed" c:identifier="g_rand_set_seed">
- <doc xml:space="preserve">Sets the seed for the random number generator #GRand to @seed.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="rand_" transfer-ownership="none">
- <doc xml:space="preserve">a #GRand</doc>
- <type name="Rand" c:type="GRand*"/>
- </instance-parameter>
- <parameter name="seed" transfer-ownership="none">
- <doc xml:space="preserve">a value to reinitialize the random number generator</doc>
- <type name="guint32" c:type="guint32"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_seed_array"
- c:identifier="g_rand_set_seed_array"
- version="2.4">
- <doc xml:space="preserve">Initializes the random number generator by an array of longs.
- Array can be of arbitrary size, though only the first 624 values
- are taken. This function is useful if you have many low entropy
- seeds, or if you require more then 32 bits of actual entropy for
- your application.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="rand_" transfer-ownership="none">
- <doc xml:space="preserve">a #GRand</doc>
- <type name="Rand" c:type="GRand*"/>
- </instance-parameter>
- <parameter name="seed" transfer-ownership="none">
- <doc xml:space="preserve">array to initialize with</doc>
- <type name="guint32" c:type="const guint32*"/>
- </parameter>
- <parameter name="seed_length" transfer-ownership="none">
- <doc xml:space="preserve">length of array</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <function name="new" c:identifier="g_rand_new" introspectable="0">
- <doc xml:space="preserve">Creates a new random number generator initialized with a seed taken
- either from `/dev/urandom` (if existing) or from the current time
- (as a fallback).
- On Windows, the seed is taken from rand_s().</doc>
- <return-value>
- <doc xml:space="preserve">the new #GRand</doc>
- <type name="Rand" c:type="GRand*"/>
- </return-value>
- </function>
- <function name="new_with_seed"
- c:identifier="g_rand_new_with_seed"
- introspectable="0">
- <doc xml:space="preserve">Creates a new random number generator initialized with @seed.</doc>
- <return-value>
- <doc xml:space="preserve">the new #GRand</doc>
- <type name="Rand" c:type="GRand*"/>
- </return-value>
- <parameters>
- <parameter name="seed" transfer-ownership="none">
- <doc xml:space="preserve">a value to initialize the random number generator</doc>
- <type name="guint32" c:type="guint32"/>
- </parameter>
- </parameters>
- </function>
- <function name="new_with_seed_array"
- c:identifier="g_rand_new_with_seed_array"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Creates a new random number generator initialized with @seed.</doc>
- <return-value>
- <doc xml:space="preserve">the new #GRand</doc>
- <type name="Rand" c:type="GRand*"/>
- </return-value>
- <parameters>
- <parameter name="seed" transfer-ownership="none">
- <doc xml:space="preserve">an array of seeds to initialize the random number generator</doc>
- <type name="guint32" c:type="const guint32*"/>
- </parameter>
- <parameter name="seed_length" transfer-ownership="none">
- <doc xml:space="preserve">an array of seeds to initialize the random number
- generator</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <record name="RecMutex" c:type="GRecMutex" version="2.32">
- <doc xml:space="preserve">The GRecMutex struct is an opaque data structure to represent a
- recursive mutex. It is similar to a #GMutex with the difference
- that it is possible to lock a GRecMutex multiple times in the same
- thread without deadlock. When doing so, care has to be taken to
- unlock the recursive mutex as often as it has been locked.
- If a #GRecMutex is allocated in static storage then it can be used
- without initialisation. Otherwise, you should call
- g_rec_mutex_init() on it and g_rec_mutex_clear() when done.
- A GRecMutex should only be accessed with the
- g_rec_mutex_ functions.</doc>
- <field name="p" readable="0" private="1">
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="i" readable="0" private="1">
- <array zero-terminated="0" c:type="guint" fixed-size="2">
- <type name="guint" c:type="guint"/>
- </array>
- </field>
- <method name="clear" c:identifier="g_rec_mutex_clear">
- <doc xml:space="preserve">Frees the resources allocated to a recursive mutex with
- g_rec_mutex_init().
- This function should not be used with a #GRecMutex that has been
- statically allocated.
- Calling g_rec_mutex_clear() on a locked recursive mutex leads
- to undefined behaviour.
- Sine: 2.32</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="rec_mutex" transfer-ownership="none">
- <doc xml:space="preserve">an initialized #GRecMutex</doc>
- <type name="RecMutex" c:type="GRecMutex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="init" c:identifier="g_rec_mutex_init" version="2.32">
- <doc xml:space="preserve">Initializes a #GRecMutex so that it can be used.
- This function is useful to initialize a recursive mutex
- that has been allocated on the stack, or as part of a larger
- structure.
- It is not necessary to initialise a recursive mutex that has been
- statically allocated.
- |[<!-- language="C" -->
- typedef struct {
- GRecMutex m;
- ...
- } Blob;
- Blob *b;
- b = g_new (Blob, 1);
- g_rec_mutex_init (&b->m);
- ]|
- Calling g_rec_mutex_init() on an already initialized #GRecMutex
- leads to undefined behaviour.
- To undo the effect of g_rec_mutex_init() when a recursive mutex
- is no longer needed, use g_rec_mutex_clear().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="rec_mutex" transfer-ownership="none">
- <doc xml:space="preserve">an uninitialized #GRecMutex</doc>
- <type name="RecMutex" c:type="GRecMutex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="lock" c:identifier="g_rec_mutex_lock" version="2.32">
- <doc xml:space="preserve">Locks @rec_mutex. If @rec_mutex is already locked by another
- thread, the current thread will block until @rec_mutex is
- unlocked by the other thread. If @rec_mutex is already locked
- by the current thread, the 'lock count' of @rec_mutex is increased.
- The mutex will only become available again when it is unlocked
- as many times as it has been locked.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="rec_mutex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRecMutex</doc>
- <type name="RecMutex" c:type="GRecMutex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="trylock" c:identifier="g_rec_mutex_trylock" version="2.32">
- <doc xml:space="preserve">Tries to lock @rec_mutex. If @rec_mutex is already locked
- by another thread, it immediately returns %FALSE. Otherwise
- it locks @rec_mutex and returns %TRUE.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @rec_mutex could be locked</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="rec_mutex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRecMutex</doc>
- <type name="RecMutex" c:type="GRecMutex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unlock" c:identifier="g_rec_mutex_unlock" version="2.32">
- <doc xml:space="preserve">Unlocks @rec_mutex. If another thread is blocked in a
- g_rec_mutex_lock() call for @rec_mutex, it will become unblocked
- and can lock @rec_mutex itself.
- Calling g_rec_mutex_unlock() on a recursive mutex that is not
- locked by the current thread leads to undefined behaviour.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="rec_mutex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRecMutex</doc>
- <type name="RecMutex" c:type="GRecMutex*"/>
- </instance-parameter>
- </parameters>
- </method>
- </record>
- <record name="Regex"
- c:type="GRegex"
- version="2.14"
- glib:type-name="GRegex"
- glib:get-type="g_regex_get_type"
- c:symbol-prefix="regex">
- <doc xml:space="preserve">The g_regex_*() functions implement regular
- expression pattern matching using syntax and semantics similar to
- Perl regular expression.
- Some functions accept a @start_position argument, setting it differs
- from just passing over a shortened string and setting #G_REGEX_MATCH_NOTBOL
- in the case of a pattern that begins with any kind of lookbehind assertion.
- For example, consider the pattern "\Biss\B" which finds occurrences of "iss"
- in the middle of words. ("\B" matches only if the current position in the
- subject is not a word boundary.) When applied to the string "Mississipi"
- from the fourth byte, namely "issipi", it does not match, because "\B" is
- always false at the start of the subject, which is deemed to be a word
- boundary. However, if the entire string is passed , but with
- @start_position set to 4, it finds the second occurrence of "iss" because
- it is able to look behind the starting point to discover that it is
- preceded by a letter.
- Note that, unless you set the #G_REGEX_RAW flag, all the strings passed
- to these functions must be encoded in UTF-8. The lengths and the positions
- inside the strings are in bytes and not in characters, so, for instance,
- "\xc3\xa0" (i.e. "&agrave;") is two bytes long but it is treated as a
- single character. If you set #G_REGEX_RAW the strings can be non-valid
- UTF-8 strings and a byte is treated as a character, so "\xc3\xa0" is two
- bytes and two characters long.
- When matching a pattern, "\n" matches only against a "\n" character in
- the string, and "\r" matches only a "\r" character. To match any newline
- sequence use "\R". This particular group matches either the two-character
- sequence CR + LF ("\r\n"), or one of the single characters LF (linefeed,
- U+000A, "\n"), VT vertical tab, U+000B, "\v"), FF (formfeed, U+000C, "\f"),
- CR (carriage return, U+000D, "\r"), NEL (next line, U+0085), LS (line
- separator, U+2028), or PS (paragraph separator, U+2029).
- The behaviour of the dot, circumflex, and dollar metacharacters are
- affected by newline characters, the default is to recognize any newline
- character (the same characters recognized by "\R"). This can be changed
- with #G_REGEX_NEWLINE_CR, #G_REGEX_NEWLINE_LF and #G_REGEX_NEWLINE_CRLF
- compile options, and with #G_REGEX_MATCH_NEWLINE_ANY,
- #G_REGEX_MATCH_NEWLINE_CR, #G_REGEX_MATCH_NEWLINE_LF and
- #G_REGEX_MATCH_NEWLINE_CRLF match options. These settings are also
- relevant when compiling a pattern if #G_REGEX_EXTENDED is set, and an
- unescaped "#" outside a character class is encountered. This indicates
- a comment that lasts until after the next newline.
- When setting the %G_REGEX_JAVASCRIPT_COMPAT flag, pattern syntax and pattern
- matching is changed to be compatible with the way that regular expressions
- work in JavaScript. More precisely, a lonely ']' character in the pattern
- is a syntax error; the '\x' escape only allows 0 to 2 hexadecimal digits, and
- you must use the '\u' escape sequence with 4 hex digits to specify a unicode
- codepoint instead of '\x' or 'x{....}'. If '\x' or '\u' are not followed by
- the specified number of hex digits, they match 'x' and 'u' literally; also
- '\U' always matches 'U' instead of being an error in the pattern. Finally,
- pattern matching is modified so that back references to an unset subpattern
- group produces a match with the empty string instead of an error. See
- pcreapi(3) for more information.
- Creating and manipulating the same #GRegex structure from different
- threads is not a problem as #GRegex does not modify its internal
- state between creation and destruction, on the other hand #GMatchInfo
- is not threadsafe.
- The regular expressions low-level functionalities are obtained through
- the excellent
- [PCRE](http://www.pcre.org/)
- library written by Philip Hazel.</doc>
- <constructor name="new"
- c:identifier="g_regex_new"
- version="2.14"
- throws="1">
- <doc xml:space="preserve">Compiles the regular expression to an internal form, and does
- the initial setup of the #GRegex structure.</doc>
- <return-value transfer-ownership="full" nullable="1">
- <doc xml:space="preserve">a #GRegex structure or %NULL if an error occured. Call
- g_regex_unref() when you are done with it</doc>
- <type name="Regex" c:type="GRegex*"/>
- </return-value>
- <parameters>
- <parameter name="pattern" transfer-ownership="none">
- <doc xml:space="preserve">the regular expression</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="compile_options" transfer-ownership="none">
- <doc xml:space="preserve">compile options for the regular expression, or 0</doc>
- <type name="RegexCompileFlags" c:type="GRegexCompileFlags"/>
- </parameter>
- <parameter name="match_options" transfer-ownership="none">
- <doc xml:space="preserve">match options for the regular expression, or 0</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="get_capture_count"
- c:identifier="g_regex_get_capture_count"
- version="2.14">
- <doc xml:space="preserve">Returns the number of capturing subpatterns in the pattern.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of capturing subpatterns</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_compile_flags"
- c:identifier="g_regex_get_compile_flags"
- version="2.26">
- <doc xml:space="preserve">Returns the compile options that @regex was created with.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">flags from #GRegexCompileFlags</doc>
- <type name="RegexCompileFlags" c:type="GRegexCompileFlags"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_has_cr_or_lf"
- c:identifier="g_regex_get_has_cr_or_lf"
- version="2.34">
- <doc xml:space="preserve">Checks whether the pattern contains explicit CR or LF references.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the pattern contains explicit CR or LF references</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex structure</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_match_flags"
- c:identifier="g_regex_get_match_flags"
- version="2.26">
- <doc xml:space="preserve">Returns the match options that @regex was created with.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">flags from #GRegexMatchFlags</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_max_backref"
- c:identifier="g_regex_get_max_backref"
- version="2.14">
- <doc xml:space="preserve">Returns the number of the highest back reference
- in the pattern, or 0 if the pattern does not contain
- back references.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of the highest back reference</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_max_lookbehind"
- c:identifier="g_regex_get_max_lookbehind"
- version="2.38">
- <doc xml:space="preserve">Gets the number of characters in the longest lookbehind assertion in the
- pattern. This information is useful when doing multi-segment matching using
- the partial matching facilities.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of characters in the longest lookbehind assertion.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex structure</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_pattern"
- c:identifier="g_regex_get_pattern"
- version="2.14">
- <doc xml:space="preserve">Gets the pattern string associated with @regex, i.e. a copy of
- the string passed to g_regex_new().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the pattern of @regex</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex structure</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_string_number"
- c:identifier="g_regex_get_string_number"
- version="2.14">
- <doc xml:space="preserve">Retrieves the number of the subexpression named @name.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">The number of the subexpression or -1 if @name
- does not exists</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">#GRegex structure</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- <parameter name="name" transfer-ownership="none">
- <doc xml:space="preserve">name of the subexpression</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="match" c:identifier="g_regex_match" version="2.14">
- <doc xml:space="preserve">Scans for a match in string for the pattern in @regex.
- The @match_options are combined with the match options specified
- when the @regex structure was created, letting you have more
- flexibility in reusing #GRegex structures.
- A #GMatchInfo structure, used to get information on the match,
- is stored in @match_info if not %NULL. Note that if @match_info
- is not %NULL then it is created even if the function returns %FALSE,
- i.e. you must free it regardless if regular expression actually matched.
- To retrieve all the non-overlapping matches of the pattern in
- string you can use g_match_info_next().
- |[<!-- language="C" -->
- static void
- print_uppercase_words (const gchar *string)
- {
- // Print all uppercase-only words.
- GRegex *regex;
- GMatchInfo *match_info;
-
- regex = g_regex_new ("[A-Z]+", 0, 0, NULL);
- g_regex_match (regex, string, 0, &match_info);
- while (g_match_info_matches (match_info))
- {
- gchar *word = g_match_info_fetch (match_info, 0);
- g_print ("Found: %s\n", word);
- g_free (word);
- g_match_info_next (match_info, NULL);
- }
- g_match_info_free (match_info);
- g_regex_unref (regex);
- }
- ]|
- @string is not copied and is used in #GMatchInfo internally. If
- you use any #GMatchInfo method (except g_match_info_free()) after
- freeing or modifying @string then the behaviour is undefined.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE is the string matched, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex structure from g_regex_new()</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to scan for matches</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="match_options" transfer-ownership="none">
- <doc xml:space="preserve">match options</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </parameter>
- <parameter name="match_info"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">pointer to location where to store
- the #GMatchInfo, or %NULL if you do not need it</doc>
- <type name="MatchInfo" c:type="GMatchInfo**"/>
- </parameter>
- </parameters>
- </method>
- <method name="match_all" c:identifier="g_regex_match_all" version="2.14">
- <doc xml:space="preserve">Using the standard algorithm for regular expression matching only
- the longest match in the string is retrieved. This function uses
- a different algorithm so it can retrieve all the possible matches.
- For more documentation see g_regex_match_all_full().
- A #GMatchInfo structure, used to get information on the match, is
- stored in @match_info if not %NULL. Note that if @match_info is
- not %NULL then it is created even if the function returns %FALSE,
- i.e. you must free it regardless if regular expression actually
- matched.
- @string is not copied and is used in #GMatchInfo internally. If
- you use any #GMatchInfo method (except g_match_info_free()) after
- freeing or modifying @string then the behaviour is undefined.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE is the string matched, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex structure from g_regex_new()</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to scan for matches</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="match_options" transfer-ownership="none">
- <doc xml:space="preserve">match options</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </parameter>
- <parameter name="match_info"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">pointer to location where to store
- the #GMatchInfo, or %NULL if you do not need it</doc>
- <type name="MatchInfo" c:type="GMatchInfo**"/>
- </parameter>
- </parameters>
- </method>
- <method name="match_all_full"
- c:identifier="g_regex_match_all_full"
- version="2.14"
- throws="1">
- <doc xml:space="preserve">Using the standard algorithm for regular expression matching only
- the longest match in the string is retrieved, it is not possible
- to obtain all the available matches. For instance matching
- "<a> <b> <c>" against the pattern "<.*>"
- you get "<a> <b> <c>".
- This function uses a different algorithm (called DFA, i.e. deterministic
- finite automaton), so it can retrieve all the possible matches, all
- starting at the same point in the string. For instance matching
- "<a> <b> <c>" against the pattern "<.*>;"
- you would obtain three matches: "<a> <b> <c>",
- "<a> <b>" and "<a>".
- The number of matched strings is retrieved using
- g_match_info_get_match_count(). To obtain the matched strings and
- their position you can use, respectively, g_match_info_fetch() and
- g_match_info_fetch_pos(). Note that the strings are returned in
- reverse order of length; that is, the longest matching string is
- given first.
- Note that the DFA algorithm is slower than the standard one and it
- is not able to capture substrings, so backreferences do not work.
- Setting @start_position differs from just passing over a shortened
- string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern
- that begins with any kind of lookbehind assertion, such as "\b".
- A #GMatchInfo structure, used to get information on the match, is
- stored in @match_info if not %NULL. Note that if @match_info is
- not %NULL then it is created even if the function returns %FALSE,
- i.e. you must free it regardless if regular expression actually
- matched.
- @string is not copied and is used in #GMatchInfo internally. If
- you use any #GMatchInfo method (except g_match_info_free()) after
- freeing or modifying @string then the behaviour is undefined.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE is the string matched, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex structure from g_regex_new()</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to scan for matches</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
- <type name="utf8" c:type="gchar"/>
- </array>
- </parameter>
- <parameter name="string_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="start_position" transfer-ownership="none">
- <doc xml:space="preserve">starting index of the string to match, in bytes</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="match_options" transfer-ownership="none">
- <doc xml:space="preserve">match options</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </parameter>
- <parameter name="match_info"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">pointer to location where to store
- the #GMatchInfo, or %NULL if you do not need it</doc>
- <type name="MatchInfo" c:type="GMatchInfo**"/>
- </parameter>
- </parameters>
- </method>
- <method name="match_full"
- c:identifier="g_regex_match_full"
- version="2.14"
- throws="1">
- <doc xml:space="preserve">Scans for a match in string for the pattern in @regex.
- The @match_options are combined with the match options specified
- when the @regex structure was created, letting you have more
- flexibility in reusing #GRegex structures.
- Setting @start_position differs from just passing over a shortened
- string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern
- that begins with any kind of lookbehind assertion, such as "\b".
- A #GMatchInfo structure, used to get information on the match, is
- stored in @match_info if not %NULL. Note that if @match_info is
- not %NULL then it is created even if the function returns %FALSE,
- i.e. you must free it regardless if regular expression actually
- matched.
- @string is not copied and is used in #GMatchInfo internally. If
- you use any #GMatchInfo method (except g_match_info_free()) after
- freeing or modifying @string then the behaviour is undefined.
- To retrieve all the non-overlapping matches of the pattern in
- string you can use g_match_info_next().
- |[<!-- language="C" -->
- static void
- print_uppercase_words (const gchar *string)
- {
- // Print all uppercase-only words.
- GRegex *regex;
- GMatchInfo *match_info;
- GError *error = NULL;
-
- regex = g_regex_new ("[A-Z]+", 0, 0, NULL);
- g_regex_match_full (regex, string, -1, 0, 0, &match_info, &error);
- while (g_match_info_matches (match_info))
- {
- gchar *word = g_match_info_fetch (match_info, 0);
- g_print ("Found: %s\n", word);
- g_free (word);
- g_match_info_next (match_info, &error);
- }
- g_match_info_free (match_info);
- g_regex_unref (regex);
- if (error != NULL)
- {
- g_printerr ("Error while matching: %s\n", error->message);
- g_error_free (error);
- }
- }
- ]|</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE is the string matched, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex structure from g_regex_new()</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to scan for matches</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
- <type name="utf8" c:type="gchar"/>
- </array>
- </parameter>
- <parameter name="string_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="start_position" transfer-ownership="none">
- <doc xml:space="preserve">starting index of the string to match, in bytes</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="match_options" transfer-ownership="none">
- <doc xml:space="preserve">match options</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </parameter>
- <parameter name="match_info"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">pointer to location where to store
- the #GMatchInfo, or %NULL if you do not need it</doc>
- <type name="MatchInfo" c:type="GMatchInfo**"/>
- </parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_regex_ref" version="2.14">
- <doc xml:space="preserve">Increases reference count of @regex by 1.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">@regex</doc>
- <type name="Regex" c:type="GRegex*"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex</doc>
- <type name="Regex" c:type="GRegex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="replace"
- c:identifier="g_regex_replace"
- version="2.14"
- throws="1">
- <doc xml:space="preserve">Replaces all occurrences of the pattern in @regex with the
- replacement text. Backreferences of the form '\number' or
- '\g<number>' in the replacement text are interpolated by the
- number-th captured subexpression of the match, '\g<name>' refers
- to the captured subexpression with the given name. '\0' refers
- to the complete match, but '\0' followed by a number is the octal
- representation of a character. To include a literal '\' in the
- replacement, write '\\'.
- There are also escapes that changes the case of the following text:
- - \l: Convert to lower case the next character
- - \u: Convert to upper case the next character
- - \L: Convert to lower case till \E
- - \U: Convert to upper case till \E
- - \E: End case modification
- If you do not need to use backreferences use g_regex_replace_literal().
- The @replacement string must be UTF-8 encoded even if #G_REGEX_RAW was
- passed to g_regex_new(). If you want to use not UTF-8 encoded stings
- you can use g_regex_replace_literal().
- Setting @start_position differs from just passing over a shortened
- string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern that
- begins with any kind of lookbehind assertion, such as "\b".</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string containing the replacements</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex structure</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to perform matches against</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
- <type name="utf8" c:type="gchar"/>
- </array>
- </parameter>
- <parameter name="string_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="start_position" transfer-ownership="none">
- <doc xml:space="preserve">starting index of the string to match, in bytes</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="replacement" transfer-ownership="none">
- <doc xml:space="preserve">text to replace each match with</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="match_options" transfer-ownership="none">
- <doc xml:space="preserve">options for the match</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </parameter>
- </parameters>
- </method>
- <method name="replace_eval"
- c:identifier="g_regex_replace_eval"
- version="2.14"
- introspectable="0"
- throws="1">
- <doc xml:space="preserve">Replaces occurrences of the pattern in regex with the output of
- @eval for that occurrence.
- Setting @start_position differs from just passing over a shortened
- string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern
- that begins with any kind of lookbehind assertion, such as "\b".
- The following example uses g_regex_replace_eval() to replace multiple
- strings at once:
- |[<!-- language="C" -->
- static gboolean
- eval_cb (const GMatchInfo *info,
- GString *res,
- gpointer data)
- {
- gchar *match;
- gchar *r;
- match = g_match_info_fetch (info, 0);
- r = g_hash_table_lookup ((GHashTable *)data, match);
- g_string_append (res, r);
- g_free (match);
- return FALSE;
- }
- ...
- GRegex *reg;
- GHashTable *h;
- gchar *res;
- h = g_hash_table_new (g_str_hash, g_str_equal);
- g_hash_table_insert (h, "1", "ONE");
- g_hash_table_insert (h, "2", "TWO");
- g_hash_table_insert (h, "3", "THREE");
- g_hash_table_insert (h, "4", "FOUR");
- reg = g_regex_new ("1|2|3|4", 0, 0, NULL);
- res = g_regex_replace_eval (reg, text, -1, 0, 0, eval_cb, h, NULL);
- g_hash_table_destroy (h);
- ...
- ]|</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string containing the replacements</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex structure from g_regex_new()</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">string to perform matches against</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
- <type name="utf8" c:type="gchar"/>
- </array>
- </parameter>
- <parameter name="string_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="start_position" transfer-ownership="none">
- <doc xml:space="preserve">starting index of the string to match, in bytes</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="match_options" transfer-ownership="none">
- <doc xml:space="preserve">options for the match</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </parameter>
- <parameter name="eval" transfer-ownership="none" closure="5">
- <doc xml:space="preserve">a function to call for each match</doc>
- <type name="RegexEvalCallback" c:type="GRegexEvalCallback"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="replace_literal"
- c:identifier="g_regex_replace_literal"
- version="2.14"
- throws="1">
- <doc xml:space="preserve">Replaces all occurrences of the pattern in @regex with the
- replacement text. @replacement is replaced literally, to
- include backreferences use g_regex_replace().
- Setting @start_position differs from just passing over a
- shortened string and setting #G_REGEX_MATCH_NOTBOL in the
- case of a pattern that begins with any kind of lookbehind
- assertion, such as "\b".</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string containing the replacements</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex structure</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to perform matches against</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
- <type name="utf8" c:type="gchar"/>
- </array>
- </parameter>
- <parameter name="string_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="start_position" transfer-ownership="none">
- <doc xml:space="preserve">starting index of the string to match, in bytes</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="replacement" transfer-ownership="none">
- <doc xml:space="preserve">text to replace each match with</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="match_options" transfer-ownership="none">
- <doc xml:space="preserve">options for the match</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </parameter>
- </parameters>
- </method>
- <method name="split" c:identifier="g_regex_split" version="2.14">
- <doc xml:space="preserve">Breaks the string on the pattern, and returns an array of the tokens.
- If the pattern contains capturing parentheses, then the text for each
- of the substrings will also be returned. If the pattern does not match
- anywhere in the string, then the whole string is returned as the first
- token.
- As a special case, the result of splitting the empty string "" is an
- empty vector, not a vector containing a single string. The reason for
- this special case is that being able to represent a empty vector is
- typically more useful than consistent handling of empty elements. If
- you do need to represent empty elements, you'll need to check for the
- empty string before calling this function.
- A pattern that can match empty strings splits @string into separate
- characters wherever it matches the empty string between characters.
- For example splitting "ab c" using as a separator "\s*", you will get
- "a", "b" and "c".</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a %NULL-terminated gchar ** array. Free
- it using g_strfreev()</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex structure</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to split with the pattern</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="match_options" transfer-ownership="none">
- <doc xml:space="preserve">match time option flags</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </parameter>
- </parameters>
- </method>
- <method name="split_full"
- c:identifier="g_regex_split_full"
- version="2.14"
- throws="1">
- <doc xml:space="preserve">Breaks the string on the pattern, and returns an array of the tokens.
- If the pattern contains capturing parentheses, then the text for each
- of the substrings will also be returned. If the pattern does not match
- anywhere in the string, then the whole string is returned as the first
- token.
- As a special case, the result of splitting the empty string "" is an
- empty vector, not a vector containing a single string. The reason for
- this special case is that being able to represent a empty vector is
- typically more useful than consistent handling of empty elements. If
- you do need to represent empty elements, you'll need to check for the
- empty string before calling this function.
- A pattern that can match empty strings splits @string into separate
- characters wherever it matches the empty string between characters.
- For example splitting "ab c" using as a separator "\s*", you will get
- "a", "b" and "c".
- Setting @start_position differs from just passing over a shortened
- string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern
- that begins with any kind of lookbehind assertion, such as "\b".</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a %NULL-terminated gchar ** array. Free
- it using g_strfreev()</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex structure</doc>
- <type name="Regex" c:type="const GRegex*"/>
- </instance-parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to split with the pattern</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
- <type name="utf8" c:type="gchar"/>
- </array>
- </parameter>
- <parameter name="string_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="start_position" transfer-ownership="none">
- <doc xml:space="preserve">starting index of the string to match, in bytes</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="match_options" transfer-ownership="none">
- <doc xml:space="preserve">match time option flags</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </parameter>
- <parameter name="max_tokens" transfer-ownership="none">
- <doc xml:space="preserve">the maximum number of tokens to split @string into.
- If this is less than 1, the string is split completely</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_regex_unref" version="2.14">
- <doc xml:space="preserve">Decreases reference count of @regex by 1. When reference count drops
- to zero, it frees all the memory associated with the regex structure.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="regex" transfer-ownership="none">
- <doc xml:space="preserve">a #GRegex</doc>
- <type name="Regex" c:type="GRegex*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="check_replacement"
- c:identifier="g_regex_check_replacement"
- version="2.14"
- throws="1">
- <doc xml:space="preserve">Checks whether @replacement is a valid replacement string
- (see g_regex_replace()), i.e. that all escape sequences in
- it are valid.
- If @has_references is not %NULL then @replacement is checked
- for pattern references. For instance, replacement text 'foo\n'
- does not contain references and may be evaluated without information
- about actual match, but '\0\1' (whole match followed by first
- subpattern) requires valid #GMatchInfo object.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">whether @replacement is a valid replacement string</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="replacement" transfer-ownership="none">
- <doc xml:space="preserve">the replacement string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="has_references"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store information about
- references in @replacement or %NULL</doc>
- <type name="gboolean" c:type="gboolean*"/>
- </parameter>
- </parameters>
- </function>
- <function name="error_quark" c:identifier="g_regex_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="escape_nul"
- c:identifier="g_regex_escape_nul"
- version="2.30">
- <doc xml:space="preserve">Escapes the nul characters in @string to "\x00". It can be used
- to compile a regex with embedded nul characters.
- For completeness, @length can be -1 for a nul-terminated string.
- In this case the output string will be of course equal to @string.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated escaped string</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to escape</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="escape_string"
- c:identifier="g_regex_escape_string"
- version="2.14">
- <doc xml:space="preserve">Escapes the special characters used for regular expressions
- in @string, for instance "a.b*c" becomes "a\.b\*c". This
- function is useful to dynamically generate regular expressions.
- @string can contain nul characters that are replaced with "\0",
- in this case remember to specify the correct length of @string
- in @length.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated escaped string</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to escape</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
- <type name="utf8" c:type="gchar"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="match_simple"
- c:identifier="g_regex_match_simple"
- version="2.14">
- <doc xml:space="preserve">Scans for a match in @string for @pattern.
- This function is equivalent to g_regex_match() but it does not
- require to compile the pattern with g_regex_new(), avoiding some
- lines of code when you need just to do a match without extracting
- substrings, capture counts, and so on.
- If this function is to be called on the same @pattern more than
- once, it's more efficient to compile the pattern once with
- g_regex_new() and then use g_regex_match().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the string matched, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="pattern" transfer-ownership="none">
- <doc xml:space="preserve">the regular expression</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to scan for matches</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="compile_options" transfer-ownership="none">
- <doc xml:space="preserve">compile options for the regular expression, or 0</doc>
- <type name="RegexCompileFlags" c:type="GRegexCompileFlags"/>
- </parameter>
- <parameter name="match_options" transfer-ownership="none">
- <doc xml:space="preserve">match options, or 0</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </parameter>
- </parameters>
- </function>
- <function name="split_simple"
- c:identifier="g_regex_split_simple"
- version="2.14">
- <doc xml:space="preserve">Breaks the string on the pattern, and returns an array of
- the tokens. If the pattern contains capturing parentheses,
- then the text for each of the substrings will also be returned.
- If the pattern does not match anywhere in the string, then the
- whole string is returned as the first token.
- This function is equivalent to g_regex_split() but it does
- not require to compile the pattern with g_regex_new(), avoiding
- some lines of code when you need just to do a split without
- extracting substrings, capture counts, and so on.
- If this function is to be called on the same @pattern more than
- once, it's more efficient to compile the pattern once with
- g_regex_new() and then use g_regex_split().
- As a special case, the result of splitting the empty string ""
- is an empty vector, not a vector containing a single string.
- The reason for this special case is that being able to represent
- a empty vector is typically more useful than consistent handling
- of empty elements. If you do need to represent empty elements,
- you'll need to check for the empty string before calling this
- function.
- A pattern that can match empty strings splits @string into
- separate characters wherever it matches the empty string between
- characters. For example splitting "ab c" using as a separator
- "\s*", you will get "a", "b" and "c".</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a %NULL-terminated array of strings. Free
- it using g_strfreev()</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="pattern" transfer-ownership="none">
- <doc xml:space="preserve">the regular expression</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to scan for matches</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="compile_options" transfer-ownership="none">
- <doc xml:space="preserve">compile options for the regular expression, or 0</doc>
- <type name="RegexCompileFlags" c:type="GRegexCompileFlags"/>
- </parameter>
- <parameter name="match_options" transfer-ownership="none">
- <doc xml:space="preserve">match options, or 0</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <bitfield name="RegexCompileFlags"
- version="2.14"
- c:type="GRegexCompileFlags">
- <doc xml:space="preserve">Flags specifying compile-time options.</doc>
- <member name="caseless" value="1" c:identifier="G_REGEX_CASELESS">
- <doc xml:space="preserve">Letters in the pattern match both upper- and
- lowercase letters. This option can be changed within a pattern
- by a "(?i)" option setting.</doc>
- </member>
- <member name="multiline" value="2" c:identifier="G_REGEX_MULTILINE">
- <doc xml:space="preserve">By default, GRegex treats the strings as consisting
- of a single line of characters (even if it actually contains
- newlines). The "start of line" metacharacter ("^") matches only
- at the start of the string, while the "end of line" metacharacter
- ("$") matches only at the end of the string, or before a terminating
- newline (unless #G_REGEX_DOLLAR_ENDONLY is set). When
- #G_REGEX_MULTILINE is set, the "start of line" and "end of line"
- constructs match immediately following or immediately before any
- newline in the string, respectively, as well as at the very start
- and end. This can be changed within a pattern by a "(?m)" option
- setting.</doc>
- </member>
- <member name="dotall" value="4" c:identifier="G_REGEX_DOTALL">
- <doc xml:space="preserve">A dot metacharater (".") in the pattern matches all
- characters, including newlines. Without it, newlines are excluded.
- This option can be changed within a pattern by a ("?s") option setting.</doc>
- </member>
- <member name="extended" value="8" c:identifier="G_REGEX_EXTENDED">
- <doc xml:space="preserve">Whitespace data characters in the pattern are
- totally ignored except when escaped or inside a character class.
- Whitespace does not include the VT character (code 11). In addition,
- characters between an unescaped "#" outside a character class and
- the next newline character, inclusive, are also ignored. This can
- be changed within a pattern by a "(?x)" option setting.</doc>
- </member>
- <member name="anchored" value="16" c:identifier="G_REGEX_ANCHORED">
- <doc xml:space="preserve">The pattern is forced to be "anchored", that is,
- it is constrained to match only at the first matching point in the
- string that is being searched. This effect can also be achieved by
- appropriate constructs in the pattern itself such as the "^"
- metacharater.</doc>
- </member>
- <member name="dollar_endonly"
- value="32"
- c:identifier="G_REGEX_DOLLAR_ENDONLY">
- <doc xml:space="preserve">A dollar metacharacter ("$") in the pattern
- matches only at the end of the string. Without this option, a
- dollar also matches immediately before the final character if
- it is a newline (but not before any other newlines). This option
- is ignored if #G_REGEX_MULTILINE is set.</doc>
- </member>
- <member name="ungreedy" value="512" c:identifier="G_REGEX_UNGREEDY">
- <doc xml:space="preserve">Inverts the "greediness" of the quantifiers so that
- they are not greedy by default, but become greedy if followed by "?".
- It can also be set by a "(?U)" option setting within the pattern.</doc>
- </member>
- <member name="raw" value="2048" c:identifier="G_REGEX_RAW">
- <doc xml:space="preserve">Usually strings must be valid UTF-8 strings, using this
- flag they are considered as a raw sequence of bytes.</doc>
- </member>
- <member name="no_auto_capture"
- value="4096"
- c:identifier="G_REGEX_NO_AUTO_CAPTURE">
- <doc xml:space="preserve">Disables the use of numbered capturing
- parentheses in the pattern. Any opening parenthesis that is not
- followed by "?" behaves as if it were followed by "?:" but named
- parentheses can still be used for capturing (and they acquire numbers
- in the usual way).</doc>
- </member>
- <member name="optimize" value="8192" c:identifier="G_REGEX_OPTIMIZE">
- <doc xml:space="preserve">Optimize the regular expression. If the pattern will
- be used many times, then it may be worth the effort to optimize it
- to improve the speed of matches.</doc>
- </member>
- <member name="firstline" value="262144" c:identifier="G_REGEX_FIRSTLINE">
- <doc xml:space="preserve">Limits an unanchored pattern to match before (or at) the
- first newline. Since: 2.34</doc>
- </member>
- <member name="dupnames" value="524288" c:identifier="G_REGEX_DUPNAMES">
- <doc xml:space="preserve">Names used to identify capturing subpatterns need not
- be unique. This can be helpful for certain types of pattern when it
- is known that only one instance of the named subpattern can ever be
- matched.</doc>
- </member>
- <member name="newline_cr"
- value="1048576"
- c:identifier="G_REGEX_NEWLINE_CR">
- <doc xml:space="preserve">Usually any newline character or character sequence is
- recognized. If this option is set, the only recognized newline character
- is '\r'.</doc>
- </member>
- <member name="newline_lf"
- value="2097152"
- c:identifier="G_REGEX_NEWLINE_LF">
- <doc xml:space="preserve">Usually any newline character or character sequence is
- recognized. If this option is set, the only recognized newline character
- is '\n'.</doc>
- </member>
- <member name="newline_crlf"
- value="3145728"
- c:identifier="G_REGEX_NEWLINE_CRLF">
- <doc xml:space="preserve">Usually any newline character or character sequence is
- recognized. If this option is set, the only recognized newline character
- sequence is '\r\n'.</doc>
- </member>
- <member name="newline_anycrlf"
- value="5242880"
- c:identifier="G_REGEX_NEWLINE_ANYCRLF">
- <doc xml:space="preserve">Usually any newline character or character sequence
- is recognized. If this option is set, the only recognized newline character
- sequences are '\r', '\n', and '\r\n'. Since: 2.34</doc>
- </member>
- <member name="bsr_anycrlf"
- value="8388608"
- c:identifier="G_REGEX_BSR_ANYCRLF">
- <doc xml:space="preserve">Usually any newline character or character sequence
- is recognised. If this option is set, then "\R" only recognizes the newline
- characters '\r', '\n' and '\r\n'. Since: 2.34</doc>
- </member>
- <member name="javascript_compat"
- value="33554432"
- c:identifier="G_REGEX_JAVASCRIPT_COMPAT">
- <doc xml:space="preserve">Changes behaviour so that it is compatible with
- JavaScript rather than PCRE. Since: 2.34</doc>
- </member>
- </bitfield>
- <enumeration name="RegexError"
- version="2.14"
- c:type="GRegexError"
- glib:error-domain="g-regex-error-quark">
- <doc xml:space="preserve">Error codes returned by regular expressions functions.</doc>
- <member name="compile" value="0" c:identifier="G_REGEX_ERROR_COMPILE">
- <doc xml:space="preserve">Compilation of the regular expression failed.</doc>
- </member>
- <member name="optimize" value="1" c:identifier="G_REGEX_ERROR_OPTIMIZE">
- <doc xml:space="preserve">Optimization of the regular expression failed.</doc>
- </member>
- <member name="replace" value="2" c:identifier="G_REGEX_ERROR_REPLACE">
- <doc xml:space="preserve">Replacement failed due to an ill-formed replacement
- string.</doc>
- </member>
- <member name="match" value="3" c:identifier="G_REGEX_ERROR_MATCH">
- <doc xml:space="preserve">The match process failed.</doc>
- </member>
- <member name="internal" value="4" c:identifier="G_REGEX_ERROR_INTERNAL">
- <doc xml:space="preserve">Internal error of the regular expression engine.
- Since 2.16</doc>
- </member>
- <member name="stray_backslash"
- value="101"
- c:identifier="G_REGEX_ERROR_STRAY_BACKSLASH">
- <doc xml:space="preserve">"\\" at end of pattern. Since 2.16</doc>
- </member>
- <member name="missing_control_char"
- value="102"
- c:identifier="G_REGEX_ERROR_MISSING_CONTROL_CHAR">
- <doc xml:space="preserve">"\\c" at end of pattern. Since 2.16</doc>
- </member>
- <member name="unrecognized_escape"
- value="103"
- c:identifier="G_REGEX_ERROR_UNRECOGNIZED_ESCAPE">
- <doc xml:space="preserve">Unrecognized character follows "\\".
- Since 2.16</doc>
- </member>
- <member name="quantifiers_out_of_order"
- value="104"
- c:identifier="G_REGEX_ERROR_QUANTIFIERS_OUT_OF_ORDER">
- <doc xml:space="preserve">Numbers out of order in "{}"
- quantifier. Since 2.16</doc>
- </member>
- <member name="quantifier_too_big"
- value="105"
- c:identifier="G_REGEX_ERROR_QUANTIFIER_TOO_BIG">
- <doc xml:space="preserve">Number too big in "{}" quantifier.
- Since 2.16</doc>
- </member>
- <member name="unterminated_character_class"
- value="106"
- c:identifier="G_REGEX_ERROR_UNTERMINATED_CHARACTER_CLASS">
- <doc xml:space="preserve">Missing terminating "]" for
- character class. Since 2.16</doc>
- </member>
- <member name="invalid_escape_in_character_class"
- value="107"
- c:identifier="G_REGEX_ERROR_INVALID_ESCAPE_IN_CHARACTER_CLASS">
- <doc xml:space="preserve">Invalid escape sequence
- in character class. Since 2.16</doc>
- </member>
- <member name="range_out_of_order"
- value="108"
- c:identifier="G_REGEX_ERROR_RANGE_OUT_OF_ORDER">
- <doc xml:space="preserve">Range out of order in character class.
- Since 2.16</doc>
- </member>
- <member name="nothing_to_repeat"
- value="109"
- c:identifier="G_REGEX_ERROR_NOTHING_TO_REPEAT">
- <doc xml:space="preserve">Nothing to repeat. Since 2.16</doc>
- </member>
- <member name="unrecognized_character"
- value="112"
- c:identifier="G_REGEX_ERROR_UNRECOGNIZED_CHARACTER">
- <doc xml:space="preserve">Unrecognized character after "(?",
- "(?<" or "(?P". Since 2.16</doc>
- </member>
- <member name="posix_named_class_outside_class"
- value="113"
- c:identifier="G_REGEX_ERROR_POSIX_NAMED_CLASS_OUTSIDE_CLASS">
- <doc xml:space="preserve">POSIX named classes are
- supported only within a class. Since 2.16</doc>
- </member>
- <member name="unmatched_parenthesis"
- value="114"
- c:identifier="G_REGEX_ERROR_UNMATCHED_PARENTHESIS">
- <doc xml:space="preserve">Missing terminating ")" or ")"
- without opening "(". Since 2.16</doc>
- </member>
- <member name="inexistent_subpattern_reference"
- value="115"
- c:identifier="G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE">
- <doc xml:space="preserve">Reference to non-existent
- subpattern. Since 2.16</doc>
- </member>
- <member name="unterminated_comment"
- value="118"
- c:identifier="G_REGEX_ERROR_UNTERMINATED_COMMENT">
- <doc xml:space="preserve">Missing terminating ")" after comment.
- Since 2.16</doc>
- </member>
- <member name="expression_too_large"
- value="120"
- c:identifier="G_REGEX_ERROR_EXPRESSION_TOO_LARGE">
- <doc xml:space="preserve">Regular expression too large.
- Since 2.16</doc>
- </member>
- <member name="memory_error"
- value="121"
- c:identifier="G_REGEX_ERROR_MEMORY_ERROR">
- <doc xml:space="preserve">Failed to get memory. Since 2.16</doc>
- </member>
- <member name="variable_length_lookbehind"
- value="125"
- c:identifier="G_REGEX_ERROR_VARIABLE_LENGTH_LOOKBEHIND">
- <doc xml:space="preserve">Lookbehind assertion is not
- fixed length. Since 2.16</doc>
- </member>
- <member name="malformed_condition"
- value="126"
- c:identifier="G_REGEX_ERROR_MALFORMED_CONDITION">
- <doc xml:space="preserve">Malformed number or name after "(?(".
- Since 2.16</doc>
- </member>
- <member name="too_many_conditional_branches"
- value="127"
- c:identifier="G_REGEX_ERROR_TOO_MANY_CONDITIONAL_BRANCHES">
- <doc xml:space="preserve">Conditional group contains
- more than two branches. Since 2.16</doc>
- </member>
- <member name="assertion_expected"
- value="128"
- c:identifier="G_REGEX_ERROR_ASSERTION_EXPECTED">
- <doc xml:space="preserve">Assertion expected after "(?(".
- Since 2.16</doc>
- </member>
- <member name="unknown_posix_class_name"
- value="130"
- c:identifier="G_REGEX_ERROR_UNKNOWN_POSIX_CLASS_NAME">
- <doc xml:space="preserve">Unknown POSIX class name.
- Since 2.16</doc>
- </member>
- <member name="posix_collating_elements_not_supported"
- value="131"
- c:identifier="G_REGEX_ERROR_POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED">
- <doc xml:space="preserve">POSIX collating
- elements are not supported. Since 2.16</doc>
- </member>
- <member name="hex_code_too_large"
- value="134"
- c:identifier="G_REGEX_ERROR_HEX_CODE_TOO_LARGE">
- <doc xml:space="preserve">Character value in "\\x{...}" sequence
- is too large. Since 2.16</doc>
- </member>
- <member name="invalid_condition"
- value="135"
- c:identifier="G_REGEX_ERROR_INVALID_CONDITION">
- <doc xml:space="preserve">Invalid condition "(?(0)". Since 2.16</doc>
- </member>
- <member name="single_byte_match_in_lookbehind"
- value="136"
- c:identifier="G_REGEX_ERROR_SINGLE_BYTE_MATCH_IN_LOOKBEHIND">
- <doc xml:space="preserve">\\C not allowed in
- lookbehind assertion. Since 2.16</doc>
- </member>
- <member name="infinite_loop"
- value="140"
- c:identifier="G_REGEX_ERROR_INFINITE_LOOP">
- <doc xml:space="preserve">Recursive call could loop indefinitely.
- Since 2.16</doc>
- </member>
- <member name="missing_subpattern_name_terminator"
- value="142"
- c:identifier="G_REGEX_ERROR_MISSING_SUBPATTERN_NAME_TERMINATOR">
- <doc xml:space="preserve">Missing terminator
- in subpattern name. Since 2.16</doc>
- </member>
- <member name="duplicate_subpattern_name"
- value="143"
- c:identifier="G_REGEX_ERROR_DUPLICATE_SUBPATTERN_NAME">
- <doc xml:space="preserve">Two named subpatterns have
- the same name. Since 2.16</doc>
- </member>
- <member name="malformed_property"
- value="146"
- c:identifier="G_REGEX_ERROR_MALFORMED_PROPERTY">
- <doc xml:space="preserve">Malformed "\\P" or "\\p" sequence.
- Since 2.16</doc>
- </member>
- <member name="unknown_property"
- value="147"
- c:identifier="G_REGEX_ERROR_UNKNOWN_PROPERTY">
- <doc xml:space="preserve">Unknown property name after "\\P" or
- "\\p". Since 2.16</doc>
- </member>
- <member name="subpattern_name_too_long"
- value="148"
- c:identifier="G_REGEX_ERROR_SUBPATTERN_NAME_TOO_LONG">
- <doc xml:space="preserve">Subpattern name is too long
- (maximum 32 characters). Since 2.16</doc>
- </member>
- <member name="too_many_subpatterns"
- value="149"
- c:identifier="G_REGEX_ERROR_TOO_MANY_SUBPATTERNS">
- <doc xml:space="preserve">Too many named subpatterns (maximum
- 10,000). Since 2.16</doc>
- </member>
- <member name="invalid_octal_value"
- value="151"
- c:identifier="G_REGEX_ERROR_INVALID_OCTAL_VALUE">
- <doc xml:space="preserve">Octal value is greater than "\\377".
- Since 2.16</doc>
- </member>
- <member name="too_many_branches_in_define"
- value="154"
- c:identifier="G_REGEX_ERROR_TOO_MANY_BRANCHES_IN_DEFINE">
- <doc xml:space="preserve">"DEFINE" group contains more
- than one branch. Since 2.16</doc>
- </member>
- <member name="define_repetion"
- value="155"
- c:identifier="G_REGEX_ERROR_DEFINE_REPETION">
- <doc xml:space="preserve">Repeating a "DEFINE" group is not allowed.
- This error is never raised. Since: 2.16 Deprecated: 2.34</doc>
- </member>
- <member name="inconsistent_newline_options"
- value="156"
- c:identifier="G_REGEX_ERROR_INCONSISTENT_NEWLINE_OPTIONS">
- <doc xml:space="preserve">Inconsistent newline options.
- Since 2.16</doc>
- </member>
- <member name="missing_back_reference"
- value="157"
- c:identifier="G_REGEX_ERROR_MISSING_BACK_REFERENCE">
- <doc xml:space="preserve">"\\g" is not followed by a braced,
- angle-bracketed, or quoted name or number, or by a plain number. Since: 2.16</doc>
- </member>
- <member name="invalid_relative_reference"
- value="158"
- c:identifier="G_REGEX_ERROR_INVALID_RELATIVE_REFERENCE">
- <doc xml:space="preserve">relative reference must not be zero. Since: 2.34</doc>
- </member>
- <member name="backtracking_control_verb_argument_forbidden"
- value="159"
- c:identifier="G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_FORBIDDEN">
- <doc xml:space="preserve">the backtracing
- control verb used does not allow an argument. Since: 2.34</doc>
- </member>
- <member name="unknown_backtracking_control_verb"
- value="160"
- c:identifier="G_REGEX_ERROR_UNKNOWN_BACKTRACKING_CONTROL_VERB">
- <doc xml:space="preserve">unknown backtracing
- control verb. Since: 2.34</doc>
- </member>
- <member name="number_too_big"
- value="161"
- c:identifier="G_REGEX_ERROR_NUMBER_TOO_BIG">
- <doc xml:space="preserve">number is too big in escape sequence. Since: 2.34</doc>
- </member>
- <member name="missing_subpattern_name"
- value="162"
- c:identifier="G_REGEX_ERROR_MISSING_SUBPATTERN_NAME">
- <doc xml:space="preserve">Missing subpattern name. Since: 2.34</doc>
- </member>
- <member name="missing_digit"
- value="163"
- c:identifier="G_REGEX_ERROR_MISSING_DIGIT">
- <doc xml:space="preserve">Missing digit. Since 2.34</doc>
- </member>
- <member name="invalid_data_character"
- value="164"
- c:identifier="G_REGEX_ERROR_INVALID_DATA_CHARACTER">
- <doc xml:space="preserve">In JavaScript compatibility mode,
- "[" is an invalid data character. Since: 2.34</doc>
- </member>
- <member name="extra_subpattern_name"
- value="165"
- c:identifier="G_REGEX_ERROR_EXTRA_SUBPATTERN_NAME">
- <doc xml:space="preserve">different names for subpatterns of the
- same number are not allowed. Since: 2.34</doc>
- </member>
- <member name="backtracking_control_verb_argument_required"
- value="166"
- c:identifier="G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_REQUIRED">
- <doc xml:space="preserve">the backtracing control
- verb requires an argument. Since: 2.34</doc>
- </member>
- <member name="invalid_control_char"
- value="168"
- c:identifier="G_REGEX_ERROR_INVALID_CONTROL_CHAR">
- <doc xml:space="preserve">"\\c" must be followed by an ASCII
- character. Since: 2.34</doc>
- </member>
- <member name="missing_name"
- value="169"
- c:identifier="G_REGEX_ERROR_MISSING_NAME">
- <doc xml:space="preserve">"\\k" is not followed by a braced, angle-bracketed, or
- quoted name. Since: 2.34</doc>
- </member>
- <member name="not_supported_in_class"
- value="171"
- c:identifier="G_REGEX_ERROR_NOT_SUPPORTED_IN_CLASS">
- <doc xml:space="preserve">"\\N" is not supported in a class. Since: 2.34</doc>
- </member>
- <member name="too_many_forward_references"
- value="172"
- c:identifier="G_REGEX_ERROR_TOO_MANY_FORWARD_REFERENCES">
- <doc xml:space="preserve">too many forward references. Since: 2.34</doc>
- </member>
- <member name="name_too_long"
- value="175"
- c:identifier="G_REGEX_ERROR_NAME_TOO_LONG">
- <doc xml:space="preserve">the name is too long in "(*MARK)", "(*PRUNE)",
- "(*SKIP)", or "(*THEN)". Since: 2.34</doc>
- </member>
- <member name="character_value_too_large"
- value="176"
- c:identifier="G_REGEX_ERROR_CHARACTER_VALUE_TOO_LARGE">
- <doc xml:space="preserve">the character value in the \\u sequence is
- too large. Since: 2.34</doc>
- </member>
- </enumeration>
- <callback name="RegexEvalCallback"
- c:type="GRegexEvalCallback"
- version="2.14">
- <doc xml:space="preserve">Specifies the type of the function passed to g_regex_replace_eval().
- It is called for each occurrence of the pattern in the string passed
- to g_regex_replace_eval(), and it should append the replacement to
- @result.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%FALSE to continue the replacement process, %TRUE to stop it</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="match_info" transfer-ownership="none">
- <doc xml:space="preserve">the #GMatchInfo generated by the match.
- Use g_match_info_get_regex() and g_match_info_get_string() if you
- need the #GRegex or the matched string.</doc>
- <type name="MatchInfo" c:type="const GMatchInfo*"/>
- </parameter>
- <parameter name="result" transfer-ownership="none">
- <doc xml:space="preserve">a #GString containing the new string</doc>
- <type name="String" c:type="GString*"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="2">
- <doc xml:space="preserve">user data passed to g_regex_replace_eval()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <bitfield name="RegexMatchFlags" version="2.14" c:type="GRegexMatchFlags">
- <doc xml:space="preserve">Flags specifying match-time options.</doc>
- <member name="anchored" value="16" c:identifier="G_REGEX_MATCH_ANCHORED">
- <doc xml:space="preserve">The pattern is forced to be "anchored", that is,
- it is constrained to match only at the first matching point in the
- string that is being searched. This effect can also be achieved by
- appropriate constructs in the pattern itself such as the "^"
- metacharater.</doc>
- </member>
- <member name="notbol" value="128" c:identifier="G_REGEX_MATCH_NOTBOL">
- <doc xml:space="preserve">Specifies that first character of the string is
- not the beginning of a line, so the circumflex metacharacter should
- not match before it. Setting this without #G_REGEX_MULTILINE (at
- compile time) causes circumflex never to match. This option affects
- only the behaviour of the circumflex metacharacter, it does not
- affect "\A".</doc>
- </member>
- <member name="noteol" value="256" c:identifier="G_REGEX_MATCH_NOTEOL">
- <doc xml:space="preserve">Specifies that the end of the subject string is
- not the end of a line, so the dollar metacharacter should not match
- it nor (except in multiline mode) a newline immediately before it.
- Setting this without #G_REGEX_MULTILINE (at compile time) causes
- dollar never to match. This option affects only the behaviour of
- the dollar metacharacter, it does not affect "\Z" or "\z".</doc>
- </member>
- <member name="notempty"
- value="1024"
- c:identifier="G_REGEX_MATCH_NOTEMPTY">
- <doc xml:space="preserve">An empty string is not considered to be a valid
- match if this option is set. If there are alternatives in the pattern,
- they are tried. If all the alternatives match the empty string, the
- entire match fails. For example, if the pattern "a?b?" is applied to
- a string not beginning with "a" or "b", it matches the empty string
- at the start of the string. With this flag set, this match is not
- valid, so GRegex searches further into the string for occurrences
- of "a" or "b".</doc>
- </member>
- <member name="partial"
- value="32768"
- c:identifier="G_REGEX_MATCH_PARTIAL">
- <doc xml:space="preserve">Turns on the partial matching feature, for more
- documentation on partial matching see g_match_info_is_partial_match().</doc>
- </member>
- <member name="newline_cr"
- value="1048576"
- c:identifier="G_REGEX_MATCH_NEWLINE_CR">
- <doc xml:space="preserve">Overrides the newline definition set when
- creating a new #GRegex, setting the '\r' character as line terminator.</doc>
- </member>
- <member name="newline_lf"
- value="2097152"
- c:identifier="G_REGEX_MATCH_NEWLINE_LF">
- <doc xml:space="preserve">Overrides the newline definition set when
- creating a new #GRegex, setting the '\n' character as line terminator.</doc>
- </member>
- <member name="newline_crlf"
- value="3145728"
- c:identifier="G_REGEX_MATCH_NEWLINE_CRLF">
- <doc xml:space="preserve">Overrides the newline definition set when
- creating a new #GRegex, setting the '\r\n' characters sequence as line terminator.</doc>
- </member>
- <member name="newline_any"
- value="4194304"
- c:identifier="G_REGEX_MATCH_NEWLINE_ANY">
- <doc xml:space="preserve">Overrides the newline definition set when
- creating a new #GRegex, any Unicode newline sequence
- is recognised as a newline. These are '\r', '\n' and '\rn', and the
- single characters U+000B LINE TABULATION, U+000C FORM FEED (FF),
- U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and
- U+2029 PARAGRAPH SEPARATOR.</doc>
- </member>
- <member name="newline_anycrlf"
- value="5242880"
- c:identifier="G_REGEX_MATCH_NEWLINE_ANYCRLF">
- <doc xml:space="preserve">Overrides the newline definition set when
- creating a new #GRegex; any '\r', '\n', or '\r\n' character sequence
- is recognized as a newline. Since: 2.34</doc>
- </member>
- <member name="bsr_anycrlf"
- value="8388608"
- c:identifier="G_REGEX_MATCH_BSR_ANYCRLF">
- <doc xml:space="preserve">Overrides the newline definition for "\R" set when
- creating a new #GRegex; only '\r', '\n', or '\r\n' character sequences
- are recognized as a newline by "\R". Since: 2.34</doc>
- </member>
- <member name="bsr_any"
- value="16777216"
- c:identifier="G_REGEX_MATCH_BSR_ANY">
- <doc xml:space="preserve">Overrides the newline definition for "\R" set when
- creating a new #GRegex; any Unicode newline character or character sequence
- are recognized as a newline by "\R". These are '\r', '\n' and '\rn', and the
- single characters U+000B LINE TABULATION, U+000C FORM FEED (FF),
- U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and
- U+2029 PARAGRAPH SEPARATOR. Since: 2.34</doc>
- </member>
- <member name="partial_soft"
- value="32768"
- c:identifier="G_REGEX_MATCH_PARTIAL_SOFT">
- <doc xml:space="preserve">An alias for #G_REGEX_MATCH_PARTIAL. Since: 2.34</doc>
- </member>
- <member name="partial_hard"
- value="134217728"
- c:identifier="G_REGEX_MATCH_PARTIAL_HARD">
- <doc xml:space="preserve">Turns on the partial matching feature. In contrast to
- to #G_REGEX_MATCH_PARTIAL_SOFT, this stops matching as soon as a partial match
- is found, without continuing to search for a possible complete match. See
- g_match_info_is_partial_match() for more information. Since: 2.34</doc>
- </member>
- <member name="notempty_atstart"
- value="268435456"
- c:identifier="G_REGEX_MATCH_NOTEMPTY_ATSTART">
- <doc xml:space="preserve">Like #G_REGEX_MATCH_NOTEMPTY, but only applied to
- the start of the matched string. For anchored
- patterns this can only happen for pattern containing "\K". Since: 2.34</doc>
- </member>
- </bitfield>
- <constant name="SEARCHPATH_SEPARATOR"
- value="59"
- c:type="G_SEARCHPATH_SEPARATOR">
- <doc xml:space="preserve">The search path separator character.
- This is ':' on UNIX machines and ';' under Windows.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="SEARCHPATH_SEPARATOR_S"
- value=";"
- c:type="G_SEARCHPATH_SEPARATOR_S">
- <doc xml:space="preserve">The search path separator as a string.
- This is ":" on UNIX machines and ";" under Windows.</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="SIZEOF_LONG" value="4" c:type="GLIB_SIZEOF_LONG">
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="SIZEOF_SIZE_T" value="4" c:type="GLIB_SIZEOF_SIZE_T">
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="SIZEOF_SSIZE_T" value="4" c:type="GLIB_SIZEOF_SSIZE_T">
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="SIZEOF_VOID_P" value="4" c:type="GLIB_SIZEOF_VOID_P">
- <type name="gint" c:type="gint"/>
- </constant>
- <record name="SList" c:type="GSList">
- <doc xml:space="preserve">The #GSList struct is used for each element in the singly-linked
- list.</doc>
- <field name="data" writable="1">
- <doc xml:space="preserve">holds the element's data, which can be a pointer to any kind
- of data, or any integer value using the
- [Type Conversion Macros][glib-Type-Conversion-Macros]</doc>
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="next" writable="1">
- <doc xml:space="preserve">contains the link to the next element in the list.</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </field>
- <function name="alloc" c:identifier="g_slist_alloc" introspectable="0">
- <doc xml:space="preserve">Allocates space for one #GSList element. It is called by the
- g_slist_append(), g_slist_prepend(), g_slist_insert() and
- g_slist_insert_sorted() functions and so is rarely used on its own.</doc>
- <return-value>
- <doc xml:space="preserve">a pointer to the newly-allocated #GSList element.</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- </function>
- <function name="append" c:identifier="g_slist_append" introspectable="0">
- <doc xml:space="preserve">Adds a new element on to the end of the list.
- The return value is the new start of the list, which may
- have changed, so make sure you store the new value.
- Note that g_slist_append() has to traverse the entire list
- to find the end, which is inefficient when adding multiple
- elements. A common idiom to avoid the inefficiency is to prepend
- the elements and reverse the list when all elements have been added.
- |[<!-- language="C" -->
- // Notice that these are initialized to the empty list.
- GSList *list = NULL, *number_list = NULL;
- // This is a list of strings.
- list = g_slist_append (list, "first");
- list = g_slist_append (list, "second");
- // This is a list of integers.
- number_list = g_slist_append (number_list, GINT_TO_POINTER (27));
- number_list = g_slist_append (number_list, GINT_TO_POINTER (14));
- ]|</doc>
- <return-value>
- <doc xml:space="preserve">the new start of the #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new element</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="concat" c:identifier="g_slist_concat" introspectable="0">
- <doc xml:space="preserve">Adds the second #GSList onto the end of the first #GSList.
- Note that the elements of the second #GSList are not copied.
- They are used directly.</doc>
- <return-value>
- <doc xml:space="preserve">the start of the new #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list1" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="list2" transfer-ownership="none">
- <doc xml:space="preserve">the #GSList to add to the end of the first #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="copy" c:identifier="g_slist_copy" introspectable="0">
- <doc xml:space="preserve">Copies a #GSList.
- Note that this is a "shallow" copy. If the list elements
- consist of pointers to data, the pointers are copied but
- the actual data isn't. See g_slist_copy_deep() if you need
- to copy the data as well.</doc>
- <return-value>
- <doc xml:space="preserve">a copy of @list</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="copy_deep"
- c:identifier="g_slist_copy_deep"
- version="2.34"
- introspectable="0">
- <doc xml:space="preserve">Makes a full (deep) copy of a #GSList.
- In contrast with g_slist_copy(), this function uses @func to make a copy of
- each list element, in addition to copying the list container itself.
- @func, as a #GCopyFunc, takes two arguments, the data to be copied and a user
- pointer. It's safe to pass #NULL as user_data, if the copy function takes only
- one argument.
- For instance, if @list holds a list of GObjects, you can do:
- |[<!-- language="C" -->
- another_list = g_slist_copy_deep (list, (GCopyFunc) g_object_ref, NULL);
- ]|
- And, to entirely free the new list, you could do:
- |[<!-- language="C" -->
- g_slist_free_full (another_list, g_object_unref);
- ]|</doc>
- <return-value>
- <doc xml:space="preserve">a full copy of @list, use #g_slist_free_full to free it</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">a copy function used to copy every element in the list</doc>
- <type name="CopyFunc" c:type="GCopyFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to the copy function @func, or #NULL</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="delete_link"
- c:identifier="g_slist_delete_link"
- introspectable="0">
- <doc xml:space="preserve">Removes the node link_ from the list and frees it.
- Compare this to g_slist_remove_link() which removes the node
- without freeing it.
- Removing arbitrary nodes from a singly-linked list requires time
- that is proportional to the length of the list (ie. O(n)). If you
- find yourself using g_slist_delete_link() frequently, you should
- consider a different data structure, such as the doubly-linked
- #GList.</doc>
- <return-value>
- <doc xml:space="preserve">the new head of @list</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="link_" transfer-ownership="none">
- <doc xml:space="preserve">node to delete</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="find" c:identifier="g_slist_find" introspectable="0">
- <doc xml:space="preserve">Finds the element in a #GSList which
- contains the given data.</doc>
- <return-value>
- <doc xml:space="preserve">the found #GSList element,
- or %NULL if it is not found</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the element data to find</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="find_custom"
- c:identifier="g_slist_find_custom"
- introspectable="0">
- <doc xml:space="preserve">Finds an element in a #GSList, using a supplied function to
- find the desired element. It iterates over the list, calling
- the given function which should return 0 when the desired
- element is found. The function takes two #gconstpointer arguments,
- the #GSList element's data as the first argument and the
- given user data.</doc>
- <return-value>
- <doc xml:space="preserve">the found #GSList element, or %NULL if it is not found</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to the function</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <doc xml:space="preserve">the function to call for each element.
- It should return 0 when the desired element is found</doc>
- <type name="CompareFunc" c:type="GCompareFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="foreach"
- c:identifier="g_slist_foreach"
- introspectable="0">
- <doc xml:space="preserve">Calls a function for each element of a #GSList.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function to call with each element's data</doc>
- <type name="Func" c:type="GFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="free" c:identifier="g_slist_free" introspectable="0">
- <doc xml:space="preserve">Frees all of the memory used by a #GSList.
- The freed elements are returned to the slice allocator.
- If list elements contain dynamically-allocated memory,
- you should either use g_slist_free_full() or free them manually
- first.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="free_1" c:identifier="g_slist_free_1" introspectable="0">
- <doc xml:space="preserve">Frees one #GSList element.
- It is usually used after g_slist_remove_link().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList element</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="free_full"
- c:identifier="g_slist_free_full"
- version="2.28"
- introspectable="0">
- <doc xml:space="preserve">Convenience method, which frees all the memory used by a #GSList, and
- calls the specified destroy function on every element's data.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="free_func" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">the function to be called to free each element's data</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="index" c:identifier="g_slist_index" introspectable="0">
- <doc xml:space="preserve">Gets the position of the element containing
- the given data (starting from 0).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the index of the element containing the data,
- or -1 if the data is not found</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to find</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="insert" c:identifier="g_slist_insert" introspectable="0">
- <doc xml:space="preserve">Inserts a new element into the list at the given position.</doc>
- <return-value>
- <doc xml:space="preserve">the new start of the #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new element</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="position" transfer-ownership="none">
- <doc xml:space="preserve">the position to insert the element.
- If this is negative, or is larger than the number
- of elements in the list, the new element is added on
- to the end of the list.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="insert_before"
- c:identifier="g_slist_insert_before"
- introspectable="0">
- <doc xml:space="preserve">Inserts a node before @sibling containing @data.</doc>
- <return-value>
- <doc xml:space="preserve">the new head of the list.</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="slist" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="sibling" transfer-ownership="none">
- <doc xml:space="preserve">node to insert @data before</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to put in the newly-inserted node</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="insert_sorted"
- c:identifier="g_slist_insert_sorted"
- introspectable="0">
- <doc xml:space="preserve">Inserts a new element into the list, using the given
- comparison function to determine its position.</doc>
- <return-value>
- <doc xml:space="preserve">the new start of the #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new element</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <doc xml:space="preserve">the function to compare elements in the list.
- It should return a number > 0 if the first parameter
- comes after the second parameter in the sort order.</doc>
- <type name="CompareFunc" c:type="GCompareFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="insert_sorted_with_data"
- c:identifier="g_slist_insert_sorted_with_data"
- version="2.10"
- introspectable="0">
- <doc xml:space="preserve">Inserts a new element into the list, using the given
- comparison function to determine its position.</doc>
- <return-value>
- <doc xml:space="preserve">the new start of the #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new element</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="3">
- <doc xml:space="preserve">the function to compare elements in the list.
- It should return a number > 0 if the first parameter
- comes after the second parameter in the sort order.</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to comparison function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="last" c:identifier="g_slist_last" introspectable="0">
- <doc xml:space="preserve">Gets the last element in a #GSList.
- This function iterates over the whole list.</doc>
- <return-value>
- <doc xml:space="preserve">the last element in the #GSList,
- or %NULL if the #GSList has no elements</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="length" c:identifier="g_slist_length" introspectable="0">
- <doc xml:space="preserve">Gets the number of elements in a #GSList.
- This function iterates over the whole list to
- count its elements. To check whether the list is non-empty, it is faster to
- check @list against %NULL.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of elements in the #GSList</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="nth" c:identifier="g_slist_nth" introspectable="0">
- <doc xml:space="preserve">Gets the element at the given position in a #GSList.</doc>
- <return-value>
- <doc xml:space="preserve">the element, or %NULL if the position is off
- the end of the #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the position of the element, counting from 0</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="nth_data"
- c:identifier="g_slist_nth_data"
- introspectable="0">
- <doc xml:space="preserve">Gets the data of the element at the given position.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the element's data, or %NULL if the position
- is off the end of the #GSList</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the position of the element</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="position"
- c:identifier="g_slist_position"
- introspectable="0">
- <doc xml:space="preserve">Gets the position of the given element
- in the #GSList (starting from 0).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the position of the element in the #GSList,
- or -1 if the element is not found</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="llink" transfer-ownership="none">
- <doc xml:space="preserve">an element in the #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="prepend"
- c:identifier="g_slist_prepend"
- introspectable="0">
- <doc xml:space="preserve">Adds a new element on to the start of the list.
- The return value is the new start of the list, which
- may have changed, so make sure you store the new value.
- |[<!-- language="C" -->
- // Notice that it is initialized to the empty list.
- GSList *list = NULL;
- list = g_slist_prepend (list, "last");
- list = g_slist_prepend (list, "first");
- ]|</doc>
- <return-value>
- <doc xml:space="preserve">the new start of the #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new element</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove" c:identifier="g_slist_remove" introspectable="0">
- <doc xml:space="preserve">Removes an element from a #GSList.
- If two elements contain the same data, only the first is removed.
- If none of the elements contain the data, the #GSList is unchanged.</doc>
- <return-value>
- <doc xml:space="preserve">the new start of the #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data of the element to remove</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_all"
- c:identifier="g_slist_remove_all"
- introspectable="0">
- <doc xml:space="preserve">Removes all list nodes with data equal to @data.
- Returns the new head of the list. Contrast with
- g_slist_remove() which removes only the first node
- matching the given data.</doc>
- <return-value>
- <doc xml:space="preserve">new head of @list</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to remove</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_link"
- c:identifier="g_slist_remove_link"
- introspectable="0">
- <doc xml:space="preserve">Removes an element from a #GSList, without
- freeing the element. The removed element's next
- link is set to %NULL, so that it becomes a
- self-contained list with one element.
- Removing arbitrary nodes from a singly-linked list
- requires time that is proportional to the length of the list
- (ie. O(n)). If you find yourself using g_slist_remove_link()
- frequently, you should consider a different data structure,
- such as the doubly-linked #GList.</doc>
- <return-value>
- <doc xml:space="preserve">the new start of the #GSList, without the element</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="link_" transfer-ownership="none">
- <doc xml:space="preserve">an element in the #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="reverse"
- c:identifier="g_slist_reverse"
- introspectable="0">
- <doc xml:space="preserve">Reverses a #GSList.</doc>
- <return-value>
- <doc xml:space="preserve">the start of the reversed #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="sort" c:identifier="g_slist_sort" introspectable="0">
- <doc xml:space="preserve">Sorts a #GSList using the given comparison function.</doc>
- <return-value>
- <doc xml:space="preserve">the start of the sorted #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="compare_func" transfer-ownership="none">
- <doc xml:space="preserve">the comparison function used to sort the #GSList.
- This function is passed the data from 2 elements of the #GSList
- and should return 0 if they are equal, a negative value if the
- first element comes before the second, or a positive value if
- the first element comes after the second.</doc>
- <type name="CompareFunc" c:type="GCompareFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="sort_with_data"
- c:identifier="g_slist_sort_with_data"
- introspectable="0">
- <doc xml:space="preserve">Like g_slist_sort(), but the sort function accepts a user data argument.</doc>
- <return-value>
- <doc xml:space="preserve">new head of the list</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </return-value>
- <parameters>
- <parameter name="list" transfer-ownership="none">
- <doc xml:space="preserve">a #GSList</doc>
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="compare_func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">comparison function</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to comparison function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <constant name="SOURCE_CONTINUE"
- value="true"
- c:type="G_SOURCE_CONTINUE"
- version="2.32">
- <doc xml:space="preserve">Use this macro as the return value of a #GSourceFunc to leave
- the #GSource in the main loop.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </constant>
- <constant name="SOURCE_REMOVE"
- value="false"
- c:type="G_SOURCE_REMOVE"
- version="2.32">
- <doc xml:space="preserve">Use this macro as the return value of a #GSourceFunc to remove
- the #GSource from the main loop.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </constant>
- <constant name="SQRT2" value="1.414214" c:type="G_SQRT2">
- <doc xml:space="preserve">The square root of two.</doc>
- <type name="gdouble" c:type="gdouble"/>
- </constant>
- <constant name="STR_DELIMITERS"
- value="_-|> <."
- c:type="G_STR_DELIMITERS">
- <doc xml:space="preserve">The standard delimiters, used in g_strdelimit().</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="SYSDEF_AF_INET" value="2" c:type="GLIB_SYSDEF_AF_INET">
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="SYSDEF_AF_INET6" value="10" c:type="GLIB_SYSDEF_AF_INET6">
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="SYSDEF_AF_UNIX" value="1" c:type="GLIB_SYSDEF_AF_UNIX">
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="SYSDEF_MSG_DONTROUTE"
- value="4"
- c:type="GLIB_SYSDEF_MSG_DONTROUTE">
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="SYSDEF_MSG_OOB" value="1" c:type="GLIB_SYSDEF_MSG_OOB">
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="SYSDEF_MSG_PEEK" value="2" c:type="GLIB_SYSDEF_MSG_PEEK">
- <type name="gint" c:type="gint"/>
- </constant>
- <record name="Scanner" c:type="GScanner">
- <doc xml:space="preserve">The data structure representing a lexical scanner.
- You should set @input_name after creating the scanner, since
- it is used by the default message handler when displaying
- warnings and errors. If you are scanning a file, the filename
- would be a good choice.
- The @user_data and @max_parse_errors fields are not used.
- If you need to associate extra data with the scanner you
- can place them here.
- If you want to use your own message handler you can set the
- @msg_handler field. The type of the message handler function
- is declared by #GScannerMsgFunc.</doc>
- <field name="user_data" writable="1">
- <doc xml:space="preserve">unused</doc>
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="max_parse_errors" writable="1">
- <doc xml:space="preserve">unused</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="parse_errors" writable="1">
- <doc xml:space="preserve">g_scanner_error() increments this field</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="input_name" writable="1">
- <doc xml:space="preserve">name of input stream, featured by the default message handler</doc>
- <type name="utf8" c:type="const gchar*"/>
- </field>
- <field name="qdata" writable="1">
- <doc xml:space="preserve">quarked data</doc>
- <type name="Data" c:type="GData*"/>
- </field>
- <field name="config" writable="1">
- <doc xml:space="preserve">link into the scanner configuration</doc>
- <type name="ScannerConfig" c:type="GScannerConfig*"/>
- </field>
- <field name="token" writable="1">
- <doc xml:space="preserve">token parsed by the last g_scanner_get_next_token()</doc>
- <type name="TokenType" c:type="GTokenType"/>
- </field>
- <field name="value" writable="1">
- <doc xml:space="preserve">value of the last token from g_scanner_get_next_token()</doc>
- <type name="TokenValue" c:type="GTokenValue"/>
- </field>
- <field name="line" writable="1">
- <doc xml:space="preserve">line number of the last token from g_scanner_get_next_token()</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="position" writable="1">
- <doc xml:space="preserve">char number of the last token from g_scanner_get_next_token()</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="next_token" writable="1">
- <doc xml:space="preserve">token parsed by the last g_scanner_peek_next_token()</doc>
- <type name="TokenType" c:type="GTokenType"/>
- </field>
- <field name="next_value" writable="1">
- <doc xml:space="preserve">value of the last token from g_scanner_peek_next_token()</doc>
- <type name="TokenValue" c:type="GTokenValue"/>
- </field>
- <field name="next_line" writable="1">
- <doc xml:space="preserve">line number of the last token from g_scanner_peek_next_token()</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="next_position" writable="1">
- <doc xml:space="preserve">char number of the last token from g_scanner_peek_next_token()</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="symbol_table" readable="0" private="1">
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </field>
- <field name="input_fd" readable="0" private="1">
- <type name="gint" c:type="gint"/>
- </field>
- <field name="text" readable="0" private="1">
- <type name="utf8" c:type="const gchar*"/>
- </field>
- <field name="text_end" readable="0" private="1">
- <type name="utf8" c:type="const gchar*"/>
- </field>
- <field name="buffer" readable="0" private="1">
- <type name="utf8" c:type="gchar*"/>
- </field>
- <field name="scope_id" readable="0" private="1">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="msg_handler" writable="1">
- <doc xml:space="preserve">handler function for _warn and _error</doc>
- <type name="ScannerMsgFunc" c:type="GScannerMsgFunc"/>
- </field>
- <method name="cur_line" c:identifier="g_scanner_cur_line">
- <doc xml:space="preserve">Returns the current line in the input stream (counting
- from 1). This is the line of the last token parsed via
- g_scanner_get_next_token().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the current line</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="cur_position" c:identifier="g_scanner_cur_position">
- <doc xml:space="preserve">Returns the current position in the current line (counting
- from 0). This is the position of the last token parsed via
- g_scanner_get_next_token().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the current position on the line</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="cur_token" c:identifier="g_scanner_cur_token">
- <doc xml:space="preserve">Gets the current token type. This is simply the @token
- field in the #GScanner structure.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the current token type</doc>
- <type name="TokenType" c:type="GTokenType"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="cur_value"
- c:identifier="g_scanner_cur_value"
- introspectable="0">
- <doc xml:space="preserve">Gets the current token value. This is simply the @value
- field in the #GScanner structure.</doc>
- <return-value>
- <doc xml:space="preserve">the current token value</doc>
- <type name="TokenValue" c:type="GTokenValue"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="destroy" c:identifier="g_scanner_destroy">
- <doc xml:space="preserve">Frees all memory used by the #GScanner.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="eof" c:identifier="g_scanner_eof">
- <doc xml:space="preserve">Returns %TRUE if the scanner has reached the end of
- the file or text buffer.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the scanner has reached the end of
- the file or text buffer</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="error" c:identifier="g_scanner_error" introspectable="0">
- <doc xml:space="preserve">Outputs an error message, via the #GScanner message handler.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">the message format. See the printf() documentation</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the parameters to insert into the format string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </method>
- <method name="get_next_token" c:identifier="g_scanner_get_next_token">
- <doc xml:space="preserve">Parses the next token just like g_scanner_peek_next_token()
- and also removes it from the input stream. The token data is
- placed in the @token, @value, @line, and @position fields of
- the #GScanner structure.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the type of the token</doc>
- <type name="TokenType" c:type="GTokenType"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="input_file" c:identifier="g_scanner_input_file">
- <doc xml:space="preserve">Prepares to scan a file.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- <parameter name="input_fd" transfer-ownership="none">
- <doc xml:space="preserve">a file descriptor</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="input_text" c:identifier="g_scanner_input_text">
- <doc xml:space="preserve">Prepares to scan a text buffer.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- <parameter name="text" transfer-ownership="none">
- <doc xml:space="preserve">the text buffer to scan</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="text_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of the text buffer</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="lookup_symbol" c:identifier="g_scanner_lookup_symbol">
- <doc xml:space="preserve">Looks up a symbol in the current scope and return its value.
- If the symbol is not bound in the current scope, %NULL is
- returned.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the value of @symbol in the current scope, or %NULL
- if @symbol is not bound in the current scope</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- <parameter name="symbol" transfer-ownership="none">
- <doc xml:space="preserve">the symbol to look up</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="peek_next_token" c:identifier="g_scanner_peek_next_token">
- <doc xml:space="preserve">Parses the next token, without removing it from the input stream.
- The token data is placed in the @next_token, @next_value, @next_line,
- and @next_position fields of the #GScanner structure.
- Note that, while the token is not removed from the input stream
- (i.e. the next call to g_scanner_get_next_token() will return the
- same token), it will not be reevaluated. This can lead to surprising
- results when changing scope or the scanner configuration after peeking
- the next token. Getting the next token after switching the scope or
- configuration will return whatever was peeked before, regardless of
- any symbols that may have been added or removed in the new scope.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the type of the token</doc>
- <type name="TokenType" c:type="GTokenType"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="scope_add_symbol"
- c:identifier="g_scanner_scope_add_symbol">
- <doc xml:space="preserve">Adds a symbol to the given scope.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- <parameter name="scope_id" transfer-ownership="none">
- <doc xml:space="preserve">the scope id</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="symbol" transfer-ownership="none">
- <doc xml:space="preserve">the symbol to add</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="value"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the value of the symbol</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="scope_foreach_symbol"
- c:identifier="g_scanner_scope_foreach_symbol"
- introspectable="0">
- <doc xml:space="preserve">Calls the given function for each of the symbol/value pairs
- in the given scope of the #GScanner. The function is passed
- the symbol and value of each pair, and the given @user_data
- parameter.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- <parameter name="scope_id" transfer-ownership="none">
- <doc xml:space="preserve">the scope id</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function to call for each symbol/value pair</doc>
- <type name="HFunc" c:type="GHFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="scope_lookup_symbol"
- c:identifier="g_scanner_scope_lookup_symbol">
- <doc xml:space="preserve">Looks up a symbol in a scope and return its value. If the
- symbol is not bound in the scope, %NULL is returned.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the value of @symbol in the given scope, or %NULL
- if @symbol is not bound in the given scope.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- <parameter name="scope_id" transfer-ownership="none">
- <doc xml:space="preserve">the scope id</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="symbol" transfer-ownership="none">
- <doc xml:space="preserve">the symbol to look up</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="scope_remove_symbol"
- c:identifier="g_scanner_scope_remove_symbol">
- <doc xml:space="preserve">Removes a symbol from a scope.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- <parameter name="scope_id" transfer-ownership="none">
- <doc xml:space="preserve">the scope id</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="symbol" transfer-ownership="none">
- <doc xml:space="preserve">the symbol to remove</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_scope" c:identifier="g_scanner_set_scope">
- <doc xml:space="preserve">Sets the current scope.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the old scope id</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- <parameter name="scope_id" transfer-ownership="none">
- <doc xml:space="preserve">the new scope id</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </method>
- <method name="sync_file_offset"
- c:identifier="g_scanner_sync_file_offset">
- <doc xml:space="preserve">Rewinds the filedescriptor to the current buffer position
- and blows the file read ahead buffer. This is useful for
- third party uses of the scanners filedescriptor, which hooks
- onto the current scanning position.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unexp_token" c:identifier="g_scanner_unexp_token">
- <doc xml:space="preserve">Outputs a message through the scanner's msg_handler,
- resulting from an unexpected token in the input stream.
- Note that you should not call g_scanner_peek_next_token()
- followed by g_scanner_unexp_token() without an intermediate
- call to g_scanner_get_next_token(), as g_scanner_unexp_token()
- evaluates the scanner's current token (not the peeked token)
- to construct part of the message.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- <parameter name="expected_token" transfer-ownership="none">
- <doc xml:space="preserve">the expected token</doc>
- <type name="TokenType" c:type="GTokenType"/>
- </parameter>
- <parameter name="identifier_spec" transfer-ownership="none">
- <doc xml:space="preserve">a string describing how the scanner's user
- refers to identifiers (%NULL defaults to "identifier").
- This is used if @expected_token is %G_TOKEN_IDENTIFIER or
- %G_TOKEN_IDENTIFIER_NULL.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="symbol_spec" transfer-ownership="none">
- <doc xml:space="preserve">a string describing how the scanner's user refers
- to symbols (%NULL defaults to "symbol"). This is used if
- @expected_token is %G_TOKEN_SYMBOL or any token value greater
- than %G_TOKEN_LAST.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="symbol_name" transfer-ownership="none">
- <doc xml:space="preserve">the name of the symbol, if the scanner's current
- token is a symbol.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="message" transfer-ownership="none">
- <doc xml:space="preserve">a message string to output at the end of the
- warning/error, or %NULL.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="is_error" transfer-ownership="none">
- <doc xml:space="preserve">if %TRUE it is output as an error. If %FALSE it is
- output as a warning.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="warn" c:identifier="g_scanner_warn" introspectable="0">
- <doc xml:space="preserve">Outputs a warning message, via the #GScanner message handler.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </instance-parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">the message format. See the printf() documentation</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the parameters to insert into the format string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </method>
- <function name="new" c:identifier="g_scanner_new" introspectable="0">
- <doc xml:space="preserve">Creates a new #GScanner.
- The @config_templ structure specifies the initial settings
- of the scanner, which are copied into the #GScanner
- @config field. If you pass %NULL then the default settings
- are used.</doc>
- <return-value>
- <doc xml:space="preserve">the new #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </return-value>
- <parameters>
- <parameter name="config_templ" transfer-ownership="none">
- <doc xml:space="preserve">the initial scanner settings</doc>
- <type name="ScannerConfig" c:type="const GScannerConfig*"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <record name="ScannerConfig" c:type="GScannerConfig">
- <doc xml:space="preserve">Specifies the #GScanner parser configuration. Most settings can
- be changed during the parsing phase and will affect the lexical
- parsing of the next unpeeked token.</doc>
- <field name="cset_skip_characters" writable="1">
- <doc xml:space="preserve">specifies which characters should be skipped
- by the scanner (the default is the whitespace characters: space,
- tab, carriage-return and line-feed).</doc>
- <type name="utf8" c:type="gchar*"/>
- </field>
- <field name="cset_identifier_first" writable="1">
- <doc xml:space="preserve">specifies the characters which can start
- identifiers (the default is #G_CSET_a_2_z, "_", and #G_CSET_A_2_Z).</doc>
- <type name="utf8" c:type="gchar*"/>
- </field>
- <field name="cset_identifier_nth" writable="1">
- <doc xml:space="preserve">specifies the characters which can be used
- in identifiers, after the first character (the default is
- #G_CSET_a_2_z, "_0123456789", #G_CSET_A_2_Z, #G_CSET_LATINS,
- #G_CSET_LATINC).</doc>
- <type name="utf8" c:type="gchar*"/>
- </field>
- <field name="cpair_comment_single" writable="1">
- <doc xml:space="preserve">specifies the characters at the start and
- end of single-line comments. The default is "#\n" which means
- that single-line comments start with a '#' and continue until
- a '\n' (end of line).</doc>
- <type name="utf8" c:type="gchar*"/>
- </field>
- <field name="case_sensitive" writable="1" bits="1">
- <doc xml:space="preserve">specifies if symbols are case sensitive (the
- default is %FALSE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="skip_comment_multi" writable="1" bits="1">
- <doc xml:space="preserve">specifies if multi-line comments are skipped
- and not returned as tokens (the default is %TRUE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="skip_comment_single" writable="1" bits="1">
- <doc xml:space="preserve">specifies if single-line comments are skipped
- and not returned as tokens (the default is %TRUE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="scan_comment_multi" writable="1" bits="1">
- <doc xml:space="preserve">specifies if multi-line comments are recognized
- (the default is %TRUE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="scan_identifier" writable="1" bits="1">
- <doc xml:space="preserve">specifies if identifiers are recognized (the
- default is %TRUE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="scan_identifier_1char" writable="1" bits="1">
- <doc xml:space="preserve">specifies if single-character
- identifiers are recognized (the default is %FALSE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="scan_identifier_NULL" writable="1" bits="1">
- <doc xml:space="preserve">specifies if %NULL is reported as
- %G_TOKEN_IDENTIFIER_NULL (the default is %FALSE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="scan_symbols" writable="1" bits="1">
- <doc xml:space="preserve">specifies if symbols are recognized (the default
- is %TRUE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="scan_binary" writable="1" bits="1">
- <doc xml:space="preserve">specifies if binary numbers are recognized (the
- default is %FALSE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="scan_octal" writable="1" bits="1">
- <doc xml:space="preserve">specifies if octal numbers are recognized (the
- default is %TRUE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="scan_float" writable="1" bits="1">
- <doc xml:space="preserve">specifies if floating point numbers are recognized
- (the default is %TRUE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="scan_hex" writable="1" bits="1">
- <doc xml:space="preserve">specifies if hexadecimal numbers are recognized (the
- default is %TRUE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="scan_hex_dollar" writable="1" bits="1">
- <doc xml:space="preserve">specifies if '$' is recognized as a prefix for
- hexadecimal numbers (the default is %FALSE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="scan_string_sq" writable="1" bits="1">
- <doc xml:space="preserve">specifies if strings can be enclosed in single
- quotes (the default is %TRUE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="scan_string_dq" writable="1" bits="1">
- <doc xml:space="preserve">specifies if strings can be enclosed in double
- quotes (the default is %TRUE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="numbers_2_int" writable="1" bits="1">
- <doc xml:space="preserve">specifies if binary, octal and hexadecimal numbers
- are reported as #G_TOKEN_INT (the default is %TRUE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="int_2_float" writable="1" bits="1">
- <doc xml:space="preserve">specifies if all numbers are reported as %G_TOKEN_FLOAT
- (the default is %FALSE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="identifier_2_string" writable="1" bits="1">
- <doc xml:space="preserve">specifies if identifiers are reported as strings
- (the default is %FALSE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="char_2_token" writable="1" bits="1">
- <doc xml:space="preserve">specifies if characters are reported by setting
- `token = ch` or as %G_TOKEN_CHAR (the default is %TRUE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="symbol_2_token" writable="1" bits="1">
- <doc xml:space="preserve">specifies if symbols are reported by setting
- `token = v_symbol` or as %G_TOKEN_SYMBOL (the default is %FALSE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="scope_0_fallback" writable="1" bits="1">
- <doc xml:space="preserve">specifies if a symbol is searched for in the
- default scope in addition to the current scope (the default is %FALSE).</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="store_int64" writable="1" bits="1">
- <doc xml:space="preserve">use value.v_int64 rather than v_int</doc>
- <type name="guint" c:type="guint"/>
- </field>
- <field name="padding_dummy" readable="0" private="1">
- <type name="guint" c:type="guint"/>
- </field>
- </record>
- <callback name="ScannerMsgFunc" c:type="GScannerMsgFunc">
- <doc xml:space="preserve">Specifies the type of the message handler function.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="scanner" transfer-ownership="none">
- <doc xml:space="preserve">a #GScanner</doc>
- <type name="Scanner" c:type="GScanner*"/>
- </parameter>
- <parameter name="message" transfer-ownership="none">
- <doc xml:space="preserve">the message</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="error" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the message signals an error,
- %FALSE if it signals a warning.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </callback>
- <enumeration name="SeekType" c:type="GSeekType">
- <doc xml:space="preserve">An enumeration specifying the base position for a
- g_io_channel_seek_position() operation.</doc>
- <member name="cur" value="0" c:identifier="G_SEEK_CUR">
- <doc xml:space="preserve">the current position in the file.</doc>
- </member>
- <member name="set" value="1" c:identifier="G_SEEK_SET">
- <doc xml:space="preserve">the start of the file.</doc>
- </member>
- <member name="end" value="2" c:identifier="G_SEEK_END">
- <doc xml:space="preserve">the end of the file.</doc>
- </member>
- </enumeration>
- <record name="Sequence" c:type="GSequence" disguised="1">
- <doc xml:space="preserve">The #GSequence struct is an opaque data type representing a
- [sequence][glib-Sequences] data type.</doc>
- <method name="append"
- c:identifier="g_sequence_append"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Adds a new item to the end of @seq.</doc>
- <return-value>
- <doc xml:space="preserve">an iterator pointing to the new item</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new item</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="foreach"
- c:identifier="g_sequence_foreach"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Calls @func for each item in the sequence passing @user_data
- to the function.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- <parameter name="func" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">the function to call for each item in @seq</doc>
- <type name="Func" c:type="GFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_sequence_free" version="2.14">
- <doc xml:space="preserve">Frees the memory allocated for @seq. If @seq has a data destroy
- function associated with it, that function is called on all items
- in @seq.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_begin_iter"
- c:identifier="g_sequence_get_begin_iter"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Returns the begin iterator for @seq.</doc>
- <return-value>
- <doc xml:space="preserve">the begin iterator for @seq.</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_end_iter"
- c:identifier="g_sequence_get_end_iter"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Returns the end iterator for @seg</doc>
- <return-value>
- <doc xml:space="preserve">the end iterator for @seq</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_iter_at_pos"
- c:identifier="g_sequence_get_iter_at_pos"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Returns the iterator at position @pos. If @pos is negative or larger
- than the number of items in @seq, the end iterator is returned.</doc>
- <return-value>
- <doc xml:space="preserve">The #GSequenceIter at position @pos</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- <parameter name="pos" transfer-ownership="none">
- <doc xml:space="preserve">a position in @seq, or -1 for the end</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_length"
- c:identifier="g_sequence_get_length"
- version="2.14">
- <doc xml:space="preserve">Returns the length of @seq. Note that this method is O(h) where `h' is the
- height of the tree. It is thus more efficient to use g_sequence_is_empty()
- when comparing the length to zero.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the length of @seq</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="insert_sorted"
- c:identifier="g_sequence_insert_sorted"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Inserts @data into @sequence using @func to determine the new
- position. The sequence must already be sorted according to @cmp_func;
- otherwise the new position of @data is undefined.
- @cmp_func is called with two items of the @seq and @user_data.
- It should return 0 if the items are equal, a negative value
- if the first item comes before the second, and a positive value
- if the second item comes before the first.</doc>
- <return-value>
- <doc xml:space="preserve">a #GSequenceIter pointing to the new item.</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to insert</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="cmp_func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function used to compare items in the sequence</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="cmp_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @cmp_func.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="insert_sorted_iter"
- c:identifier="g_sequence_insert_sorted_iter"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Like g_sequence_insert_sorted(), but uses
- a #GSequenceIterCompareFunc instead of a #GCompareDataFunc as
- the compare function.
- @iter_cmp is called with two iterators pointing into @seq.
- It should return 0 if the iterators are equal, a negative
- value if the first iterator comes before the second, and a
- positive value if the second iterator comes before the first.
- It is called with two iterators pointing into @seq. It should
- return 0 if the iterators are equal, a negative value if the
- first iterator comes before the second, and a positive value
- if the second iterator comes before the first.</doc>
- <return-value>
- <doc xml:space="preserve">a #GSequenceIter pointing to the new item</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data for the new item</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="iter_cmp" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function used to compare iterators in the sequence</doc>
- <type name="SequenceIterCompareFunc"
- c:type="GSequenceIterCompareFunc"/>
- </parameter>
- <parameter name="cmp_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @cmp_func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="is_empty"
- c:identifier="g_sequence_is_empty"
- version="2.48">
- <doc xml:space="preserve">Returns %TRUE if the sequence contains zero items.
- This function is functionally identical to checking the result of
- g_sequence_get_length() being equal to zero. However this function is
- implemented in O(1) running time.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the sequence is empty, otherwise %FALSE.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="lookup"
- c:identifier="g_sequence_lookup"
- version="2.28"
- introspectable="0">
- <doc xml:space="preserve">Returns an iterator pointing to the position of the first item found
- equal to @data according to @cmp_func and @cmp_data. If more than one
- item is equal, it is not guaranteed that it is the first which is
- returned. In that case, you can use g_sequence_iter_next() and
- g_sequence_iter_prev() to get others.
- @cmp_func is called with two items of the @seq and @user_data.
- It should return 0 if the items are equal, a negative value if
- the first item comes before the second, and a positive value if
- the second item comes before the first.
- This function will fail if the data contained in the sequence is
- unsorted. Use g_sequence_insert_sorted() or
- g_sequence_insert_sorted_iter() to add data to your sequence or, if
- you want to add a large amount of data, call g_sequence_sort() after
- doing unsorted insertions.</doc>
- <return-value>
- <doc xml:space="preserve">an #GSequenceIter pointing to the position of the
- first item found equal to @data according to @cmp_func and
- @cmp_data, or %NULL if no such item exists</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to lookup</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="cmp_func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function used to compare items in the sequence</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="cmp_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @cmp_func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="lookup_iter"
- c:identifier="g_sequence_lookup_iter"
- version="2.28"
- introspectable="0">
- <doc xml:space="preserve">Like g_sequence_lookup(), but uses a #GSequenceIterCompareFunc
- instead of a #GCompareDataFunc as the compare function.
- @iter_cmp is called with two iterators pointing into @seq.
- It should return 0 if the iterators are equal, a negative value
- if the first iterator comes before the second, and a positive
- value if the second iterator comes before the first.
- This function will fail if the data contained in the sequence is
- unsorted. Use g_sequence_insert_sorted() or
- g_sequence_insert_sorted_iter() to add data to your sequence or, if
- you want to add a large amount of data, call g_sequence_sort() after
- doing unsorted insertions.</doc>
- <return-value>
- <doc xml:space="preserve">an #GSequenceIter pointing to the position of
- the first item found equal to @data according to @cmp_func
- and @cmp_data, or %NULL if no such item exists</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to lookup</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="iter_cmp" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function used to compare iterators in the sequence</doc>
- <type name="SequenceIterCompareFunc"
- c:type="GSequenceIterCompareFunc"/>
- </parameter>
- <parameter name="cmp_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @iter_cmp</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="prepend"
- c:identifier="g_sequence_prepend"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Adds a new item to the front of @seq</doc>
- <return-value>
- <doc xml:space="preserve">an iterator pointing to the new item</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new item</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="search"
- c:identifier="g_sequence_search"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Returns an iterator pointing to the position where @data would
- be inserted according to @cmp_func and @cmp_data.
- @cmp_func is called with two items of the @seq and @user_data.
- It should return 0 if the items are equal, a negative value if
- the first item comes before the second, and a positive value if
- the second item comes before the first.
- If you are simply searching for an existing element of the sequence,
- consider using g_sequence_lookup().
- This function will fail if the data contained in the sequence is
- unsorted. Use g_sequence_insert_sorted() or
- g_sequence_insert_sorted_iter() to add data to your sequence or, if
- you want to add a large amount of data, call g_sequence_sort() after
- doing unsorted insertions.</doc>
- <return-value>
- <doc xml:space="preserve">an #GSequenceIter pointing to the position where @data
- would have been inserted according to @cmp_func and @cmp_data</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data for the new item</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="cmp_func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function used to compare items in the sequence</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="cmp_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @cmp_func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="search_iter"
- c:identifier="g_sequence_search_iter"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Like g_sequence_search(), but uses a #GSequenceIterCompareFunc
- instead of a #GCompareDataFunc as the compare function.
- @iter_cmp is called with two iterators pointing into @seq.
- It should return 0 if the iterators are equal, a negative value
- if the first iterator comes before the second, and a positive
- value if the second iterator comes before the first.
- If you are simply searching for an existing element of the sequence,
- consider using g_sequence_lookup_iter().
- This function will fail if the data contained in the sequence is
- unsorted. Use g_sequence_insert_sorted() or
- g_sequence_insert_sorted_iter() to add data to your sequence or, if
- you want to add a large amount of data, call g_sequence_sort() after
- doing unsorted insertions.</doc>
- <return-value>
- <doc xml:space="preserve">a #GSequenceIter pointing to the position in @seq
- where @data would have been inserted according to @iter_cmp
- and @cmp_data</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data for the new item</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="iter_cmp" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function used to compare iterators in the sequence</doc>
- <type name="SequenceIterCompareFunc"
- c:type="GSequenceIterCompareFunc"/>
- </parameter>
- <parameter name="cmp_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @iter_cmp</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="sort"
- c:identifier="g_sequence_sort"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Sorts @seq using @cmp_func.
- @cmp_func is passed two items of @seq and should
- return 0 if they are equal, a negative value if the
- first comes before the second, and a positive value
- if the second comes before the first.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- <parameter name="cmp_func" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">the function used to sort the sequence</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="cmp_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @cmp_func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="sort_iter"
- c:identifier="g_sequence_sort_iter"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Like g_sequence_sort(), but uses a #GSequenceIterCompareFunc instead
- of a GCompareDataFunc as the compare function
- @cmp_func is called with two iterators pointing into @seq. It should
- return 0 if the iterators are equal, a negative value if the first
- iterator comes before the second, and a positive value if the second
- iterator comes before the first.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="seq" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </instance-parameter>
- <parameter name="cmp_func" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">the function used to compare iterators in the sequence</doc>
- <type name="SequenceIterCompareFunc"
- c:type="GSequenceIterCompareFunc"/>
- </parameter>
- <parameter name="cmp_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @cmp_func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <function name="foreach_range"
- c:identifier="g_sequence_foreach_range"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Calls @func for each item in the range (@begin, @end) passing
- @user_data to the function.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="begin" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="end" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="3">
- <doc xml:space="preserve">a #GFunc</doc>
- <type name="Func" c:type="GFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="get" c:identifier="g_sequence_get" version="2.14">
- <doc xml:space="preserve">Returns the data that @iter points to.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the data that @iter points to</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- </parameters>
- </function>
- <function name="insert_before"
- c:identifier="g_sequence_insert_before"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Inserts a new item just before the item pointed to by @iter.</doc>
- <return-value>
- <doc xml:space="preserve">an iterator pointing to the new item</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the new item</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="move" c:identifier="g_sequence_move" version="2.14">
- <doc xml:space="preserve">Moves the item pointed to by @src to the position indicated by @dest.
- After calling this function @dest will point to the position immediately
- after @src. It is allowed for @src and @dest to point into different
- sequences.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="src" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter pointing to the item to move</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="dest" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter pointing to the position to which
- the item is moved</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- </parameters>
- </function>
- <function name="move_range"
- c:identifier="g_sequence_move_range"
- version="2.14">
- <doc xml:space="preserve">Inserts the (@begin, @end) range at the destination pointed to by ptr.
- The @begin and @end iters must point into the same sequence. It is
- allowed for @dest to point to a different sequence than the one pointed
- into by @begin and @end.
- If @dest is NULL, the range indicated by @begin and @end is
- removed from the sequence. If @dest iter points to a place within
- the (@begin, @end) range, the range does not move.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="dest" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="begin" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="end" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- </parameters>
- </function>
- <function name="new"
- c:identifier="g_sequence_new"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Creates a new GSequence. The @data_destroy function, if non-%NULL will
- be called on all items when the sequence is destroyed and on items that
- are removed from the sequence.</doc>
- <return-value>
- <doc xml:space="preserve">a new #GSequence</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </return-value>
- <parameters>
- <parameter name="data_destroy"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">a #GDestroyNotify function, or %NULL</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="range_get_midpoint"
- c:identifier="g_sequence_range_get_midpoint"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Finds an iterator somewhere in the range (@begin, @end). This
- iterator will be close to the middle of the range, but is not
- guaranteed to be exactly in the middle.
- The @begin and @end iterators must both point to the same sequence
- and @begin must come before or be equal to @end in the sequence.</doc>
- <return-value>
- <doc xml:space="preserve">a #GSequenceIter pointing somewhere in the
- (@begin, @end) range</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <parameter name="begin" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="end" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove" c:identifier="g_sequence_remove" version="2.14">
- <doc xml:space="preserve">Removes the item pointed to by @iter. It is an error to pass the
- end iterator to this function.
- If the sequence has a data destroy function associated with it, this
- function is called on the data for the removed item.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_range"
- c:identifier="g_sequence_remove_range"
- version="2.14">
- <doc xml:space="preserve">Removes all items in the (@begin, @end) range.
- If the sequence has a data destroy function associated with it, this
- function is called on the data for the removed items.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="begin" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="end" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- </parameters>
- </function>
- <function name="set" c:identifier="g_sequence_set" version="2.14">
- <doc xml:space="preserve">Changes the data for the item pointed to by @iter to be @data. If
- the sequence has a data destroy function associated with it, that
- function is called on the existing data that @iter pointed to.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">new data for the item</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="sort_changed"
- c:identifier="g_sequence_sort_changed"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Moves the data pointed to a new position as indicated by @cmp_func. This
- function should be called for items in a sequence already sorted according
- to @cmp_func whenever some aspect of an item changes so that @cmp_func
- may return different values for that item.
- @cmp_func is called with two items of the @seq and @user_data.
- It should return 0 if the items are equal, a negative value if
- the first item comes before the second, and a positive value if
- the second item comes before the first.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">A #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="cmp_func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function used to compare items in the sequence</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="cmp_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @cmp_func.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="sort_changed_iter"
- c:identifier="g_sequence_sort_changed_iter"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Like g_sequence_sort_changed(), but uses
- a #GSequenceIterCompareFunc instead of a #GCompareDataFunc as
- the compare function.
- @iter_cmp is called with two iterators pointing into @seq. It should
- return 0 if the iterators are equal, a negative value if the first
- iterator comes before the second, and a positive value if the second
- iterator comes before the first.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="iter_cmp" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function used to compare iterators in the sequence</doc>
- <type name="SequenceIterCompareFunc"
- c:type="GSequenceIterCompareFunc"/>
- </parameter>
- <parameter name="cmp_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @cmp_func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="swap" c:identifier="g_sequence_swap" version="2.14">
- <doc xml:space="preserve">Swaps the items pointed to by @a and @b. It is allowed for @a and @b
- to point into difference sequences.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="a" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="b" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <record name="SequenceIter" c:type="GSequenceIter" disguised="1">
- <doc xml:space="preserve">The #GSequenceIter struct is an opaque data type representing an
- iterator pointing into a #GSequence.</doc>
- <method name="compare"
- c:identifier="g_sequence_iter_compare"
- version="2.14">
- <doc xml:space="preserve">Returns a negative number if @a comes before @b, 0 if they are equal,
- and a positive number if @a comes after @b.
- The @a and @b iterators must point into the same sequence.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a negative number if @a comes before @b, 0 if they are
- equal, and a positive number if @a comes after @b</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="a" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </instance-parameter>
- <parameter name="b" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_position"
- c:identifier="g_sequence_iter_get_position"
- version="2.14">
- <doc xml:space="preserve">Returns the position of @iter</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the position of @iter</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_sequence"
- c:identifier="g_sequence_iter_get_sequence"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Returns the #GSequence that @iter points into.</doc>
- <return-value>
- <doc xml:space="preserve">the #GSequence that @iter points into</doc>
- <type name="Sequence" c:type="GSequence*"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_begin"
- c:identifier="g_sequence_iter_is_begin"
- version="2.14">
- <doc xml:space="preserve">Returns whether @iter is the begin iterator</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">whether @iter is the begin iterator</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_end"
- c:identifier="g_sequence_iter_is_end"
- version="2.14">
- <doc xml:space="preserve">Returns whether @iter is the end iterator</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">Whether @iter is the end iterator</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="move"
- c:identifier="g_sequence_iter_move"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Returns the #GSequenceIter which is @delta positions away from @iter.
- If @iter is closer than -@delta positions to the beginning of the sequence,
- the begin iterator is returned. If @iter is closer than @delta positions
- to the end of the sequence, the end iterator is returned.</doc>
- <return-value>
- <doc xml:space="preserve">a #GSequenceIter which is @delta positions away from @iter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </instance-parameter>
- <parameter name="delta" transfer-ownership="none">
- <doc xml:space="preserve">A positive or negative number indicating how many positions away
- from @iter the returned #GSequenceIter will be</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="next"
- c:identifier="g_sequence_iter_next"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Returns an iterator pointing to the next position after @iter.
- If @iter is the end iterator, the end iterator is returned.</doc>
- <return-value>
- <doc xml:space="preserve">a #GSequenceIter pointing to the next position after @iter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="prev"
- c:identifier="g_sequence_iter_prev"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Returns an iterator pointing to the previous position before @iter.
- If @iter is the begin iterator, the begin iterator is returned.</doc>
- <return-value>
- <doc xml:space="preserve">a #GSequenceIter pointing to the previous position
- before @iter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </instance-parameter>
- </parameters>
- </method>
- </record>
- <callback name="SequenceIterCompareFunc" c:type="GSequenceIterCompareFunc">
- <doc xml:space="preserve">A #GSequenceIterCompareFunc is a function used to compare iterators.
- It must return zero if the iterators compare equal, a negative value
- if @a comes before @b, and a positive value if @b comes before @a.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">zero if the iterators are equal, a negative value if @a
- comes before @b, and a positive value if @b comes before @a.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="a" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="b" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <enumeration name="ShellError"
- c:type="GShellError"
- glib:error-domain="g-shell-error-quark">
- <doc xml:space="preserve">Error codes returned by shell functions.</doc>
- <member name="bad_quoting"
- value="0"
- c:identifier="G_SHELL_ERROR_BAD_QUOTING">
- <doc xml:space="preserve">Mismatched or otherwise mangled quoting.</doc>
- </member>
- <member name="empty_string"
- value="1"
- c:identifier="G_SHELL_ERROR_EMPTY_STRING">
- <doc xml:space="preserve">String to be parsed was empty.</doc>
- </member>
- <member name="failed" value="2" c:identifier="G_SHELL_ERROR_FAILED">
- <doc xml:space="preserve">Some other error.</doc>
- </member>
- </enumeration>
- <enumeration name="SliceConfig" c:type="GSliceConfig">
- <member name="always_malloc"
- value="1"
- c:identifier="G_SLICE_CONFIG_ALWAYS_MALLOC">
- </member>
- <member name="bypass_magazines"
- value="2"
- c:identifier="G_SLICE_CONFIG_BYPASS_MAGAZINES">
- </member>
- <member name="working_set_msecs"
- value="3"
- c:identifier="G_SLICE_CONFIG_WORKING_SET_MSECS">
- </member>
- <member name="color_increment"
- value="4"
- c:identifier="G_SLICE_CONFIG_COLOR_INCREMENT">
- </member>
- <member name="chunk_sizes"
- value="5"
- c:identifier="G_SLICE_CONFIG_CHUNK_SIZES">
- </member>
- <member name="contention_counter"
- value="6"
- c:identifier="G_SLICE_CONFIG_CONTENTION_COUNTER">
- </member>
- </enumeration>
- <record name="Source"
- c:type="GSource"
- glib:type-name="GSource"
- glib:get-type="g_source_get_type"
- c:symbol-prefix="source">
- <doc xml:space="preserve">The `GSource` struct is an opaque data type
- representing an event source.</doc>
- <field name="callback_data" readable="0" private="1">
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="callback_funcs" readable="0" private="1">
- <type name="SourceCallbackFuncs" c:type="GSourceCallbackFuncs*"/>
- </field>
- <field name="source_funcs" readable="0" private="1">
- <type name="SourceFuncs" c:type="const GSourceFuncs*"/>
- </field>
- <field name="ref_count" readable="0" private="1">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="context" readable="0" private="1">
- <type name="MainContext" c:type="GMainContext*"/>
- </field>
- <field name="priority" readable="0" private="1">
- <type name="gint" c:type="gint"/>
- </field>
- <field name="flags" readable="0" private="1">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="source_id" readable="0" private="1">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="poll_fds" readable="0" private="1">
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </field>
- <field name="prev" readable="0" private="1">
- <type name="Source" c:type="GSource*"/>
- </field>
- <field name="next" readable="0" private="1">
- <type name="Source" c:type="GSource*"/>
- </field>
- <field name="name" readable="0" private="1">
- <type name="utf8" c:type="char*"/>
- </field>
- <field name="priv" readable="0" private="1">
- <type name="SourcePrivate" c:type="GSourcePrivate*"/>
- </field>
- <constructor name="new" c:identifier="g_source_new">
- <doc xml:space="preserve">Creates a new #GSource structure. The size is specified to
- allow creating structures derived from #GSource that contain
- additional data. The size passed in must be at least
- `sizeof (GSource)`.
- The source will not initially be associated with any #GMainContext
- and must be added to one with g_source_attach() before it will be
- executed.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly-created #GSource.</doc>
- <type name="Source" c:type="GSource*"/>
- </return-value>
- <parameters>
- <parameter name="source_funcs" transfer-ownership="none">
- <doc xml:space="preserve">structure containing functions that implement
- the sources behavior.</doc>
- <type name="SourceFuncs" c:type="GSourceFuncs*"/>
- </parameter>
- <parameter name="struct_size" transfer-ownership="none">
- <doc xml:space="preserve">size of the #GSource structure to create.</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="add_child_source"
- c:identifier="g_source_add_child_source"
- version="2.28">
- <doc xml:space="preserve">Adds @child_source to @source as a "polled" source; when @source is
- added to a #GMainContext, @child_source will be automatically added
- with the same priority, when @child_source is triggered, it will
- cause @source to dispatch (in addition to calling its own
- callback), and when @source is destroyed, it will destroy
- @child_source as well. (@source will also still be dispatched if
- its own prepare/check functions indicate that it is ready.)
- If you don't need @child_source to do anything on its own when it
- triggers, you can call g_source_set_dummy_callback() on it to set a
- callback that does nothing (except return %TRUE if appropriate).
- @source will hold a reference on @child_source while @child_source
- is attached to it.
- This API is only intended to be used by implementations of #GSource.
- Do not call this API on a #GSource that you did not create.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="child_source" transfer-ownership="none">
- <doc xml:space="preserve">a second #GSource that @source should "poll"</doc>
- <type name="Source" c:type="GSource*"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_poll" c:identifier="g_source_add_poll">
- <doc xml:space="preserve">Adds a file descriptor to the set of file descriptors polled for
- this source. This is usually combined with g_source_new() to add an
- event source. The event source's check function will typically test
- the @revents field in the #GPollFD struct and return %TRUE if events need
- to be processed.
- This API is only intended to be used by implementations of #GSource.
- Do not call this API on a #GSource that you did not create.
- Using this API forces the linear scanning of event sources on each
- main loop iteration. Newly-written event sources should try to use
- g_source_add_unix_fd() instead of this API.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="fd" transfer-ownership="none">
- <doc xml:space="preserve">a #GPollFD structure holding information about a file
- descriptor to watch.</doc>
- <type name="PollFD" c:type="GPollFD*"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_unix_fd"
- c:identifier="g_source_add_unix_fd"
- version="2.36">
- <doc xml:space="preserve">Monitors @fd for the IO events in @events.
- The tag returned by this function can be used to remove or modify the
- monitoring of the fd using g_source_remove_unix_fd() or
- g_source_modify_unix_fd().
- It is not necessary to remove the fd before destroying the source; it
- will be cleaned up automatically.
- This API is only intended to be used by implementations of #GSource.
- Do not call this API on a #GSource that you did not create.
- As the name suggests, this function is not available on Windows.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">an opaque tag</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="fd" transfer-ownership="none">
- <doc xml:space="preserve">the fd to monitor</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="events" transfer-ownership="none">
- <doc xml:space="preserve">an event mask</doc>
- <type name="IOCondition" c:type="GIOCondition"/>
- </parameter>
- </parameters>
- </method>
- <method name="attach" c:identifier="g_source_attach">
- <doc xml:space="preserve">Adds a #GSource to a @context so that it will be executed within
- that context. Remove it by calling g_source_destroy().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ID (greater than 0) for the source within the
- #GMainContext.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="context"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GMainContext (if %NULL, the default context will be used)</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </parameter>
- </parameters>
- </method>
- <method name="destroy" c:identifier="g_source_destroy">
- <doc xml:space="preserve">Removes a source from its #GMainContext, if any, and mark it as
- destroyed. The source cannot be subsequently added to another
- context. It is safe to call this on sources which have already been
- removed from their context.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_can_recurse" c:identifier="g_source_get_can_recurse">
- <doc xml:space="preserve">Checks whether a source is allowed to be called recursively.
- see g_source_set_can_recurse().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">whether recursion is allowed.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_context" c:identifier="g_source_get_context">
- <doc xml:space="preserve">Gets the #GMainContext with which the source is associated.
- You can call this on a source that has been destroyed, provided
- that the #GMainContext it was attached to still exists (in which
- case it will return that #GMainContext). In particular, you can
- always call this function on the source returned from
- g_main_current_source(). But calling this function on a source
- whose #GMainContext has been destroyed is an error.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the #GMainContext with which the
- source is associated, or %NULL if the context has not
- yet been added to a source.</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_current_time"
- c:identifier="g_source_get_current_time"
- deprecated="1"
- deprecated-version="2.28">
- <doc xml:space="preserve">This function ignores @source and is otherwise the same as
- g_get_current_time().</doc>
- <doc-deprecated xml:space="preserve">use g_source_get_time() instead</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="timeval" transfer-ownership="none">
- <doc xml:space="preserve">#GTimeVal structure in which to store current time.</doc>
- <type name="TimeVal" c:type="GTimeVal*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_id" c:identifier="g_source_get_id">
- <doc xml:space="preserve">Returns the numeric ID for a particular source. The ID of a source
- is a positive integer which is unique within a particular main loop
- context. The reverse
- mapping from ID to source is done by g_main_context_find_source_by_id().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ID (greater than 0) for the source</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_name" c:identifier="g_source_get_name" version="2.26">
- <doc xml:space="preserve">Gets a name for the source, used in debugging and profiling. The
- name may be #NULL if it has never been set with g_source_set_name().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the name of the source</doc>
- <type name="utf8" c:type="const char*"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_priority" c:identifier="g_source_get_priority">
- <doc xml:space="preserve">Gets the priority of a source.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the priority of the source</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_ready_time" c:identifier="g_source_get_ready_time">
- <doc xml:space="preserve">Gets the "ready time" of @source, as set by
- g_source_set_ready_time().
- Any time before the current monotonic time (including 0) is an
- indication that the source will fire immediately.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the monotonic ready time, -1 for "never"</doc>
- <type name="gint64" c:type="gint64"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_time" c:identifier="g_source_get_time" version="2.28">
- <doc xml:space="preserve">Gets the time to be used when checking this source. The advantage of
- calling this function over calling g_get_monotonic_time() directly is
- that when checking multiple sources, GLib can cache a single value
- instead of having to repeatedly get the system monotonic time.
- The time here is the system monotonic time, if available, or some
- other reasonable alternative otherwise. See g_get_monotonic_time().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the monotonic time in microseconds</doc>
- <type name="gint64" c:type="gint64"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_destroyed"
- c:identifier="g_source_is_destroyed"
- version="2.12">
- <doc xml:space="preserve">Returns whether @source has been destroyed.
- This is important when you operate upon your objects
- from within idle handlers, but may have freed the object
- before the dispatch of your idle handler.
- |[<!-- language="C" -->
- static gboolean
- idle_callback (gpointer data)
- {
- SomeWidget *self = data;
-
- GDK_THREADS_ENTER ();
- // do stuff with self
- self->idle_id = 0;
- GDK_THREADS_LEAVE ();
-
- return G_SOURCE_REMOVE;
- }
-
- static void
- some_widget_do_stuff_later (SomeWidget *self)
- {
- self->idle_id = g_idle_add (idle_callback, self);
- }
-
- static void
- some_widget_finalize (GObject *object)
- {
- SomeWidget *self = SOME_WIDGET (object);
-
- if (self->idle_id)
- g_source_remove (self->idle_id);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
- }
- ]|
- This will fail in a multi-threaded application if the
- widget is destroyed before the idle handler fires due
- to the use after free in the callback. A solution, to
- this particular problem, is to check to if the source
- has already been destroy within the callback.
- |[<!-- language="C" -->
- static gboolean
- idle_callback (gpointer data)
- {
- SomeWidget *self = data;
-
- GDK_THREADS_ENTER ();
- if (!g_source_is_destroyed (g_main_current_source ()))
- {
- // do stuff with self
- }
- GDK_THREADS_LEAVE ();
-
- return FALSE;
- }
- ]|</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the source has been destroyed</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="modify_unix_fd"
- c:identifier="g_source_modify_unix_fd"
- version="2.36">
- <doc xml:space="preserve">Updates the event mask to watch for the fd identified by @tag.
- @tag is the tag returned from g_source_add_unix_fd().
- If you want to remove a fd, don't set its event mask to zero.
- Instead, call g_source_remove_unix_fd().
- This API is only intended to be used by implementations of #GSource.
- Do not call this API on a #GSource that you did not create.
- As the name suggests, this function is not available on Windows.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="tag" transfer-ownership="none">
- <doc xml:space="preserve">the tag from g_source_add_unix_fd()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="new_events" transfer-ownership="none">
- <doc xml:space="preserve">the new event mask to watch</doc>
- <type name="IOCondition" c:type="GIOCondition"/>
- </parameter>
- </parameters>
- </method>
- <method name="query_unix_fd"
- c:identifier="g_source_query_unix_fd"
- version="2.36">
- <doc xml:space="preserve">Queries the events reported for the fd corresponding to @tag on
- @source during the last poll.
- The return value of this function is only defined when the function
- is called from the check or dispatch functions for @source.
- This API is only intended to be used by implementations of #GSource.
- Do not call this API on a #GSource that you did not create.
- As the name suggests, this function is not available on Windows.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the conditions reported on the fd</doc>
- <type name="IOCondition" c:type="GIOCondition"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="tag" transfer-ownership="none">
- <doc xml:space="preserve">the tag from g_source_add_unix_fd()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_source_ref">
- <doc xml:space="preserve">Increases the reference count on a source by one.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">@source</doc>
- <type name="Source" c:type="GSource*"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="remove_child_source"
- c:identifier="g_source_remove_child_source"
- version="2.28">
- <doc xml:space="preserve">Detaches @child_source from @source and destroys it.
- This API is only intended to be used by implementations of #GSource.
- Do not call this API on a #GSource that you did not create.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="child_source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource previously passed to
- g_source_add_child_source().</doc>
- <type name="Source" c:type="GSource*"/>
- </parameter>
- </parameters>
- </method>
- <method name="remove_poll" c:identifier="g_source_remove_poll">
- <doc xml:space="preserve">Removes a file descriptor from the set of file descriptors polled for
- this source.
- This API is only intended to be used by implementations of #GSource.
- Do not call this API on a #GSource that you did not create.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="fd" transfer-ownership="none">
- <doc xml:space="preserve">a #GPollFD structure previously passed to g_source_add_poll().</doc>
- <type name="PollFD" c:type="GPollFD*"/>
- </parameter>
- </parameters>
- </method>
- <method name="remove_unix_fd"
- c:identifier="g_source_remove_unix_fd"
- version="2.36">
- <doc xml:space="preserve">Reverses the effect of a previous call to g_source_add_unix_fd().
- You only need to call this if you want to remove an fd from being
- watched while keeping the same source around. In the normal case you
- will just want to destroy the source.
- This API is only intended to be used by implementations of #GSource.
- Do not call this API on a #GSource that you did not create.
- As the name suggests, this function is not available on Windows.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="tag" transfer-ownership="none">
- <doc xml:space="preserve">the tag from g_source_add_unix_fd()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_callback" c:identifier="g_source_set_callback">
- <doc xml:space="preserve">Sets the callback function for a source. The callback for a source is
- called from the source's dispatch function.
- The exact type of @func depends on the type of source; ie. you
- should not count on @func being called with @data as its first
- parameter.
- See [memory management of sources][mainloop-memory-management] for details
- on how to handle memory management of @data.
- Typically, you won't use this function. Instead use functions specific
- to the type of source you are using.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">the source</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="func"
- transfer-ownership="none"
- scope="notified"
- closure="1"
- destroy="2">
- <doc xml:space="preserve">a callback function</doc>
- <type name="SourceFunc" c:type="GSourceFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data to pass to callback function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="notify"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">a function to call when @data is no longer in use, or %NULL.</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_callback_indirect"
- c:identifier="g_source_set_callback_indirect">
- <doc xml:space="preserve">Sets the callback function storing the data as a refcounted callback
- "object". This is used internally. Note that calling
- g_source_set_callback_indirect() assumes
- an initial reference count on @callback_data, and thus
- @callback_funcs->unref will eventually be called once more
- than @callback_funcs->ref.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">the source</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="callback_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">pointer to callback data "object"</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="callback_funcs" transfer-ownership="none">
- <doc xml:space="preserve">functions for reference counting @callback_data
- and getting the callback and data</doc>
- <type name="SourceCallbackFuncs" c:type="GSourceCallbackFuncs*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_can_recurse" c:identifier="g_source_set_can_recurse">
- <doc xml:space="preserve">Sets whether a source can be called recursively. If @can_recurse is
- %TRUE, then while the source is being dispatched then this source
- will be processed normally. Otherwise, all processing of this
- source is blocked until the dispatch function returns.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="can_recurse" transfer-ownership="none">
- <doc xml:space="preserve">whether recursion is allowed for this source</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_funcs"
- c:identifier="g_source_set_funcs"
- version="2.12">
- <doc xml:space="preserve">Sets the source functions (can be used to override
- default implementations) of an unattached source.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="funcs" transfer-ownership="none">
- <doc xml:space="preserve">the new #GSourceFuncs</doc>
- <type name="SourceFuncs" c:type="GSourceFuncs*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_name" c:identifier="g_source_set_name" version="2.26">
- <doc xml:space="preserve">Sets a name for the source, used in debugging and profiling.
- The name defaults to #NULL.
- The source name should describe in a human-readable way
- what the source does. For example, "X11 event queue"
- or "GTK+ repaint idle handler" or whatever it is.
- It is permitted to call this function multiple times, but is not
- recommended due to the potential performance impact. For example,
- one could change the name in the "check" function of a #GSourceFuncs
- to include details like the event type in the source name.
- Use caution if changing the name while another thread may be
- accessing it with g_source_get_name(); that function does not copy
- the value, and changing the value will free it while the other thread
- may be attempting to use it.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="name" transfer-ownership="none">
- <doc xml:space="preserve">debug name for the source</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_priority" c:identifier="g_source_set_priority">
- <doc xml:space="preserve">Sets the priority of a source. While the main loop is being run, a
- source will be dispatched if it is ready to be dispatched and no
- sources at a higher (numerically smaller) priority are ready to be
- dispatched.
- A child source always has the same priority as its parent. It is not
- permitted to change the priority of a source once it has been added
- as a child of another source.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="priority" transfer-ownership="none">
- <doc xml:space="preserve">the new priority.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_ready_time"
- c:identifier="g_source_set_ready_time"
- version="2.36">
- <doc xml:space="preserve">Sets a #GSource to be dispatched when the given monotonic time is
- reached (or passed). If the monotonic time is in the past (as it
- always will be if @ready_time is 0) then the source will be
- dispatched immediately.
- If @ready_time is -1 then the source is never woken up on the basis
- of the passage of time.
- Dispatching the source does not reset the ready time. You should do
- so yourself, from the source dispatch function.
- Note that if you have a pair of sources where the ready time of one
- suggests that it will be delivered first but the priority for the
- other suggests that it would be delivered first, and the ready time
- for both sources is reached during the same main context iteration
- then the order of dispatch is undefined.
- This API is only intended to be used by implementations of #GSource.
- Do not call this API on a #GSource that you did not create.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- <parameter name="ready_time" transfer-ownership="none">
- <doc xml:space="preserve">the monotonic time at which the source will be ready,
- 0 for "immediately", -1 for "never"</doc>
- <type name="gint64" c:type="gint64"/>
- </parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_source_unref">
- <doc xml:space="preserve">Decreases the reference count of a source by one. If the
- resulting reference count is zero the source and associated
- memory will be destroyed.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="remove" c:identifier="g_source_remove">
- <doc xml:space="preserve">Removes the source with the given id from the default main context.
- The id of a #GSource is given by g_source_get_id(), or will be
- returned by the functions g_source_attach(), g_idle_add(),
- g_idle_add_full(), g_timeout_add(), g_timeout_add_full(),
- g_child_watch_add(), g_child_watch_add_full(), g_io_add_watch(), and
- g_io_add_watch_full().
- See also g_source_destroy(). You must use g_source_destroy() for sources
- added to a non-default main context.
- It is a programmer error to attempt to remove a non-existent source.
- More specifically: source IDs can be reissued after a source has been
- destroyed and therefore it is never valid to use this function with a
- source ID which may have already been removed. An example is when
- scheduling an idle to run in another thread with g_idle_add(): the
- idle may already have run and been removed by the time this function
- is called on its (now invalid) source ID. This source ID may have
- been reissued, leading to the operation being performed against the
- wrong source.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">For historical reasons, this function always returns %TRUE</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="tag" transfer-ownership="none">
- <doc xml:space="preserve">the ID of the source to remove.</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_by_funcs_user_data"
- c:identifier="g_source_remove_by_funcs_user_data">
- <doc xml:space="preserve">Removes a source from the default main loop context given the
- source functions and user data. If multiple sources exist with the
- same source functions and user data, only one will be destroyed.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a source was found and removed.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="funcs" transfer-ownership="none">
- <doc xml:space="preserve">The @source_funcs passed to g_source_new()</doc>
- <type name="SourceFuncs" c:type="GSourceFuncs*"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the user data for the callback</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="remove_by_user_data"
- c:identifier="g_source_remove_by_user_data">
- <doc xml:space="preserve">Removes a source from the default main loop context given the user
- data for the callback. If multiple sources exist with the same user
- data, only one will be destroyed.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a source was found and removed.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the user_data for the callback.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="set_name_by_id"
- c:identifier="g_source_set_name_by_id"
- version="2.26">
- <doc xml:space="preserve">Sets the name of a source using its ID.
- This is a convenience utility to set source names from the return
- value of g_idle_add(), g_timeout_add(), etc.
- It is a programmer error to attempt to set the name of a non-existent
- source.
- More specifically: source IDs can be reissued after a source has been
- destroyed and therefore it is never valid to use this function with a
- source ID which may have already been removed. An example is when
- scheduling an idle to run in another thread with g_idle_add(): the
- idle may already have run and been removed by the time this function
- is called on its (now invalid) source ID. This source ID may have
- been reissued, leading to the operation being performed against the
- wrong source.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="tag" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource ID</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="name" transfer-ownership="none">
- <doc xml:space="preserve">debug name for the source</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <record name="SourceCallbackFuncs" c:type="GSourceCallbackFuncs">
- <doc xml:space="preserve">The `GSourceCallbackFuncs` struct contains
- functions for managing callback objects.</doc>
- <field name="ref">
- <callback name="ref">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="cb_data" transfer-ownership="none">
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="unref">
- <callback name="unref">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="cb_data" transfer-ownership="none">
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="get" introspectable="0">
- <callback name="get" introspectable="0">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="cb_data" transfer-ownership="none">
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="source" transfer-ownership="none">
- <type name="Source" c:type="GSource*"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="3">
- <type name="SourceFunc" c:type="GSourceFunc*"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <type name="gpointer" c:type="gpointer*"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- </record>
- <callback name="SourceDummyMarshal" c:type="GSourceDummyMarshal">
- <doc xml:space="preserve">This is just a placeholder for #GClosureMarshal,
- which cannot be used here for dependency reasons.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- </callback>
- <callback name="SourceFunc" c:type="GSourceFunc">
- <doc xml:space="preserve">Specifies the type of function passed to g_timeout_add(),
- g_timeout_add_full(), g_idle_add(), and g_idle_add_full().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%FALSE if the source should be removed. #G_SOURCE_CONTINUE and
- #G_SOURCE_REMOVE are more memorable names for the return value.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="0">
- <doc xml:space="preserve">data passed to the function, set when the source was
- created with one of the above functions</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <record name="SourceFuncs" c:type="GSourceFuncs">
- <doc xml:space="preserve">The `GSourceFuncs` struct contains a table of
- functions used to handle event sources in a generic manner.
- For idle sources, the prepare and check functions always return %TRUE
- to indicate that the source is always ready to be processed. The prepare
- function also returns a timeout value of 0 to ensure that the poll() call
- doesn't block (since that would be time wasted which could have been spent
- running the idle function).
- For timeout sources, the prepare and check functions both return %TRUE
- if the timeout interval has expired. The prepare function also returns
- a timeout value to ensure that the poll() call doesn't block too long
- and miss the next timeout.
- For file descriptor sources, the prepare function typically returns %FALSE,
- since it must wait until poll() has been called before it knows whether
- any events need to be processed. It sets the returned timeout to -1 to
- indicate that it doesn't mind how long the poll() call blocks. In the
- check function, it tests the results of the poll() call to see if the
- required condition has been met, and returns %TRUE if so.</doc>
- <field name="prepare">
- <callback name="prepare">
- <return-value transfer-ownership="none">
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="source" transfer-ownership="none">
- <type name="Source" c:type="GSource*"/>
- </parameter>
- <parameter name="timeout_" transfer-ownership="none">
- <type name="gint" c:type="gint*"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="check">
- <callback name="check">
- <return-value transfer-ownership="none">
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="source" transfer-ownership="none">
- <type name="Source" c:type="GSource*"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="dispatch" introspectable="0">
- <callback name="dispatch" introspectable="0">
- <return-value transfer-ownership="none">
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="source" transfer-ownership="none">
- <type name="Source" c:type="GSource*"/>
- </parameter>
- <parameter name="callback" transfer-ownership="none" closure="2">
- <type name="SourceFunc" c:type="GSourceFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="2">
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="finalize">
- <callback name="finalize">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="source" transfer-ownership="none">
- <type name="Source" c:type="GSource*"/>
- </parameter>
- </parameters>
- </callback>
- </field>
- <field name="closure_callback" readable="0" private="1">
- <type name="SourceFunc" c:type="GSourceFunc"/>
- </field>
- <field name="closure_marshal" readable="0" private="1">
- <type name="SourceDummyMarshal" c:type="GSourceDummyMarshal"/>
- </field>
- </record>
- <record name="SourcePrivate" c:type="GSourcePrivate" disguised="1">
- </record>
- <callback name="SpawnChildSetupFunc" c:type="GSpawnChildSetupFunc">
- <doc xml:space="preserve">Specifies the type of the setup function passed to g_spawn_async(),
- g_spawn_sync() and g_spawn_async_with_pipes(), which can, in very
- limited ways, be used to affect the child's execution.
- On POSIX platforms, the function is called in the child after GLib
- has performed all the setup it plans to perform, but before calling
- exec(). Actions taken in this function will only affect the child,
- not the parent.
- On Windows, the function is called in the parent. Its usefulness on
- Windows is thus questionable. In many cases executing the child setup
- function in the parent can have ill effects, and you should be very
- careful when porting software to Windows that uses child setup
- functions.
- However, even on POSIX, you are extremely limited in what you can
- safely do from a #GSpawnChildSetupFunc, because any mutexes that were
- held by other threads in the parent process at the time of the fork()
- will still be locked in the child process, and they will never be
- unlocked (since the threads that held them don't exist in the child).
- POSIX allows only async-signal-safe functions (see signal(7)) to be
- called in the child between fork() and exec(), which drastically limits
- the usefulness of child setup functions.
- In particular, it is not safe to call any function which may
- call malloc(), which includes POSIX functions such as setenv().
- If you need to set up the child environment differently from
- the parent, you should use g_get_environ(), g_environ_setenv(),
- and g_environ_unsetenv(), and then pass the complete environment
- list to the `g_spawn...` function.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="0">
- <doc xml:space="preserve">user data to pass to the function.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <enumeration name="SpawnError"
- c:type="GSpawnError"
- glib:error-domain="g-exec-error-quark">
- <doc xml:space="preserve">Error codes returned by spawning processes.</doc>
- <member name="fork" value="0" c:identifier="G_SPAWN_ERROR_FORK">
- <doc xml:space="preserve">Fork failed due to lack of memory.</doc>
- </member>
- <member name="read" value="1" c:identifier="G_SPAWN_ERROR_READ">
- <doc xml:space="preserve">Read or select on pipes failed.</doc>
- </member>
- <member name="chdir" value="2" c:identifier="G_SPAWN_ERROR_CHDIR">
- <doc xml:space="preserve">Changing to working directory failed.</doc>
- </member>
- <member name="acces" value="3" c:identifier="G_SPAWN_ERROR_ACCES">
- <doc xml:space="preserve">execv() returned `EACCES`</doc>
- </member>
- <member name="perm" value="4" c:identifier="G_SPAWN_ERROR_PERM">
- <doc xml:space="preserve">execv() returned `EPERM`</doc>
- </member>
- <member name="too_big" value="5" c:identifier="G_SPAWN_ERROR_TOO_BIG">
- <doc xml:space="preserve">execv() returned `E2BIG`</doc>
- </member>
- <member name="2big" value="5" c:identifier="G_SPAWN_ERROR_2BIG">
- <doc xml:space="preserve">deprecated alias for %G_SPAWN_ERROR_TOO_BIG</doc>
- </member>
- <member name="noexec" value="6" c:identifier="G_SPAWN_ERROR_NOEXEC">
- <doc xml:space="preserve">execv() returned `ENOEXEC`</doc>
- </member>
- <member name="nametoolong"
- value="7"
- c:identifier="G_SPAWN_ERROR_NAMETOOLONG">
- <doc xml:space="preserve">execv() returned `ENAMETOOLONG`</doc>
- </member>
- <member name="noent" value="8" c:identifier="G_SPAWN_ERROR_NOENT">
- <doc xml:space="preserve">execv() returned `ENOENT`</doc>
- </member>
- <member name="nomem" value="9" c:identifier="G_SPAWN_ERROR_NOMEM">
- <doc xml:space="preserve">execv() returned `ENOMEM`</doc>
- </member>
- <member name="notdir" value="10" c:identifier="G_SPAWN_ERROR_NOTDIR">
- <doc xml:space="preserve">execv() returned `ENOTDIR`</doc>
- </member>
- <member name="loop" value="11" c:identifier="G_SPAWN_ERROR_LOOP">
- <doc xml:space="preserve">execv() returned `ELOOP`</doc>
- </member>
- <member name="txtbusy" value="12" c:identifier="G_SPAWN_ERROR_TXTBUSY">
- <doc xml:space="preserve">execv() returned `ETXTBUSY`</doc>
- </member>
- <member name="io" value="13" c:identifier="G_SPAWN_ERROR_IO">
- <doc xml:space="preserve">execv() returned `EIO`</doc>
- </member>
- <member name="nfile" value="14" c:identifier="G_SPAWN_ERROR_NFILE">
- <doc xml:space="preserve">execv() returned `ENFILE`</doc>
- </member>
- <member name="mfile" value="15" c:identifier="G_SPAWN_ERROR_MFILE">
- <doc xml:space="preserve">execv() returned `EMFILE`</doc>
- </member>
- <member name="inval" value="16" c:identifier="G_SPAWN_ERROR_INVAL">
- <doc xml:space="preserve">execv() returned `EINVAL`</doc>
- </member>
- <member name="isdir" value="17" c:identifier="G_SPAWN_ERROR_ISDIR">
- <doc xml:space="preserve">execv() returned `EISDIR`</doc>
- </member>
- <member name="libbad" value="18" c:identifier="G_SPAWN_ERROR_LIBBAD">
- <doc xml:space="preserve">execv() returned `ELIBBAD`</doc>
- </member>
- <member name="failed" value="19" c:identifier="G_SPAWN_ERROR_FAILED">
- <doc xml:space="preserve">Some other fatal failure,
- `error->message` should explain.</doc>
- </member>
- </enumeration>
- <bitfield name="SpawnFlags" c:type="GSpawnFlags">
- <doc xml:space="preserve">Flags passed to g_spawn_sync(), g_spawn_async() and g_spawn_async_with_pipes().</doc>
- <member name="default" value="0" c:identifier="G_SPAWN_DEFAULT">
- <doc xml:space="preserve">no flags, default behaviour</doc>
- </member>
- <member name="leave_descriptors_open"
- value="1"
- c:identifier="G_SPAWN_LEAVE_DESCRIPTORS_OPEN">
- <doc xml:space="preserve">the parent's open file descriptors will
- be inherited by the child; otherwise all descriptors except stdin,
- stdout and stderr will be closed before calling exec() in the child.</doc>
- </member>
- <member name="do_not_reap_child"
- value="2"
- c:identifier="G_SPAWN_DO_NOT_REAP_CHILD">
- <doc xml:space="preserve">the child will not be automatically reaped;
- you must use g_child_watch_add() yourself (or call waitpid() or handle
- `SIGCHLD` yourself), or the child will become a zombie.</doc>
- </member>
- <member name="search_path" value="4" c:identifier="G_SPAWN_SEARCH_PATH">
- <doc xml:space="preserve">`argv[0]` need not be an absolute path, it will be
- looked for in the user's `PATH`.</doc>
- </member>
- <member name="stdout_to_dev_null"
- value="8"
- c:identifier="G_SPAWN_STDOUT_TO_DEV_NULL">
- <doc xml:space="preserve">the child's standard output will be discarded,
- instead of going to the same location as the parent's standard output.</doc>
- </member>
- <member name="stderr_to_dev_null"
- value="16"
- c:identifier="G_SPAWN_STDERR_TO_DEV_NULL">
- <doc xml:space="preserve">the child's standard error will be discarded.</doc>
- </member>
- <member name="child_inherits_stdin"
- value="32"
- c:identifier="G_SPAWN_CHILD_INHERITS_STDIN">
- <doc xml:space="preserve">the child will inherit the parent's standard
- input (by default, the child's standard input is attached to `/dev/null`).</doc>
- </member>
- <member name="file_and_argv_zero"
- value="64"
- c:identifier="G_SPAWN_FILE_AND_ARGV_ZERO">
- <doc xml:space="preserve">the first element of `argv` is the file to
- execute, while the remaining elements are the actual argument vector
- to pass to the file. Normally g_spawn_async_with_pipes() uses `argv[0]`
- as the file to execute, and passes all of `argv` to the child.</doc>
- </member>
- <member name="search_path_from_envp"
- value="128"
- c:identifier="G_SPAWN_SEARCH_PATH_FROM_ENVP">
- <doc xml:space="preserve">if `argv[0]` is not an abolute path,
- it will be looked for in the `PATH` from the passed child environment.
- Since: 2.34</doc>
- </member>
- <member name="cloexec_pipes"
- value="256"
- c:identifier="G_SPAWN_CLOEXEC_PIPES">
- <doc xml:space="preserve">create all pipes with the `O_CLOEXEC` flag set.
- Since: 2.40</doc>
- </member>
- </bitfield>
- <record name="StatBuf" c:type="GStatBuf" disguised="1">
- <doc xml:space="preserve">A type corresponding to the appropriate struct type for the stat()
- system call, depending on the platform and/or compiler being used.
- See g_stat() for more information.</doc>
- </record>
- <record name="String"
- c:type="GString"
- glib:type-name="GString"
- glib:get-type="g_gstring_get_type"
- c:symbol-prefix="gstring">
- <doc xml:space="preserve">The GString struct contains the public fields of a GString.</doc>
- <field name="str" writable="1">
- <doc xml:space="preserve">points to the character data. It may move as text is added.
- The @str field is null-terminated and so
- can be used as an ordinary C string.</doc>
- <type name="utf8" c:type="gchar*"/>
- </field>
- <field name="len" writable="1">
- <doc xml:space="preserve">contains the length of the string, not including the
- terminating nul byte.</doc>
- <type name="gsize" c:type="gsize"/>
- </field>
- <field name="allocated_len" writable="1">
- <doc xml:space="preserve">the number of bytes that can be stored in the
- string before it needs to be reallocated. May be larger than @len.</doc>
- <type name="gsize" c:type="gsize"/>
- </field>
- <method name="append" c:identifier="g_string_append">
- <doc xml:space="preserve">Adds a string onto the end of a #GString, expanding
- it if necessary.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">the string to append onto the end of @string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="append_c" c:identifier="g_string_append_c">
- <doc xml:space="preserve">Adds a byte onto the end of a #GString, expanding
- it if necessary.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">the byte to append onto the end of @string</doc>
- <type name="gchar" c:type="gchar"/>
- </parameter>
- </parameters>
- </method>
- <method name="append_len" c:identifier="g_string_append_len">
- <doc xml:space="preserve">Appends @len bytes of @val to @string. Because @len is
- provided, @val may contain embedded nuls and need not
- be nul-terminated.
- Since this function does not stop at nul bytes, it is
- the caller's responsibility to ensure that @val has at
- least @len addressable bytes.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">bytes to append</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">number of bytes of @val to use</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </method>
- <method name="append_printf"
- c:identifier="g_string_append_printf"
- introspectable="0">
- <doc xml:space="preserve">Appends a formatted string onto the end of a #GString.
- This function is similar to g_string_printf() except
- that the text is appended to the #GString.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">the string format. See the printf() documentation</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the parameters to insert into the format string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </method>
- <method name="append_unichar" c:identifier="g_string_append_unichar">
- <doc xml:space="preserve">Converts a Unicode character into UTF-8, and appends it
- to the string.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="wc" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </method>
- <method name="append_uri_escaped"
- c:identifier="g_string_append_uri_escaped"
- version="2.16">
- <doc xml:space="preserve">Appends @unescaped to @string, escaped any characters that
- are reserved in URIs using URI-style escape sequences.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="unescaped" transfer-ownership="none">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="reserved_chars_allowed" transfer-ownership="none">
- <doc xml:space="preserve">a string of reserved characters allowed
- to be used, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="allow_utf8" transfer-ownership="none">
- <doc xml:space="preserve">set %TRUE if the escaped string may include UTF8 characters</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="append_vprintf"
- c:identifier="g_string_append_vprintf"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Appends a formatted string onto the end of a #GString.
- This function is similar to g_string_append_printf()
- except that the arguments to the format string are passed
- as a va_list.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">the string format. See the printf() documentation</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="args" transfer-ownership="none">
- <doc xml:space="preserve">the list of arguments to insert in the output</doc>
- <type name="va_list" c:type="va_list"/>
- </parameter>
- </parameters>
- </method>
- <method name="ascii_down" c:identifier="g_string_ascii_down">
- <doc xml:space="preserve">Converts all uppercase ASCII letters to lowercase ASCII letters.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">passed-in @string pointer, with all the
- uppercase characters converted to lowercase in place,
- with semantics that exactly match g_ascii_tolower().</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="ascii_up" c:identifier="g_string_ascii_up">
- <doc xml:space="preserve">Converts all lowercase ASCII letters to uppercase ASCII letters.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">passed-in @string pointer, with all the
- lowercase characters converted to uppercase in place,
- with semantics that exactly match g_ascii_toupper().</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="assign" c:identifier="g_string_assign">
- <doc xml:space="preserve">Copies the bytes from a string into a #GString,
- destroying any previous contents. It is rather like
- the standard strcpy() function, except that you do not
- have to worry about having enough space to copy the string.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the destination #GString. Its current contents
- are destroyed.</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="rval" transfer-ownership="none">
- <doc xml:space="preserve">the string to copy into @string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="down"
- c:identifier="g_string_down"
- deprecated="1"
- deprecated-version="2.2">
- <doc xml:space="preserve">Converts a #GString to lowercase.</doc>
- <doc-deprecated xml:space="preserve">This function uses the locale-specific
- tolower() function, which is almost never the right thing.
- Use g_string_ascii_down() or g_utf8_strdown() instead.</doc-deprecated>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the #GString</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="equal" c:identifier="g_string_equal">
- <doc xml:space="preserve">Compares two strings for equality, returning %TRUE if they are equal.
- For use with #GHashTable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the strings are the same length and contain the
- same bytes</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="v" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="const GString*"/>
- </instance-parameter>
- <parameter name="v2" transfer-ownership="none">
- <doc xml:space="preserve">another #GString</doc>
- <type name="String" c:type="const GString*"/>
- </parameter>
- </parameters>
- </method>
- <method name="erase" c:identifier="g_string_erase">
- <doc xml:space="preserve">Removes @len bytes from a #GString, starting at position @pos.
- The rest of the #GString is shifted down to fill the gap.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="pos" transfer-ownership="none">
- <doc xml:space="preserve">the position of the content to remove</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes to remove, or -1 to remove all
- following bytes</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_string_free">
- <doc xml:space="preserve">Frees the memory allocated for the #GString.
- If @free_segment is %TRUE it also frees the character data. If
- it's %FALSE, the caller gains ownership of the buffer and must
- free it after use with g_free().</doc>
- <return-value transfer-ownership="full" nullable="1">
- <doc xml:space="preserve">the character data of @string
- (i.e. %NULL if @free_segment is %TRUE)</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="full">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="free_segment" transfer-ownership="none">
- <doc xml:space="preserve">if %TRUE, the actual character data is freed as well</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="free_to_bytes"
- c:identifier="g_string_free_to_bytes"
- version="2.34">
- <doc xml:space="preserve">Transfers ownership of the contents of @string to a newly allocated
- #GBytes. The #GString structure itself is deallocated, and it is
- therefore invalid to use @string after invoking this function.
- Note that while #GString ensures that its buffer always has a
- trailing nul character (not reflected in its "len"), the returned
- #GBytes does not include this extra nul; i.e. it has length exactly
- equal to the "len" member.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">A newly allocated #GBytes containing contents of @string; @string itself is freed</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="full">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="hash" c:identifier="g_string_hash">
- <doc xml:space="preserve">Creates a hash code for @str; for use with #GHashTable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">hash code for @str</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a string to hash</doc>
- <type name="String" c:type="const GString*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="insert" c:identifier="g_string_insert">
- <doc xml:space="preserve">Inserts a copy of a string into a #GString,
- expanding it if necessary.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="pos" transfer-ownership="none">
- <doc xml:space="preserve">the position to insert the copy of the string</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">the string to insert</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="insert_c" c:identifier="g_string_insert_c">
- <doc xml:space="preserve">Inserts a byte into a #GString, expanding it if necessary.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="pos" transfer-ownership="none">
- <doc xml:space="preserve">the position to insert the byte</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">the byte to insert</doc>
- <type name="gchar" c:type="gchar"/>
- </parameter>
- </parameters>
- </method>
- <method name="insert_len" c:identifier="g_string_insert_len">
- <doc xml:space="preserve">Inserts @len bytes of @val into @string at @pos.
- Because @len is provided, @val may contain embedded
- nuls and need not be nul-terminated. If @pos is -1,
- bytes are inserted at the end of the string.
- Since this function does not stop at nul bytes, it is
- the caller's responsibility to ensure that @val has at
- least @len addressable bytes.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="pos" transfer-ownership="none">
- <doc xml:space="preserve">position in @string where insertion should
- happen, or -1 for at the end</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">bytes to insert</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">number of bytes of @val to insert</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </method>
- <method name="insert_unichar" c:identifier="g_string_insert_unichar">
- <doc xml:space="preserve">Converts a Unicode character into UTF-8, and insert it
- into the string at the given position.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="pos" transfer-ownership="none">
- <doc xml:space="preserve">the position at which to insert character, or -1
- to append at the end of the string</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="wc" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </method>
- <method name="overwrite"
- c:identifier="g_string_overwrite"
- version="2.14">
- <doc xml:space="preserve">Overwrites part of a string, lengthening it if necessary.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="pos" transfer-ownership="none">
- <doc xml:space="preserve">the position at which to start overwriting</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">the string that will overwrite the @string starting at @pos</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="overwrite_len"
- c:identifier="g_string_overwrite_len"
- version="2.14">
- <doc xml:space="preserve">Overwrites part of a string, lengthening it if necessary.
- This function will work with embedded nuls.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="pos" transfer-ownership="none">
- <doc xml:space="preserve">the position at which to start overwriting</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">the string that will overwrite the @string starting at @pos</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes to write from @val</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </method>
- <method name="prepend" c:identifier="g_string_prepend">
- <doc xml:space="preserve">Adds a string on to the start of a #GString,
- expanding it if necessary.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">the string to prepend on the start of @string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="prepend_c" c:identifier="g_string_prepend_c">
- <doc xml:space="preserve">Adds a byte onto the start of a #GString,
- expanding it if necessary.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">the byte to prepend on the start of the #GString</doc>
- <type name="gchar" c:type="gchar"/>
- </parameter>
- </parameters>
- </method>
- <method name="prepend_len" c:identifier="g_string_prepend_len">
- <doc xml:space="preserve">Prepends @len bytes of @val to @string.
- Because @len is provided, @val may contain
- embedded nuls and need not be nul-terminated.
- Since this function does not stop at nul bytes,
- it is the caller's responsibility to ensure that
- @val has at least @len addressable bytes.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">bytes to prepend</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">number of bytes in @val to prepend</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </method>
- <method name="prepend_unichar" c:identifier="g_string_prepend_unichar">
- <doc xml:space="preserve">Converts a Unicode character into UTF-8, and prepends it
- to the string.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="wc" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </method>
- <method name="printf" c:identifier="g_string_printf" introspectable="0">
- <doc xml:space="preserve">Writes a formatted string into a #GString.
- This is similar to the standard sprintf() function,
- except that the #GString buffer automatically expands
- to contain the results. The previous contents of the
- #GString are destroyed.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">the string format. See the printf() documentation</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the parameters to insert into the format string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </method>
- <method name="set_size" c:identifier="g_string_set_size">
- <doc xml:space="preserve">Sets the length of a #GString. If the length is less than
- the current length, the string will be truncated. If the
- length is greater than the current length, the contents
- of the newly added area are undefined. (However, as
- always, string->str[string->len] will be a nul byte.)</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the new length</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </method>
- <method name="truncate" c:identifier="g_string_truncate">
- <doc xml:space="preserve">Cuts off the end of the GString, leaving the first @len bytes.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the new size of @string</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </method>
- <method name="up"
- c:identifier="g_string_up"
- deprecated="1"
- deprecated-version="2.2">
- <doc xml:space="preserve">Converts a #GString to uppercase.</doc>
- <doc-deprecated xml:space="preserve">This function uses the locale-specific
- toupper() function, which is almost never the right thing.
- Use g_string_ascii_up() or g_utf8_strup() instead.</doc-deprecated>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="vprintf"
- c:identifier="g_string_vprintf"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Writes a formatted string into a #GString.
- This function is similar to g_string_printf() except that
- the arguments to the format string are passed as a va_list.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a #GString</doc>
- <type name="String" c:type="GString*"/>
- </instance-parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">the string format. See the printf() documentation</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="args" transfer-ownership="none">
- <doc xml:space="preserve">the parameters to insert into the format string</doc>
- <type name="va_list" c:type="va_list"/>
- </parameter>
- </parameters>
- </method>
- </record>
- <record name="StringChunk" c:type="GStringChunk" disguised="1">
- <doc xml:space="preserve">An opaque data structure representing String Chunks.
- It should only be accessed by using the following functions.</doc>
- <method name="clear" c:identifier="g_string_chunk_clear" version="2.14">
- <doc xml:space="preserve">Frees all strings contained within the #GStringChunk.
- After calling g_string_chunk_clear() it is not safe to
- access any of the strings which were contained within it.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="chunk" transfer-ownership="none">
- <doc xml:space="preserve">a #GStringChunk</doc>
- <type name="StringChunk" c:type="GStringChunk*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_string_chunk_free">
- <doc xml:space="preserve">Frees all memory allocated by the #GStringChunk.
- After calling g_string_chunk_free() it is not safe to
- access any of the strings which were contained within it.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="chunk" transfer-ownership="none">
- <doc xml:space="preserve">a #GStringChunk</doc>
- <type name="StringChunk" c:type="GStringChunk*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="insert" c:identifier="g_string_chunk_insert">
- <doc xml:space="preserve">Adds a copy of @string to the #GStringChunk.
- It returns a pointer to the new copy of the string
- in the #GStringChunk. The characters in the string
- can be changed, if necessary, though you should not
- change anything after the end of the string.
- Unlike g_string_chunk_insert_const(), this function
- does not check for duplicates. Also strings added
- with g_string_chunk_insert() will not be searched
- by g_string_chunk_insert_const() when looking for
- duplicates.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a pointer to the copy of @string within
- the #GStringChunk</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="chunk" transfer-ownership="none">
- <doc xml:space="preserve">a #GStringChunk</doc>
- <type name="StringChunk" c:type="GStringChunk*"/>
- </instance-parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to add</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="insert_const" c:identifier="g_string_chunk_insert_const">
- <doc xml:space="preserve">Adds a copy of @string to the #GStringChunk, unless the same
- string has already been added to the #GStringChunk with
- g_string_chunk_insert_const().
- This function is useful if you need to copy a large number
- of strings but do not want to waste space storing duplicates.
- But you must remember that there may be several pointers to
- the same string, and so any changes made to the strings
- should be done very carefully.
- Note that g_string_chunk_insert_const() will not return a
- pointer to a string added with g_string_chunk_insert(), even
- if they do match.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a pointer to the new or existing copy of @string
- within the #GStringChunk</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="chunk" transfer-ownership="none">
- <doc xml:space="preserve">a #GStringChunk</doc>
- <type name="StringChunk" c:type="GStringChunk*"/>
- </instance-parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to add</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="insert_len"
- c:identifier="g_string_chunk_insert_len"
- version="2.4">
- <doc xml:space="preserve">Adds a copy of the first @len bytes of @string to the #GStringChunk.
- The copy is nul-terminated.
- Since this function does not stop at nul bytes, it is the caller's
- responsibility to ensure that @string has at least @len addressable
- bytes.
- The characters in the returned string can be changed, if necessary,
- though you should not change anything after the end of the string.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a pointer to the copy of @string within the #GStringChunk</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="chunk" transfer-ownership="none">
- <doc xml:space="preserve">a #GStringChunk</doc>
- <type name="StringChunk" c:type="GStringChunk*"/>
- </instance-parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">bytes to insert</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">number of bytes of @string to insert, or -1 to insert a
- nul-terminated string</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </method>
- <function name="new"
- c:identifier="g_string_chunk_new"
- introspectable="0">
- <doc xml:space="preserve">Creates a new #GStringChunk.</doc>
- <return-value>
- <doc xml:space="preserve">a new #GStringChunk</doc>
- <type name="StringChunk" c:type="GStringChunk*"/>
- </return-value>
- <parameters>
- <parameter name="size" transfer-ownership="none">
- <doc xml:space="preserve">the default size of the blocks of memory which are
- allocated to store the strings. If a particular string
- is larger than this default size, a larger block of
- memory will be allocated for it.</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <constant name="TIME_SPAN_DAY"
- value="86400000000"
- c:type="G_TIME_SPAN_DAY"
- version="2.26">
- <doc xml:space="preserve">Evaluates to a time span of one day.</doc>
- <type name="gint64" c:type="gint64"/>
- </constant>
- <constant name="TIME_SPAN_HOUR"
- value="3600000000"
- c:type="G_TIME_SPAN_HOUR"
- version="2.26">
- <doc xml:space="preserve">Evaluates to a time span of one hour.</doc>
- <type name="gint64" c:type="gint64"/>
- </constant>
- <constant name="TIME_SPAN_MILLISECOND"
- value="1000"
- c:type="G_TIME_SPAN_MILLISECOND"
- version="2.26">
- <doc xml:space="preserve">Evaluates to a time span of one millisecond.</doc>
- <type name="gint64" c:type="gint64"/>
- </constant>
- <constant name="TIME_SPAN_MINUTE"
- value="60000000"
- c:type="G_TIME_SPAN_MINUTE"
- version="2.26">
- <doc xml:space="preserve">Evaluates to a time span of one minute.</doc>
- <type name="gint64" c:type="gint64"/>
- </constant>
- <constant name="TIME_SPAN_SECOND"
- value="1000000"
- c:type="G_TIME_SPAN_SECOND"
- version="2.26">
- <doc xml:space="preserve">Evaluates to a time span of one second.</doc>
- <type name="gint64" c:type="gint64"/>
- </constant>
- <record name="TestCase" c:type="GTestCase" disguised="1">
- <doc xml:space="preserve">An opaque structure representing a test case.</doc>
- </record>
- <record name="TestConfig" c:type="GTestConfig">
- <field name="test_initialized" writable="1">
- <type name="gboolean" c:type="gboolean"/>
- </field>
- <field name="test_quick" writable="1">
- <type name="gboolean" c:type="gboolean"/>
- </field>
- <field name="test_perf" writable="1">
- <type name="gboolean" c:type="gboolean"/>
- </field>
- <field name="test_verbose" writable="1">
- <type name="gboolean" c:type="gboolean"/>
- </field>
- <field name="test_quiet" writable="1">
- <type name="gboolean" c:type="gboolean"/>
- </field>
- <field name="test_undefined" writable="1">
- <type name="gboolean" c:type="gboolean"/>
- </field>
- </record>
- <callback name="TestDataFunc" c:type="GTestDataFunc" version="2.28">
- <doc xml:space="preserve">The type used for test case functions that take an extra pointer
- argument.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="0">
- <doc xml:space="preserve">the data provided when registering the test</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </callback>
- <enumeration name="TestFileType" version="2.38" c:type="GTestFileType">
- <doc xml:space="preserve">The type of file to return the filename for, when used with
- g_test_build_filename().
- These two options correspond rather directly to the 'dist' and
- 'built' terminology that automake uses and are explicitly used to
- distinguish between the 'srcdir' and 'builddir' being separate. All
- files in your project should either be dist (in the
- `DIST_EXTRA` or `dist_schema_DATA`
- sense, in which case they will always be in the srcdir) or built (in
- the `BUILT_SOURCES` sense, in which case they will
- always be in the builddir).
- Note: as a general rule of automake, files that are generated only as
- part of the build-from-git process (but then are distributed with the
- tarball) always go in srcdir (even if doing a srcdir != builddir
- build from git) and are considered as distributed files.</doc>
- <member name="dist" value="0" c:identifier="G_TEST_DIST">
- <doc xml:space="preserve">a file that was included in the distribution tarball</doc>
- </member>
- <member name="built" value="1" c:identifier="G_TEST_BUILT">
- <doc xml:space="preserve">a file that was built on the compiling machine</doc>
- </member>
- </enumeration>
- <callback name="TestFixtureFunc" c:type="GTestFixtureFunc" version="2.28">
- <doc xml:space="preserve">The type used for functions that operate on test fixtures. This is
- used for the fixture setup and teardown functions as well as for the
- testcases themselves.
- @user_data is a pointer to the data that was given when registering
- the test case.
- @fixture will be a pointer to the area of memory allocated by the
- test framework, of the size requested. If the requested size was
- zero then @fixture will be equal to @user_data.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="fixture" transfer-ownership="none">
- <doc xml:space="preserve">the test fixture</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="1">
- <doc xml:space="preserve">the data provided when registering the test</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </callback>
- <callback name="TestFunc" c:type="GTestFunc" version="2.28">
- <doc xml:space="preserve">The type used for test case functions.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- </callback>
- <record name="TestLogBuffer" c:type="GTestLogBuffer">
- <field name="data" readable="0" private="1">
- <type name="String" c:type="GString*"/>
- </field>
- <field name="msgs" readable="0" private="1">
- <type name="GLib.SList" c:type="GSList*">
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </field>
- <method name="free" c:identifier="g_test_log_buffer_free">
- <doc xml:space="preserve">Internal function for gtester to free test log messages, no ABI guarantees provided.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="tbuffer" transfer-ownership="none">
- <type name="TestLogBuffer" c:type="GTestLogBuffer*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="pop"
- c:identifier="g_test_log_buffer_pop"
- introspectable="0">
- <doc xml:space="preserve">Internal function for gtester to retrieve test log messages, no ABI guarantees provided.</doc>
- <return-value>
- <type name="TestLogMsg" c:type="GTestLogMsg*"/>
- </return-value>
- <parameters>
- <instance-parameter name="tbuffer" transfer-ownership="none">
- <type name="TestLogBuffer" c:type="GTestLogBuffer*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="push" c:identifier="g_test_log_buffer_push">
- <doc xml:space="preserve">Internal function for gtester to decode test log messages, no ABI guarantees provided.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="tbuffer" transfer-ownership="none">
- <type name="TestLogBuffer" c:type="GTestLogBuffer*"/>
- </instance-parameter>
- <parameter name="n_bytes" transfer-ownership="none">
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="bytes" transfer-ownership="none">
- <type name="guint8" c:type="const guint8*"/>
- </parameter>
- </parameters>
- </method>
- <function name="new"
- c:identifier="g_test_log_buffer_new"
- introspectable="0">
- <doc xml:space="preserve">Internal function for gtester to decode test log messages, no ABI guarantees provided.</doc>
- <return-value>
- <type name="TestLogBuffer" c:type="GTestLogBuffer*"/>
- </return-value>
- </function>
- </record>
- <callback name="TestLogFatalFunc"
- c:type="GTestLogFatalFunc"
- version="2.22">
- <doc xml:space="preserve">Specifies the prototype of fatal log handler functions.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the program should abort, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="log_domain" transfer-ownership="none">
- <doc xml:space="preserve">the log domain of the message</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="log_level" transfer-ownership="none">
- <doc xml:space="preserve">the log level of the message (including the fatal and recursion flags)</doc>
- <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
- </parameter>
- <parameter name="message" transfer-ownership="none">
- <doc xml:space="preserve">the message to process</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="3">
- <doc xml:space="preserve">user data, set in g_test_log_set_fatal_handler()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <record name="TestLogMsg" c:type="GTestLogMsg">
- <field name="log_type" writable="1">
- <type name="TestLogType" c:type="GTestLogType"/>
- </field>
- <field name="n_strings" writable="1">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="strings" writable="1">
- <type name="utf8" c:type="gchar**"/>
- </field>
- <field name="n_nums" writable="1">
- <type name="guint" c:type="guint"/>
- </field>
- <field name="nums" writable="1">
- <type name="glong" c:type="long*"/>
- </field>
- <method name="free" c:identifier="g_test_log_msg_free">
- <doc xml:space="preserve">Internal function for gtester to free test log messages, no ABI guarantees provided.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="tmsg" transfer-ownership="none">
- <type name="TestLogMsg" c:type="GTestLogMsg*"/>
- </instance-parameter>
- </parameters>
- </method>
- </record>
- <enumeration name="TestLogType" c:type="GTestLogType">
- <member name="none" value="0" c:identifier="G_TEST_LOG_NONE">
- </member>
- <member name="error" value="1" c:identifier="G_TEST_LOG_ERROR">
- </member>
- <member name="start_binary"
- value="2"
- c:identifier="G_TEST_LOG_START_BINARY">
- </member>
- <member name="list_case" value="3" c:identifier="G_TEST_LOG_LIST_CASE">
- </member>
- <member name="skip_case" value="4" c:identifier="G_TEST_LOG_SKIP_CASE">
- </member>
- <member name="start_case" value="5" c:identifier="G_TEST_LOG_START_CASE">
- </member>
- <member name="stop_case" value="6" c:identifier="G_TEST_LOG_STOP_CASE">
- </member>
- <member name="min_result" value="7" c:identifier="G_TEST_LOG_MIN_RESULT">
- </member>
- <member name="max_result" value="8" c:identifier="G_TEST_LOG_MAX_RESULT">
- </member>
- <member name="message" value="9" c:identifier="G_TEST_LOG_MESSAGE">
- </member>
- <member name="start_suite"
- value="10"
- c:identifier="G_TEST_LOG_START_SUITE">
- </member>
- <member name="stop_suite"
- value="11"
- c:identifier="G_TEST_LOG_STOP_SUITE">
- </member>
- </enumeration>
- <bitfield name="TestSubprocessFlags" c:type="GTestSubprocessFlags">
- <doc xml:space="preserve">Flags to pass to g_test_trap_subprocess() to control input and output.
- Note that in contrast with g_test_trap_fork(), the default is to
- not show stdout and stderr.</doc>
- <member name="stdin"
- value="1"
- c:identifier="G_TEST_SUBPROCESS_INHERIT_STDIN">
- <doc xml:space="preserve">If this flag is given, the child
- process will inherit the parent's stdin. Otherwise, the child's
- stdin is redirected to `/dev/null`.</doc>
- </member>
- <member name="stdout"
- value="2"
- c:identifier="G_TEST_SUBPROCESS_INHERIT_STDOUT">
- <doc xml:space="preserve">If this flag is given, the child
- process will inherit the parent's stdout. Otherwise, the child's
- stdout will not be visible, but it will be captured to allow
- later tests with g_test_trap_assert_stdout().</doc>
- </member>
- <member name="stderr"
- value="4"
- c:identifier="G_TEST_SUBPROCESS_INHERIT_STDERR">
- <doc xml:space="preserve">If this flag is given, the child
- process will inherit the parent's stderr. Otherwise, the child's
- stderr will not be visible, but it will be captured to allow
- later tests with g_test_trap_assert_stderr().</doc>
- </member>
- </bitfield>
- <record name="TestSuite" c:type="GTestSuite" disguised="1">
- <doc xml:space="preserve">An opaque structure representing a test suite.</doc>
- <method name="add" c:identifier="g_test_suite_add" version="2.16">
- <doc xml:space="preserve">Adds @test_case to @suite.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="suite" transfer-ownership="none">
- <doc xml:space="preserve">a #GTestSuite</doc>
- <type name="TestSuite" c:type="GTestSuite*"/>
- </instance-parameter>
- <parameter name="test_case" transfer-ownership="none">
- <doc xml:space="preserve">a #GTestCase</doc>
- <type name="TestCase" c:type="GTestCase*"/>
- </parameter>
- </parameters>
- </method>
- <method name="add_suite"
- c:identifier="g_test_suite_add_suite"
- version="2.16">
- <doc xml:space="preserve">Adds @nestedsuite to @suite.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="suite" transfer-ownership="none">
- <doc xml:space="preserve">a #GTestSuite</doc>
- <type name="TestSuite" c:type="GTestSuite*"/>
- </instance-parameter>
- <parameter name="nestedsuite" transfer-ownership="none">
- <doc xml:space="preserve">another #GTestSuite</doc>
- <type name="TestSuite" c:type="GTestSuite*"/>
- </parameter>
- </parameters>
- </method>
- </record>
- <bitfield name="TestTrapFlags" deprecated="1" c:type="GTestTrapFlags">
- <doc xml:space="preserve">Test traps are guards around forked tests.
- These flags determine what traps to set.</doc>
- <doc-deprecated xml:space="preserve">#GTestTrapFlags is used only with g_test_trap_fork(),
- which is deprecated. g_test_trap_subprocess() uses
- #GTestTrapSubprocessFlags.</doc-deprecated>
- <member name="silence_stdout"
- value="128"
- c:identifier="G_TEST_TRAP_SILENCE_STDOUT">
- <doc xml:space="preserve">Redirect stdout of the test child to
- `/dev/null` so it cannot be observed on the console during test
- runs. The actual output is still captured though to allow later
- tests with g_test_trap_assert_stdout().</doc>
- </member>
- <member name="silence_stderr"
- value="256"
- c:identifier="G_TEST_TRAP_SILENCE_STDERR">
- <doc xml:space="preserve">Redirect stderr of the test child to
- `/dev/null` so it cannot be observed on the console during test
- runs. The actual output is still captured though to allow later
- tests with g_test_trap_assert_stderr().</doc>
- </member>
- <member name="inherit_stdin"
- value="512"
- c:identifier="G_TEST_TRAP_INHERIT_STDIN">
- <doc xml:space="preserve">If this flag is given, stdin of the
- child process is shared with stdin of its parent process.
- It is redirected to `/dev/null` otherwise.</doc>
- </member>
- </bitfield>
- <record name="Thread"
- c:type="GThread"
- glib:type-name="GThread"
- glib:get-type="g_thread_get_type"
- c:symbol-prefix="thread">
- <doc xml:space="preserve">The #GThread struct represents a running thread. This struct
- is returned by g_thread_new() or g_thread_try_new(). You can
- obtain the #GThread struct representing the current thread by
- calling g_thread_self().
- GThread is refcounted, see g_thread_ref() and g_thread_unref().
- The thread represented by it holds a reference while it is running,
- and g_thread_join() consumes the reference that it is given, so
- it is normally not necessary to manage GThread references
- explicitly.
- The structure is opaque -- none of its fields may be directly
- accessed.</doc>
- <constructor name="new"
- c:identifier="g_thread_new"
- version="2.32"
- introspectable="0">
- <doc xml:space="preserve">This function creates a new thread. The new thread starts by invoking
- @func with the argument data. The thread will run until @func returns
- or until g_thread_exit() is called from the new thread. The return value
- of @func becomes the return value of the thread, which can be obtained
- with g_thread_join().
- The @name can be useful for discriminating threads in a debugger.
- It is not used for other purposes and does not have to be unique.
- Some systems restrict the length of @name to 16 bytes.
- If the thread can not be created the program aborts. See
- g_thread_try_new() if you want to attempt to deal with failures.
- If you are using threads to offload (potentially many) short-lived tasks,
- #GThreadPool may be more appropriate than manually spawning and tracking
- multiple #GThreads.
- To free the struct returned by this function, use g_thread_unref().
- Note that g_thread_join() implicitly unrefs the #GThread as well.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the new #GThread</doc>
- <type name="Thread" c:type="GThread*"/>
- </return-value>
- <parameters>
- <parameter name="name"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">an (optional) name for the new thread</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">a function to execute in the new thread</doc>
- <type name="ThreadFunc" c:type="GThreadFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">an argument to supply to the new thread</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="try_new"
- c:identifier="g_thread_try_new"
- version="2.32"
- introspectable="0"
- throws="1">
- <doc xml:space="preserve">This function is the same as g_thread_new() except that
- it allows for the possibility of failure.
- If a thread can not be created (due to resource limits),
- @error is set and %NULL is returned.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the new #GThread, or %NULL if an error occurred</doc>
- <type name="Thread" c:type="GThread*"/>
- </return-value>
- <parameters>
- <parameter name="name"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">an (optional) name for the new thread</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">a function to execute in the new thread</doc>
- <type name="ThreadFunc" c:type="GThreadFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">an argument to supply to the new thread</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="join" c:identifier="g_thread_join">
- <doc xml:space="preserve">Waits until @thread finishes, i.e. the function @func, as
- given to g_thread_new(), returns or g_thread_exit() is called.
- If @thread has already terminated, then g_thread_join()
- returns immediately.
- Any thread can wait for any other thread by calling g_thread_join(),
- not just its 'creator'. Calling g_thread_join() from multiple threads
- for the same @thread leads to undefined behaviour.
- The value returned by @func or given to g_thread_exit() is
- returned by this function.
- g_thread_join() consumes the reference to the passed-in @thread.
- This will usually cause the #GThread struct and associated resources
- to be freed. Use g_thread_ref() to obtain an extra reference if you
- want to keep the GThread alive beyond the g_thread_join() call.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the return value of the thread</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="thread" transfer-ownership="none">
- <doc xml:space="preserve">a #GThread</doc>
- <type name="Thread" c:type="GThread*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_thread_ref" version="2.32">
- <doc xml:space="preserve">Increase the reference count on @thread.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new reference to @thread</doc>
- <type name="Thread" c:type="GThread*"/>
- </return-value>
- <parameters>
- <instance-parameter name="thread" transfer-ownership="none">
- <doc xml:space="preserve">a #GThread</doc>
- <type name="Thread" c:type="GThread*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_thread_unref" version="2.32">
- <doc xml:space="preserve">Decrease the reference count on @thread, possibly freeing all
- resources associated with it.
- Note that each thread holds a reference to its #GThread while
- it is running, so it is safe to drop your own reference to it
- if you don't need it anymore.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="thread" transfer-ownership="none">
- <doc xml:space="preserve">a #GThread</doc>
- <type name="Thread" c:type="GThread*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="error_quark" c:identifier="g_thread_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="exit" c:identifier="g_thread_exit">
- <doc xml:space="preserve">Terminates the current thread.
- If another thread is waiting for us using g_thread_join() then the
- waiting thread will be woken up and get @retval as the return value
- of g_thread_join().
- Calling g_thread_exit() with a parameter @retval is equivalent to
- returning @retval from the function @func, as given to g_thread_new().
- You must only call g_thread_exit() from a thread that you created
- yourself with g_thread_new() or related APIs. You must not call
- this function from a thread created with another threading library
- or or from within a #GThreadPool.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="retval"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the return value of this thread</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="self" c:identifier="g_thread_self">
- <doc xml:space="preserve">This function returns the #GThread corresponding to the
- current thread. Note that this function does not increase
- the reference count of the returned struct.
- This function will return a #GThread even for threads that
- were not created by GLib (i.e. those created by other threading
- APIs). This may be useful for thread identification purposes
- (i.e. comparisons) but you must not use GLib functions (such
- as g_thread_join()) on these threads.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the #GThread representing the current thread</doc>
- <type name="Thread" c:type="GThread*"/>
- </return-value>
- </function>
- <function name="yield" c:identifier="g_thread_yield">
- <doc xml:space="preserve">Causes the calling thread to voluntarily relinquish the CPU, so
- that other threads can run.
- This function is often used as a method to make busy wait less evil.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- </function>
- </record>
- <enumeration name="ThreadError"
- c:type="GThreadError"
- glib:error-domain="g_thread_error">
- <doc xml:space="preserve">Possible errors of thread related functions.</doc>
- <member name="thread_error_again"
- value="0"
- c:identifier="G_THREAD_ERROR_AGAIN">
- <doc xml:space="preserve">a thread couldn't be created due to resource
- shortage. Try again later.</doc>
- </member>
- </enumeration>
- <callback name="ThreadFunc" c:type="GThreadFunc">
- <doc xml:space="preserve">Specifies the type of the @func functions passed to g_thread_new()
- or g_thread_try_new().</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the return value of the thread</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data passed to the thread</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <record name="ThreadPool" c:type="GThreadPool">
- <doc xml:space="preserve">The #GThreadPool struct represents a thread pool. It has three
- public read-only members, but the underlying struct is bigger,
- so you must not copy this struct.</doc>
- <field name="func" writable="1">
- <doc xml:space="preserve">the function to execute in the threads of this pool</doc>
- <type name="Func" c:type="GFunc"/>
- </field>
- <field name="user_data" writable="1">
- <doc xml:space="preserve">the user data for the threads of this pool</doc>
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="exclusive" writable="1">
- <doc xml:space="preserve">are all threads exclusive to this pool</doc>
- <type name="gboolean" c:type="gboolean"/>
- </field>
- <method name="free" c:identifier="g_thread_pool_free">
- <doc xml:space="preserve">Frees all resources allocated for @pool.
- If @immediate is %TRUE, no new task is processed for @pool.
- Otherwise @pool is not freed before the last task is processed.
- Note however, that no thread of this pool is interrupted while
- processing a task. Instead at least all still running threads
- can finish their tasks before the @pool is freed.
- If @wait_ is %TRUE, the functions does not return before all
- tasks to be processed (dependent on @immediate, whether all
- or only the currently running) are ready.
- Otherwise the function returns immediately.
- After calling this function @pool must not be used anymore.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="pool" transfer-ownership="none">
- <doc xml:space="preserve">a #GThreadPool</doc>
- <type name="ThreadPool" c:type="GThreadPool*"/>
- </instance-parameter>
- <parameter name="immediate" transfer-ownership="none">
- <doc xml:space="preserve">should @pool shut down immediately?</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="wait_" transfer-ownership="none">
- <doc xml:space="preserve">should the function wait for all tasks to be finished?</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_max_threads"
- c:identifier="g_thread_pool_get_max_threads">
- <doc xml:space="preserve">Returns the maximal number of threads for @pool.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the maximal number of threads</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="pool" transfer-ownership="none">
- <doc xml:space="preserve">a #GThreadPool</doc>
- <type name="ThreadPool" c:type="GThreadPool*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_num_threads"
- c:identifier="g_thread_pool_get_num_threads">
- <doc xml:space="preserve">Returns the number of threads currently running in @pool.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of threads currently running</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="pool" transfer-ownership="none">
- <doc xml:space="preserve">a #GThreadPool</doc>
- <type name="ThreadPool" c:type="GThreadPool*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="move_to_front"
- c:identifier="g_thread_pool_move_to_front"
- version="2.46">
- <doc xml:space="preserve">Moves the item to the front of the queue of unprocessed
- items, so that it will be processed next.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the item was found and moved</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="pool" transfer-ownership="none">
- <doc xml:space="preserve">a #GThreadPool</doc>
- <type name="ThreadPool" c:type="GThreadPool*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">an unprocessed item in the pool</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="push" c:identifier="g_thread_pool_push" throws="1">
- <doc xml:space="preserve">Inserts @data into the list of tasks to be executed by @pool.
- When the number of currently running threads is lower than the
- maximal allowed number of threads, a new thread is started (or
- reused) with the properties given to g_thread_pool_new().
- Otherwise, @data stays in the queue until a thread in this pool
- finishes its previous task and processes @data.
- @error can be %NULL to ignore errors, or non-%NULL to report
- errors. An error can only occur when a new thread couldn't be
- created. In that case @data is simply appended to the queue of
- work to do.
- Before version 2.32, this function did not return a success status.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on success, %FALSE if an error occurred</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="pool" transfer-ownership="none">
- <doc xml:space="preserve">a #GThreadPool</doc>
- <type name="ThreadPool" c:type="GThreadPool*"/>
- </instance-parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a new task for @pool</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_max_threads"
- c:identifier="g_thread_pool_set_max_threads"
- throws="1">
- <doc xml:space="preserve">Sets the maximal allowed number of threads for @pool.
- A value of -1 means that the maximal number of threads
- is unlimited. If @pool is an exclusive thread pool, setting
- the maximal number of threads to -1 is not allowed.
- Setting @max_threads to 0 means stopping all work for @pool.
- It is effectively frozen until @max_threads is set to a non-zero
- value again.
- A thread is never terminated while calling @func, as supplied by
- g_thread_pool_new(). Instead the maximal number of threads only
- has effect for the allocation of new threads in g_thread_pool_push().
- A new thread is allocated, whenever the number of currently
- running threads in @pool is smaller than the maximal number.
- @error can be %NULL to ignore errors, or non-%NULL to report
- errors. An error can only occur when a new thread couldn't be
- created.
- Before version 2.32, this function did not return a success status.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on success, %FALSE if an error occurred</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="pool" transfer-ownership="none">
- <doc xml:space="preserve">a #GThreadPool</doc>
- <type name="ThreadPool" c:type="GThreadPool*"/>
- </instance-parameter>
- <parameter name="max_threads" transfer-ownership="none">
- <doc xml:space="preserve">a new maximal number of threads for @pool,
- or -1 for unlimited</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="set_sort_function"
- c:identifier="g_thread_pool_set_sort_function"
- version="2.10"
- introspectable="0">
- <doc xml:space="preserve">Sets the function used to sort the list of tasks. This allows the
- tasks to be processed by a priority determined by @func, and not
- just in the order in which they were added to the pool.
- Note, if the maximum number of threads is more than 1, the order
- that threads are executed cannot be guaranteed 100%. Threads are
- scheduled by the operating system and are executed at random. It
- cannot be assumed that threads are executed in the order they are
- created.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="pool" transfer-ownership="none">
- <doc xml:space="preserve">a #GThreadPool</doc>
- <type name="ThreadPool" c:type="GThreadPool*"/>
- </instance-parameter>
- <parameter name="func" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">the #GCompareDataFunc used to sort the list of tasks.
- This function is passed two tasks. It should return
- 0 if the order in which they are handled does not matter,
- a negative value if the first task should be processed before
- the second or a positive value if the second task should be
- processed first.</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to @func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="unprocessed" c:identifier="g_thread_pool_unprocessed">
- <doc xml:space="preserve">Returns the number of tasks still unprocessed in @pool.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of unprocessed tasks</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="pool" transfer-ownership="none">
- <doc xml:space="preserve">a #GThreadPool</doc>
- <type name="ThreadPool" c:type="GThreadPool*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="get_max_idle_time"
- c:identifier="g_thread_pool_get_max_idle_time"
- version="2.10">
- <doc xml:space="preserve">This function will return the maximum @interval that a
- thread will wait in the thread pool for new tasks before
- being stopped.
- If this function returns 0, threads waiting in the thread
- pool for new work are not stopped.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the maximum @interval (milliseconds) to wait
- for new tasks in the thread pool before stopping the
- thread</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- </function>
- <function name="get_max_unused_threads"
- c:identifier="g_thread_pool_get_max_unused_threads">
- <doc xml:space="preserve">Returns the maximal allowed number of unused threads.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the maximal number of unused threads</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- </function>
- <function name="get_num_unused_threads"
- c:identifier="g_thread_pool_get_num_unused_threads">
- <doc xml:space="preserve">Returns the number of currently unused threads.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of currently unused threads</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- </function>
- <function name="new"
- c:identifier="g_thread_pool_new"
- introspectable="0"
- throws="1">
- <doc xml:space="preserve">This function creates a new thread pool.
- Whenever you call g_thread_pool_push(), either a new thread is
- created or an unused one is reused. At most @max_threads threads
- are running concurrently for this thread pool. @max_threads = -1
- allows unlimited threads to be created for this thread pool. The
- newly created or reused thread now executes the function @func
- with the two arguments. The first one is the parameter to
- g_thread_pool_push() and the second one is @user_data.
- The parameter @exclusive determines whether the thread pool owns
- all threads exclusive or shares them with other thread pools.
- If @exclusive is %TRUE, @max_threads threads are started
- immediately and they will run exclusively for this thread pool
- until it is destroyed by g_thread_pool_free(). If @exclusive is
- %FALSE, threads are created when needed and shared between all
- non-exclusive thread pools. This implies that @max_threads may
- not be -1 for exclusive thread pools. Besides, exclusive thread
- pools are not affected by g_thread_pool_set_max_idle_time()
- since their threads are never considered idle and returned to the
- global pool.
- @error can be %NULL to ignore errors, or non-%NULL to report
- errors. An error can only occur when @exclusive is set to %TRUE
- and not all @max_threads threads could be created.
- See #GThreadError for possible errors that may occur.
- Note, even in case of error a valid #GThreadPool is returned.</doc>
- <return-value>
- <doc xml:space="preserve">the new #GThreadPool</doc>
- <type name="ThreadPool" c:type="GThreadPool*"/>
- </return-value>
- <parameters>
- <parameter name="func" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">a function to execute in the threads of the new thread pool</doc>
- <type name="Func" c:type="GFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data that is handed over to @func every time it
- is called</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="max_threads" transfer-ownership="none">
- <doc xml:space="preserve">the maximal number of threads to execute concurrently
- in the new thread pool, -1 means no limit</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="exclusive" transfer-ownership="none">
- <doc xml:space="preserve">should this thread pool be exclusive?</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </function>
- <function name="set_max_idle_time"
- c:identifier="g_thread_pool_set_max_idle_time"
- version="2.10">
- <doc xml:space="preserve">This function will set the maximum @interval that a thread
- waiting in the pool for new tasks can be idle for before
- being stopped. This function is similar to calling
- g_thread_pool_stop_unused_threads() on a regular timeout,
- except this is done on a per thread basis.
- By setting @interval to 0, idle threads will not be stopped.
- The default value is 15000 (15 seconds).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="interval" transfer-ownership="none">
- <doc xml:space="preserve">the maximum @interval (in milliseconds)
- a thread can be idle</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="set_max_unused_threads"
- c:identifier="g_thread_pool_set_max_unused_threads">
- <doc xml:space="preserve">Sets the maximal number of unused threads to @max_threads.
- If @max_threads is -1, no limit is imposed on the number
- of unused threads.
- The default value is 2.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="max_threads" transfer-ownership="none">
- <doc xml:space="preserve">maximal number of unused threads</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="stop_unused_threads"
- c:identifier="g_thread_pool_stop_unused_threads">
- <doc xml:space="preserve">Stops all currently unused threads. This does not change the
- maximal number of unused threads. This function can be used to
- regularly stop all unused threads e.g. from g_timeout_add().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- </function>
- </record>
- <enumeration name="TimeType" c:type="GTimeType">
- <doc xml:space="preserve">Disambiguates a given time in two ways.
- First, specifies if the given time is in universal or local time.
- Second, if the time is in local time, specifies if it is local
- standard time or local daylight time. This is important for the case
- where the same local time occurs twice (during daylight savings time
- transitions, for example).</doc>
- <member name="standard" value="0" c:identifier="G_TIME_TYPE_STANDARD">
- <doc xml:space="preserve">the time is in local standard time</doc>
- </member>
- <member name="daylight" value="1" c:identifier="G_TIME_TYPE_DAYLIGHT">
- <doc xml:space="preserve">the time is in local daylight time</doc>
- </member>
- <member name="universal" value="2" c:identifier="G_TIME_TYPE_UNIVERSAL">
- <doc xml:space="preserve">the time is in UTC</doc>
- </member>
- </enumeration>
- <record name="TimeVal" c:type="GTimeVal">
- <doc xml:space="preserve">Represents a precise time, with seconds and microseconds.
- Similar to the struct timeval returned by the gettimeofday()
- UNIX system call.
- GLib is attempting to unify around the use of 64bit integers to
- represent microsecond-precision time. As such, this type will be
- removed from a future version of GLib.</doc>
- <field name="tv_sec" writable="1">
- <doc xml:space="preserve">seconds</doc>
- <type name="glong" c:type="glong"/>
- </field>
- <field name="tv_usec" writable="1">
- <doc xml:space="preserve">microseconds</doc>
- <type name="glong" c:type="glong"/>
- </field>
- <method name="add" c:identifier="g_time_val_add">
- <doc xml:space="preserve">Adds the given number of microseconds to @time_. @microseconds can
- also be negative to decrease the value of @time_.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="time_" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeVal</doc>
- <type name="TimeVal" c:type="GTimeVal*"/>
- </instance-parameter>
- <parameter name="microseconds" transfer-ownership="none">
- <doc xml:space="preserve">number of microseconds to add to @time</doc>
- <type name="glong" c:type="glong"/>
- </parameter>
- </parameters>
- </method>
- <method name="to_iso8601"
- c:identifier="g_time_val_to_iso8601"
- version="2.12">
- <doc xml:space="preserve">Converts @time_ into an RFC 3339 encoded string, relative to the
- Coordinated Universal Time (UTC). This is one of the many formats
- allowed by ISO 8601.
- ISO 8601 allows a large number of date/time formats, with or without
- punctuation and optional elements. The format returned by this function
- is a complete date and time, with optional punctuation included, the
- UTC time zone represented as "Z", and the @tv_usec part included if
- and only if it is nonzero, i.e. either
- "YYYY-MM-DDTHH:MM:SSZ" or "YYYY-MM-DDTHH:MM:SS.fffffZ".
- This corresponds to the Internet date/time format defined by
- [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt),
- and to either of the two most-precise formats defined by
- the W3C Note
- [Date and Time Formats](http://www.w3.org/TR/NOTE-datetime-19980827).
- Both of these documents are profiles of ISO 8601.
- Use g_date_time_format() or g_strdup_printf() if a different
- variation of ISO 8601 format is required.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string containing an ISO 8601 date</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="time_" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeVal</doc>
- <type name="TimeVal" c:type="GTimeVal*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="from_iso8601"
- c:identifier="g_time_val_from_iso8601"
- version="2.12">
- <doc xml:space="preserve">Converts a string containing an ISO 8601 encoded date and time
- to a #GTimeVal and puts it into @time_.
- @iso_date must include year, month, day, hours, minutes, and
- seconds. It can optionally include fractions of a second and a time
- zone indicator. (In the absence of any time zone indication, the
- timestamp is assumed to be in local time.)</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the conversion was successful.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="iso_date" transfer-ownership="none">
- <doc xml:space="preserve">an ISO 8601 encoded date string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="time_"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeVal</doc>
- <type name="TimeVal" c:type="GTimeVal*"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <record name="TimeZone"
- c:type="GTimeZone"
- version="2.26"
- glib:type-name="GTimeZone"
- glib:get-type="g_time_zone_get_type"
- c:symbol-prefix="time_zone">
- <doc xml:space="preserve">#GTimeZone is an opaque structure whose members cannot be accessed
- directly.</doc>
- <constructor name="new" c:identifier="g_time_zone_new" version="2.26">
- <doc xml:space="preserve">Creates a #GTimeZone corresponding to @identifier.
- @identifier can either be an RFC3339/ISO 8601 time offset or
- something that would pass as a valid value for the `TZ` environment
- variable (including %NULL).
- In Windows, @identifier can also be the unlocalized name of a time
- zone for standard time, for example "Pacific Standard Time".
- Valid RFC3339 time offsets are `"Z"` (for UTC) or
- `"±hh:mm"`. ISO 8601 additionally specifies
- `"±hhmm"` and `"±hh"`. Offsets are
- time values to be added to Coordinated Universal Time (UTC) to get
- the local time.
- In UNIX, the `TZ` environment variable typically corresponds
- to the name of a file in the zoneinfo database, or string in
- "std offset [dst [offset],start[/time],end[/time]]" (POSIX) format.
- There are no spaces in the specification. The name of standard
- and daylight savings time zone must be three or more alphabetic
- characters. Offsets are time values to be added to local time to
- get Coordinated Universal Time (UTC) and should be
- `"[±]hh[[:]mm[:ss]]"`. Dates are either
- `"Jn"` (Julian day with n between 1 and 365, leap
- years not counted), `"n"` (zero-based Julian day
- with n between 0 and 365) or `"Mm.w.d"` (day d
- (0 <= d <= 6) of week w (1 <= w <= 5) of month m (1 <= m <= 12), day
- 0 is a Sunday). Times are in local wall clock time, the default is
- 02:00:00.
- In Windows, the "tzn[+|–]hh[:mm[:ss]][dzn]" format is used, but also
- accepts POSIX format. The Windows format uses US rules for all time
- zones; daylight savings time is 60 minutes behind the standard time
- with date and time of change taken from Pacific Standard Time.
- Offsets are time values to be added to the local time to get
- Coordinated Universal Time (UTC).
- g_time_zone_new_local() calls this function with the value of the
- `TZ` environment variable. This function itself is independent of
- the value of `TZ`, but if @identifier is %NULL then `/etc/localtime`
- will be consulted to discover the correct time zone on UNIX and the
- registry will be consulted or GetTimeZoneInformation() will be used
- to get the local time zone on Windows.
- If intervals are not available, only time zone rules from `TZ`
- environment variable or other means, then they will be computed
- from year 1900 to 2037. If the maximum year for the rules is
- available and it is greater than 2037, then it will followed
- instead.
- See
- [RFC3339 §5.6](http://tools.ietf.org/html/rfc3339#section-5.6)
- for a precise definition of valid RFC3339 time offsets
- (the `time-offset` expansion) and ISO 8601 for the
- full list of valid time offsets. See
- [The GNU C Library manual](http://www.gnu.org/s/libc/manual/html_node/TZ-Variable.html)
- for an explanation of the possible
- values of the `TZ` environment variable. See
- [Microsoft Time Zone Index Values](http://msdn.microsoft.com/en-us/library/ms912391%28v=winembedded.11%29.aspx)
- for the list of time zones on Windows.
- You should release the return value by calling g_time_zone_unref()
- when you are done with it.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the requested timezone</doc>
- <type name="TimeZone" c:type="GTimeZone*"/>
- </return-value>
- <parameters>
- <parameter name="identifier"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a timezone identifier</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_local"
- c:identifier="g_time_zone_new_local"
- version="2.26">
- <doc xml:space="preserve">Creates a #GTimeZone corresponding to local time. The local time
- zone may change between invocations to this function; for example,
- if the system administrator changes it.
- This is equivalent to calling g_time_zone_new() with the value of
- the `TZ` environment variable (including the possibility of %NULL).
- You should release the return value by calling g_time_zone_unref()
- when you are done with it.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the local timezone</doc>
- <type name="TimeZone" c:type="GTimeZone*"/>
- </return-value>
- </constructor>
- <constructor name="new_utc"
- c:identifier="g_time_zone_new_utc"
- version="2.26">
- <doc xml:space="preserve">Creates a #GTimeZone corresponding to UTC.
- This is equivalent to calling g_time_zone_new() with a value like
- "Z", "UTC", "+00", etc.
- You should release the return value by calling g_time_zone_unref()
- when you are done with it.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the universal timezone</doc>
- <type name="TimeZone" c:type="GTimeZone*"/>
- </return-value>
- </constructor>
- <method name="adjust_time"
- c:identifier="g_time_zone_adjust_time"
- version="2.26">
- <doc xml:space="preserve">Finds an interval within @tz that corresponds to the given @time_,
- possibly adjusting @time_ if required to fit into an interval.
- The meaning of @time_ depends on @type.
- This function is similar to g_time_zone_find_interval(), with the
- difference that it always succeeds (by making the adjustments
- described below).
- In any of the cases where g_time_zone_find_interval() succeeds then
- this function returns the same value, without modifying @time_.
- This function may, however, modify @time_ in order to deal with
- non-existent times. If the non-existent local @time_ of 02:30 were
- requested on March 14th 2010 in Toronto then this function would
- adjust @time_ to be 03:00 and return the interval containing the
- adjusted time.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the interval containing @time_, never -1</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="tz" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeZone</doc>
- <type name="TimeZone" c:type="GTimeZone*"/>
- </instance-parameter>
- <parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">the #GTimeType of @time_</doc>
- <type name="TimeType" c:type="GTimeType"/>
- </parameter>
- <parameter name="time_" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a number of seconds since January 1, 1970</doc>
- <type name="gint64" c:type="gint64*"/>
- </parameter>
- </parameters>
- </method>
- <method name="find_interval"
- c:identifier="g_time_zone_find_interval"
- version="2.26">
- <doc xml:space="preserve">Finds an the interval within @tz that corresponds to the given @time_.
- The meaning of @time_ depends on @type.
- If @type is %G_TIME_TYPE_UNIVERSAL then this function will always
- succeed (since universal time is monotonic and continuous).
- Otherwise @time_ is treated as local time. The distinction between
- %G_TIME_TYPE_STANDARD and %G_TIME_TYPE_DAYLIGHT is ignored except in
- the case that the given @time_ is ambiguous. In Toronto, for example,
- 01:30 on November 7th 2010 occurred twice (once inside of daylight
- savings time and the next, an hour later, outside of daylight savings
- time). In this case, the different value of @type would result in a
- different interval being returned.
- It is still possible for this function to fail. In Toronto, for
- example, 02:00 on March 14th 2010 does not exist (due to the leap
- forward to begin daylight savings time). -1 is returned in that
- case.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the interval containing @time_, or -1 in case of failure</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="tz" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeZone</doc>
- <type name="TimeZone" c:type="GTimeZone*"/>
- </instance-parameter>
- <parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">the #GTimeType of @time_</doc>
- <type name="TimeType" c:type="GTimeType"/>
- </parameter>
- <parameter name="time_" transfer-ownership="none">
- <doc xml:space="preserve">a number of seconds since January 1, 1970</doc>
- <type name="gint64" c:type="gint64"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_abbreviation"
- c:identifier="g_time_zone_get_abbreviation"
- version="2.26">
- <doc xml:space="preserve">Determines the time zone abbreviation to be used during a particular
- @interval of time in the time zone @tz.
- For example, in Toronto this is currently "EST" during the winter
- months and "EDT" during the summer months when daylight savings time
- is in effect.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the time zone abbreviation, which belongs to @tz</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="tz" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeZone</doc>
- <type name="TimeZone" c:type="GTimeZone*"/>
- </instance-parameter>
- <parameter name="interval" transfer-ownership="none">
- <doc xml:space="preserve">an interval within the timezone</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_offset"
- c:identifier="g_time_zone_get_offset"
- version="2.26">
- <doc xml:space="preserve">Determines the offset to UTC in effect during a particular @interval
- of time in the time zone @tz.
- The offset is the number of seconds that you add to UTC time to
- arrive at local time for @tz (ie: negative numbers for time zones
- west of GMT, positive numbers for east).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of seconds that should be added to UTC to get the
- local time in @tz</doc>
- <type name="gint32" c:type="gint32"/>
- </return-value>
- <parameters>
- <instance-parameter name="tz" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeZone</doc>
- <type name="TimeZone" c:type="GTimeZone*"/>
- </instance-parameter>
- <parameter name="interval" transfer-ownership="none">
- <doc xml:space="preserve">an interval within the timezone</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="is_dst" c:identifier="g_time_zone_is_dst" version="2.26">
- <doc xml:space="preserve">Determines if daylight savings time is in effect during a particular
- @interval of time in the time zone @tz.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if daylight savings time is in effect</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="tz" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeZone</doc>
- <type name="TimeZone" c:type="GTimeZone*"/>
- </instance-parameter>
- <parameter name="interval" transfer-ownership="none">
- <doc xml:space="preserve">an interval within the timezone</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_time_zone_ref" version="2.26">
- <doc xml:space="preserve">Increases the reference count on @tz.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new reference to @tz.</doc>
- <type name="TimeZone" c:type="GTimeZone*"/>
- </return-value>
- <parameters>
- <instance-parameter name="tz" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeZone</doc>
- <type name="TimeZone" c:type="GTimeZone*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_time_zone_unref" version="2.26">
- <doc xml:space="preserve">Decreases the reference count on @tz.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="tz" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeZone</doc>
- <type name="TimeZone" c:type="GTimeZone*"/>
- </instance-parameter>
- </parameters>
- </method>
- </record>
- <record name="Timer" c:type="GTimer" disguised="1">
- <doc xml:space="preserve">Opaque datatype that records a start time.</doc>
- <method name="continue" c:identifier="g_timer_continue" version="2.4">
- <doc xml:space="preserve">Resumes a timer that has previously been stopped with
- g_timer_stop(). g_timer_stop() must be called before using this
- function.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="timer" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimer.</doc>
- <type name="Timer" c:type="GTimer*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="destroy" c:identifier="g_timer_destroy">
- <doc xml:space="preserve">Destroys a timer, freeing associated resources.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="timer" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimer to destroy.</doc>
- <type name="Timer" c:type="GTimer*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="elapsed" c:identifier="g_timer_elapsed">
- <doc xml:space="preserve">If @timer has been started but not stopped, obtains the time since
- the timer was started. If @timer has been stopped, obtains the
- elapsed time between the time it was started and the time it was
- stopped. The return value is the number of seconds elapsed,
- including any fractional part. The @microseconds out parameter is
- essentially useless.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">seconds elapsed as a floating point value, including any
- fractional part.</doc>
- <type name="gdouble" c:type="gdouble"/>
- </return-value>
- <parameters>
- <instance-parameter name="timer" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimer.</doc>
- <type name="Timer" c:type="GTimer*"/>
- </instance-parameter>
- <parameter name="microseconds" transfer-ownership="none">
- <doc xml:space="preserve">return location for the fractional part of seconds
- elapsed, in microseconds (that is, the total number
- of microseconds elapsed, modulo 1000000), or %NULL</doc>
- <type name="gulong" c:type="gulong*"/>
- </parameter>
- </parameters>
- </method>
- <method name="reset" c:identifier="g_timer_reset">
- <doc xml:space="preserve">This function is useless; it's fine to call g_timer_start() on an
- already-started timer to reset the start time, so g_timer_reset()
- serves no purpose.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="timer" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimer.</doc>
- <type name="Timer" c:type="GTimer*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="start" c:identifier="g_timer_start">
- <doc xml:space="preserve">Marks a start time, so that future calls to g_timer_elapsed() will
- report the time since g_timer_start() was called. g_timer_new()
- automatically marks the start time, so no need to call
- g_timer_start() immediately after creating the timer.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="timer" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimer.</doc>
- <type name="Timer" c:type="GTimer*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="stop" c:identifier="g_timer_stop">
- <doc xml:space="preserve">Marks an end time, so calls to g_timer_elapsed() will return the
- difference between this end time and the start time.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="timer" transfer-ownership="none">
- <doc xml:space="preserve">a #GTimer.</doc>
- <type name="Timer" c:type="GTimer*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="new" c:identifier="g_timer_new" introspectable="0">
- <doc xml:space="preserve">Creates a new timer, and starts timing (i.e. g_timer_start() is
- implicitly called for you).</doc>
- <return-value>
- <doc xml:space="preserve">a new #GTimer.</doc>
- <type name="Timer" c:type="GTimer*"/>
- </return-value>
- </function>
- </record>
- <enumeration name="TokenType" c:type="GTokenType">
- <doc xml:space="preserve">The possible types of token returned from each
- g_scanner_get_next_token() call.</doc>
- <member name="eof" value="0" c:identifier="G_TOKEN_EOF">
- <doc xml:space="preserve">the end of the file</doc>
- </member>
- <member name="left_paren" value="40" c:identifier="G_TOKEN_LEFT_PAREN">
- <doc xml:space="preserve">a '(' character</doc>
- </member>
- <member name="right_paren" value="41" c:identifier="G_TOKEN_RIGHT_PAREN">
- <doc xml:space="preserve">a ')' character</doc>
- </member>
- <member name="left_curly" value="123" c:identifier="G_TOKEN_LEFT_CURLY">
- <doc xml:space="preserve">a '{' character</doc>
- </member>
- <member name="right_curly"
- value="125"
- c:identifier="G_TOKEN_RIGHT_CURLY">
- <doc xml:space="preserve">a '}' character</doc>
- </member>
- <member name="left_brace" value="91" c:identifier="G_TOKEN_LEFT_BRACE">
- <doc xml:space="preserve">a '[' character</doc>
- </member>
- <member name="right_brace" value="93" c:identifier="G_TOKEN_RIGHT_BRACE">
- <doc xml:space="preserve">a ']' character</doc>
- </member>
- <member name="equal_sign" value="61" c:identifier="G_TOKEN_EQUAL_SIGN">
- <doc xml:space="preserve">a '=' character</doc>
- </member>
- <member name="comma" value="44" c:identifier="G_TOKEN_COMMA">
- <doc xml:space="preserve">a ',' character</doc>
- </member>
- <member name="none" value="256" c:identifier="G_TOKEN_NONE">
- <doc xml:space="preserve">not a token</doc>
- </member>
- <member name="error" value="257" c:identifier="G_TOKEN_ERROR">
- <doc xml:space="preserve">an error occurred</doc>
- </member>
- <member name="char" value="258" c:identifier="G_TOKEN_CHAR">
- <doc xml:space="preserve">a character</doc>
- </member>
- <member name="binary" value="259" c:identifier="G_TOKEN_BINARY">
- <doc xml:space="preserve">a binary integer</doc>
- </member>
- <member name="octal" value="260" c:identifier="G_TOKEN_OCTAL">
- <doc xml:space="preserve">an octal integer</doc>
- </member>
- <member name="int" value="261" c:identifier="G_TOKEN_INT">
- <doc xml:space="preserve">an integer</doc>
- </member>
- <member name="hex" value="262" c:identifier="G_TOKEN_HEX">
- <doc xml:space="preserve">a hex integer</doc>
- </member>
- <member name="float" value="263" c:identifier="G_TOKEN_FLOAT">
- <doc xml:space="preserve">a floating point number</doc>
- </member>
- <member name="string" value="264" c:identifier="G_TOKEN_STRING">
- <doc xml:space="preserve">a string</doc>
- </member>
- <member name="symbol" value="265" c:identifier="G_TOKEN_SYMBOL">
- <doc xml:space="preserve">a symbol</doc>
- </member>
- <member name="identifier" value="266" c:identifier="G_TOKEN_IDENTIFIER">
- <doc xml:space="preserve">an identifier</doc>
- </member>
- <member name="identifier_null"
- value="267"
- c:identifier="G_TOKEN_IDENTIFIER_NULL">
- <doc xml:space="preserve">a null identifier</doc>
- </member>
- <member name="comment_single"
- value="268"
- c:identifier="G_TOKEN_COMMENT_SINGLE">
- <doc xml:space="preserve">one line comment</doc>
- </member>
- <member name="comment_multi"
- value="269"
- c:identifier="G_TOKEN_COMMENT_MULTI">
- <doc xml:space="preserve">multi line comment</doc>
- </member>
- </enumeration>
- <union name="TokenValue" c:type="GTokenValue">
- <doc xml:space="preserve">A union holding the value of the token.</doc>
- <field name="v_symbol" writable="1">
- <doc xml:space="preserve">token symbol value</doc>
- <type name="gpointer" c:type="gpointer"/>
- </field>
- <field name="v_identifier" writable="1">
- <doc xml:space="preserve">token identifier value</doc>
- <type name="utf8" c:type="gchar*"/>
- </field>
- <field name="v_binary" writable="1">
- <doc xml:space="preserve">token binary integer value</doc>
- <type name="gulong" c:type="gulong"/>
- </field>
- <field name="v_octal" writable="1">
- <doc xml:space="preserve">octal integer value</doc>
- <type name="gulong" c:type="gulong"/>
- </field>
- <field name="v_int" writable="1">
- <doc xml:space="preserve">integer value</doc>
- <type name="gulong" c:type="gulong"/>
- </field>
- <field name="v_int64" writable="1">
- <doc xml:space="preserve">64-bit integer value</doc>
- <type name="guint64" c:type="guint64"/>
- </field>
- <field name="v_float" writable="1">
- <doc xml:space="preserve">floating point value</doc>
- <type name="gdouble" c:type="gdouble"/>
- </field>
- <field name="v_hex" writable="1">
- <doc xml:space="preserve">hex integer value</doc>
- <type name="gulong" c:type="gulong"/>
- </field>
- <field name="v_string" writable="1">
- <doc xml:space="preserve">string value</doc>
- <type name="utf8" c:type="gchar*"/>
- </field>
- <field name="v_comment" writable="1">
- <doc xml:space="preserve">comment value</doc>
- <type name="utf8" c:type="gchar*"/>
- </field>
- <field name="v_char" writable="1">
- <doc xml:space="preserve">character value</doc>
- <type name="guint8" c:type="guchar"/>
- </field>
- <field name="v_error" writable="1">
- <doc xml:space="preserve">error value</doc>
- <type name="guint" c:type="guint"/>
- </field>
- </union>
- <callback name="TranslateFunc" c:type="GTranslateFunc">
- <doc xml:space="preserve">The type of functions which are used to translate user-visible
- strings, for <option>--help</option> output.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a translation of the string for the current locale.
- The returned string is owned by GLib and must not be freed.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">the untranslated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data specified when installing the function, e.g.
- in g_option_group_set_translate_func()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <record name="TrashStack"
- c:type="GTrashStack"
- deprecated="1"
- deprecated-version="2.48">
- <doc xml:space="preserve">Each piece of memory that is pushed onto the stack
- is cast to a GTrashStack*.</doc>
- <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
- <field name="next" writable="1">
- <doc xml:space="preserve">pointer to the previous element of the stack,
- gets stored in the first `sizeof (gpointer)`
- bytes of the element</doc>
- <type name="TrashStack" c:type="GTrashStack*"/>
- </field>
- <function name="height"
- c:identifier="g_trash_stack_height"
- deprecated="1"
- deprecated-version="2.48">
- <doc xml:space="preserve">Returns the height of a #GTrashStack.
- Note that execution of this function is of O(N) complexity
- where N denotes the number of items on the stack.</doc>
- <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the height of the stack</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="stack_p" transfer-ownership="none">
- <doc xml:space="preserve">a #GTrashStack</doc>
- <type name="TrashStack" c:type="GTrashStack**"/>
- </parameter>
- </parameters>
- </function>
- <function name="peek"
- c:identifier="g_trash_stack_peek"
- deprecated="1"
- deprecated-version="2.48">
- <doc xml:space="preserve">Returns the element at the top of a #GTrashStack
- which may be %NULL.</doc>
- <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the element at the top of the stack</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="stack_p" transfer-ownership="none">
- <doc xml:space="preserve">a #GTrashStack</doc>
- <type name="TrashStack" c:type="GTrashStack**"/>
- </parameter>
- </parameters>
- </function>
- <function name="pop"
- c:identifier="g_trash_stack_pop"
- deprecated="1"
- deprecated-version="2.48">
- <doc xml:space="preserve">Pops a piece of memory off a #GTrashStack.</doc>
- <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the element at the top of the stack</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="stack_p" transfer-ownership="none">
- <doc xml:space="preserve">a #GTrashStack</doc>
- <type name="TrashStack" c:type="GTrashStack**"/>
- </parameter>
- </parameters>
- </function>
- <function name="push"
- c:identifier="g_trash_stack_push"
- deprecated="1"
- deprecated-version="2.48">
- <doc xml:space="preserve">Pushes a piece of memory onto a #GTrashStack.</doc>
- <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="stack_p" transfer-ownership="none">
- <doc xml:space="preserve">a #GTrashStack</doc>
- <type name="TrashStack" c:type="GTrashStack**"/>
- </parameter>
- <parameter name="data_p" transfer-ownership="none">
- <doc xml:space="preserve">the piece of memory to push on the stack</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <bitfield name="TraverseFlags" c:type="GTraverseFlags">
- <doc xml:space="preserve">Specifies which nodes are visited during several of the tree
- functions, including g_node_traverse() and g_node_find().</doc>
- <member name="leaves" value="1" c:identifier="G_TRAVERSE_LEAVES">
- <doc xml:space="preserve">only leaf nodes should be visited. This name has
- been introduced in 2.6, for older version use
- %G_TRAVERSE_LEAFS.</doc>
- </member>
- <member name="non_leaves" value="2" c:identifier="G_TRAVERSE_NON_LEAVES">
- <doc xml:space="preserve">only non-leaf nodes should be visited. This
- name has been introduced in 2.6, for older
- version use %G_TRAVERSE_NON_LEAFS.</doc>
- </member>
- <member name="all" value="3" c:identifier="G_TRAVERSE_ALL">
- <doc xml:space="preserve">all nodes should be visited.</doc>
- </member>
- <member name="mask" value="3" c:identifier="G_TRAVERSE_MASK">
- <doc xml:space="preserve">a mask of all traverse flags.</doc>
- </member>
- <member name="leafs" value="1" c:identifier="G_TRAVERSE_LEAFS">
- <doc xml:space="preserve">identical to %G_TRAVERSE_LEAVES.</doc>
- </member>
- <member name="non_leafs" value="2" c:identifier="G_TRAVERSE_NON_LEAFS">
- <doc xml:space="preserve">identical to %G_TRAVERSE_NON_LEAVES.</doc>
- </member>
- </bitfield>
- <callback name="TraverseFunc" c:type="GTraverseFunc">
- <doc xml:space="preserve">Specifies the type of function passed to g_tree_traverse(). It is
- passed the key and value of each node, together with the @user_data
- parameter passed to g_tree_traverse(). If the function returns
- %TRUE, the traversal is stopped.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE to stop the traversal</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key of a #GTree node</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="value"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the value corresponding to the key</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data passed to g_tree_traverse()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <enumeration name="TraverseType" c:type="GTraverseType">
- <doc xml:space="preserve">Specifies the type of traveral performed by g_tree_traverse(),
- g_node_traverse() and g_node_find(). The different orders are
- illustrated here:
- - In order: A, B, C, D, E, F, G, H, I
- 
- - Pre order: F, B, A, D, C, E, G, I, H
- 
- - Post order: A, C, E, D, B, H, I, G, F
- 
- - Level order: F, B, G, A, D, I, C, E, H
- </doc>
- <member name="in_order" value="0" c:identifier="G_IN_ORDER">
- <doc xml:space="preserve">vists a node's left child first, then the node itself,
- then its right child. This is the one to use if you
- want the output sorted according to the compare
- function.</doc>
- </member>
- <member name="pre_order" value="1" c:identifier="G_PRE_ORDER">
- <doc xml:space="preserve">visits a node, then its children.</doc>
- </member>
- <member name="post_order" value="2" c:identifier="G_POST_ORDER">
- <doc xml:space="preserve">visits the node's children, then the node itself.</doc>
- </member>
- <member name="level_order" value="3" c:identifier="G_LEVEL_ORDER">
- <doc xml:space="preserve">is not implemented for
- [balanced binary trees][glib-Balanced-Binary-Trees].
- For [n-ary trees][glib-N-ary-Trees], it
- vists the root node first, then its children, then
- its grandchildren, and so on. Note that this is less
- efficient than the other orders.</doc>
- </member>
- </enumeration>
- <record name="Tree" c:type="GTree" disguised="1">
- <doc xml:space="preserve">The GTree struct is an opaque data structure representing a
- [balanced binary tree][glib-Balanced-Binary-Trees]. It should be
- accessed only by using the following functions.</doc>
- <method name="destroy" c:identifier="g_tree_destroy">
- <doc xml:space="preserve">Removes all keys and values from the #GTree and decreases its
- reference count by one. If keys and/or values are dynamically
- allocated, you should either free them first or create the #GTree
- using g_tree_new_full(). In the latter case the destroy functions
- you supplied will be called on all keys and values before destroying
- the #GTree.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="tree" transfer-ownership="none">
- <doc xml:space="preserve">a #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="foreach" c:identifier="g_tree_foreach" introspectable="0">
- <doc xml:space="preserve">Calls the given function for each of the key/value pairs in the #GTree.
- The function is passed the key and value of each pair, and the given
- @data parameter. The tree is traversed in sorted order.
- The tree may not be modified while iterating over it (you can't
- add/remove items). To remove all items matching a predicate, you need
- to add each item to a list in your #GTraverseFunc as you walk over
- the tree, then walk the list and remove each item.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="tree" transfer-ownership="none">
- <doc xml:space="preserve">a #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </instance-parameter>
- <parameter name="func" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">the function to call for each node visited.
- If this function returns %TRUE, the traversal is stopped.</doc>
- <type name="TraverseFunc" c:type="GTraverseFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="height" c:identifier="g_tree_height">
- <doc xml:space="preserve">Gets the height of a #GTree.
- If the #GTree contains no nodes, the height is 0.
- If the #GTree contains only one root node the height is 1.
- If the root node has children the height is 2, etc.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the height of @tree</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="tree" transfer-ownership="none">
- <doc xml:space="preserve">a #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="insert" c:identifier="g_tree_insert">
- <doc xml:space="preserve">Inserts a key/value pair into a #GTree.
- If the given key already exists in the #GTree its corresponding value
- is set to the new value. If you supplied a @value_destroy_func when
- creating the #GTree, the old value is freed using that function. If
- you supplied a @key_destroy_func when creating the #GTree, the passed
- key is freed using that function.
- The tree is automatically 'balanced' as new key/value pairs are added,
- so that the distance from the root to every leaf is as small as possible.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="tree" transfer-ownership="none">
- <doc xml:space="preserve">a #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </instance-parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the key to insert</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="value"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the value corresponding to the key</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="lookup" c:identifier="g_tree_lookup">
- <doc xml:space="preserve">Gets the value corresponding to the given key. Since a #GTree is
- automatically balanced as key/value pairs are added, key lookup
- is O(log n) (where n is the number of key/value pairs in the tree).</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the value corresponding to the key, or %NULL
- if the key was not found</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="tree" transfer-ownership="none">
- <doc xml:space="preserve">a #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </instance-parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the key to look up</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="lookup_extended" c:identifier="g_tree_lookup_extended">
- <doc xml:space="preserve">Looks up a key in the #GTree, returning the original key and the
- associated value. This is useful if you need to free the memory
- allocated for the original key, for example before calling
- g_tree_remove().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key was found in the #GTree</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="tree" transfer-ownership="none">
- <doc xml:space="preserve">a #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </instance-parameter>
- <parameter name="lookup_key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the key to look up</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="orig_key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">returns the original key</doc>
- <type name="gpointer" c:type="gpointer*"/>
- </parameter>
- <parameter name="value"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">returns the value associated with the key</doc>
- <type name="gpointer" c:type="gpointer*"/>
- </parameter>
- </parameters>
- </method>
- <method name="nnodes" c:identifier="g_tree_nnodes">
- <doc xml:space="preserve">Gets the number of nodes in a #GTree.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of nodes in @tree</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="tree" transfer-ownership="none">
- <doc xml:space="preserve">a #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="ref"
- c:identifier="g_tree_ref"
- version="2.22"
- introspectable="0">
- <doc xml:space="preserve">Increments the reference count of @tree by one.
- It is safe to call this function from any thread.</doc>
- <return-value>
- <doc xml:space="preserve">the passed in #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </return-value>
- <parameters>
- <instance-parameter name="tree" transfer-ownership="none">
- <doc xml:space="preserve">a #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="remove" c:identifier="g_tree_remove">
- <doc xml:space="preserve">Removes a key/value pair from a #GTree.
- If the #GTree was created using g_tree_new_full(), the key and value
- are freed using the supplied destroy functions, otherwise you have to
- make sure that any dynamically allocated values are freed yourself.
- If the key does not exist in the #GTree, the function does nothing.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key was found (prior to 2.8, this function
- returned nothing)</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="tree" transfer-ownership="none">
- <doc xml:space="preserve">a #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </instance-parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the key to remove</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="replace" c:identifier="g_tree_replace">
- <doc xml:space="preserve">Inserts a new key and value into a #GTree similar to g_tree_insert().
- The difference is that if the key already exists in the #GTree, it gets
- replaced by the new key. If you supplied a @value_destroy_func when
- creating the #GTree, the old value is freed using that function. If you
- supplied a @key_destroy_func when creating the #GTree, the old key is
- freed using that function.
- The tree is automatically 'balanced' as new key/value pairs are added,
- so that the distance from the root to every leaf is as small as possible.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="tree" transfer-ownership="none">
- <doc xml:space="preserve">a #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </instance-parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the key to insert</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="value"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the value corresponding to the key</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="search" c:identifier="g_tree_search" introspectable="0">
- <doc xml:space="preserve">Searches a #GTree using @search_func.
- The @search_func is called with a pointer to the key of a key/value
- pair in the tree, and the passed in @user_data. If @search_func returns
- 0 for a key/value pair, then the corresponding value is returned as
- the result of g_tree_search(). If @search_func returns -1, searching
- will proceed among the key/value pairs that have a smaller key; if
- @search_func returns 1, searching will proceed among the key/value
- pairs that have a larger key.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the value corresponding to the found key, or %NULL
- if the key was not found</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="tree" transfer-ownership="none">
- <doc xml:space="preserve">a #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </instance-parameter>
- <parameter name="search_func" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">a function used to search the #GTree</doc>
- <type name="CompareFunc" c:type="GCompareFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data passed as the second argument to @search_func</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="steal" c:identifier="g_tree_steal">
- <doc xml:space="preserve">Removes a key and its associated value from a #GTree without calling
- the key and value destroy functions.
- If the key does not exist in the #GTree, the function does nothing.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key was found (prior to 2.8, this function
- returned nothing)</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="tree" transfer-ownership="none">
- <doc xml:space="preserve">a #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </instance-parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the key to remove</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="traverse"
- c:identifier="g_tree_traverse"
- introspectable="0"
- deprecated="1"
- deprecated-version="2.2">
- <doc xml:space="preserve">Calls the given function for each node in the #GTree.</doc>
- <doc-deprecated xml:space="preserve">The order of a balanced tree is somewhat arbitrary.
- If you just want to visit all nodes in sorted order, use
- g_tree_foreach() instead. If you really need to visit nodes in
- a different order, consider using an [n-ary tree][glib-N-ary-Trees].</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="tree" transfer-ownership="none">
- <doc xml:space="preserve">a #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </instance-parameter>
- <parameter name="traverse_func"
- transfer-ownership="none"
- closure="2">
- <doc xml:space="preserve">the function to call for each node visited. If this
- function returns %TRUE, the traversal is stopped.</doc>
- <type name="TraverseFunc" c:type="GTraverseFunc"/>
- </parameter>
- <parameter name="traverse_type" transfer-ownership="none">
- <doc xml:space="preserve">the order in which nodes are visited, one of %G_IN_ORDER,
- %G_PRE_ORDER and %G_POST_ORDER</doc>
- <type name="TraverseType" c:type="GTraverseType"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_tree_unref" version="2.22">
- <doc xml:space="preserve">Decrements the reference count of @tree by one.
- If the reference count drops to 0, all keys and values will
- be destroyed (if destroy functions were specified) and all
- memory allocated by @tree will be released.
- It is safe to call this function from any thread.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="tree" transfer-ownership="none">
- <doc xml:space="preserve">a #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="new" c:identifier="g_tree_new" introspectable="0">
- <doc xml:space="preserve">Creates a new #GTree.</doc>
- <return-value>
- <doc xml:space="preserve">a newly allocated #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </return-value>
- <parameters>
- <parameter name="key_compare_func" transfer-ownership="none">
- <doc xml:space="preserve">the function used to order the nodes in the #GTree.
- It should return values similar to the standard strcmp() function -
- 0 if the two arguments are equal, a negative value if the first argument
- comes before the second, or a positive value if the first argument comes
- after the second.</doc>
- <type name="CompareFunc" c:type="GCompareFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="new_full"
- c:identifier="g_tree_new_full"
- introspectable="0">
- <doc xml:space="preserve">Creates a new #GTree like g_tree_new() and allows to specify functions
- to free the memory allocated for the key and value that get called when
- removing the entry from the #GTree.</doc>
- <return-value>
- <doc xml:space="preserve">a newly allocated #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </return-value>
- <parameters>
- <parameter name="key_compare_func"
- transfer-ownership="none"
- scope="notified"
- closure="1"
- destroy="3">
- <doc xml:space="preserve">qsort()-style comparison function</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="key_compare_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to comparison function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="key_destroy_func"
- transfer-ownership="none"
- scope="async">
- <doc xml:space="preserve">a function to free the memory allocated for the key
- used when removing the entry from the #GTree or %NULL if you don't
- want to supply such a function</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- <parameter name="value_destroy_func"
- transfer-ownership="none"
- scope="async">
- <doc xml:space="preserve">a function to free the memory allocated for the
- value used when removing the entry from the #GTree or %NULL if you
- don't want to supply such a function</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="new_with_data"
- c:identifier="g_tree_new_with_data"
- introspectable="0">
- <doc xml:space="preserve">Creates a new #GTree with a comparison function that accepts user data.
- See g_tree_new() for more details.</doc>
- <return-value>
- <doc xml:space="preserve">a newly allocated #GTree</doc>
- <type name="Tree" c:type="GTree*"/>
- </return-value>
- <parameters>
- <parameter name="key_compare_func"
- transfer-ownership="none"
- closure="1">
- <doc xml:space="preserve">qsort()-style comparison function</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="key_compare_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to comparison function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <constant name="UNICHAR_MAX_DECOMPOSITION_LENGTH"
- value="18"
- c:type="G_UNICHAR_MAX_DECOMPOSITION_LENGTH"
- version="2.32">
- <doc xml:space="preserve">The maximum length (in codepoints) of a compatibility or canonical
- decomposition of a single Unicode character.
- This is as defined by Unicode 6.1.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <constant name="URI_RESERVED_CHARS_GENERIC_DELIMITERS"
- value=":/?#[]@"
- c:type="G_URI_RESERVED_CHARS_GENERIC_DELIMITERS">
- <doc xml:space="preserve">Generic delimiters characters as defined in RFC 3986. Includes ":/?#[]@".</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS"
- value="!$&'()*+,;="
- c:type="G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS">
- <doc xml:space="preserve">Subcomponent delimiter characters as defined in RFC 3986. Includes "!$&'()*+,;=".</doc>
- <type name="utf8" c:type="gchar*"/>
- </constant>
- <constant name="USEC_PER_SEC" value="1000000" c:type="G_USEC_PER_SEC">
- <doc xml:space="preserve">Number of microseconds in one second (1 million).
- This macro is provided for code readability.</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <enumeration name="UnicodeBreakType" c:type="GUnicodeBreakType">
- <doc xml:space="preserve">These are the possible line break classifications.
- Since new unicode versions may add new types here, applications should be ready
- to handle unknown values. They may be regarded as %G_UNICODE_BREAK_UNKNOWN.
- See <ulink url="http://www.unicode.org/unicode/reports/tr14/">http://www.unicode.org/unicode/reports/tr14/</ulink>.</doc>
- <member name="mandatory"
- value="0"
- c:identifier="G_UNICODE_BREAK_MANDATORY">
- <doc xml:space="preserve">Mandatory Break (BK)</doc>
- </member>
- <member name="carriage_return"
- value="1"
- c:identifier="G_UNICODE_BREAK_CARRIAGE_RETURN">
- <doc xml:space="preserve">Carriage Return (CR)</doc>
- </member>
- <member name="line_feed"
- value="2"
- c:identifier="G_UNICODE_BREAK_LINE_FEED">
- <doc xml:space="preserve">Line Feed (LF)</doc>
- </member>
- <member name="combining_mark"
- value="3"
- c:identifier="G_UNICODE_BREAK_COMBINING_MARK">
- <doc xml:space="preserve">Attached Characters and Combining Marks (CM)</doc>
- </member>
- <member name="surrogate"
- value="4"
- c:identifier="G_UNICODE_BREAK_SURROGATE">
- <doc xml:space="preserve">Surrogates (SG)</doc>
- </member>
- <member name="zero_width_space"
- value="5"
- c:identifier="G_UNICODE_BREAK_ZERO_WIDTH_SPACE">
- <doc xml:space="preserve">Zero Width Space (ZW)</doc>
- </member>
- <member name="inseparable"
- value="6"
- c:identifier="G_UNICODE_BREAK_INSEPARABLE">
- <doc xml:space="preserve">Inseparable (IN)</doc>
- </member>
- <member name="non_breaking_glue"
- value="7"
- c:identifier="G_UNICODE_BREAK_NON_BREAKING_GLUE">
- <doc xml:space="preserve">Non-breaking ("Glue") (GL)</doc>
- </member>
- <member name="contingent"
- value="8"
- c:identifier="G_UNICODE_BREAK_CONTINGENT">
- <doc xml:space="preserve">Contingent Break Opportunity (CB)</doc>
- </member>
- <member name="space" value="9" c:identifier="G_UNICODE_BREAK_SPACE">
- <doc xml:space="preserve">Space (SP)</doc>
- </member>
- <member name="after" value="10" c:identifier="G_UNICODE_BREAK_AFTER">
- <doc xml:space="preserve">Break Opportunity After (BA)</doc>
- </member>
- <member name="before" value="11" c:identifier="G_UNICODE_BREAK_BEFORE">
- <doc xml:space="preserve">Break Opportunity Before (BB)</doc>
- </member>
- <member name="before_and_after"
- value="12"
- c:identifier="G_UNICODE_BREAK_BEFORE_AND_AFTER">
- <doc xml:space="preserve">Break Opportunity Before and After (B2)</doc>
- </member>
- <member name="hyphen" value="13" c:identifier="G_UNICODE_BREAK_HYPHEN">
- <doc xml:space="preserve">Hyphen (HY)</doc>
- </member>
- <member name="non_starter"
- value="14"
- c:identifier="G_UNICODE_BREAK_NON_STARTER">
- <doc xml:space="preserve">Nonstarter (NS)</doc>
- </member>
- <member name="open_punctuation"
- value="15"
- c:identifier="G_UNICODE_BREAK_OPEN_PUNCTUATION">
- <doc xml:space="preserve">Opening Punctuation (OP)</doc>
- </member>
- <member name="close_punctuation"
- value="16"
- c:identifier="G_UNICODE_BREAK_CLOSE_PUNCTUATION">
- <doc xml:space="preserve">Closing Punctuation (CL)</doc>
- </member>
- <member name="quotation"
- value="17"
- c:identifier="G_UNICODE_BREAK_QUOTATION">
- <doc xml:space="preserve">Ambiguous Quotation (QU)</doc>
- </member>
- <member name="exclamation"
- value="18"
- c:identifier="G_UNICODE_BREAK_EXCLAMATION">
- <doc xml:space="preserve">Exclamation/Interrogation (EX)</doc>
- </member>
- <member name="ideographic"
- value="19"
- c:identifier="G_UNICODE_BREAK_IDEOGRAPHIC">
- <doc xml:space="preserve">Ideographic (ID)</doc>
- </member>
- <member name="numeric" value="20" c:identifier="G_UNICODE_BREAK_NUMERIC">
- <doc xml:space="preserve">Numeric (NU)</doc>
- </member>
- <member name="infix_separator"
- value="21"
- c:identifier="G_UNICODE_BREAK_INFIX_SEPARATOR">
- <doc xml:space="preserve">Infix Separator (Numeric) (IS)</doc>
- </member>
- <member name="symbol" value="22" c:identifier="G_UNICODE_BREAK_SYMBOL">
- <doc xml:space="preserve">Symbols Allowing Break After (SY)</doc>
- </member>
- <member name="alphabetic"
- value="23"
- c:identifier="G_UNICODE_BREAK_ALPHABETIC">
- <doc xml:space="preserve">Ordinary Alphabetic and Symbol Characters (AL)</doc>
- </member>
- <member name="prefix" value="24" c:identifier="G_UNICODE_BREAK_PREFIX">
- <doc xml:space="preserve">Prefix (Numeric) (PR)</doc>
- </member>
- <member name="postfix" value="25" c:identifier="G_UNICODE_BREAK_POSTFIX">
- <doc xml:space="preserve">Postfix (Numeric) (PO)</doc>
- </member>
- <member name="complex_context"
- value="26"
- c:identifier="G_UNICODE_BREAK_COMPLEX_CONTEXT">
- <doc xml:space="preserve">Complex Content Dependent (South East Asian) (SA)</doc>
- </member>
- <member name="ambiguous"
- value="27"
- c:identifier="G_UNICODE_BREAK_AMBIGUOUS">
- <doc xml:space="preserve">Ambiguous (Alphabetic or Ideographic) (AI)</doc>
- </member>
- <member name="unknown" value="28" c:identifier="G_UNICODE_BREAK_UNKNOWN">
- <doc xml:space="preserve">Unknown (XX)</doc>
- </member>
- <member name="next_line"
- value="29"
- c:identifier="G_UNICODE_BREAK_NEXT_LINE">
- <doc xml:space="preserve">Next Line (NL)</doc>
- </member>
- <member name="word_joiner"
- value="30"
- c:identifier="G_UNICODE_BREAK_WORD_JOINER">
- <doc xml:space="preserve">Word Joiner (WJ)</doc>
- </member>
- <member name="hangul_l_jamo"
- value="31"
- c:identifier="G_UNICODE_BREAK_HANGUL_L_JAMO">
- <doc xml:space="preserve">Hangul L Jamo (JL)</doc>
- </member>
- <member name="hangul_v_jamo"
- value="32"
- c:identifier="G_UNICODE_BREAK_HANGUL_V_JAMO">
- <doc xml:space="preserve">Hangul V Jamo (JV)</doc>
- </member>
- <member name="hangul_t_jamo"
- value="33"
- c:identifier="G_UNICODE_BREAK_HANGUL_T_JAMO">
- <doc xml:space="preserve">Hangul T Jamo (JT)</doc>
- </member>
- <member name="hangul_lv_syllable"
- value="34"
- c:identifier="G_UNICODE_BREAK_HANGUL_LV_SYLLABLE">
- <doc xml:space="preserve">Hangul LV Syllable (H2)</doc>
- </member>
- <member name="hangul_lvt_syllable"
- value="35"
- c:identifier="G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE">
- <doc xml:space="preserve">Hangul LVT Syllable (H3)</doc>
- </member>
- <member name="close_paranthesis"
- value="36"
- c:identifier="G_UNICODE_BREAK_CLOSE_PARANTHESIS">
- <doc xml:space="preserve">Closing Parenthesis (CP). Since 2.28</doc>
- </member>
- <member name="conditional_japanese_starter"
- value="37"
- c:identifier="G_UNICODE_BREAK_CONDITIONAL_JAPANESE_STARTER">
- <doc xml:space="preserve">Conditional Japanese Starter (CJ). Since: 2.32</doc>
- </member>
- <member name="hebrew_letter"
- value="38"
- c:identifier="G_UNICODE_BREAK_HEBREW_LETTER">
- <doc xml:space="preserve">Hebrew Letter (HL). Since: 2.32</doc>
- </member>
- <member name="regional_indicator"
- value="39"
- c:identifier="G_UNICODE_BREAK_REGIONAL_INDICATOR">
- <doc xml:space="preserve">Regional Indicator (RI). Since: 2.36</doc>
- </member>
- </enumeration>
- <enumeration name="UnicodeScript" c:type="GUnicodeScript">
- <doc xml:space="preserve">The #GUnicodeScript enumeration identifies different writing
- systems. The values correspond to the names as defined in the
- Unicode standard. The enumeration has been added in GLib 2.14,
- and is interchangeable with #PangoScript.
- Note that new types may be added in the future. Applications
- should be ready to handle unknown values.
- See <ulink
- url="http://www.unicode.org/reports/tr24/">Unicode Standard Annex
- #24: Script names</ulink>.</doc>
- <member name="invalid_code"
- value="-1"
- c:identifier="G_UNICODE_SCRIPT_INVALID_CODE">
- <doc xml:space="preserve">a value never returned from g_unichar_get_script()</doc>
- </member>
- <member name="common" value="0" c:identifier="G_UNICODE_SCRIPT_COMMON">
- <doc xml:space="preserve">a character used by multiple different scripts</doc>
- </member>
- <member name="inherited"
- value="1"
- c:identifier="G_UNICODE_SCRIPT_INHERITED">
- <doc xml:space="preserve">a mark glyph that takes its script from the
- base glyph to which it is attached</doc>
- </member>
- <member name="arabic" value="2" c:identifier="G_UNICODE_SCRIPT_ARABIC">
- <doc xml:space="preserve">Arabic</doc>
- </member>
- <member name="armenian"
- value="3"
- c:identifier="G_UNICODE_SCRIPT_ARMENIAN">
- <doc xml:space="preserve">Armenian</doc>
- </member>
- <member name="bengali" value="4" c:identifier="G_UNICODE_SCRIPT_BENGALI">
- <doc xml:space="preserve">Bengali</doc>
- </member>
- <member name="bopomofo"
- value="5"
- c:identifier="G_UNICODE_SCRIPT_BOPOMOFO">
- <doc xml:space="preserve">Bopomofo</doc>
- </member>
- <member name="cherokee"
- value="6"
- c:identifier="G_UNICODE_SCRIPT_CHEROKEE">
- <doc xml:space="preserve">Cherokee</doc>
- </member>
- <member name="coptic" value="7" c:identifier="G_UNICODE_SCRIPT_COPTIC">
- <doc xml:space="preserve">Coptic</doc>
- </member>
- <member name="cyrillic"
- value="8"
- c:identifier="G_UNICODE_SCRIPT_CYRILLIC">
- <doc xml:space="preserve">Cyrillic</doc>
- </member>
- <member name="deseret" value="9" c:identifier="G_UNICODE_SCRIPT_DESERET">
- <doc xml:space="preserve">Deseret</doc>
- </member>
- <member name="devanagari"
- value="10"
- c:identifier="G_UNICODE_SCRIPT_DEVANAGARI">
- <doc xml:space="preserve">Devanagari</doc>
- </member>
- <member name="ethiopic"
- value="11"
- c:identifier="G_UNICODE_SCRIPT_ETHIOPIC">
- <doc xml:space="preserve">Ethiopic</doc>
- </member>
- <member name="georgian"
- value="12"
- c:identifier="G_UNICODE_SCRIPT_GEORGIAN">
- <doc xml:space="preserve">Georgian</doc>
- </member>
- <member name="gothic" value="13" c:identifier="G_UNICODE_SCRIPT_GOTHIC">
- <doc xml:space="preserve">Gothic</doc>
- </member>
- <member name="greek" value="14" c:identifier="G_UNICODE_SCRIPT_GREEK">
- <doc xml:space="preserve">Greek</doc>
- </member>
- <member name="gujarati"
- value="15"
- c:identifier="G_UNICODE_SCRIPT_GUJARATI">
- <doc xml:space="preserve">Gujarati</doc>
- </member>
- <member name="gurmukhi"
- value="16"
- c:identifier="G_UNICODE_SCRIPT_GURMUKHI">
- <doc xml:space="preserve">Gurmukhi</doc>
- </member>
- <member name="han" value="17" c:identifier="G_UNICODE_SCRIPT_HAN">
- <doc xml:space="preserve">Han</doc>
- </member>
- <member name="hangul" value="18" c:identifier="G_UNICODE_SCRIPT_HANGUL">
- <doc xml:space="preserve">Hangul</doc>
- </member>
- <member name="hebrew" value="19" c:identifier="G_UNICODE_SCRIPT_HEBREW">
- <doc xml:space="preserve">Hebrew</doc>
- </member>
- <member name="hiragana"
- value="20"
- c:identifier="G_UNICODE_SCRIPT_HIRAGANA">
- <doc xml:space="preserve">Hiragana</doc>
- </member>
- <member name="kannada"
- value="21"
- c:identifier="G_UNICODE_SCRIPT_KANNADA">
- <doc xml:space="preserve">Kannada</doc>
- </member>
- <member name="katakana"
- value="22"
- c:identifier="G_UNICODE_SCRIPT_KATAKANA">
- <doc xml:space="preserve">Katakana</doc>
- </member>
- <member name="khmer" value="23" c:identifier="G_UNICODE_SCRIPT_KHMER">
- <doc xml:space="preserve">Khmer</doc>
- </member>
- <member name="lao" value="24" c:identifier="G_UNICODE_SCRIPT_LAO">
- <doc xml:space="preserve">Lao</doc>
- </member>
- <member name="latin" value="25" c:identifier="G_UNICODE_SCRIPT_LATIN">
- <doc xml:space="preserve">Latin</doc>
- </member>
- <member name="malayalam"
- value="26"
- c:identifier="G_UNICODE_SCRIPT_MALAYALAM">
- <doc xml:space="preserve">Malayalam</doc>
- </member>
- <member name="mongolian"
- value="27"
- c:identifier="G_UNICODE_SCRIPT_MONGOLIAN">
- <doc xml:space="preserve">Mongolian</doc>
- </member>
- <member name="myanmar"
- value="28"
- c:identifier="G_UNICODE_SCRIPT_MYANMAR">
- <doc xml:space="preserve">Myanmar</doc>
- </member>
- <member name="ogham" value="29" c:identifier="G_UNICODE_SCRIPT_OGHAM">
- <doc xml:space="preserve">Ogham</doc>
- </member>
- <member name="old_italic"
- value="30"
- c:identifier="G_UNICODE_SCRIPT_OLD_ITALIC">
- <doc xml:space="preserve">Old Italic</doc>
- </member>
- <member name="oriya" value="31" c:identifier="G_UNICODE_SCRIPT_ORIYA">
- <doc xml:space="preserve">Oriya</doc>
- </member>
- <member name="runic" value="32" c:identifier="G_UNICODE_SCRIPT_RUNIC">
- <doc xml:space="preserve">Runic</doc>
- </member>
- <member name="sinhala"
- value="33"
- c:identifier="G_UNICODE_SCRIPT_SINHALA">
- <doc xml:space="preserve">Sinhala</doc>
- </member>
- <member name="syriac" value="34" c:identifier="G_UNICODE_SCRIPT_SYRIAC">
- <doc xml:space="preserve">Syriac</doc>
- </member>
- <member name="tamil" value="35" c:identifier="G_UNICODE_SCRIPT_TAMIL">
- <doc xml:space="preserve">Tamil</doc>
- </member>
- <member name="telugu" value="36" c:identifier="G_UNICODE_SCRIPT_TELUGU">
- <doc xml:space="preserve">Telugu</doc>
- </member>
- <member name="thaana" value="37" c:identifier="G_UNICODE_SCRIPT_THAANA">
- <doc xml:space="preserve">Thaana</doc>
- </member>
- <member name="thai" value="38" c:identifier="G_UNICODE_SCRIPT_THAI">
- <doc xml:space="preserve">Thai</doc>
- </member>
- <member name="tibetan"
- value="39"
- c:identifier="G_UNICODE_SCRIPT_TIBETAN">
- <doc xml:space="preserve">Tibetan</doc>
- </member>
- <member name="canadian_aboriginal"
- value="40"
- c:identifier="G_UNICODE_SCRIPT_CANADIAN_ABORIGINAL">
- <doc xml:space="preserve">Canadian Aboriginal</doc>
- </member>
- <member name="yi" value="41" c:identifier="G_UNICODE_SCRIPT_YI">
- <doc xml:space="preserve">Yi</doc>
- </member>
- <member name="tagalog"
- value="42"
- c:identifier="G_UNICODE_SCRIPT_TAGALOG">
- <doc xml:space="preserve">Tagalog</doc>
- </member>
- <member name="hanunoo"
- value="43"
- c:identifier="G_UNICODE_SCRIPT_HANUNOO">
- <doc xml:space="preserve">Hanunoo</doc>
- </member>
- <member name="buhid" value="44" c:identifier="G_UNICODE_SCRIPT_BUHID">
- <doc xml:space="preserve">Buhid</doc>
- </member>
- <member name="tagbanwa"
- value="45"
- c:identifier="G_UNICODE_SCRIPT_TAGBANWA">
- <doc xml:space="preserve">Tagbanwa</doc>
- </member>
- <member name="braille"
- value="46"
- c:identifier="G_UNICODE_SCRIPT_BRAILLE">
- <doc xml:space="preserve">Braille</doc>
- </member>
- <member name="cypriot"
- value="47"
- c:identifier="G_UNICODE_SCRIPT_CYPRIOT">
- <doc xml:space="preserve">Cypriot</doc>
- </member>
- <member name="limbu" value="48" c:identifier="G_UNICODE_SCRIPT_LIMBU">
- <doc xml:space="preserve">Limbu</doc>
- </member>
- <member name="osmanya"
- value="49"
- c:identifier="G_UNICODE_SCRIPT_OSMANYA">
- <doc xml:space="preserve">Osmanya</doc>
- </member>
- <member name="shavian"
- value="50"
- c:identifier="G_UNICODE_SCRIPT_SHAVIAN">
- <doc xml:space="preserve">Shavian</doc>
- </member>
- <member name="linear_b"
- value="51"
- c:identifier="G_UNICODE_SCRIPT_LINEAR_B">
- <doc xml:space="preserve">Linear B</doc>
- </member>
- <member name="tai_le" value="52" c:identifier="G_UNICODE_SCRIPT_TAI_LE">
- <doc xml:space="preserve">Tai Le</doc>
- </member>
- <member name="ugaritic"
- value="53"
- c:identifier="G_UNICODE_SCRIPT_UGARITIC">
- <doc xml:space="preserve">Ugaritic</doc>
- </member>
- <member name="new_tai_lue"
- value="54"
- c:identifier="G_UNICODE_SCRIPT_NEW_TAI_LUE">
- <doc xml:space="preserve">New Tai Lue</doc>
- </member>
- <member name="buginese"
- value="55"
- c:identifier="G_UNICODE_SCRIPT_BUGINESE">
- <doc xml:space="preserve">Buginese</doc>
- </member>
- <member name="glagolitic"
- value="56"
- c:identifier="G_UNICODE_SCRIPT_GLAGOLITIC">
- <doc xml:space="preserve">Glagolitic</doc>
- </member>
- <member name="tifinagh"
- value="57"
- c:identifier="G_UNICODE_SCRIPT_TIFINAGH">
- <doc xml:space="preserve">Tifinagh</doc>
- </member>
- <member name="syloti_nagri"
- value="58"
- c:identifier="G_UNICODE_SCRIPT_SYLOTI_NAGRI">
- <doc xml:space="preserve">Syloti Nagri</doc>
- </member>
- <member name="old_persian"
- value="59"
- c:identifier="G_UNICODE_SCRIPT_OLD_PERSIAN">
- <doc xml:space="preserve">Old Persian</doc>
- </member>
- <member name="kharoshthi"
- value="60"
- c:identifier="G_UNICODE_SCRIPT_KHAROSHTHI">
- <doc xml:space="preserve">Kharoshthi</doc>
- </member>
- <member name="unknown"
- value="61"
- c:identifier="G_UNICODE_SCRIPT_UNKNOWN">
- <doc xml:space="preserve">an unassigned code point</doc>
- </member>
- <member name="balinese"
- value="62"
- c:identifier="G_UNICODE_SCRIPT_BALINESE">
- <doc xml:space="preserve">Balinese</doc>
- </member>
- <member name="cuneiform"
- value="63"
- c:identifier="G_UNICODE_SCRIPT_CUNEIFORM">
- <doc xml:space="preserve">Cuneiform</doc>
- </member>
- <member name="phoenician"
- value="64"
- c:identifier="G_UNICODE_SCRIPT_PHOENICIAN">
- <doc xml:space="preserve">Phoenician</doc>
- </member>
- <member name="phags_pa"
- value="65"
- c:identifier="G_UNICODE_SCRIPT_PHAGS_PA">
- <doc xml:space="preserve">Phags-pa</doc>
- </member>
- <member name="nko" value="66" c:identifier="G_UNICODE_SCRIPT_NKO">
- <doc xml:space="preserve">N'Ko</doc>
- </member>
- <member name="kayah_li"
- value="67"
- c:identifier="G_UNICODE_SCRIPT_KAYAH_LI">
- <doc xml:space="preserve">Kayah Li. Since 2.16.3</doc>
- </member>
- <member name="lepcha" value="68" c:identifier="G_UNICODE_SCRIPT_LEPCHA">
- <doc xml:space="preserve">Lepcha. Since 2.16.3</doc>
- </member>
- <member name="rejang" value="69" c:identifier="G_UNICODE_SCRIPT_REJANG">
- <doc xml:space="preserve">Rejang. Since 2.16.3</doc>
- </member>
- <member name="sundanese"
- value="70"
- c:identifier="G_UNICODE_SCRIPT_SUNDANESE">
- <doc xml:space="preserve">Sundanese. Since 2.16.3</doc>
- </member>
- <member name="saurashtra"
- value="71"
- c:identifier="G_UNICODE_SCRIPT_SAURASHTRA">
- <doc xml:space="preserve">Saurashtra. Since 2.16.3</doc>
- </member>
- <member name="cham" value="72" c:identifier="G_UNICODE_SCRIPT_CHAM">
- <doc xml:space="preserve">Cham. Since 2.16.3</doc>
- </member>
- <member name="ol_chiki"
- value="73"
- c:identifier="G_UNICODE_SCRIPT_OL_CHIKI">
- <doc xml:space="preserve">Ol Chiki. Since 2.16.3</doc>
- </member>
- <member name="vai" value="74" c:identifier="G_UNICODE_SCRIPT_VAI">
- <doc xml:space="preserve">Vai. Since 2.16.3</doc>
- </member>
- <member name="carian" value="75" c:identifier="G_UNICODE_SCRIPT_CARIAN">
- <doc xml:space="preserve">Carian. Since 2.16.3</doc>
- </member>
- <member name="lycian" value="76" c:identifier="G_UNICODE_SCRIPT_LYCIAN">
- <doc xml:space="preserve">Lycian. Since 2.16.3</doc>
- </member>
- <member name="lydian" value="77" c:identifier="G_UNICODE_SCRIPT_LYDIAN">
- <doc xml:space="preserve">Lydian. Since 2.16.3</doc>
- </member>
- <member name="avestan"
- value="78"
- c:identifier="G_UNICODE_SCRIPT_AVESTAN">
- <doc xml:space="preserve">Avestan. Since 2.26</doc>
- </member>
- <member name="bamum" value="79" c:identifier="G_UNICODE_SCRIPT_BAMUM">
- <doc xml:space="preserve">Bamum. Since 2.26</doc>
- </member>
- <member name="egyptian_hieroglyphs"
- value="80"
- c:identifier="G_UNICODE_SCRIPT_EGYPTIAN_HIEROGLYPHS">
- <doc xml:space="preserve">Egyptian Hieroglpyhs. Since 2.26</doc>
- </member>
- <member name="imperial_aramaic"
- value="81"
- c:identifier="G_UNICODE_SCRIPT_IMPERIAL_ARAMAIC">
- <doc xml:space="preserve">Imperial Aramaic. Since 2.26</doc>
- </member>
- <member name="inscriptional_pahlavi"
- value="82"
- c:identifier="G_UNICODE_SCRIPT_INSCRIPTIONAL_PAHLAVI">
- <doc xml:space="preserve">Inscriptional Pahlavi. Since 2.26</doc>
- </member>
- <member name="inscriptional_parthian"
- value="83"
- c:identifier="G_UNICODE_SCRIPT_INSCRIPTIONAL_PARTHIAN">
- <doc xml:space="preserve">Inscriptional Parthian. Since 2.26</doc>
- </member>
- <member name="javanese"
- value="84"
- c:identifier="G_UNICODE_SCRIPT_JAVANESE">
- <doc xml:space="preserve">Javanese. Since 2.26</doc>
- </member>
- <member name="kaithi" value="85" c:identifier="G_UNICODE_SCRIPT_KAITHI">
- <doc xml:space="preserve">Kaithi. Since 2.26</doc>
- </member>
- <member name="lisu" value="86" c:identifier="G_UNICODE_SCRIPT_LISU">
- <doc xml:space="preserve">Lisu. Since 2.26</doc>
- </member>
- <member name="meetei_mayek"
- value="87"
- c:identifier="G_UNICODE_SCRIPT_MEETEI_MAYEK">
- <doc xml:space="preserve">Meetei Mayek. Since 2.26</doc>
- </member>
- <member name="old_south_arabian"
- value="88"
- c:identifier="G_UNICODE_SCRIPT_OLD_SOUTH_ARABIAN">
- <doc xml:space="preserve">Old South Arabian. Since 2.26</doc>
- </member>
- <member name="old_turkic"
- value="89"
- c:identifier="G_UNICODE_SCRIPT_OLD_TURKIC">
- <doc xml:space="preserve">Old Turkic. Since 2.28</doc>
- </member>
- <member name="samaritan"
- value="90"
- c:identifier="G_UNICODE_SCRIPT_SAMARITAN">
- <doc xml:space="preserve">Samaritan. Since 2.26</doc>
- </member>
- <member name="tai_tham"
- value="91"
- c:identifier="G_UNICODE_SCRIPT_TAI_THAM">
- <doc xml:space="preserve">Tai Tham. Since 2.26</doc>
- </member>
- <member name="tai_viet"
- value="92"
- c:identifier="G_UNICODE_SCRIPT_TAI_VIET">
- <doc xml:space="preserve">Tai Viet. Since 2.26</doc>
- </member>
- <member name="batak" value="93" c:identifier="G_UNICODE_SCRIPT_BATAK">
- <doc xml:space="preserve">Batak. Since 2.28</doc>
- </member>
- <member name="brahmi" value="94" c:identifier="G_UNICODE_SCRIPT_BRAHMI">
- <doc xml:space="preserve">Brahmi. Since 2.28</doc>
- </member>
- <member name="mandaic"
- value="95"
- c:identifier="G_UNICODE_SCRIPT_MANDAIC">
- <doc xml:space="preserve">Mandaic. Since 2.28</doc>
- </member>
- <member name="chakma" value="96" c:identifier="G_UNICODE_SCRIPT_CHAKMA">
- <doc xml:space="preserve">Chakma. Since: 2.32</doc>
- </member>
- <member name="meroitic_cursive"
- value="97"
- c:identifier="G_UNICODE_SCRIPT_MEROITIC_CURSIVE">
- <doc xml:space="preserve">Meroitic Cursive. Since: 2.32</doc>
- </member>
- <member name="meroitic_hieroglyphs"
- value="98"
- c:identifier="G_UNICODE_SCRIPT_MEROITIC_HIEROGLYPHS">
- <doc xml:space="preserve">Meroitic Hieroglyphs. Since: 2.32</doc>
- </member>
- <member name="miao" value="99" c:identifier="G_UNICODE_SCRIPT_MIAO">
- <doc xml:space="preserve">Miao. Since: 2.32</doc>
- </member>
- <member name="sharada"
- value="100"
- c:identifier="G_UNICODE_SCRIPT_SHARADA">
- <doc xml:space="preserve">Sharada. Since: 2.32</doc>
- </member>
- <member name="sora_sompeng"
- value="101"
- c:identifier="G_UNICODE_SCRIPT_SORA_SOMPENG">
- <doc xml:space="preserve">Sora Sompeng. Since: 2.32</doc>
- </member>
- <member name="takri" value="102" c:identifier="G_UNICODE_SCRIPT_TAKRI">
- <doc xml:space="preserve">Takri. Since: 2.32</doc>
- </member>
- <member name="bassa_vah"
- value="103"
- c:identifier="G_UNICODE_SCRIPT_BASSA_VAH">
- <doc xml:space="preserve">Bassa. Since: 2.42</doc>
- </member>
- <member name="caucasian_albanian"
- value="104"
- c:identifier="G_UNICODE_SCRIPT_CAUCASIAN_ALBANIAN">
- <doc xml:space="preserve">Caucasian Albanian. Since: 2.42</doc>
- </member>
- <member name="duployan"
- value="105"
- c:identifier="G_UNICODE_SCRIPT_DUPLOYAN">
- <doc xml:space="preserve">Duployan. Since: 2.42</doc>
- </member>
- <member name="elbasan"
- value="106"
- c:identifier="G_UNICODE_SCRIPT_ELBASAN">
- <doc xml:space="preserve">Elbasan. Since: 2.42</doc>
- </member>
- <member name="grantha"
- value="107"
- c:identifier="G_UNICODE_SCRIPT_GRANTHA">
- <doc xml:space="preserve">Grantha. Since: 2.42</doc>
- </member>
- <member name="khojki" value="108" c:identifier="G_UNICODE_SCRIPT_KHOJKI">
- <doc xml:space="preserve">Kjohki. Since: 2.42</doc>
- </member>
- <member name="khudawadi"
- value="109"
- c:identifier="G_UNICODE_SCRIPT_KHUDAWADI">
- <doc xml:space="preserve">Khudawadi, Sindhi. Since: 2.42</doc>
- </member>
- <member name="linear_a"
- value="110"
- c:identifier="G_UNICODE_SCRIPT_LINEAR_A">
- <doc xml:space="preserve">Linear A. Since: 2.42</doc>
- </member>
- <member name="mahajani"
- value="111"
- c:identifier="G_UNICODE_SCRIPT_MAHAJANI">
- <doc xml:space="preserve">Mahajani. Since: 2.42</doc>
- </member>
- <member name="manichaean"
- value="112"
- c:identifier="G_UNICODE_SCRIPT_MANICHAEAN">
- <doc xml:space="preserve">Manichaean. Since: 2.42</doc>
- </member>
- <member name="mende_kikakui"
- value="113"
- c:identifier="G_UNICODE_SCRIPT_MENDE_KIKAKUI">
- <doc xml:space="preserve">Mende Kikakui. Since: 2.42</doc>
- </member>
- <member name="modi" value="114" c:identifier="G_UNICODE_SCRIPT_MODI">
- <doc xml:space="preserve">Modi. Since: 2.42</doc>
- </member>
- <member name="mro" value="115" c:identifier="G_UNICODE_SCRIPT_MRO">
- <doc xml:space="preserve">Mro. Since: 2.42</doc>
- </member>
- <member name="nabataean"
- value="116"
- c:identifier="G_UNICODE_SCRIPT_NABATAEAN">
- <doc xml:space="preserve">Nabataean. Since: 2.42</doc>
- </member>
- <member name="old_north_arabian"
- value="117"
- c:identifier="G_UNICODE_SCRIPT_OLD_NORTH_ARABIAN">
- <doc xml:space="preserve">Old North Arabian. Since: 2.42</doc>
- </member>
- <member name="old_permic"
- value="118"
- c:identifier="G_UNICODE_SCRIPT_OLD_PERMIC">
- <doc xml:space="preserve">Old Permic. Since: 2.42</doc>
- </member>
- <member name="pahawh_hmong"
- value="119"
- c:identifier="G_UNICODE_SCRIPT_PAHAWH_HMONG">
- <doc xml:space="preserve">Pahawh Hmong. Since: 2.42</doc>
- </member>
- <member name="palmyrene"
- value="120"
- c:identifier="G_UNICODE_SCRIPT_PALMYRENE">
- <doc xml:space="preserve">Palmyrene. Since: 2.42</doc>
- </member>
- <member name="pau_cin_hau"
- value="121"
- c:identifier="G_UNICODE_SCRIPT_PAU_CIN_HAU">
- <doc xml:space="preserve">Pau Cin Hau. Since: 2.42</doc>
- </member>
- <member name="psalter_pahlavi"
- value="122"
- c:identifier="G_UNICODE_SCRIPT_PSALTER_PAHLAVI">
- <doc xml:space="preserve">Psalter Pahlavi. Since: 2.42</doc>
- </member>
- <member name="siddham"
- value="123"
- c:identifier="G_UNICODE_SCRIPT_SIDDHAM">
- <doc xml:space="preserve">Siddham. Since: 2.42</doc>
- </member>
- <member name="tirhuta"
- value="124"
- c:identifier="G_UNICODE_SCRIPT_TIRHUTA">
- <doc xml:space="preserve">Tirhuta. Since: 2.42</doc>
- </member>
- <member name="warang_citi"
- value="125"
- c:identifier="G_UNICODE_SCRIPT_WARANG_CITI">
- <doc xml:space="preserve">Warang Citi. Since: 2.42</doc>
- </member>
- <member name="ahom" value="126" c:identifier="G_UNICODE_SCRIPT_AHOM">
- <doc xml:space="preserve">Ahom. Since: 2.48</doc>
- </member>
- <member name="anatolian_hieroglyphs"
- value="127"
- c:identifier="G_UNICODE_SCRIPT_ANATOLIAN_HIEROGLYPHS">
- <doc xml:space="preserve">Anatolian Hieroglyphs. Since: 2.48</doc>
- </member>
- <member name="hatran" value="128" c:identifier="G_UNICODE_SCRIPT_HATRAN">
- <doc xml:space="preserve">Hatran. Since: 2.48</doc>
- </member>
- <member name="multani"
- value="129"
- c:identifier="G_UNICODE_SCRIPT_MULTANI">
- <doc xml:space="preserve">Multani. Since: 2.48</doc>
- </member>
- <member name="old_hungarian"
- value="130"
- c:identifier="G_UNICODE_SCRIPT_OLD_HUNGARIAN">
- <doc xml:space="preserve">Old Hungarian. Since: 2.48</doc>
- </member>
- <member name="signwriting"
- value="131"
- c:identifier="G_UNICODE_SCRIPT_SIGNWRITING">
- <doc xml:space="preserve">Signwriting. Since: 2.48</doc>
- </member>
- </enumeration>
- <enumeration name="UnicodeType" c:type="GUnicodeType">
- <doc xml:space="preserve">These are the possible character classifications from the
- Unicode specification.
- See <ulink url="http://www.unicode.org/Public/UNIDATA/UnicodeData.html">http://www.unicode.org/Public/UNIDATA/UnicodeData.html</ulink>.</doc>
- <member name="control" value="0" c:identifier="G_UNICODE_CONTROL">
- <doc xml:space="preserve">General category "Other, Control" (Cc)</doc>
- </member>
- <member name="format" value="1" c:identifier="G_UNICODE_FORMAT">
- <doc xml:space="preserve">General category "Other, Format" (Cf)</doc>
- </member>
- <member name="unassigned" value="2" c:identifier="G_UNICODE_UNASSIGNED">
- <doc xml:space="preserve">General category "Other, Not Assigned" (Cn)</doc>
- </member>
- <member name="private_use"
- value="3"
- c:identifier="G_UNICODE_PRIVATE_USE">
- <doc xml:space="preserve">General category "Other, Private Use" (Co)</doc>
- </member>
- <member name="surrogate" value="4" c:identifier="G_UNICODE_SURROGATE">
- <doc xml:space="preserve">General category "Other, Surrogate" (Cs)</doc>
- </member>
- <member name="lowercase_letter"
- value="5"
- c:identifier="G_UNICODE_LOWERCASE_LETTER">
- <doc xml:space="preserve">General category "Letter, Lowercase" (Ll)</doc>
- </member>
- <member name="modifier_letter"
- value="6"
- c:identifier="G_UNICODE_MODIFIER_LETTER">
- <doc xml:space="preserve">General category "Letter, Modifier" (Lm)</doc>
- </member>
- <member name="other_letter"
- value="7"
- c:identifier="G_UNICODE_OTHER_LETTER">
- <doc xml:space="preserve">General category "Letter, Other" (Lo)</doc>
- </member>
- <member name="titlecase_letter"
- value="8"
- c:identifier="G_UNICODE_TITLECASE_LETTER">
- <doc xml:space="preserve">General category "Letter, Titlecase" (Lt)</doc>
- </member>
- <member name="uppercase_letter"
- value="9"
- c:identifier="G_UNICODE_UPPERCASE_LETTER">
- <doc xml:space="preserve">General category "Letter, Uppercase" (Lu)</doc>
- </member>
- <member name="spacing_mark"
- value="10"
- c:identifier="G_UNICODE_SPACING_MARK">
- <doc xml:space="preserve">General category "Mark, Spacing" (Mc)</doc>
- </member>
- <member name="enclosing_mark"
- value="11"
- c:identifier="G_UNICODE_ENCLOSING_MARK">
- <doc xml:space="preserve">General category "Mark, Enclosing" (Me)</doc>
- </member>
- <member name="non_spacing_mark"
- value="12"
- c:identifier="G_UNICODE_NON_SPACING_MARK">
- <doc xml:space="preserve">General category "Mark, Nonspacing" (Mn)</doc>
- </member>
- <member name="decimal_number"
- value="13"
- c:identifier="G_UNICODE_DECIMAL_NUMBER">
- <doc xml:space="preserve">General category "Number, Decimal Digit" (Nd)</doc>
- </member>
- <member name="letter_number"
- value="14"
- c:identifier="G_UNICODE_LETTER_NUMBER">
- <doc xml:space="preserve">General category "Number, Letter" (Nl)</doc>
- </member>
- <member name="other_number"
- value="15"
- c:identifier="G_UNICODE_OTHER_NUMBER">
- <doc xml:space="preserve">General category "Number, Other" (No)</doc>
- </member>
- <member name="connect_punctuation"
- value="16"
- c:identifier="G_UNICODE_CONNECT_PUNCTUATION">
- <doc xml:space="preserve">General category "Punctuation, Connector" (Pc)</doc>
- </member>
- <member name="dash_punctuation"
- value="17"
- c:identifier="G_UNICODE_DASH_PUNCTUATION">
- <doc xml:space="preserve">General category "Punctuation, Dash" (Pd)</doc>
- </member>
- <member name="close_punctuation"
- value="18"
- c:identifier="G_UNICODE_CLOSE_PUNCTUATION">
- <doc xml:space="preserve">General category "Punctuation, Close" (Pe)</doc>
- </member>
- <member name="final_punctuation"
- value="19"
- c:identifier="G_UNICODE_FINAL_PUNCTUATION">
- <doc xml:space="preserve">General category "Punctuation, Final quote" (Pf)</doc>
- </member>
- <member name="initial_punctuation"
- value="20"
- c:identifier="G_UNICODE_INITIAL_PUNCTUATION">
- <doc xml:space="preserve">General category "Punctuation, Initial quote" (Pi)</doc>
- </member>
- <member name="other_punctuation"
- value="21"
- c:identifier="G_UNICODE_OTHER_PUNCTUATION">
- <doc xml:space="preserve">General category "Punctuation, Other" (Po)</doc>
- </member>
- <member name="open_punctuation"
- value="22"
- c:identifier="G_UNICODE_OPEN_PUNCTUATION">
- <doc xml:space="preserve">General category "Punctuation, Open" (Ps)</doc>
- </member>
- <member name="currency_symbol"
- value="23"
- c:identifier="G_UNICODE_CURRENCY_SYMBOL">
- <doc xml:space="preserve">General category "Symbol, Currency" (Sc)</doc>
- </member>
- <member name="modifier_symbol"
- value="24"
- c:identifier="G_UNICODE_MODIFIER_SYMBOL">
- <doc xml:space="preserve">General category "Symbol, Modifier" (Sk)</doc>
- </member>
- <member name="math_symbol"
- value="25"
- c:identifier="G_UNICODE_MATH_SYMBOL">
- <doc xml:space="preserve">General category "Symbol, Math" (Sm)</doc>
- </member>
- <member name="other_symbol"
- value="26"
- c:identifier="G_UNICODE_OTHER_SYMBOL">
- <doc xml:space="preserve">General category "Symbol, Other" (So)</doc>
- </member>
- <member name="line_separator"
- value="27"
- c:identifier="G_UNICODE_LINE_SEPARATOR">
- <doc xml:space="preserve">General category "Separator, Line" (Zl)</doc>
- </member>
- <member name="paragraph_separator"
- value="28"
- c:identifier="G_UNICODE_PARAGRAPH_SEPARATOR">
- <doc xml:space="preserve">General category "Separator, Paragraph" (Zp)</doc>
- </member>
- <member name="space_separator"
- value="29"
- c:identifier="G_UNICODE_SPACE_SEPARATOR">
- <doc xml:space="preserve">General category "Separator, Space" (Zs)</doc>
- </member>
- </enumeration>
- <callback name="UnixFDSourceFunc" c:type="GUnixFDSourceFunc">
- <doc xml:space="preserve">The type of functions to be called when a UNIX fd watch source
- triggers.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%FALSE if the source should be removed</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="fd" transfer-ownership="none">
- <doc xml:space="preserve">the fd that triggered the event</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="condition" transfer-ownership="none">
- <doc xml:space="preserve">the IO conditions reported on @fd</doc>
- <type name="IOCondition" c:type="GIOCondition"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="2">
- <doc xml:space="preserve">user data passed to g_unix_fd_add()</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </callback>
- <enumeration name="UserDirectory" version="2.14" c:type="GUserDirectory">
- <doc xml:space="preserve">These are logical ids for special directories which are defined
- depending on the platform used. You should use g_get_user_special_dir()
- to retrieve the full path associated to the logical id.
- The #GUserDirectory enumeration can be extended at later date. Not
- every platform has a directory for every logical id in this
- enumeration.</doc>
- <member name="directory_desktop"
- value="0"
- c:identifier="G_USER_DIRECTORY_DESKTOP">
- <doc xml:space="preserve">the user's Desktop directory</doc>
- </member>
- <member name="directory_documents"
- value="1"
- c:identifier="G_USER_DIRECTORY_DOCUMENTS">
- <doc xml:space="preserve">the user's Documents directory</doc>
- </member>
- <member name="directory_download"
- value="2"
- c:identifier="G_USER_DIRECTORY_DOWNLOAD">
- <doc xml:space="preserve">the user's Downloads directory</doc>
- </member>
- <member name="directory_music"
- value="3"
- c:identifier="G_USER_DIRECTORY_MUSIC">
- <doc xml:space="preserve">the user's Music directory</doc>
- </member>
- <member name="directory_pictures"
- value="4"
- c:identifier="G_USER_DIRECTORY_PICTURES">
- <doc xml:space="preserve">the user's Pictures directory</doc>
- </member>
- <member name="directory_public_share"
- value="5"
- c:identifier="G_USER_DIRECTORY_PUBLIC_SHARE">
- <doc xml:space="preserve">the user's shared directory</doc>
- </member>
- <member name="directory_templates"
- value="6"
- c:identifier="G_USER_DIRECTORY_TEMPLATES">
- <doc xml:space="preserve">the user's Templates directory</doc>
- </member>
- <member name="directory_videos"
- value="7"
- c:identifier="G_USER_DIRECTORY_VIDEOS">
- <doc xml:space="preserve">the user's Movies directory</doc>
- </member>
- <member name="n_directories"
- value="8"
- c:identifier="G_USER_N_DIRECTORIES">
- <doc xml:space="preserve">the number of enum values</doc>
- </member>
- </enumeration>
- <constant name="VERSION_MIN_REQUIRED"
- value="2"
- c:type="GLIB_VERSION_MIN_REQUIRED"
- version="2.32">
- <doc xml:space="preserve">A macro that should be defined by the user prior to including
- the glib.h header.
- The definition should be one of the predefined GLib version
- macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,...
- This macro defines the earliest version of GLib that the package is
- required to be able to compile against.
- If the compiler is configured to warn about the use of deprecated
- functions, then using functions that were deprecated in version
- %GLIB_VERSION_MIN_REQUIRED or earlier will cause warnings (but
- using functions deprecated in later releases will not).</doc>
- <type name="gint" c:type="gint"/>
- </constant>
- <record name="Variant"
- c:type="GVariant"
- version="2.24"
- glib:type-name="GVariant"
- glib:get-type="intern"
- c:symbol-prefix="variant">
- <doc xml:space="preserve">#GVariant is a variant datatype; it stores a value along with
- information about the type of that value. The range of possible
- values is determined by the type. The type system used by #GVariant
- is #GVariantType.
- #GVariant instances always have a type and a value (which are given
- at construction time). The type and value of a #GVariant instance
- can never change other than by the #GVariant itself being
- destroyed. A #GVariant cannot contain a pointer.
- #GVariant is reference counted using g_variant_ref() and
- g_variant_unref(). #GVariant also has floating reference counts --
- see g_variant_ref_sink().
- #GVariant is completely threadsafe. A #GVariant instance can be
- concurrently accessed in any way from any number of threads without
- problems.
- #GVariant is heavily optimised for dealing with data in serialised
- form. It works particularly well with data located in memory-mapped
- files. It can perform nearly all deserialisation operations in a
- small constant time, usually touching only a single memory page.
- Serialised #GVariant data can also be sent over the network.
- #GVariant is largely compatible with D-Bus. Almost all types of
- #GVariant instances can be sent over D-Bus. See #GVariantType for
- exceptions. (However, #GVariant's serialisation format is not the same
- as the serialisation format of a D-Bus message body: use #GDBusMessage,
- in the gio library, for those.)
- For space-efficiency, the #GVariant serialisation format does not
- automatically include the variant's length, type or endianness,
- which must either be implied from context (such as knowledge that a
- particular file format always contains a little-endian
- %G_VARIANT_TYPE_VARIANT which occupies the whole length of the file)
- or supplied out-of-band (for instance, a length, type and/or endianness
- indicator could be placed at the beginning of a file, network message
- or network stream).
- A #GVariant's size is limited mainly by any lower level operating
- system constraints, such as the number of bits in #gsize. For
- example, it is reasonable to have a 2GB file mapped into memory
- with #GMappedFile, and call g_variant_new_from_data() on it.
- For convenience to C programmers, #GVariant features powerful
- varargs-based value construction and destruction. This feature is
- designed to be embedded in other libraries.
- There is a Python-inspired text language for describing #GVariant
- values. #GVariant includes a printer for this language and a parser
- with type inferencing.
- ## Memory Use
- #GVariant tries to be quite efficient with respect to memory use.
- This section gives a rough idea of how much memory is used by the
- current implementation. The information here is subject to change
- in the future.
- The memory allocated by #GVariant can be grouped into 4 broad
- purposes: memory for serialised data, memory for the type
- information cache, buffer management memory and memory for the
- #GVariant structure itself.
- ## Serialised Data Memory
- This is the memory that is used for storing GVariant data in
- serialised form. This is what would be sent over the network or
- what would end up on disk, not counting any indicator of the
- endianness, or of the length or type of the top-level variant.
- The amount of memory required to store a boolean is 1 byte. 16,
- 32 and 64 bit integers and double precision floating point numbers
- use their "natural" size. Strings (including object path and
- signature strings) are stored with a nul terminator, and as such
- use the length of the string plus 1 byte.
- Maybe types use no space at all to represent the null value and
- use the same amount of space (sometimes plus one byte) as the
- equivalent non-maybe-typed value to represent the non-null case.
- Arrays use the amount of space required to store each of their
- members, concatenated. Additionally, if the items stored in an
- array are not of a fixed-size (ie: strings, other arrays, etc)
- then an additional framing offset is stored for each item. The
- size of this offset is either 1, 2 or 4 bytes depending on the
- overall size of the container. Additionally, extra padding bytes
- are added as required for alignment of child values.
- Tuples (including dictionary entries) use the amount of space
- required to store each of their members, concatenated, plus one
- framing offset (as per arrays) for each non-fixed-sized item in
- the tuple, except for the last one. Additionally, extra padding
- bytes are added as required for alignment of child values.
- Variants use the same amount of space as the item inside of the
- variant, plus 1 byte, plus the length of the type string for the
- item inside the variant.
- As an example, consider a dictionary mapping strings to variants.
- In the case that the dictionary is empty, 0 bytes are required for
- the serialisation.
- If we add an item "width" that maps to the int32 value of 500 then
- we will use 4 byte to store the int32 (so 6 for the variant
- containing it) and 6 bytes for the string. The variant must be
- aligned to 8 after the 6 bytes of the string, so that's 2 extra
- bytes. 6 (string) + 2 (padding) + 6 (variant) is 14 bytes used
- for the dictionary entry. An additional 1 byte is added to the
- array as a framing offset making a total of 15 bytes.
- If we add another entry, "title" that maps to a nullable string
- that happens to have a value of null, then we use 0 bytes for the
- null value (and 3 bytes for the variant to contain it along with
- its type string) plus 6 bytes for the string. Again, we need 2
- padding bytes. That makes a total of 6 + 2 + 3 = 11 bytes.
- We now require extra padding between the two items in the array.
- After the 14 bytes of the first item, that's 2 bytes required.
- We now require 2 framing offsets for an extra two
- bytes. 14 + 2 + 11 + 2 = 29 bytes to encode the entire two-item
- dictionary.
- ## Type Information Cache
- For each GVariant type that currently exists in the program a type
- information structure is kept in the type information cache. The
- type information structure is required for rapid deserialisation.
- Continuing with the above example, if a #GVariant exists with the
- type "a{sv}" then a type information struct will exist for
- "a{sv}", "{sv}", "s", and "v". Multiple uses of the same type
- will share the same type information. Additionally, all
- single-digit types are stored in read-only static memory and do
- not contribute to the writable memory footprint of a program using
- #GVariant.
- Aside from the type information structures stored in read-only
- memory, there are two forms of type information. One is used for
- container types where there is a single element type: arrays and
- maybe types. The other is used for container types where there
- are multiple element types: tuples and dictionary entries.
- Array type info structures are 6 * sizeof (void *), plus the
- memory required to store the type string itself. This means that
- on 32-bit systems, the cache entry for "a{sv}" would require 30
- bytes of memory (plus malloc overhead).
- Tuple type info structures are 6 * sizeof (void *), plus 4 *
- sizeof (void *) for each item in the tuple, plus the memory
- required to store the type string itself. A 2-item tuple, for
- example, would have a type information structure that consumed
- writable memory in the size of 14 * sizeof (void *) (plus type
- string) This means that on 32-bit systems, the cache entry for
- "{sv}" would require 61 bytes of memory (plus malloc overhead).
- This means that in total, for our "a{sv}" example, 91 bytes of
- type information would be allocated.
- The type information cache, additionally, uses a #GHashTable to
- store and lookup the cached items and stores a pointer to this
- hash table in static storage. The hash table is freed when there
- are zero items in the type cache.
- Although these sizes may seem large it is important to remember
- that a program will probably only have a very small number of
- different types of values in it and that only one type information
- structure is required for many different values of the same type.
- ## Buffer Management Memory
- #GVariant uses an internal buffer management structure to deal
- with the various different possible sources of serialised data
- that it uses. The buffer is responsible for ensuring that the
- correct call is made when the data is no longer in use by
- #GVariant. This may involve a g_free() or a g_slice_free() or
- even g_mapped_file_unref().
- One buffer management structure is used for each chunk of
- serialised data. The size of the buffer management structure
- is 4 * (void *). On 32-bit systems, that's 16 bytes.
- ## GVariant structure
- The size of a #GVariant structure is 6 * (void *). On 32-bit
- systems, that's 24 bytes.
- #GVariant structures only exist if they are explicitly created
- with API calls. For example, if a #GVariant is constructed out of
- serialised data for the example given above (with the dictionary)
- then although there are 9 individual values that comprise the
- entire dictionary (two keys, two values, two variants containing
- the values, two dictionary entries, plus the dictionary itself),
- only 1 #GVariant instance exists -- the one referring to the
- dictionary.
- If calls are made to start accessing the other values then
- #GVariant instances will exist for those values only for as long
- as they are in use (ie: until you call g_variant_unref()). The
- type information is shared. The serialised data and the buffer
- management structure for that serialised data is shared by the
- child.
- ## Summary
- To put the entire example together, for our dictionary mapping
- strings to variants (with two entries, as given above), we are
- using 91 bytes of memory for type information, 29 byes of memory
- for the serialised data, 16 bytes for buffer management and 24
- bytes for the #GVariant instance, or a total of 160 bytes, plus
- malloc overhead. If we were to use g_variant_get_child_value() to
- access the two dictionary entries, we would use an additional 48
- bytes. If we were to have other dictionaries of the same type, we
- would use more memory for the serialised data and buffer
- management for those dictionaries, but the type information would
- be shared.</doc>
- <constructor name="new"
- c:identifier="g_variant_new"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">Creates a new #GVariant instance.
- Think of this function as an analogue to g_strdup_printf().
- The type of the created instance and the arguments that are expected
- by this function are determined by @format_string. See the section on
- [GVariant format strings][gvariant-format-strings]. Please note that
- the syntax of the format string is very likely to be extended in the
- future.
- The first character of the format string must not be '*' '?' '@' or
- 'r'; in essence, a new #GVariant must always be constructed by this
- function (and not merely passed through it unmodified).
- Note that the arguments must be of the correct width for their types
- specified in @format_string. This can be achieved by casting them. See
- the [GVariant varargs documentation][gvariant-varargs].
- |[<!-- language="C" -->
- MyFlags some_flags = FLAG_ONE | FLAG_TWO;
- const gchar *some_strings[] = { "a", "b", "c", NULL };
- GVariant *new_variant;
- new_variant = g_variant_new ("(t^as)",
- /<!-- -->* This cast is required. *<!-- -->/
- (guint64) some_flags,
- some_strings);
- ]|</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new floating #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="format_string" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">arguments, as per @format_string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_array"
- c:identifier="g_variant_new_array"
- version="2.24">
- <doc xml:space="preserve">Creates a new #GVariant array from @children.
- @child_type must be non-%NULL if @n_children is zero. Otherwise, the
- child type is determined by inspecting the first element of the
- @children array. If @child_type is non-%NULL then it must be a
- definite type.
- The items of the array are taken from the @children array. No entry
- in the @children array may be %NULL.
- All items in the array must have the same type, which must be the
- same as @child_type, if given.
- If the @children are floating references (see g_variant_ref_sink()), the
- new instance takes ownership of them as if via g_variant_ref_sink().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new #GVariant array</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="child_type"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the element type of the new array</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- <parameter name="children"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">an array of
- #GVariant pointers, the children</doc>
- <array length="2" zero-terminated="0" c:type="GVariant**">
- <type name="Variant" c:type="GVariant*"/>
- </array>
- </parameter>
- <parameter name="n_children" transfer-ownership="none">
- <doc xml:space="preserve">the length of @children</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_boolean"
- c:identifier="g_variant_new_boolean"
- version="2.24">
- <doc xml:space="preserve">Creates a new boolean #GVariant instance -- either %TRUE or %FALSE.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new boolean #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #gboolean value</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_byte"
- c:identifier="g_variant_new_byte"
- version="2.24">
- <doc xml:space="preserve">Creates a new byte #GVariant instance.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new byte #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #guint8 value</doc>
- <type name="guint8" c:type="guchar"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_bytestring"
- c:identifier="g_variant_new_bytestring"
- version="2.26">
- <doc xml:space="preserve">Creates an array-of-bytes #GVariant with the contents of @string.
- This function is just like g_variant_new_string() except that the
- string need not be valid UTF-8.
- The nul terminator character at the end of the string is stored in
- the array.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new bytestring #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a normal
- nul-terminated string in no particular encoding</doc>
- <array c:type="gchar*">
- <type name="guint8"/>
- </array>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_bytestring_array"
- c:identifier="g_variant_new_bytestring_array"
- version="2.26">
- <doc xml:space="preserve">Constructs an array of bytestring #GVariant from the given array of
- strings.
- If @length is -1 then @strv is %NULL-terminated.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a new floating #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="strv" transfer-ownership="none">
- <doc xml:space="preserve">an array of strings</doc>
- <array length="1" zero-terminated="0" c:type="gchar**">
- <type name="utf8" c:type="gchar*"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of @strv, or -1</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_dict_entry"
- c:identifier="g_variant_new_dict_entry"
- version="2.24">
- <doc xml:space="preserve">Creates a new dictionary entry #GVariant. @key and @value must be
- non-%NULL. @key must be a value of a basic type (ie: not a container).
- If the @key or @value are floating references (see g_variant_ref_sink()),
- the new instance takes ownership of them as if via g_variant_ref_sink().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new dictionary entry #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a basic #GVariant, the key</doc>
- <type name="Variant" c:type="GVariant*"/>
- </parameter>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant, the value</doc>
- <type name="Variant" c:type="GVariant*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_double"
- c:identifier="g_variant_new_double"
- version="2.24">
- <doc xml:space="preserve">Creates a new double #GVariant instance.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new double #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #gdouble floating point value</doc>
- <type name="gdouble" c:type="gdouble"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_fixed_array"
- c:identifier="g_variant_new_fixed_array"
- version="2.32">
- <doc xml:space="preserve">Provides access to the serialised data for an array of fixed-sized
- items.
- @value must be an array with fixed-sized elements. Numeric types are
- fixed-size as are tuples containing only other fixed-sized types.
- @element_size must be the size of a single element in the array.
- For example, if calling this function for an array of 32-bit integers,
- you might say sizeof(gint32). This value isn't used except for the purpose
- of a double-check that the form of the serialised data matches the caller's
- expectation.
- @n_elements, which must be non-%NULL is set equal to the number of
- items in the array.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new array #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="element_type" transfer-ownership="none">
- <doc xml:space="preserve">the #GVariantType of each element</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- <parameter name="elements"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a pointer to the fixed array of contiguous elements</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="n_elements" transfer-ownership="none">
- <doc xml:space="preserve">the number of elements</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="element_size" transfer-ownership="none">
- <doc xml:space="preserve">the size of each element</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_from_bytes"
- c:identifier="g_variant_new_from_bytes"
- version="2.36">
- <doc xml:space="preserve">Constructs a new serialised-mode #GVariant instance. This is the
- inner interface for creation of new serialised values that gets
- called from various functions in gvariant.c.
- A reference is taken on @bytes.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a new #GVariant with a floating reference</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- <parameter name="bytes" transfer-ownership="none">
- <doc xml:space="preserve">a #GBytes</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </parameter>
- <parameter name="trusted" transfer-ownership="none">
- <doc xml:space="preserve">if the contents of @bytes are trusted</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_from_data"
- c:identifier="g_variant_new_from_data"
- version="2.24">
- <doc xml:space="preserve">Creates a new #GVariant instance from serialised data.
- @type is the type of #GVariant instance that will be constructed.
- The interpretation of @data depends on knowing the type.
- @data is not modified by this function and must remain valid with an
- unchanging value until such a time as @notify is called with
- @user_data. If the contents of @data change before that time then
- the result is undefined.
- If @data is trusted to be serialised data in normal form then
- @trusted should be %TRUE. This applies to serialised data created
- within this process or read from a trusted location on the disk (such
- as a file installed in /usr/lib alongside your application). You
- should set trusted to %FALSE if @data is read from the network, a
- file in the user's home directory, etc.
- If @data was not stored in this machine's native endianness, any multi-byte
- numeric values in the returned variant will also be in non-native
- endianness. g_variant_byteswap() can be used to recover the original values.
- @notify will be called with @user_data when @data is no longer
- needed. The exact time of this call is unspecified and might even be
- before this function returns.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a new floating #GVariant of type @type</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a definite #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">the serialised data</doc>
- <array length="2" zero-terminated="0" c:type="gconstpointer">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="size" transfer-ownership="none">
- <doc xml:space="preserve">the size of @data</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="trusted" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @data is definitely in normal form</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="notify" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">function to call when @data is no longer needed</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data for @notify</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_handle"
- c:identifier="g_variant_new_handle"
- version="2.24">
- <doc xml:space="preserve">Creates a new handle #GVariant instance.
- By convention, handles are indexes into an array of file descriptors
- that are sent alongside a D-Bus message. If you're not interacting
- with D-Bus, you probably don't need them.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new handle #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #gint32 value</doc>
- <type name="gint32" c:type="gint32"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_int16"
- c:identifier="g_variant_new_int16"
- version="2.24">
- <doc xml:space="preserve">Creates a new int16 #GVariant instance.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new int16 #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #gint16 value</doc>
- <type name="gint16" c:type="gint16"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_int32"
- c:identifier="g_variant_new_int32"
- version="2.24">
- <doc xml:space="preserve">Creates a new int32 #GVariant instance.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new int32 #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #gint32 value</doc>
- <type name="gint32" c:type="gint32"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_int64"
- c:identifier="g_variant_new_int64"
- version="2.24">
- <doc xml:space="preserve">Creates a new int64 #GVariant instance.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new int64 #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #gint64 value</doc>
- <type name="gint64" c:type="gint64"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_maybe"
- c:identifier="g_variant_new_maybe"
- version="2.24">
- <doc xml:space="preserve">Depending on if @child is %NULL, either wraps @child inside of a
- maybe container or creates a Nothing instance for the given @type.
- At least one of @child_type and @child must be non-%NULL.
- If @child_type is non-%NULL then it must be a definite type.
- If they are both non-%NULL then @child_type must be the type
- of @child.
- If @child is a floating reference (see g_variant_ref_sink()), the new
- instance takes ownership of @child.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new #GVariant maybe instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="child_type"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the #GVariantType of the child, or %NULL</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- <parameter name="child"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the child value, or %NULL</doc>
- <type name="Variant" c:type="GVariant*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_object_path"
- c:identifier="g_variant_new_object_path"
- version="2.24">
- <doc xml:space="preserve">Creates a D-Bus object path #GVariant with the contents of @string.
- @string must be a valid D-Bus object path. Use
- g_variant_is_object_path() if you're not sure.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new object path #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="object_path" transfer-ownership="none">
- <doc xml:space="preserve">a normal C nul-terminated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_objv"
- c:identifier="g_variant_new_objv"
- version="2.30">
- <doc xml:space="preserve">Constructs an array of object paths #GVariant from the given array of
- strings.
- Each string must be a valid #GVariant object path; see
- g_variant_is_object_path().
- If @length is -1 then @strv is %NULL-terminated.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a new floating #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="strv" transfer-ownership="none">
- <doc xml:space="preserve">an array of strings</doc>
- <array length="1" zero-terminated="0" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of @strv, or -1</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_parsed"
- c:identifier="g_variant_new_parsed"
- introspectable="0">
- <doc xml:space="preserve">Parses @format and returns the result.
- @format must be a text format #GVariant with one extension: at any
- point that a value may appear in the text, a '%' character followed
- by a GVariant format string (as per g_variant_new()) may appear. In
- that case, the same arguments are collected from the argument list as
- g_variant_new() would have collected.
- Note that the arguments must be of the correct width for their types
- specified in @format. This can be achieved by casting them. See
- the [GVariant varargs documentation][gvariant-varargs].
- Consider this simple example:
- |[<!-- language="C" -->
- g_variant_new_parsed ("[('one', 1), ('two', %i), (%s, 3)]", 2, "three");
- ]|
- In the example, the variable argument parameters are collected and
- filled in as if they were part of the original string to produce the
- result of
- |[<!-- language="C" -->
- [('one', 1), ('two', 2), ('three', 3)]
- ]|
- This function is intended only to be used with @format as a string
- literal. Any parse error is fatal to the calling process. If you
- want to parse data from untrusted sources, use g_variant_parse().
- You may not use this function to return, unmodified, a single
- #GVariant pointer from the argument list. ie: @format may not solely
- be anything along the lines of "%*", "%?", "\%r", or anything starting
- with "%@".</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new floating #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a text format #GVariant</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">arguments as per @format</doc>
- <varargs/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_parsed_va"
- c:identifier="g_variant_new_parsed_va"
- introspectable="0">
- <doc xml:space="preserve">Parses @format and returns the result.
- This is the version of g_variant_new_parsed() intended to be used
- from libraries.
- The return value will be floating if it was a newly created GVariant
- instance. In the case that @format simply specified the collection
- of a #GVariant pointer (eg: @format was "%*") then the collected
- #GVariant pointer will be returned unmodified, without adding any
- additional references.
- Note that the arguments in @app must be of the correct width for their types
- specified in @format when collected into the #va_list. See
- the [GVariant varargs documentation][gvariant-varargs].
- In order to behave correctly in all cases it is necessary for the
- calling function to g_variant_ref_sink() the return result before
- returning control to the user that originally provided the pointer.
- At this point, the caller will have their own full reference to the
- result. This can also be done by adding the result to a container,
- or by passing it to another g_variant_new() call.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new, usually floating, #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a text format #GVariant</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="app" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #va_list</doc>
- <type name="va_list" c:type="va_list*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_printf"
- c:identifier="g_variant_new_printf"
- version="2.38"
- introspectable="0">
- <doc xml:space="preserve">Creates a string-type GVariant using printf formatting.
- This is similar to calling g_strdup_printf() and then
- g_variant_new_string() but it saves a temporary variable and an
- unnecessary copy.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new string
- #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="format_string" transfer-ownership="none">
- <doc xml:space="preserve">a printf-style format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">arguments for @format_string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_signature"
- c:identifier="g_variant_new_signature"
- version="2.24">
- <doc xml:space="preserve">Creates a D-Bus type signature #GVariant with the contents of
- @string. @string must be a valid D-Bus type signature. Use
- g_variant_is_signature() if you're not sure.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new signature #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="signature" transfer-ownership="none">
- <doc xml:space="preserve">a normal C nul-terminated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_string"
- c:identifier="g_variant_new_string"
- version="2.24">
- <doc xml:space="preserve">Creates a string #GVariant with the contents of @string.
- @string must be valid UTF-8, and must not be %NULL. To encode
- potentially-%NULL strings, use g_variant_new() with `ms` as the
- [format string][gvariant-format-strings-maybe-types].</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new string #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a normal UTF-8 nul-terminated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_strv"
- c:identifier="g_variant_new_strv"
- version="2.24">
- <doc xml:space="preserve">Constructs an array of strings #GVariant from the given array of
- strings.
- If @length is -1 then @strv is %NULL-terminated.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a new floating #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="strv" transfer-ownership="none">
- <doc xml:space="preserve">an array of strings</doc>
- <array length="1" zero-terminated="0" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of @strv, or -1</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_take_string"
- c:identifier="g_variant_new_take_string"
- version="2.38"
- introspectable="0">
- <doc xml:space="preserve">Creates a string #GVariant with the contents of @string.
- @string must be valid UTF-8, and must not be %NULL. To encode
- potentially-%NULL strings, use this with g_variant_new_maybe().
- This function consumes @string. g_free() will be called on @string
- when it is no longer required.
- You must not modify or access @string in any other way after passing
- it to this function. It is even possible that @string is immediately
- freed.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new string
- #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a normal UTF-8 nul-terminated string</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_tuple"
- c:identifier="g_variant_new_tuple"
- version="2.24">
- <doc xml:space="preserve">Creates a new tuple #GVariant out of the items in @children. The
- type is determined from the types of @children. No entry in the
- @children array may be %NULL.
- If @n_children is 0 then the unit tuple is constructed.
- If the @children are floating references (see g_variant_ref_sink()), the
- new instance takes ownership of them as if via g_variant_ref_sink().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new #GVariant tuple</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="children" transfer-ownership="none">
- <doc xml:space="preserve">the items to make the tuple out of</doc>
- <array length="1" zero-terminated="0" c:type="GVariant**">
- <type name="Variant" c:type="GVariant*"/>
- </array>
- </parameter>
- <parameter name="n_children" transfer-ownership="none">
- <doc xml:space="preserve">the length of @children</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_uint16"
- c:identifier="g_variant_new_uint16"
- version="2.24">
- <doc xml:space="preserve">Creates a new uint16 #GVariant instance.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new uint16 #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #guint16 value</doc>
- <type name="guint16" c:type="guint16"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_uint32"
- c:identifier="g_variant_new_uint32"
- version="2.24">
- <doc xml:space="preserve">Creates a new uint32 #GVariant instance.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new uint32 #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #guint32 value</doc>
- <type name="guint32" c:type="guint32"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_uint64"
- c:identifier="g_variant_new_uint64"
- version="2.24">
- <doc xml:space="preserve">Creates a new uint64 #GVariant instance.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new uint64 #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #guint64 value</doc>
- <type name="guint64" c:type="guint64"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_va"
- c:identifier="g_variant_new_va"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">This function is intended to be used by libraries based on
- #GVariant that want to provide g_variant_new()-like functionality
- to their users.
- The API is more general than g_variant_new() to allow a wider range
- of possible uses.
- @format_string must still point to a valid format string, but it only
- needs to be nul-terminated if @endptr is %NULL. If @endptr is
- non-%NULL then it is updated to point to the first character past the
- end of the format string.
- @app is a pointer to a #va_list. The arguments, according to
- @format_string, are collected from this #va_list and the list is left
- pointing to the argument following the last.
- Note that the arguments in @app must be of the correct width for their
- types specified in @format_string when collected into the #va_list.
- See the [GVariant varargs documentation][gvariant-varargs.
- These two generalisations allow mixing of multiple calls to
- g_variant_new_va() and g_variant_get_va() within a single actual
- varargs call by the user.
- The return value will be floating if it was a newly created GVariant
- instance (for example, if the format string was "(ii)"). In the case
- that the format_string was '*', '?', 'r', or a format starting with
- '@' then the collected #GVariant pointer will be returned unmodified,
- without adding any additional references.
- In order to behave correctly in all cases it is necessary for the
- calling function to g_variant_ref_sink() the return result before
- returning control to the user that originally provided the pointer.
- At this point, the caller will have their own full reference to the
- result. This can also be done by adding the result to a container,
- or by passing it to another g_variant_new() call.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new, usually floating, #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="format_string" transfer-ownership="none">
- <doc xml:space="preserve">a string that is prefixed with a format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="endptr"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">location to store the end pointer,
- or %NULL</doc>
- <type name="utf8" c:type="const gchar**"/>
- </parameter>
- <parameter name="app" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #va_list</doc>
- <type name="va_list" c:type="va_list*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_variant"
- c:identifier="g_variant_new_variant"
- version="2.24">
- <doc xml:space="preserve">Boxes @value. The result is a #GVariant instance representing a
- variant containing the original value.
- If @child is a floating reference (see g_variant_ref_sink()), the new
- instance takes ownership of @child.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a floating reference to a new variant #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="byteswap" c:identifier="g_variant_byteswap" version="2.24">
- <doc xml:space="preserve">Performs a byteswapping operation on the contents of @value. The
- result is that all multi-byte numeric data contained in @value is
- byteswapped. That includes 16, 32, and 64bit signed and unsigned
- integers as well as file handles and double precision floating point
- values.
- This function is an identity mapping on any value that does not
- contain multi-byte numeric data. That include strings, booleans,
- bytes and containers containing only these things (recursively).
- The returned value is always in normal form and is marked as trusted.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the byteswapped form of @value</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="check_format_string"
- c:identifier="g_variant_check_format_string"
- version="2.34">
- <doc xml:space="preserve">Checks if calling g_variant_get() with @format_string on @value would
- be valid from a type-compatibility standpoint. @format_string is
- assumed to be a valid format string (from a syntactic standpoint).
- If @copy_only is %TRUE then this function additionally checks that it
- would be safe to call g_variant_unref() on @value immediately after
- the call to g_variant_get() without invalidating the result. This is
- only possible if deep copies are made (ie: there are no pointers to
- the data inside of the soon-to-be-freed #GVariant instance). If this
- check fails then a g_critical() is printed and %FALSE is returned.
- This function is meant to be used by functions that wish to provide
- varargs accessors to #GVariant values of uncertain values (eg:
- g_variant_lookup() or g_menu_model_get_item_attribute()).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @format_string is safe to use</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="format_string" transfer-ownership="none">
- <doc xml:space="preserve">a valid #GVariant format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="copy_only" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE to ensure the format string makes deep copies</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="classify" c:identifier="g_variant_classify" version="2.24">
- <doc xml:space="preserve">Classifies @value according to its top-level type.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the #GVariantClass of @value</doc>
- <type name="VariantClass" c:type="GVariantClass"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="compare" c:identifier="g_variant_compare" version="2.26">
- <doc xml:space="preserve">Compares @one and @two.
- The types of @one and @two are #gconstpointer only to allow use of
- this function with #GTree, #GPtrArray, etc. They must each be a
- #GVariant.
- Comparison is only defined for basic types (ie: booleans, numbers,
- strings). For booleans, %FALSE is less than %TRUE. Numbers are
- ordered in the usual way. Strings are in ASCII lexographical order.
- It is a programmer error to attempt to compare container values or
- two values that have types that are not exactly equal. For example,
- you cannot compare a 32-bit signed integer with a 32-bit unsigned
- integer. Also note that this function is not particularly
- well-behaved when it comes to comparison of doubles; in particular,
- the handling of incomparable values (ie: NaN) is undefined.
- If you only require an equality comparison, g_variant_equal() is more
- general.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">negative value if a < b;
- zero if a = b;
- positive value if a > b.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <instance-parameter name="one" transfer-ownership="none">
- <doc xml:space="preserve">a basic-typed #GVariant instance</doc>
- <type name="Variant" c:type="gconstpointer"/>
- </instance-parameter>
- <parameter name="two" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant instance of the same type</doc>
- <type name="Variant" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="dup_bytestring"
- c:identifier="g_variant_dup_bytestring"
- version="2.26">
- <doc xml:space="preserve">Similar to g_variant_get_bytestring() except that instead of
- returning a constant string, the string is duplicated.
- The return value must be freed using g_free().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">
- a newly allocated string</doc>
- <array length="0" zero-terminated="1" c:type="gchar*">
- <type name="guint8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">an array-of-bytes #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">a pointer to a #gsize, to store
- the length (not including the nul terminator)</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="dup_bytestring_array"
- c:identifier="g_variant_dup_bytestring_array"
- version="2.26">
- <doc xml:space="preserve">Gets the contents of an array of array of bytes #GVariant. This call
- makes a deep copy; the return result should be released with
- g_strfreev().
- If @length is non-%NULL then the number of elements in the result is
- stored there. In any case, the resulting array will be
- %NULL-terminated.
- For an empty array, @length will be set to 0 and a pointer to a
- %NULL pointer will be returned.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">an array of strings</doc>
- <array length="0" zero-terminated="0" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">an array of array of bytes #GVariant ('aay')</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">the length of the result, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="dup_objv" c:identifier="g_variant_dup_objv" version="2.30">
- <doc xml:space="preserve">Gets the contents of an array of object paths #GVariant. This call
- makes a deep copy; the return result should be released with
- g_strfreev().
- If @length is non-%NULL then the number of elements in the result
- is stored there. In any case, the resulting array will be
- %NULL-terminated.
- For an empty array, @length will be set to 0 and a pointer to a
- %NULL pointer will be returned.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">an array of strings</doc>
- <array length="0" zero-terminated="1" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">an array of object paths #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">the length of the result, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="dup_string"
- c:identifier="g_variant_dup_string"
- version="2.24">
- <doc xml:space="preserve">Similar to g_variant_get_string() except that instead of returning
- a constant string, the string is duplicated.
- The string will always be UTF-8 encoded.
- The return value must be freed using g_free().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string, UTF-8 encoded</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a string #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">a pointer to a #gsize, to store the length</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="dup_strv" c:identifier="g_variant_dup_strv" version="2.24">
- <doc xml:space="preserve">Gets the contents of an array of strings #GVariant. This call
- makes a deep copy; the return result should be released with
- g_strfreev().
- If @length is non-%NULL then the number of elements in the result
- is stored there. In any case, the resulting array will be
- %NULL-terminated.
- For an empty array, @length will be set to 0 and a pointer to a
- %NULL pointer will be returned.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">an array of strings</doc>
- <array length="0" zero-terminated="1" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">an array of strings #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">the length of the result, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="equal" c:identifier="g_variant_equal" version="2.24">
- <doc xml:space="preserve">Checks if @one and @two have the same type and value.
- The types of @one and @two are #gconstpointer only to allow use of
- this function with #GHashTable. They must each be a #GVariant.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @one and @two are equal</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="one" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant instance</doc>
- <type name="Variant" c:type="gconstpointer"/>
- </instance-parameter>
- <parameter name="two" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant instance</doc>
- <type name="Variant" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="get"
- c:identifier="g_variant_get"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">Deconstructs a #GVariant instance.
- Think of this function as an analogue to scanf().
- The arguments that are expected by this function are entirely
- determined by @format_string. @format_string also restricts the
- permissible types of @value. It is an error to give a value with
- an incompatible type. See the section on
- [GVariant format strings][gvariant-format-strings].
- Please note that the syntax of the format string is very likely to be
- extended in the future.
- @format_string determines the C types that are used for unpacking
- the values and also determines if the values are copied or borrowed,
- see the section on
- [GVariant format strings][gvariant-format-strings-pointers].</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="format_string" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">arguments, as per @format_string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </method>
- <method name="get_boolean"
- c:identifier="g_variant_get_boolean"
- version="2.24">
- <doc xml:space="preserve">Returns the boolean value of @value.
- It is an error to call this function with a @value of any type
- other than %G_VARIANT_TYPE_BOOLEAN.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE or %FALSE</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a boolean #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_byte" c:identifier="g_variant_get_byte" version="2.24">
- <doc xml:space="preserve">Returns the byte value of @value.
- It is an error to call this function with a @value of any type
- other than %G_VARIANT_TYPE_BYTE.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #guchar</doc>
- <type name="guint8" c:type="guchar"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a byte #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_bytestring"
- c:identifier="g_variant_get_bytestring"
- version="2.26">
- <doc xml:space="preserve">Returns the string value of a #GVariant instance with an
- array-of-bytes type. The string has no particular encoding.
- If the array does not end with a nul terminator character, the empty
- string is returned. For this reason, you can always trust that a
- non-%NULL nul-terminated string will be returned by this function.
- If the array contains a nul terminator character somewhere other than
- the last byte then the returned string is the string, up to the first
- such nul character.
- It is an error to call this function with a @value that is not an
- array of bytes.
- The return value remains valid as long as @value exists.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">
- the constant string</doc>
- <array c:type="gchar*">
- <type name="guint8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">an array-of-bytes #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_bytestring_array"
- c:identifier="g_variant_get_bytestring_array"
- version="2.26">
- <doc xml:space="preserve">Gets the contents of an array of array of bytes #GVariant. This call
- makes a shallow copy; the return result should be released with
- g_free(), but the individual strings must not be modified.
- If @length is non-%NULL then the number of elements in the result is
- stored there. In any case, the resulting array will be
- %NULL-terminated.
- For an empty array, @length will be set to 0 and a pointer to a
- %NULL pointer will be returned.</doc>
- <return-value transfer-ownership="container">
- <doc xml:space="preserve">an array of constant strings</doc>
- <array length="0" zero-terminated="0" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">an array of array of bytes #GVariant ('aay')</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">the length of the result, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_child"
- c:identifier="g_variant_get_child"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">Reads a child item out of a container #GVariant instance and
- deconstructs it according to @format_string. This call is
- essentially a combination of g_variant_get_child_value() and
- g_variant_get().
- @format_string determines the C types that are used for unpacking
- the values and also determines if the values are copied or borrowed,
- see the section on
- [GVariant format strings][gvariant-format-strings-pointers].</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a container #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="index_" transfer-ownership="none">
- <doc xml:space="preserve">the index of the child to deconstruct</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="format_string" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">arguments, as per @format_string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </method>
- <method name="get_child_value"
- c:identifier="g_variant_get_child_value"
- version="2.24">
- <doc xml:space="preserve">Reads a child item out of a container #GVariant instance. This
- includes variants, maybes, arrays, tuples and dictionary
- entries. It is an error to call this function on any other type of
- #GVariant.
- It is an error if @index_ is greater than the number of child items
- in the container. See g_variant_n_children().
- The returned value is never floating. You should free it with
- g_variant_unref() when you're done with it.
- This function is O(1).</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the child at the specified index</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a container #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="index_" transfer-ownership="none">
- <doc xml:space="preserve">the index of the child to fetch</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_data" c:identifier="g_variant_get_data" version="2.24">
- <doc xml:space="preserve">Returns a pointer to the serialised form of a #GVariant instance.
- The returned data may not be in fully-normalised form if read from an
- untrusted source. The returned data must not be freed; it remains
- valid for as long as @value exists.
- If @value is a fixed-sized value that was deserialised from a
- corrupted serialised container then %NULL may be returned. In this
- case, the proper thing to do is typically to use the appropriate
- number of nul bytes in place of @value. If @value is not fixed-sized
- then %NULL is never returned.
- In the case that @value is already in serialised form, this function
- is O(1). If the value is not already in serialised form,
- serialisation occurs implicitly and is approximately O(n) in the size
- of the result.
- To deserialise the data returned by this function, in addition to the
- serialised data, you must know the type of the #GVariant, and (if the
- machine might be different) the endianness of the machine that stored
- it. As a result, file formats or network messages that incorporate
- serialised #GVariants must include this information either
- implicitly (for instance "the file always contains a
- %G_VARIANT_TYPE_VARIANT and it is always in little-endian order") or
- explicitly (by storing the type and/or endianness in addition to the
- serialised data).</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the serialised form of @value, or %NULL</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_data_as_bytes"
- c:identifier="g_variant_get_data_as_bytes"
- version="2.36">
- <doc xml:space="preserve">Returns a pointer to the serialised form of a #GVariant instance.
- The semantics of this function are exactly the same as
- g_variant_get_data(), except that the returned #GBytes holds
- a reference to the variant data.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">A new #GBytes representing the variant data</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_double"
- c:identifier="g_variant_get_double"
- version="2.24">
- <doc xml:space="preserve">Returns the double precision floating point value of @value.
- It is an error to call this function with a @value of any type
- other than %G_VARIANT_TYPE_DOUBLE.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #gdouble</doc>
- <type name="gdouble" c:type="gdouble"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a double #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_fixed_array"
- c:identifier="g_variant_get_fixed_array"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">Provides access to the serialised data for an array of fixed-sized
- items.
- @value must be an array with fixed-sized elements. Numeric types are
- fixed-size, as are tuples containing only other fixed-sized types.
- @element_size must be the size of a single element in the array,
- as given by the section on
- [serialized data memory][gvariant-serialised-data-memory].
- In particular, arrays of these fixed-sized types can be interpreted
- as an array of the given C type, with @element_size set to the size
- the appropriate type:
- - %G_VARIANT_TYPE_INT16 (etc.): #gint16 (etc.)
- - %G_VARIANT_TYPE_BOOLEAN: #guchar (not #gboolean!)
- - %G_VARIANT_TYPE_BYTE: #guchar
- - %G_VARIANT_TYPE_HANDLE: #guint32
- - %G_VARIANT_TYPE_DOUBLE: #gdouble
- For example, if calling this function for an array of 32-bit integers,
- you might say sizeof(gint32). This value isn't used except for the purpose
- of a double-check that the form of the serialised data matches the caller's
- expectation.
- @n_elements, which must be non-%NULL is set equal to the number of
- items in the array.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a pointer to
- the fixed array</doc>
- <array length="0" zero-terminated="0" c:type="gconstpointer">
- <type name="gpointer" c:type="gconstpointer"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant array with fixed-sized elements</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="n_elements"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">a pointer to the location to store the number of items</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- <parameter name="element_size" transfer-ownership="none">
- <doc xml:space="preserve">the size of each element</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_handle"
- c:identifier="g_variant_get_handle"
- version="2.24">
- <doc xml:space="preserve">Returns the 32-bit signed integer value of @value.
- It is an error to call this function with a @value of any type other
- than %G_VARIANT_TYPE_HANDLE.
- By convention, handles are indexes into an array of file descriptors
- that are sent alongside a D-Bus message. If you're not interacting
- with D-Bus, you probably don't need them.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #gint32</doc>
- <type name="gint32" c:type="gint32"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a handle #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_int16"
- c:identifier="g_variant_get_int16"
- version="2.24">
- <doc xml:space="preserve">Returns the 16-bit signed integer value of @value.
- It is an error to call this function with a @value of any type
- other than %G_VARIANT_TYPE_INT16.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #gint16</doc>
- <type name="gint16" c:type="gint16"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a int16 #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_int32"
- c:identifier="g_variant_get_int32"
- version="2.24">
- <doc xml:space="preserve">Returns the 32-bit signed integer value of @value.
- It is an error to call this function with a @value of any type
- other than %G_VARIANT_TYPE_INT32.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #gint32</doc>
- <type name="gint32" c:type="gint32"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a int32 #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_int64"
- c:identifier="g_variant_get_int64"
- version="2.24">
- <doc xml:space="preserve">Returns the 64-bit signed integer value of @value.
- It is an error to call this function with a @value of any type
- other than %G_VARIANT_TYPE_INT64.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #gint64</doc>
- <type name="gint64" c:type="gint64"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a int64 #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_maybe"
- c:identifier="g_variant_get_maybe"
- version="2.24">
- <doc xml:space="preserve">Given a maybe-typed #GVariant instance, extract its value. If the
- value is Nothing, then this function returns %NULL.</doc>
- <return-value transfer-ownership="full" nullable="1">
- <doc xml:space="preserve">the contents of @value, or %NULL</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a maybe-typed value</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_normal_form"
- c:identifier="g_variant_get_normal_form"
- version="2.24">
- <doc xml:space="preserve">Gets a #GVariant instance that has the same value as @value and is
- trusted to be in normal form.
- If @value is already trusted to be in normal form then a new
- reference to @value is returned.
- If @value is not already trusted, then it is scanned to check if it
- is in normal form. If it is found to be in normal form then it is
- marked as trusted and a new reference to it is returned.
- If @value is found not to be in normal form then a new trusted
- #GVariant is created with the same value as @value.
- It makes sense to call this function if you've received #GVariant
- data from untrusted sources and you want to ensure your serialised
- output is definitely in normal form.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a trusted #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_objv" c:identifier="g_variant_get_objv" version="2.30">
- <doc xml:space="preserve">Gets the contents of an array of object paths #GVariant. This call
- makes a shallow copy; the return result should be released with
- g_free(), but the individual strings must not be modified.
- If @length is non-%NULL then the number of elements in the result
- is stored there. In any case, the resulting array will be
- %NULL-terminated.
- For an empty array, @length will be set to 0 and a pointer to a
- %NULL pointer will be returned.</doc>
- <return-value transfer-ownership="container">
- <doc xml:space="preserve">an array of constant strings</doc>
- <array length="0" zero-terminated="1" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">an array of object paths #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">the length of the result, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_size" c:identifier="g_variant_get_size" version="2.24">
- <doc xml:space="preserve">Determines the number of bytes that would be required to store @value
- with g_variant_store().
- If @value has a fixed-sized type then this function always returned
- that fixed size.
- In the case that @value is already in serialised form or the size has
- already been calculated (ie: this function has been called before)
- then this function is O(1). Otherwise, the size is calculated, an
- operation which is approximately O(n) in the number of values
- involved.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the serialised size of @value</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_string"
- c:identifier="g_variant_get_string"
- version="2.24">
- <doc xml:space="preserve">Returns the string value of a #GVariant instance with a string
- type. This includes the types %G_VARIANT_TYPE_STRING,
- %G_VARIANT_TYPE_OBJECT_PATH and %G_VARIANT_TYPE_SIGNATURE.
- The string will always be UTF-8 encoded, and will never be %NULL.
- If @length is non-%NULL then the length of the string (in bytes) is
- returned there. For trusted values, this information is already
- known. For untrusted values, a strlen() will be performed.
- It is an error to call this function with a @value of any type
- other than those three.
- The return value remains valid as long as @value exists.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the constant string, UTF-8 encoded</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a string #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">a pointer to a #gsize,
- to store the length</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_strv" c:identifier="g_variant_get_strv" version="2.24">
- <doc xml:space="preserve">Gets the contents of an array of strings #GVariant. This call
- makes a shallow copy; the return result should be released with
- g_free(), but the individual strings must not be modified.
- If @length is non-%NULL then the number of elements in the result
- is stored there. In any case, the resulting array will be
- %NULL-terminated.
- For an empty array, @length will be set to 0 and a pointer to a
- %NULL pointer will be returned.</doc>
- <return-value transfer-ownership="container">
- <doc xml:space="preserve">an array of constant strings</doc>
- <array length="0" zero-terminated="1" c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">an array of strings #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">the length of the result, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_type" c:identifier="g_variant_get_type" version="2.24">
- <doc xml:space="preserve">Determines the type of @value.
- The return value is valid for the lifetime of @value and must not
- be freed.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_type_string"
- c:identifier="g_variant_get_type_string"
- version="2.24">
- <doc xml:space="preserve">Returns the type string of @value. Unlike the result of calling
- g_variant_type_peek_string(), this string is nul-terminated. This
- string belongs to #GVariant and must not be freed.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the type string for the type of @value</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_uint16"
- c:identifier="g_variant_get_uint16"
- version="2.24">
- <doc xml:space="preserve">Returns the 16-bit unsigned integer value of @value.
- It is an error to call this function with a @value of any type
- other than %G_VARIANT_TYPE_UINT16.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #guint16</doc>
- <type name="guint16" c:type="guint16"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a uint16 #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_uint32"
- c:identifier="g_variant_get_uint32"
- version="2.24">
- <doc xml:space="preserve">Returns the 32-bit unsigned integer value of @value.
- It is an error to call this function with a @value of any type
- other than %G_VARIANT_TYPE_UINT32.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #guint32</doc>
- <type name="guint32" c:type="guint32"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a uint32 #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_uint64"
- c:identifier="g_variant_get_uint64"
- version="2.24">
- <doc xml:space="preserve">Returns the 64-bit unsigned integer value of @value.
- It is an error to call this function with a @value of any type
- other than %G_VARIANT_TYPE_UINT64.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #guint64</doc>
- <type name="guint64" c:type="guint64"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a uint64 #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_va"
- c:identifier="g_variant_get_va"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">This function is intended to be used by libraries based on #GVariant
- that want to provide g_variant_get()-like functionality to their
- users.
- The API is more general than g_variant_get() to allow a wider range
- of possible uses.
- @format_string must still point to a valid format string, but it only
- need to be nul-terminated if @endptr is %NULL. If @endptr is
- non-%NULL then it is updated to point to the first character past the
- end of the format string.
- @app is a pointer to a #va_list. The arguments, according to
- @format_string, are collected from this #va_list and the list is left
- pointing to the argument following the last.
- These two generalisations allow mixing of multiple calls to
- g_variant_new_va() and g_variant_get_va() within a single actual
- varargs call by the user.
- @format_string determines the C types that are used for unpacking
- the values and also determines if the values are copied or borrowed,
- see the section on
- [GVariant format strings][gvariant-format-strings-pointers].</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="format_string" transfer-ownership="none">
- <doc xml:space="preserve">a string that is prefixed with a format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="endptr"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">location to store the end pointer,
- or %NULL</doc>
- <type name="utf8" c:type="const gchar**"/>
- </parameter>
- <parameter name="app" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #va_list</doc>
- <type name="va_list" c:type="va_list*"/>
- </parameter>
- </parameters>
- </method>
- <method name="get_variant"
- c:identifier="g_variant_get_variant"
- version="2.24">
- <doc xml:space="preserve">Unboxes @value. The result is the #GVariant instance that was
- contained in @value.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the item contained in the variant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a variant #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="hash" c:identifier="g_variant_hash" version="2.24">
- <doc xml:space="preserve">Generates a hash value for a #GVariant instance.
- The output of this function is guaranteed to be the same for a given
- value only per-process. It may change between different processor
- architectures or even different versions of GLib. Do not use this
- function as a basis for building protocols or file formats.
- The type of @value is #gconstpointer only to allow use of this
- function with #GHashTable. @value must be a #GVariant.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a hash value corresponding to @value</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a basic #GVariant value as a #gconstpointer</doc>
- <type name="Variant" c:type="gconstpointer"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_container"
- c:identifier="g_variant_is_container"
- version="2.24">
- <doc xml:space="preserve">Checks if @value is a container.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @value is a container</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_floating"
- c:identifier="g_variant_is_floating"
- version="2.26">
- <doc xml:space="preserve">Checks whether @value has a floating reference count.
- This function should only ever be used to assert that a given variant
- is or is not floating, or for debug purposes. To acquire a reference
- to a variant that might be floating, always use g_variant_ref_sink()
- or g_variant_take_ref().
- See g_variant_ref_sink() for more information about floating reference
- counts.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">whether @value is floating</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_normal_form"
- c:identifier="g_variant_is_normal_form"
- version="2.24">
- <doc xml:space="preserve">Checks if @value is in normal form.
- The main reason to do this is to detect if a given chunk of
- serialised data is in normal form: load the data into a #GVariant
- using g_variant_new_from_data() and then use this function to
- check.
- If @value is found to be in normal form then it will be marked as
- being trusted. If the value was already marked as being trusted then
- this function will immediately return %TRUE.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @value is in normal form</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_of_type"
- c:identifier="g_variant_is_of_type"
- version="2.24">
- <doc xml:space="preserve">Checks if a value has a type matching the provided type.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the type of @value matches @type</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant instance</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- </parameters>
- </method>
- <method name="iter_new"
- c:identifier="g_variant_iter_new"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">Creates a heap-allocated #GVariantIter for iterating over the items
- in @value.
- Use g_variant_iter_free() to free the return value when you no longer
- need it.
- A reference is taken to @value and will be released only when
- g_variant_iter_free() is called.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new heap-allocated #GVariantIter</doc>
- <type name="VariantIter" c:type="GVariantIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a container #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="lookup"
- c:identifier="g_variant_lookup"
- version="2.28"
- introspectable="0">
- <doc xml:space="preserve">Looks up a value in a dictionary #GVariant.
- This function is a wrapper around g_variant_lookup_value() and
- g_variant_get(). In the case that %NULL would have been returned,
- this function returns %FALSE. Otherwise, it unpacks the returned
- value and returns %TRUE.
- @format_string determines the C types that are used for unpacking
- the values and also determines if the values are copied or borrowed,
- see the section on
- [GVariant format strings][gvariant-format-strings-pointers].
- This function is currently implemented with a linear scan. If you
- plan to do many lookups then #GVariantDict may be more efficient.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a value was unpacked</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="dictionary" transfer-ownership="none">
- <doc xml:space="preserve">a dictionary #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">the key to lookup in the dictionary</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="format_string" transfer-ownership="none">
- <doc xml:space="preserve">a GVariant format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the arguments to unpack the value into</doc>
- <varargs/>
- </parameter>
- </parameters>
- </method>
- <method name="lookup_value"
- c:identifier="g_variant_lookup_value"
- version="2.28">
- <doc xml:space="preserve">Looks up a value in a dictionary #GVariant.
- This function works with dictionaries of the type a{s*} (and equally
- well with type a{o*}, but we only further discuss the string case
- for sake of clarity).
- In the event that @dictionary has the type a{sv}, the @expected_type
- string specifies what type of value is expected to be inside of the
- variant. If the value inside the variant has a different type then
- %NULL is returned. In the event that @dictionary has a value type other
- than v then @expected_type must directly match the key type and it is
- used to unpack the value directly or an error occurs.
- In either case, if @key is not found in @dictionary, %NULL is returned.
- If the key is found and the value has the correct type, it is
- returned. If @expected_type was specified then any non-%NULL return
- value will have this type.
- This function is currently implemented with a linear scan. If you
- plan to do many lookups then #GVariantDict may be more efficient.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the value of the dictionary key, or %NULL</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <instance-parameter name="dictionary" transfer-ownership="none">
- <doc xml:space="preserve">a dictionary #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">the key to lookup in the dictionary</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="expected_type"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GVariantType, or %NULL</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- </parameters>
- </method>
- <method name="n_children"
- c:identifier="g_variant_n_children"
- version="2.24">
- <doc xml:space="preserve">Determines the number of children in a container #GVariant instance.
- This includes variants, maybes, arrays, tuples and dictionary
- entries. It is an error to call this function on any other type of
- #GVariant.
- For variants, the return value is always 1. For values with maybe
- types, it is always zero or one. For arrays, it is the length of the
- array. For tuples it is the number of tuple items (which depends
- only on the type). For dictionary entries, it is always 2
- This function is O(1).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of children in the container</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a container #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="print" c:identifier="g_variant_print" version="2.24">
- <doc xml:space="preserve">Pretty-prints @value in the format understood by g_variant_parse().
- The format is described [here][gvariant-text].
- If @type_annotate is %TRUE, then type information is included in
- the output.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string holding the result.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="type_annotate" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if type information should be included in
- the output</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="print_string"
- c:identifier="g_variant_print_string"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">Behaves as g_variant_print(), but operates on a #GString.
- If @string is non-%NULL then it is appended to and returned. Else,
- a new empty #GString is allocated and it is returned.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a #GString containing the string</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="string"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GString, or %NULL</doc>
- <type name="String" c:type="GString*"/>
- </parameter>
- <parameter name="type_annotate" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if type information should be included in
- the output</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_variant_ref" version="2.24">
- <doc xml:space="preserve">Increases the reference count of @value.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the same @value</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="ref_sink" c:identifier="g_variant_ref_sink" version="2.24">
- <doc xml:space="preserve">#GVariant uses a floating reference count system. All functions with
- names starting with `g_variant_new_` return floating
- references.
- Calling g_variant_ref_sink() on a #GVariant with a floating reference
- will convert the floating reference into a full reference. Calling
- g_variant_ref_sink() on a non-floating #GVariant results in an
- additional normal reference being added.
- In other words, if the @value is floating, then this call "assumes
- ownership" of the floating reference, converting it to a normal
- reference. If the @value is not floating, then this call adds a
- new normal reference increasing the reference count by one.
- All calls that result in a #GVariant instance being inserted into a
- container will call g_variant_ref_sink() on the instance. This means
- that if the value was just created (and has only its floating
- reference) then the container will assume sole ownership of the value
- at that point and the caller will not need to unreference it. This
- makes certain common styles of programming much easier while still
- maintaining normal refcounting semantics in situations where values
- are not floating.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the same @value</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="store" c:identifier="g_variant_store" version="2.24">
- <doc xml:space="preserve">Stores the serialised form of @value at @data. @data should be
- large enough. See g_variant_get_size().
- The stored data is in machine native byte order but may not be in
- fully-normalised form if read from an untrusted source. See
- g_variant_get_normal_form() for a solution.
- As with g_variant_get_data(), to be able to deserialise the
- serialised variant successfully, its type and (if the destination
- machine might be different) its endianness must also be available.
- This function is approximately O(n) in the size of @data.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">the #GVariant to store</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">the location to store the serialised data at</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="take_ref" c:identifier="g_variant_take_ref">
- <doc xml:space="preserve">If @value is floating, sink it. Otherwise, do nothing.
- Typically you want to use g_variant_ref_sink() in order to
- automatically do the correct thing with respect to floating or
- non-floating references, but there is one specific scenario where
- this function is helpful.
- The situation where this function is helpful is when creating an API
- that allows the user to provide a callback function that returns a
- #GVariant. We certainly want to allow the user the flexibility to
- return a non-floating reference from this callback (for the case
- where the value that is being returned already exists).
- At the same time, the style of the #GVariant API makes it likely that
- for newly-created #GVariant instances, the user can be saved some
- typing if they are allowed to return a #GVariant with a floating
- reference.
- Using this function on the return value of the user's callback allows
- the user to do whichever is more convenient for them. The caller
- will alway receives exactly one full reference to the value: either
- the one that was returned in the first place, or a floating reference
- that has been converted to a full reference.
- This function has an odd interaction when combined with
- g_variant_ref_sink() running at the same time in another thread on
- the same #GVariant instance. If g_variant_ref_sink() runs first then
- the result will be that the floating reference is converted to a hard
- reference. If g_variant_take_ref() runs first then the result will
- be that the floating reference is converted to a hard reference and
- an additional reference on top of that one is added. It is best to
- avoid this situation.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the same @value</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_variant_unref" version="2.24">
- <doc xml:space="preserve">Decreases the reference count of @value. When its reference count
- drops to 0, the memory used by the variant is freed.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="is_object_path"
- c:identifier="g_variant_is_object_path"
- version="2.24">
- <doc xml:space="preserve">Determines if a given string is a valid D-Bus object path. You
- should ensure that a string is a valid D-Bus object path before
- passing it to g_variant_new_object_path().
- A valid object path starts with '/' followed by zero or more
- sequences of characters separated by '/' characters. Each sequence
- must contain only the characters "[A-Z][a-z][0-9]_". No sequence
- (including the one following the final '/' character) may be empty.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @string is a D-Bus object path</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a normal C nul-terminated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="is_signature"
- c:identifier="g_variant_is_signature"
- version="2.24">
- <doc xml:space="preserve">Determines if a given string is a valid D-Bus type signature. You
- should ensure that a string is a valid D-Bus type signature before
- passing it to g_variant_new_signature().
- D-Bus type signatures consist of zero or more definite #GVariantType
- strings in sequence.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @string is a D-Bus type signature</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a normal C nul-terminated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="parse" c:identifier="g_variant_parse" throws="1">
- <doc xml:space="preserve">Parses a #GVariant from a text representation.
- A single #GVariant is parsed from the content of @text.
- The format is described [here][gvariant-text].
- The memory at @limit will never be accessed and the parser behaves as
- if the character at @limit is the nul terminator. This has the
- effect of bounding @text.
- If @endptr is non-%NULL then @text is permitted to contain data
- following the value that this function parses and @endptr will be
- updated to point to the first character past the end of the text
- parsed by this function. If @endptr is %NULL and there is extra data
- then an error is returned.
- If @type is non-%NULL then the value will be parsed to have that
- type. This may result in additional parse errors (in the case that
- the parsed value doesn't fit the type) but may also result in fewer
- errors (in the case that the type would have been ambiguous, such as
- with empty arrays).
- In the event that the parsing is successful, the resulting #GVariant
- is returned. It is never floating, and must be freed with
- g_variant_unref().
- In case of any error, %NULL will be returned. If @error is non-%NULL
- then it will be set to reflect the error that occurred.
- Officially, the language understood by the parser is "any string
- produced by g_variant_print()".</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a non-floating reference to a #GVariant, or %NULL</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="type"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GVariantType, or %NULL</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- <parameter name="text" transfer-ownership="none">
- <doc xml:space="preserve">a string containing a GVariant in text form</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="limit"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a pointer to the end of @text, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="endptr"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a location to store the end pointer, or %NULL</doc>
- <type name="utf8" c:type="const gchar**"/>
- </parameter>
- </parameters>
- </function>
- <function name="parse_error_print_context"
- c:identifier="g_variant_parse_error_print_context"
- version="2.40">
- <doc xml:space="preserve">Pretty-prints a message showing the context of a #GVariant parse
- error within the string for which parsing was attempted.
- The resulting string is suitable for output to the console or other
- monospace media where newlines are treated in the usual way.
- The message will typically look something like one of the following:
- |[
- unterminated string constant:
- (1, 2, 3, 'abc
- ^^^^
- ]|
- or
- |[
- unable to find a common type:
- [1, 2, 3, 'str']
- ^ ^^^^^
- ]|
- The format of the message may change in a future version.
- @error must have come from a failed attempt to g_variant_parse() and
- @source_str must be exactly the same string that caused the error.
- If @source_str was not nul-terminated when you passed it to
- g_variant_parse() then you must add nul termination before using this
- function.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the printed message</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="error" transfer-ownership="none">
- <doc xml:space="preserve">a #GError from the #GVariantParseError domain</doc>
- <type name="Error" c:type="GError*"/>
- </parameter>
- <parameter name="source_str" transfer-ownership="none">
- <doc xml:space="preserve">the string that was given to the parser</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="parse_error_quark"
- c:identifier="g_variant_parse_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="parser_get_error_quark"
- c:identifier="g_variant_parser_get_error_quark"
- deprecated="1">
- <doc xml:space="preserve">Same as g_variant_error_quark().</doc>
- <doc-deprecated xml:space="preserve">Use g_variant_parse_error_quark() instead.</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- </record>
- <record name="VariantBuilder"
- c:type="GVariantBuilder"
- glib:type-name="GVariantBuilder"
- glib:get-type="g_variant_builder_get_type"
- c:symbol-prefix="variant_builder">
- <doc xml:space="preserve">A utility type for constructing container-type #GVariant instances.
- This is an opaque structure and may only be accessed using the
- following functions.
- #GVariantBuilder is not threadsafe in any way. Do not attempt to
- access it from more than one thread.</doc>
- <field name="x" readable="0" private="1">
- <array zero-terminated="0" c:type="gsize" fixed-size="16">
- <type name="gsize" c:type="gsize"/>
- </array>
- </field>
- <constructor name="new"
- c:identifier="g_variant_builder_new"
- version="2.24">
- <doc xml:space="preserve">Allocates and initialises a new #GVariantBuilder.
- You should call g_variant_builder_unref() on the return value when it
- is no longer needed. The memory will not be automatically freed by
- any other call.
- In most cases it is easier to place a #GVariantBuilder directly on
- the stack of the calling function and initialise it with
- g_variant_builder_init().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a #GVariantBuilder</doc>
- <type name="VariantBuilder" c:type="GVariantBuilder*"/>
- </return-value>
- <parameters>
- <parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a container type</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="add"
- c:identifier="g_variant_builder_add"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">Adds to a #GVariantBuilder.
- This call is a convenience wrapper that is exactly equivalent to
- calling g_variant_new() followed by g_variant_builder_add_value().
- Note that the arguments must be of the correct width for their types
- specified in @format_string. This can be achieved by casting them. See
- the [GVariant varargs documentation][gvariant-varargs].
- This function might be used as follows:
- |[<!-- language="C" -->
- GVariant *
- make_pointless_dictionary (void)
- {
- GVariantBuilder builder;
- int i;
- g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
- for (i = 0; i < 16; i++)
- {
- gchar buf[3];
- sprintf (buf, "%d", i);
- g_variant_builder_add (&builder, "{is}", i, buf);
- }
- return g_variant_builder_end (&builder);
- }
- ]|</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="builder" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantBuilder</doc>
- <type name="VariantBuilder" c:type="GVariantBuilder*"/>
- </instance-parameter>
- <parameter name="format_string" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant varargs format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">arguments, as per @format_string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </method>
- <method name="add_parsed"
- c:identifier="g_variant_builder_add_parsed"
- version="2.26"
- introspectable="0">
- <doc xml:space="preserve">Adds to a #GVariantBuilder.
- This call is a convenience wrapper that is exactly equivalent to
- calling g_variant_new_parsed() followed by
- g_variant_builder_add_value().
- Note that the arguments must be of the correct width for their types
- specified in @format_string. This can be achieved by casting them. See
- the [GVariant varargs documentation][gvariant-varargs].
- This function might be used as follows:
- |[<!-- language="C" -->
- GVariant *
- make_pointless_dictionary (void)
- {
- GVariantBuilder builder;
- int i;
- g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
- g_variant_builder_add_parsed (&builder, "{'width', <%i>}", 600);
- g_variant_builder_add_parsed (&builder, "{'title', <%s>}", "foo");
- g_variant_builder_add_parsed (&builder, "{'transparency', <0.5>}");
- return g_variant_builder_end (&builder);
- }
- ]|</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="builder" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantBuilder</doc>
- <type name="VariantBuilder" c:type="GVariantBuilder*"/>
- </instance-parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a text format #GVariant</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">arguments as per @format</doc>
- <varargs/>
- </parameter>
- </parameters>
- </method>
- <method name="add_value"
- c:identifier="g_variant_builder_add_value"
- version="2.24">
- <doc xml:space="preserve">Adds @value to @builder.
- It is an error to call this function in any way that would create an
- inconsistent value to be constructed. Some examples of this are
- putting different types of items into an array, putting the wrong
- types or number of items in a tuple, putting more than one value into
- a variant, etc.
- If @value is a floating reference (see g_variant_ref_sink()),
- the @builder instance takes ownership of @value.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="builder" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantBuilder</doc>
- <type name="VariantBuilder" c:type="GVariantBuilder*"/>
- </instance-parameter>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </parameter>
- </parameters>
- </method>
- <method name="clear"
- c:identifier="g_variant_builder_clear"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">Releases all memory associated with a #GVariantBuilder without
- freeing the #GVariantBuilder structure itself.
- It typically only makes sense to do this on a stack-allocated
- #GVariantBuilder if you want to abort building the value part-way
- through. This function need not be called if you call
- g_variant_builder_end() and it also doesn't need to be called on
- builders allocated with g_variant_builder_new (see
- g_variant_builder_unref() for that).
- This function leaves the #GVariantBuilder structure set to all-zeros.
- It is valid to call this function on either an initialised
- #GVariantBuilder or one that is set to all-zeros but it is not valid
- to call this function on uninitialised memory.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="builder" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantBuilder</doc>
- <type name="VariantBuilder" c:type="GVariantBuilder*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="close"
- c:identifier="g_variant_builder_close"
- version="2.24">
- <doc xml:space="preserve">Closes the subcontainer inside the given @builder that was opened by
- the most recent call to g_variant_builder_open().
- It is an error to call this function in any way that would create an
- inconsistent value to be constructed (ie: too few values added to the
- subcontainer).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="builder" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantBuilder</doc>
- <type name="VariantBuilder" c:type="GVariantBuilder*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="end" c:identifier="g_variant_builder_end" version="2.24">
- <doc xml:space="preserve">Ends the builder process and returns the constructed value.
- It is not permissible to use @builder in any way after this call
- except for reference counting operations (in the case of a
- heap-allocated #GVariantBuilder) or by reinitialising it with
- g_variant_builder_init() (in the case of stack-allocated).
- It is an error to call this function in any way that would create an
- inconsistent value to be constructed (ie: insufficient number of
- items added to a container with a specific number of children
- required). It is also an error to call this function if the builder
- was created with an indefinite array or maybe type and no children
- have been added; in this case it is impossible to infer the type of
- the empty array.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a new, floating, #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <instance-parameter name="builder" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantBuilder</doc>
- <type name="VariantBuilder" c:type="GVariantBuilder*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="init"
- c:identifier="g_variant_builder_init"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">Initialises a #GVariantBuilder structure.
- @type must be non-%NULL. It specifies the type of container to
- construct. It can be an indefinite type such as
- %G_VARIANT_TYPE_ARRAY or a definite type such as "as" or "(ii)".
- Maybe, array, tuple, dictionary entry and variant-typed values may be
- constructed.
- After the builder is initialised, values are added using
- g_variant_builder_add_value() or g_variant_builder_add().
- After all the child values are added, g_variant_builder_end() frees
- the memory associated with the builder and returns the #GVariant that
- was created.
- This function completely ignores the previous contents of @builder.
- On one hand this means that it is valid to pass in completely
- uninitialised memory. On the other hand, this means that if you are
- initialising over top of an existing #GVariantBuilder you need to
- first call g_variant_builder_clear() in order to avoid leaking
- memory.
- You must not call g_variant_builder_ref() or
- g_variant_builder_unref() on a #GVariantBuilder that was initialised
- with this function. If you ever pass a reference to a
- #GVariantBuilder outside of the control of your own code then you
- should assume that the person receiving that reference may try to use
- reference counting; you should use g_variant_builder_new() instead of
- this function.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="builder" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantBuilder</doc>
- <type name="VariantBuilder" c:type="GVariantBuilder*"/>
- </instance-parameter>
- <parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a container type</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- </parameters>
- </method>
- <method name="open" c:identifier="g_variant_builder_open" version="2.24">
- <doc xml:space="preserve">Opens a subcontainer inside the given @builder. When done adding
- items to the subcontainer, g_variant_builder_close() must be called.
- It is an error to call this function in any way that would cause an
- inconsistent value to be constructed (ie: adding too many values or
- a value of an incorrect type).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="builder" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantBuilder</doc>
- <type name="VariantBuilder" c:type="GVariantBuilder*"/>
- </instance-parameter>
- <parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_variant_builder_ref" version="2.24">
- <doc xml:space="preserve">Increases the reference count on @builder.
- Don't call this on stack-allocated #GVariantBuilder instances or bad
- things will happen.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new reference to @builder</doc>
- <type name="VariantBuilder" c:type="GVariantBuilder*"/>
- </return-value>
- <parameters>
- <instance-parameter name="builder" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantBuilder allocated by g_variant_builder_new()</doc>
- <type name="VariantBuilder" c:type="GVariantBuilder*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="unref"
- c:identifier="g_variant_builder_unref"
- version="2.24">
- <doc xml:space="preserve">Decreases the reference count on @builder.
- In the event that there are no more references, releases all memory
- associated with the #GVariantBuilder.
- Don't call this on stack-allocated #GVariantBuilder instances or bad
- things will happen.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="builder" transfer-ownership="full">
- <doc xml:space="preserve">a #GVariantBuilder allocated by g_variant_builder_new()</doc>
- <type name="VariantBuilder" c:type="GVariantBuilder*"/>
- </instance-parameter>
- </parameters>
- </method>
- </record>
- <enumeration name="VariantClass" version="2.24" c:type="GVariantClass">
- <doc xml:space="preserve">The range of possible top-level types of #GVariant instances.</doc>
- <member name="boolean" value="98" c:identifier="G_VARIANT_CLASS_BOOLEAN">
- <doc xml:space="preserve">The #GVariant is a boolean.</doc>
- </member>
- <member name="byte" value="121" c:identifier="G_VARIANT_CLASS_BYTE">
- <doc xml:space="preserve">The #GVariant is a byte.</doc>
- </member>
- <member name="int16" value="110" c:identifier="G_VARIANT_CLASS_INT16">
- <doc xml:space="preserve">The #GVariant is a signed 16 bit integer.</doc>
- </member>
- <member name="uint16" value="113" c:identifier="G_VARIANT_CLASS_UINT16">
- <doc xml:space="preserve">The #GVariant is an unsigned 16 bit integer.</doc>
- </member>
- <member name="int32" value="105" c:identifier="G_VARIANT_CLASS_INT32">
- <doc xml:space="preserve">The #GVariant is a signed 32 bit integer.</doc>
- </member>
- <member name="uint32" value="117" c:identifier="G_VARIANT_CLASS_UINT32">
- <doc xml:space="preserve">The #GVariant is an unsigned 32 bit integer.</doc>
- </member>
- <member name="int64" value="120" c:identifier="G_VARIANT_CLASS_INT64">
- <doc xml:space="preserve">The #GVariant is a signed 64 bit integer.</doc>
- </member>
- <member name="uint64" value="116" c:identifier="G_VARIANT_CLASS_UINT64">
- <doc xml:space="preserve">The #GVariant is an unsigned 64 bit integer.</doc>
- </member>
- <member name="handle" value="104" c:identifier="G_VARIANT_CLASS_HANDLE">
- <doc xml:space="preserve">The #GVariant is a file handle index.</doc>
- </member>
- <member name="double" value="100" c:identifier="G_VARIANT_CLASS_DOUBLE">
- <doc xml:space="preserve">The #GVariant is a double precision floating
- point value.</doc>
- </member>
- <member name="string" value="115" c:identifier="G_VARIANT_CLASS_STRING">
- <doc xml:space="preserve">The #GVariant is a normal string.</doc>
- </member>
- <member name="object_path"
- value="111"
- c:identifier="G_VARIANT_CLASS_OBJECT_PATH">
- <doc xml:space="preserve">The #GVariant is a D-Bus object path
- string.</doc>
- </member>
- <member name="signature"
- value="103"
- c:identifier="G_VARIANT_CLASS_SIGNATURE">
- <doc xml:space="preserve">The #GVariant is a D-Bus signature string.</doc>
- </member>
- <member name="variant"
- value="118"
- c:identifier="G_VARIANT_CLASS_VARIANT">
- <doc xml:space="preserve">The #GVariant is a variant.</doc>
- </member>
- <member name="maybe" value="109" c:identifier="G_VARIANT_CLASS_MAYBE">
- <doc xml:space="preserve">The #GVariant is a maybe-typed value.</doc>
- </member>
- <member name="array" value="97" c:identifier="G_VARIANT_CLASS_ARRAY">
- <doc xml:space="preserve">The #GVariant is an array.</doc>
- </member>
- <member name="tuple" value="40" c:identifier="G_VARIANT_CLASS_TUPLE">
- <doc xml:space="preserve">The #GVariant is a tuple.</doc>
- </member>
- <member name="dict_entry"
- value="123"
- c:identifier="G_VARIANT_CLASS_DICT_ENTRY">
- <doc xml:space="preserve">The #GVariant is a dictionary entry.</doc>
- </member>
- </enumeration>
- <record name="VariantDict"
- c:type="GVariantDict"
- version="2.40"
- glib:type-name="GVariantDict"
- glib:get-type="g_variant_dict_get_type"
- c:symbol-prefix="variant_dict">
- <doc xml:space="preserve">#GVariantDict is a mutable interface to #GVariant dictionaries.
- It can be used for doing a sequence of dictionary lookups in an
- efficient way on an existing #GVariant dictionary or it can be used
- to construct new dictionaries with a hashtable-like interface. It
- can also be used for taking existing dictionaries and modifying them
- in order to create new ones.
- #GVariantDict can only be used with %G_VARIANT_TYPE_VARDICT
- dictionaries.
- It is possible to use #GVariantDict allocated on the stack or on the
- heap. When using a stack-allocated #GVariantDict, you begin with a
- call to g_variant_dict_init() and free the resources with a call to
- g_variant_dict_clear().
- Heap-allocated #GVariantDict follows normal refcounting rules: you
- allocate it with g_variant_dict_new() and use g_variant_dict_ref()
- and g_variant_dict_unref().
- g_variant_dict_end() is used to convert the #GVariantDict back into a
- dictionary-type #GVariant. When used with stack-allocated instances,
- this also implicitly frees all associated memory, but for
- heap-allocated instances, you must still call g_variant_dict_unref()
- afterwards.
- You will typically want to use a heap-allocated #GVariantDict when
- you expose it as part of an API. For most other uses, the
- stack-allocated form will be more convenient.
- Consider the following two examples that do the same thing in each
- style: take an existing dictionary and look up the "count" uint32
- key, adding 1 to it if it is found, or returning an error if the
- key is not found. Each returns the new dictionary as a floating
- #GVariant.
- ## Using a stack-allocated GVariantDict
- |[<!-- language="C" -->
- GVariant *
- add_to_count (GVariant *orig,
- GError **error)
- {
- GVariantDict dict;
- guint32 count;
- g_variant_dict_init (&dict, orig);
- if (!g_variant_dict_lookup (&dict, "count", "u", &count))
- {
- g_set_error (...);
- g_variant_dict_clear (&dict);
- return NULL;
- }
- g_variant_dict_insert (&dict, "count", "u", count + 1);
- return g_variant_dict_end (&dict);
- }
- ]|
- ## Using heap-allocated GVariantDict
- |[<!-- language="C" -->
- GVariant *
- add_to_count (GVariant *orig,
- GError **error)
- {
- GVariantDict *dict;
- GVariant *result;
- guint32 count;
- dict = g_variant_dict_new (orig);
- if (g_variant_dict_lookup (dict, "count", "u", &count))
- {
- g_variant_dict_insert (dict, "count", "u", count + 1);
- result = g_variant_dict_end (dict);
- }
- else
- {
- g_set_error (...);
- result = NULL;
- }
- g_variant_dict_unref (dict);
- return result;
- }
- ]|</doc>
- <field name="x" readable="0" private="1">
- <array zero-terminated="0" c:type="gsize" fixed-size="16">
- <type name="gsize" c:type="gsize"/>
- </array>
- </field>
- <constructor name="new" c:identifier="g_variant_dict_new" version="2.40">
- <doc xml:space="preserve">Allocates and initialises a new #GVariantDict.
- You should call g_variant_dict_unref() on the return value when it
- is no longer needed. The memory will not be automatically freed by
- any other call.
- In some cases it may be easier to place a #GVariantDict directly on
- the stack of the calling function and initialise it with
- g_variant_dict_init(). This is particularly useful when you are
- using #GVariantDict to construct a #GVariant.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a #GVariantDict</doc>
- <type name="VariantDict" c:type="GVariantDict*"/>
- </return-value>
- <parameters>
- <parameter name="from_asv"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the #GVariant with which to initialise the
- dictionary</doc>
- <type name="Variant" c:type="GVariant*"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="clear" c:identifier="g_variant_dict_clear" version="2.40">
- <doc xml:space="preserve">Releases all memory associated with a #GVariantDict without freeing
- the #GVariantDict structure itself.
- It typically only makes sense to do this on a stack-allocated
- #GVariantDict if you want to abort building the value part-way
- through. This function need not be called if you call
- g_variant_dict_end() and it also doesn't need to be called on dicts
- allocated with g_variant_dict_new (see g_variant_dict_unref() for
- that).
- It is valid to call this function on either an initialised
- #GVariantDict or one that was previously cleared by an earlier call
- to g_variant_dict_clear() but it is not valid to call this function
- on uninitialised memory.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="dict" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantDict</doc>
- <type name="VariantDict" c:type="GVariantDict*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="contains"
- c:identifier="g_variant_dict_contains"
- version="2.40">
- <doc xml:space="preserve">Checks if @key exists in @dict.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @key is in @dict</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="dict" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantDict</doc>
- <type name="VariantDict" c:type="GVariantDict*"/>
- </instance-parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">the key to lookup in the dictionary</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="end" c:identifier="g_variant_dict_end" version="2.40">
- <doc xml:space="preserve">Returns the current value of @dict as a #GVariant of type
- %G_VARIANT_TYPE_VARDICT, clearing it in the process.
- It is not permissible to use @dict in any way after this call except
- for reference counting operations (in the case of a heap-allocated
- #GVariantDict) or by reinitialising it with g_variant_dict_init() (in
- the case of stack-allocated).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a new, floating, #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <instance-parameter name="dict" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantDict</doc>
- <type name="VariantDict" c:type="GVariantDict*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="init"
- c:identifier="g_variant_dict_init"
- version="2.40"
- introspectable="0">
- <doc xml:space="preserve">Initialises a #GVariantDict structure.
- If @from_asv is given, it is used to initialise the dictionary.
- This function completely ignores the previous contents of @dict. On
- one hand this means that it is valid to pass in completely
- uninitialised memory. On the other hand, this means that if you are
- initialising over top of an existing #GVariantDict you need to first
- call g_variant_dict_clear() in order to avoid leaking memory.
- You must not call g_variant_dict_ref() or g_variant_dict_unref() on a
- #GVariantDict that was initialised with this function. If you ever
- pass a reference to a #GVariantDict outside of the control of your
- own code then you should assume that the person receiving that
- reference may try to use reference counting; you should use
- g_variant_dict_new() instead of this function.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="dict" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantDict</doc>
- <type name="VariantDict" c:type="GVariantDict*"/>
- </instance-parameter>
- <parameter name="from_asv"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the initial value for @dict</doc>
- <type name="Variant" c:type="GVariant*"/>
- </parameter>
- </parameters>
- </method>
- <method name="insert"
- c:identifier="g_variant_dict_insert"
- version="2.40"
- introspectable="0">
- <doc xml:space="preserve">Inserts a value into a #GVariantDict.
- This call is a convenience wrapper that is exactly equivalent to
- calling g_variant_new() followed by g_variant_dict_insert_value().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="dict" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantDict</doc>
- <type name="VariantDict" c:type="GVariantDict*"/>
- </instance-parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">the key to insert a value for</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="format_string" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariant varargs format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">arguments, as per @format_string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </method>
- <method name="insert_value"
- c:identifier="g_variant_dict_insert_value"
- version="2.40">
- <doc xml:space="preserve">Inserts (or replaces) a key in a #GVariantDict.
- @value is consumed if it is floating.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="dict" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantDict</doc>
- <type name="VariantDict" c:type="GVariantDict*"/>
- </instance-parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">the key to insert a value for</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">the value to insert</doc>
- <type name="Variant" c:type="GVariant*"/>
- </parameter>
- </parameters>
- </method>
- <method name="lookup"
- c:identifier="g_variant_dict_lookup"
- version="2.40"
- introspectable="0">
- <doc xml:space="preserve">Looks up a value in a #GVariantDict.
- This function is a wrapper around g_variant_dict_lookup_value() and
- g_variant_get(). In the case that %NULL would have been returned,
- this function returns %FALSE. Otherwise, it unpacks the returned
- value and returns %TRUE.
- @format_string determines the C types that are used for unpacking the
- values and also determines if the values are copied or borrowed, see the
- section on [GVariant format strings][gvariant-format-strings-pointers].</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a value was unpacked</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="dict" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantDict</doc>
- <type name="VariantDict" c:type="GVariantDict*"/>
- </instance-parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">the key to lookup in the dictionary</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="format_string" transfer-ownership="none">
- <doc xml:space="preserve">a GVariant format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the arguments to unpack the value into</doc>
- <varargs/>
- </parameter>
- </parameters>
- </method>
- <method name="lookup_value"
- c:identifier="g_variant_dict_lookup_value"
- version="2.40">
- <doc xml:space="preserve">Looks up a value in a #GVariantDict.
- If @key is not found in @dictionary, %NULL is returned.
- The @expected_type string specifies what type of value is expected.
- If the value associated with @key has a different type then %NULL is
- returned.
- If the key is found and the value has the correct type, it is
- returned. If @expected_type was specified then any non-%NULL return
- value will have this type.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the value of the dictionary key, or %NULL</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <instance-parameter name="dict" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantDict</doc>
- <type name="VariantDict" c:type="GVariantDict*"/>
- </instance-parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">the key to lookup in the dictionary</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="expected_type"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GVariantType, or %NULL</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- </parameters>
- </method>
- <method name="ref" c:identifier="g_variant_dict_ref" version="2.40">
- <doc xml:space="preserve">Increases the reference count on @dict.
- Don't call this on stack-allocated #GVariantDict instances or bad
- things will happen.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new reference to @dict</doc>
- <type name="VariantDict" c:type="GVariantDict*"/>
- </return-value>
- <parameters>
- <instance-parameter name="dict" transfer-ownership="none">
- <doc xml:space="preserve">a heap-allocated #GVariantDict</doc>
- <type name="VariantDict" c:type="GVariantDict*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="remove"
- c:identifier="g_variant_dict_remove"
- version="2.40">
- <doc xml:space="preserve">Removes a key and its associated value from a #GVariantDict.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key was found and removed</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="dict" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantDict</doc>
- <type name="VariantDict" c:type="GVariantDict*"/>
- </instance-parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">the key to remove</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </method>
- <method name="unref" c:identifier="g_variant_dict_unref" version="2.40">
- <doc xml:space="preserve">Decreases the reference count on @dict.
- In the event that there are no more references, releases all memory
- associated with the #GVariantDict.
- Don't call this on stack-allocated #GVariantDict instances or bad
- things will happen.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="dict" transfer-ownership="full">
- <doc xml:space="preserve">a heap-allocated #GVariantDict</doc>
- <type name="VariantDict" c:type="GVariantDict*"/>
- </instance-parameter>
- </parameters>
- </method>
- </record>
- <record name="VariantIter" c:type="GVariantIter" introspectable="0">
- <doc xml:space="preserve">#GVariantIter is an opaque data structure and can only be accessed
- using the following functions.</doc>
- <field name="x" readable="0" private="1">
- <array zero-terminated="0" c:type="gsize" fixed-size="16">
- <type name="gsize" c:type="gsize"/>
- </array>
- </field>
- <method name="copy"
- c:identifier="g_variant_iter_copy"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">Creates a new heap-allocated #GVariantIter to iterate over the
- container that was being iterated over by @iter. Iteration begins on
- the new iterator from the current position of the old iterator but
- the two copies are independent past that point.
- Use g_variant_iter_free() to free the return value when you no longer
- need it.
- A reference is taken to the container that @iter is iterating over
- and will be releated only when g_variant_iter_free() is called.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new heap-allocated #GVariantIter</doc>
- <type name="VariantIter" c:type="GVariantIter*"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantIter</doc>
- <type name="VariantIter" c:type="GVariantIter*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_variant_iter_free" version="2.24">
- <doc xml:space="preserve">Frees a heap-allocated #GVariantIter. Only call this function on
- iterators that were returned by g_variant_iter_new() or
- g_variant_iter_copy().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="full">
- <doc xml:space="preserve">a heap-allocated #GVariantIter</doc>
- <type name="VariantIter" c:type="GVariantIter*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="init"
- c:identifier="g_variant_iter_init"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">Initialises (without allocating) a #GVariantIter. @iter may be
- completely uninitialised prior to this call; its old value is
- ignored.
- The iterator remains valid for as long as @value exists, and need not
- be freed in any way.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of items in @value</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GVariantIter</doc>
- <type name="VariantIter" c:type="GVariantIter*"/>
- </instance-parameter>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a container #GVariant</doc>
- <type name="Variant" c:type="GVariant*"/>
- </parameter>
- </parameters>
- </method>
- <method name="loop"
- c:identifier="g_variant_iter_loop"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">Gets the next item in the container and unpacks it into the variable
- argument list according to @format_string, returning %TRUE.
- If no more items remain then %FALSE is returned.
- On the first call to this function, the pointers appearing on the
- variable argument list are assumed to point at uninitialised memory.
- On the second and later calls, it is assumed that the same pointers
- will be given and that they will point to the memory as set by the
- previous call to this function. This allows the previous values to
- be freed, as appropriate.
- This function is intended to be used with a while loop as
- demonstrated in the following example. This function can only be
- used when iterating over an array. It is only valid to call this
- function with a string constant for the format string and the same
- string constant must be used each time. Mixing calls to this
- function and g_variant_iter_next() or g_variant_iter_next_value() on
- the same iterator causes undefined behavior.
- If you break out of a such a while loop using g_variant_iter_loop() then
- you must free or unreference all the unpacked values as you would with
- g_variant_get(). Failure to do so will cause a memory leak.
- Here is an example for memory management with g_variant_iter_loop():
- |[<!-- language="C" -->
- // Iterates a dictionary of type 'a{sv}'
- void
- iterate_dictionary (GVariant *dictionary)
- {
- GVariantIter iter;
- GVariant *value;
- gchar *key;
- g_variant_iter_init (&iter, dictionary);
- while (g_variant_iter_loop (&iter, "{sv}", &key, &value))
- {
- g_print ("Item '%s' has type '%s'\n", key,
- g_variant_get_type_string (value));
- // no need to free 'key' and 'value' here
- // unless breaking out of this loop
- }
- }
- ]|
- For most cases you should use g_variant_iter_next().
- This function is really only useful when unpacking into #GVariant or
- #GVariantIter in order to allow you to skip the call to
- g_variant_unref() or g_variant_iter_free().
- For example, if you are only looping over simple integer and string
- types, g_variant_iter_next() is definitely preferred. For string
- types, use the '&' prefix to avoid allocating any memory at all (and
- thereby avoiding the need to free anything as well).
- @format_string determines the C types that are used for unpacking
- the values and also determines if the values are copied or borrowed.
- See the section on
- [GVariant format strings][gvariant-format-strings-pointers].</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a value was unpacked, or %FALSE if there was no
- value</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantIter</doc>
- <type name="VariantIter" c:type="GVariantIter*"/>
- </instance-parameter>
- <parameter name="format_string" transfer-ownership="none">
- <doc xml:space="preserve">a GVariant format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the arguments to unpack the value into</doc>
- <varargs/>
- </parameter>
- </parameters>
- </method>
- <method name="n_children"
- c:identifier="g_variant_iter_n_children"
- version="2.24">
- <doc xml:space="preserve">Queries the number of child items in the container that we are
- iterating over. This is the total number of items -- not the number
- of items remaining.
- This function might be useful for preallocation of arrays.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of children in the container</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantIter</doc>
- <type name="VariantIter" c:type="GVariantIter*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="next"
- c:identifier="g_variant_iter_next"
- version="2.24"
- introspectable="0">
- <doc xml:space="preserve">Gets the next item in the container and unpacks it into the variable
- argument list according to @format_string, returning %TRUE.
- If no more items remain then %FALSE is returned.
- All of the pointers given on the variable arguments list of this
- function are assumed to point at uninitialised memory. It is the
- responsibility of the caller to free all of the values returned by
- the unpacking process.
- Here is an example for memory management with g_variant_iter_next():
- |[<!-- language="C" -->
- // Iterates a dictionary of type 'a{sv}'
- void
- iterate_dictionary (GVariant *dictionary)
- {
- GVariantIter iter;
- GVariant *value;
- gchar *key;
- g_variant_iter_init (&iter, dictionary);
- while (g_variant_iter_next (&iter, "{sv}", &key, &value))
- {
- g_print ("Item '%s' has type '%s'\n", key,
- g_variant_get_type_string (value));
- // must free data for ourselves
- g_variant_unref (value);
- g_free (key);
- }
- }
- ]|
- For a solution that is likely to be more convenient to C programmers
- when dealing with loops, see g_variant_iter_loop().
- @format_string determines the C types that are used for unpacking
- the values and also determines if the values are copied or borrowed.
- See the section on
- [GVariant format strings][gvariant-format-strings-pointers].</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a value was unpacked, or %FALSE if there as no value</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantIter</doc>
- <type name="VariantIter" c:type="GVariantIter*"/>
- </instance-parameter>
- <parameter name="format_string" transfer-ownership="none">
- <doc xml:space="preserve">a GVariant format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the arguments to unpack the value into</doc>
- <varargs/>
- </parameter>
- </parameters>
- </method>
- <method name="next_value"
- c:identifier="g_variant_iter_next_value"
- version="2.24">
- <doc xml:space="preserve">Gets the next item in the container. If no more items remain then
- %NULL is returned.
- Use g_variant_unref() to drop your reference on the return value when
- you no longer need it.
- Here is an example for iterating with g_variant_iter_next_value():
- |[<!-- language="C" -->
- // recursively iterate a container
- void
- iterate_container_recursive (GVariant *container)
- {
- GVariantIter iter;
- GVariant *child;
- g_variant_iter_init (&iter, container);
- while ((child = g_variant_iter_next_value (&iter)))
- {
- g_print ("type '%s'\n", g_variant_get_type_string (child));
- if (g_variant_is_container (child))
- iterate_container_recursive (child);
- g_variant_unref (child);
- }
- }
- ]|</doc>
- <return-value transfer-ownership="full" nullable="1">
- <doc xml:space="preserve">a #GVariant, or %NULL</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <instance-parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantIter</doc>
- <type name="VariantIter" c:type="GVariantIter*"/>
- </instance-parameter>
- </parameters>
- </method>
- </record>
- <enumeration name="VariantParseError"
- c:type="GVariantParseError"
- glib:error-domain="g-variant-parse-error-quark">
- <doc xml:space="preserve">Error codes returned by parsing text-format GVariants.</doc>
- <member name="failed"
- value="0"
- c:identifier="G_VARIANT_PARSE_ERROR_FAILED">
- <doc xml:space="preserve">generic error (unused)</doc>
- </member>
- <member name="basic_type_expected"
- value="1"
- c:identifier="G_VARIANT_PARSE_ERROR_BASIC_TYPE_EXPECTED">
- <doc xml:space="preserve">a non-basic #GVariantType was given where a basic type was expected</doc>
- </member>
- <member name="cannot_infer_type"
- value="2"
- c:identifier="G_VARIANT_PARSE_ERROR_CANNOT_INFER_TYPE">
- <doc xml:space="preserve">cannot infer the #GVariantType</doc>
- </member>
- <member name="definite_type_expected"
- value="3"
- c:identifier="G_VARIANT_PARSE_ERROR_DEFINITE_TYPE_EXPECTED">
- <doc xml:space="preserve">an indefinite #GVariantType was given where a definite type was expected</doc>
- </member>
- <member name="input_not_at_end"
- value="4"
- c:identifier="G_VARIANT_PARSE_ERROR_INPUT_NOT_AT_END">
- <doc xml:space="preserve">extra data after parsing finished</doc>
- </member>
- <member name="invalid_character"
- value="5"
- c:identifier="G_VARIANT_PARSE_ERROR_INVALID_CHARACTER">
- <doc xml:space="preserve">invalid character in number or unicode escape</doc>
- </member>
- <member name="invalid_format_string"
- value="6"
- c:identifier="G_VARIANT_PARSE_ERROR_INVALID_FORMAT_STRING">
- <doc xml:space="preserve">not a valid #GVariant format string</doc>
- </member>
- <member name="invalid_object_path"
- value="7"
- c:identifier="G_VARIANT_PARSE_ERROR_INVALID_OBJECT_PATH">
- <doc xml:space="preserve">not a valid object path</doc>
- </member>
- <member name="invalid_signature"
- value="8"
- c:identifier="G_VARIANT_PARSE_ERROR_INVALID_SIGNATURE">
- <doc xml:space="preserve">not a valid type signature</doc>
- </member>
- <member name="invalid_type_string"
- value="9"
- c:identifier="G_VARIANT_PARSE_ERROR_INVALID_TYPE_STRING">
- <doc xml:space="preserve">not a valid #GVariant type string</doc>
- </member>
- <member name="no_common_type"
- value="10"
- c:identifier="G_VARIANT_PARSE_ERROR_NO_COMMON_TYPE">
- <doc xml:space="preserve">could not find a common type for array entries</doc>
- </member>
- <member name="number_out_of_range"
- value="11"
- c:identifier="G_VARIANT_PARSE_ERROR_NUMBER_OUT_OF_RANGE">
- <doc xml:space="preserve">the numerical value is out of range of the given type</doc>
- </member>
- <member name="number_too_big"
- value="12"
- c:identifier="G_VARIANT_PARSE_ERROR_NUMBER_TOO_BIG">
- <doc xml:space="preserve">the numerical value is out of range for any type</doc>
- </member>
- <member name="type_error"
- value="13"
- c:identifier="G_VARIANT_PARSE_ERROR_TYPE_ERROR">
- <doc xml:space="preserve">cannot parse as variant of the specified type</doc>
- </member>
- <member name="unexpected_token"
- value="14"
- c:identifier="G_VARIANT_PARSE_ERROR_UNEXPECTED_TOKEN">
- <doc xml:space="preserve">an unexpected token was encountered</doc>
- </member>
- <member name="unknown_keyword"
- value="15"
- c:identifier="G_VARIANT_PARSE_ERROR_UNKNOWN_KEYWORD">
- <doc xml:space="preserve">an unknown keyword was encountered</doc>
- </member>
- <member name="unterminated_string_constant"
- value="16"
- c:identifier="G_VARIANT_PARSE_ERROR_UNTERMINATED_STRING_CONSTANT">
- <doc xml:space="preserve">unterminated string constant</doc>
- </member>
- <member name="value_expected"
- value="17"
- c:identifier="G_VARIANT_PARSE_ERROR_VALUE_EXPECTED">
- <doc xml:space="preserve">no value given</doc>
- </member>
- </enumeration>
- <record name="VariantType"
- c:type="GVariantType"
- glib:type-name="GVariantType"
- glib:get-type="g_variant_type_get_gtype"
- c:symbol-prefix="variant_type">
- <doc xml:space="preserve">This section introduces the GVariant type system. It is based, in
- large part, on the D-Bus type system, with two major changes and
- some minor lifting of restrictions. The
- [D-Bus specification](http://dbus.freedesktop.org/doc/dbus-specification.html),
- therefore, provides a significant amount of
- information that is useful when working with GVariant.
- The first major change with respect to the D-Bus type system is the
- introduction of maybe (or "nullable") types. Any type in GVariant can be
- converted to a maybe type, in which case, "nothing" (or "null") becomes a
- valid value. Maybe types have been added by introducing the
- character "m" to type strings.
- The second major change is that the GVariant type system supports the
- concept of "indefinite types" -- types that are less specific than
- the normal types found in D-Bus. For example, it is possible to speak
- of "an array of any type" in GVariant, where the D-Bus type system
- would require you to speak of "an array of integers" or "an array of
- strings". Indefinite types have been added by introducing the
- characters "*", "?" and "r" to type strings.
- Finally, all arbitrary restrictions relating to the complexity of
- types are lifted along with the restriction that dictionary entries
- may only appear nested inside of arrays.
- Just as in D-Bus, GVariant types are described with strings ("type
- strings"). Subject to the differences mentioned above, these strings
- are of the same form as those found in DBus. Note, however: D-Bus
- always works in terms of messages and therefore individual type
- strings appear nowhere in its interface. Instead, "signatures"
- are a concatenation of the strings of the type of each argument in a
- message. GVariant deals with single values directly so GVariant type
- strings always describe the type of exactly one value. This means
- that a D-Bus signature string is generally not a valid GVariant type
- string -- except in the case that it is the signature of a message
- containing exactly one argument.
- An indefinite type is similar in spirit to what may be called an
- abstract type in other type systems. No value can exist that has an
- indefinite type as its type, but values can exist that have types
- that are subtypes of indefinite types. That is to say,
- g_variant_get_type() will never return an indefinite type, but
- calling g_variant_is_of_type() with an indefinite type may return
- %TRUE. For example, you cannot have a value that represents "an
- array of no particular type", but you can have an "array of integers"
- which certainly matches the type of "an array of no particular type",
- since "array of integers" is a subtype of "array of no particular
- type".
- This is similar to how instances of abstract classes may not
- directly exist in other type systems, but instances of their
- non-abstract subtypes may. For example, in GTK, no object that has
- the type of #GtkBin can exist (since #GtkBin is an abstract class),
- but a #GtkWindow can certainly be instantiated, and you would say
- that the #GtkWindow is a #GtkBin (since #GtkWindow is a subclass of
- #GtkBin).
- ## GVariant Type Strings
- A GVariant type string can be any of the following:
- - any basic type string (listed below)
- - "v", "r" or "*"
- - one of the characters 'a' or 'm', followed by another type string
- - the character '(', followed by a concatenation of zero or more other
- type strings, followed by the character ')'
- - the character '{', followed by a basic type string (see below),
- followed by another type string, followed by the character '}'
- A basic type string describes a basic type (as per
- g_variant_type_is_basic()) and is always a single character in length.
- The valid basic type strings are "b", "y", "n", "q", "i", "u", "x", "t",
- "h", "d", "s", "o", "g" and "?".
- The above definition is recursive to arbitrary depth. "aaaaai" and
- "(ui(nq((y)))s)" are both valid type strings, as is
- "a(aa(ui)(qna{ya(yd)}))".
- The meaning of each of the characters is as follows:
- - `b`: the type string of %G_VARIANT_TYPE_BOOLEAN; a boolean value.
- - `y`: the type string of %G_VARIANT_TYPE_BYTE; a byte.
- - `n`: the type string of %G_VARIANT_TYPE_INT16; a signed 16 bit integer.
- - `q`: the type string of %G_VARIANT_TYPE_UINT16; an unsigned 16 bit integer.
- - `i`: the type string of %G_VARIANT_TYPE_INT32; a signed 32 bit integer.
- - `u`: the type string of %G_VARIANT_TYPE_UINT32; an unsigned 32 bit integer.
- - `x`: the type string of %G_VARIANT_TYPE_INT64; a signed 64 bit integer.
- - `t`: the type string of %G_VARIANT_TYPE_UINT64; an unsigned 64 bit integer.
- - `h`: the type string of %G_VARIANT_TYPE_HANDLE; a signed 32 bit value
- that, by convention, is used as an index into an array of file
- descriptors that are sent alongside a D-Bus message.
- - `d`: the type string of %G_VARIANT_TYPE_DOUBLE; a double precision
- floating point value.
- - `s`: the type string of %G_VARIANT_TYPE_STRING; a string.
- - `o`: the type string of %G_VARIANT_TYPE_OBJECT_PATH; a string in the form
- of a D-Bus object path.
- - `g`: the type string of %G_VARIANT_TYPE_STRING; a string in the form of
- a D-Bus type signature.
- - `?`: the type string of %G_VARIANT_TYPE_BASIC; an indefinite type that
- is a supertype of any of the basic types.
- - `v`: the type string of %G_VARIANT_TYPE_VARIANT; a container type that
- contain any other type of value.
- - `a`: used as a prefix on another type string to mean an array of that
- type; the type string "ai", for example, is the type of an array of
- signed 32-bit integers.
- - `m`: used as a prefix on another type string to mean a "maybe", or
- "nullable", version of that type; the type string "ms", for example,
- is the type of a value that maybe contains a string, or maybe contains
- nothing.
- - `()`: used to enclose zero or more other concatenated type strings to
- create a tuple type; the type string "(is)", for example, is the type of
- a pair of an integer and a string.
- - `r`: the type string of %G_VARIANT_TYPE_TUPLE; an indefinite type that is
- a supertype of any tuple type, regardless of the number of items.
- - `{}`: used to enclose a basic type string concatenated with another type
- string to create a dictionary entry type, which usually appears inside of
- an array to form a dictionary; the type string "a{sd}", for example, is
- the type of a dictionary that maps strings to double precision floating
- point values.
- The first type (the basic type) is the key type and the second type is
- the value type. The reason that the first type is restricted to being a
- basic type is so that it can easily be hashed.
- - `*`: the type string of %G_VARIANT_TYPE_ANY; the indefinite type that is
- a supertype of all types. Note that, as with all type strings, this
- character represents exactly one type. It cannot be used inside of tuples
- to mean "any number of items".
- Any type string of a container that contains an indefinite type is,
- itself, an indefinite type. For example, the type string "a*"
- (corresponding to %G_VARIANT_TYPE_ARRAY) is an indefinite type
- that is a supertype of every array type. "(*s)" is a supertype
- of all tuples that contain exactly two items where the second
- item is a string.
- "a{?*}" is an indefinite type that is a supertype of all arrays
- containing dictionary entries where the key is any basic type and
- the value is any type at all. This is, by definition, a dictionary,
- so this type string corresponds to %G_VARIANT_TYPE_DICTIONARY. Note
- that, due to the restriction that the key of a dictionary entry must
- be a basic type, "{**}" is not a valid type string.</doc>
- <constructor name="new" c:identifier="g_variant_type_new" version="2.24">
- <doc xml:space="preserve">Creates a new #GVariantType corresponding to the type string given
- by @type_string. It is appropriate to call g_variant_type_free() on
- the return value.
- It is a programmer error to call this function with an invalid type
- string. Use g_variant_type_string_is_valid() if you are unsure.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GVariantType</doc>
- <type name="VariantType" c:type="GVariantType*"/>
- </return-value>
- <parameters>
- <parameter name="type_string" transfer-ownership="none">
- <doc xml:space="preserve">a valid GVariant type string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_array" c:identifier="g_variant_type_new_array">
- <doc xml:space="preserve">Constructs the type corresponding to an array of elements of the
- type @type.
- It is appropriate to call g_variant_type_free() on the return value.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new array #GVariantType
- Since 2.24</doc>
- <type name="VariantType" c:type="GVariantType*"/>
- </return-value>
- <parameters>
- <parameter name="element" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_dict_entry"
- c:identifier="g_variant_type_new_dict_entry">
- <doc xml:space="preserve">Constructs the type corresponding to a dictionary entry with a key
- of type @key and a value of type @value.
- It is appropriate to call g_variant_type_free() on the return value.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new dictionary entry #GVariantType
- Since 2.24</doc>
- <type name="VariantType" c:type="GVariantType*"/>
- </return-value>
- <parameters>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">a basic #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_maybe" c:identifier="g_variant_type_new_maybe">
- <doc xml:space="preserve">Constructs the type corresponding to a maybe instance containing
- type @type or Nothing.
- It is appropriate to call g_variant_type_free() on the return value.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new maybe #GVariantType
- Since 2.24</doc>
- <type name="VariantType" c:type="GVariantType*"/>
- </return-value>
- <parameters>
- <parameter name="element" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- </parameters>
- </constructor>
- <constructor name="new_tuple" c:identifier="g_variant_type_new_tuple">
- <doc xml:space="preserve">Constructs a new tuple type, from @items.
- @length is the number of items in @items, or -1 to indicate that
- @items is %NULL-terminated.
- It is appropriate to call g_variant_type_free() on the return value.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new tuple #GVariantType
- Since 2.24</doc>
- <type name="VariantType" c:type="GVariantType*"/>
- </return-value>
- <parameters>
- <parameter name="items" transfer-ownership="none">
- <doc xml:space="preserve">an array of #GVariantTypes, one for each item</doc>
- <array length="1" zero-terminated="0" c:type="GVariantType**">
- <type name="VariantType" c:type="GVariantType*"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of @items, or -1</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </constructor>
- <method name="copy" c:identifier="g_variant_type_copy">
- <doc xml:space="preserve">Makes a copy of a #GVariantType. It is appropriate to call
- g_variant_type_free() on the return value. @type may not be %NULL.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GVariantType
- Since 2.24</doc>
- <type name="VariantType" c:type="GVariantType*"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="dup_string" c:identifier="g_variant_type_dup_string">
- <doc xml:space="preserve">Returns a newly-allocated copy of the type string corresponding to
- @type. The returned string is nul-terminated. It is appropriate to
- call g_free() on the return value.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the corresponding type string
- Since 2.24</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="element" c:identifier="g_variant_type_element">
- <doc xml:space="preserve">Determines the element type of an array or maybe type.
- This function may only be used with array or maybe types.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the element type of @type
- Since 2.24</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">an array or maybe #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="equal" c:identifier="g_variant_type_equal">
- <doc xml:space="preserve">Compares @type1 and @type2 for equality.
- Only returns %TRUE if the types are exactly equal. Even if one type
- is an indefinite type and the other is a subtype of it, %FALSE will
- be returned if they are not exactly equal. If you want to check for
- subtypes, use g_variant_type_is_subtype_of().
- The argument types of @type1 and @type2 are only #gconstpointer to
- allow use with #GHashTable without function pointer casting. For
- both arguments, a valid #GVariantType must be provided.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @type1 and @type2 are exactly equal
- Since 2.24</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="type1" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="gconstpointer"/>
- </instance-parameter>
- <parameter name="type2" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </method>
- <method name="first" c:identifier="g_variant_type_first">
- <doc xml:space="preserve">Determines the first item type of a tuple or dictionary entry
- type.
- This function may only be used with tuple or dictionary entry types,
- but must not be used with the generic tuple type
- %G_VARIANT_TYPE_TUPLE.
- In the case of a dictionary entry type, this returns the type of
- the key.
- %NULL is returned in case of @type being %G_VARIANT_TYPE_UNIT.
- This call, together with g_variant_type_next() provides an iterator
- interface over tuple and dictionary entry types.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the first item type of @type, or %NULL
- Since 2.24</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a tuple or dictionary entry #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="free" c:identifier="g_variant_type_free">
- <doc xml:space="preserve">Frees a #GVariantType that was allocated with
- g_variant_type_copy(), g_variant_type_new() or one of the container
- type constructor functions.
- In the case that @type is %NULL, this function does nothing.
- Since 2.24</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <instance-parameter name="type"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GVariantType, or %NULL</doc>
- <type name="VariantType" c:type="GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="get_string_length"
- c:identifier="g_variant_type_get_string_length">
- <doc xml:space="preserve">Returns the length of the type string corresponding to the given
- @type. This function must be used to determine the valid extent of
- the memory region returned by g_variant_type_peek_string().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the length of the corresponding type string
- Since 2.24</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="hash" c:identifier="g_variant_type_hash">
- <doc xml:space="preserve">Hashes @type.
- The argument type of @type is only #gconstpointer to allow use with
- #GHashTable without function pointer casting. A valid
- #GVariantType must be provided.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the hash value
- Since 2.24</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="gconstpointer"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_array" c:identifier="g_variant_type_is_array">
- <doc xml:space="preserve">Determines if the given @type is an array type. This is true if the
- type string for @type starts with an 'a'.
- This function returns %TRUE for any indefinite type for which every
- definite subtype is an array type -- %G_VARIANT_TYPE_ARRAY, for
- example.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @type is an array type
- Since 2.24</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_basic" c:identifier="g_variant_type_is_basic">
- <doc xml:space="preserve">Determines if the given @type is a basic type.
- Basic types are booleans, bytes, integers, doubles, strings, object
- paths and signatures.
- Only a basic type may be used as the key of a dictionary entry.
- This function returns %FALSE for all indefinite types except
- %G_VARIANT_TYPE_BASIC.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @type is a basic type
- Since 2.24</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_container" c:identifier="g_variant_type_is_container">
- <doc xml:space="preserve">Determines if the given @type is a container type.
- Container types are any array, maybe, tuple, or dictionary
- entry types plus the variant type.
- This function returns %TRUE for any indefinite type for which every
- definite subtype is a container -- %G_VARIANT_TYPE_ARRAY, for
- example.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @type is a container type
- Since 2.24</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_definite" c:identifier="g_variant_type_is_definite">
- <doc xml:space="preserve">Determines if the given @type is definite (ie: not indefinite).
- A type is definite if its type string does not contain any indefinite
- type characters ('*', '?', or 'r').
- A #GVariant instance may not have an indefinite type, so calling
- this function on the result of g_variant_get_type() will always
- result in %TRUE being returned. Calling this function on an
- indefinite type like %G_VARIANT_TYPE_ARRAY, however, will result in
- %FALSE being returned.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @type is definite
- Since 2.24</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_dict_entry" c:identifier="g_variant_type_is_dict_entry">
- <doc xml:space="preserve">Determines if the given @type is a dictionary entry type. This is
- true if the type string for @type starts with a '{'.
- This function returns %TRUE for any indefinite type for which every
- definite subtype is a dictionary entry type --
- %G_VARIANT_TYPE_DICT_ENTRY, for example.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @type is a dictionary entry type
- Since 2.24</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_maybe" c:identifier="g_variant_type_is_maybe">
- <doc xml:space="preserve">Determines if the given @type is a maybe type. This is true if the
- type string for @type starts with an 'm'.
- This function returns %TRUE for any indefinite type for which every
- definite subtype is a maybe type -- %G_VARIANT_TYPE_MAYBE, for
- example.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @type is a maybe type
- Since 2.24</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_subtype_of" c:identifier="g_variant_type_is_subtype_of">
- <doc xml:space="preserve">Checks if @type is a subtype of @supertype.
- This function returns %TRUE if @type is a subtype of @supertype. All
- types are considered to be subtypes of themselves. Aside from that,
- only indefinite types can have subtypes.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @type is a subtype of @supertype
- Since 2.24</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- <parameter name="supertype" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- </parameters>
- </method>
- <method name="is_tuple" c:identifier="g_variant_type_is_tuple">
- <doc xml:space="preserve">Determines if the given @type is a tuple type. This is true if the
- type string for @type starts with a '(' or if @type is
- %G_VARIANT_TYPE_TUPLE.
- This function returns %TRUE for any indefinite type for which every
- definite subtype is a tuple type -- %G_VARIANT_TYPE_TUPLE, for
- example.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @type is a tuple type
- Since 2.24</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="is_variant" c:identifier="g_variant_type_is_variant">
- <doc xml:space="preserve">Determines if the given @type is the variant type.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @type is the variant type
- Since 2.24</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="key" c:identifier="g_variant_type_key">
- <doc xml:space="preserve">Determines the key type of a dictionary entry type.
- This function may only be used with a dictionary entry type. Other
- than the additional restriction, this call is equivalent to
- g_variant_type_first().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the key type of the dictionary entry
- Since 2.24</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a dictionary entry #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="n_items" c:identifier="g_variant_type_n_items">
- <doc xml:space="preserve">Determines the number of items contained in a tuple or
- dictionary entry type.
- This function may only be used with tuple or dictionary entry types,
- but must not be used with the generic tuple type
- %G_VARIANT_TYPE_TUPLE.
- In the case of a dictionary entry type, this function will always
- return 2.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of items in @type
- Since 2.24</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a tuple or dictionary entry #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="next" c:identifier="g_variant_type_next">
- <doc xml:space="preserve">Determines the next item type of a tuple or dictionary entry
- type.
- @type must be the result of a previous call to
- g_variant_type_first() or g_variant_type_next().
- If called on the key type of a dictionary entry then this call
- returns the value type. If called on the value type of a dictionary
- entry then this call returns %NULL.
- For tuples, %NULL is returned when @type is the last item in a tuple.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the next #GVariantType after @type, or %NULL
- Since 2.24</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType from a previous call</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="peek_string"
- c:identifier="g_variant_type_peek_string"
- introspectable="0">
- <doc xml:space="preserve">Returns the type string corresponding to the given @type. The
- result is not nul-terminated; in order to determine its length you
- must call g_variant_type_get_string_length().
- To get a nul-terminated string, see g_variant_type_dup_string().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the corresponding type string (not nul-terminated)
- Since 2.24</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <method name="value" c:identifier="g_variant_type_value">
- <doc xml:space="preserve">Determines the value type of a dictionary entry type.
- This function may only be used with a dictionary entry type.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value type of the dictionary entry
- Since 2.24</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </return-value>
- <parameters>
- <instance-parameter name="type" transfer-ownership="none">
- <doc xml:space="preserve">a dictionary entry #GVariantType</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </instance-parameter>
- </parameters>
- </method>
- <function name="checked_" c:identifier="g_variant_type_checked_">
- <return-value transfer-ownership="none">
- <type name="VariantType" c:type="const GVariantType*"/>
- </return-value>
- <parameters>
- <parameter name="arg0" transfer-ownership="none">
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="string_is_valid"
- c:identifier="g_variant_type_string_is_valid">
- <doc xml:space="preserve">Checks if @type_string is a valid GVariant type string. This call is
- equivalent to calling g_variant_type_string_scan() and confirming
- that the following character is a nul terminator.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @type_string is exactly one valid type string
- Since 2.24</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="type_string" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to any string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="string_scan"
- c:identifier="g_variant_type_string_scan"
- version="2.24">
- <doc xml:space="preserve">Scan for a single complete and valid GVariant type string in @string.
- The memory pointed to by @limit (or bytes beyond it) is never
- accessed.
- If a valid type string is found, @endptr is updated to point to the
- first character past the end of the string that was found and %TRUE
- is returned.
- If there is no valid type string starting at @string, or if the type
- string does not end before @limit then %FALSE is returned.
- For the simple case of checking if a string is a valid type string,
- see g_variant_type_string_is_valid().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a valid type string was found</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to any string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="limit"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the end of @string, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="endptr"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store the end pointer, or %NULL</doc>
- <type name="utf8" c:type="const gchar**"/>
- </parameter>
- </parameters>
- </function>
- </record>
- <callback name="VoidFunc" c:type="GVoidFunc">
- <doc xml:space="preserve">Declares a type of function which takes no arguments
- and has no return value. It is used to specify the type
- function passed to g_atexit().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- </callback>
- <constant name="WIN32_MSG_HANDLE"
- value="19981206"
- c:type="G_WIN32_MSG_HANDLE">
- <type name="gint" c:type="gint"/>
- </constant>
- <function name="access" c:identifier="g_access" version="2.8">
- <doc xml:space="preserve">A wrapper for the POSIX access() function. This function is used to
- test a pathname for one or several of read, write or execute
- permissions, or just existence.
- On Windows, the file protection mechanism is not at all POSIX-like,
- and the underlying function in the C library only checks the
- FAT-style READONLY attribute, and does not look at the ACL of a
- file at all. This function is this in practise almost useless on
- Windows. Software that needs to handle file permissions on Windows
- more exactly should use the Win32 API.
- See your C library manual for more details about access().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">zero if the pathname refers to an existing file system
- object that has all the tested permissions, or -1 otherwise
- or on error.</doc>
- <type name="gint" c:type="int"/>
- </return-value>
- <parameters>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">a pathname in the GLib file name encoding (UTF-8 on Windows)</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="mode" transfer-ownership="none">
- <doc xml:space="preserve">as in access()</doc>
- <type name="gint" c:type="int"/>
- </parameter>
- </parameters>
- </function>
- <function name="ascii_digit_value" c:identifier="g_ascii_digit_value">
- <doc xml:space="preserve">Determines the numeric value of a character as a decimal digit.
- Differs from g_unichar_digit_value() because it takes a char, so
- there's no worry about sign extension if characters are signed.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">If @c is a decimal digit (according to g_ascii_isdigit()),
- its numeric value. Otherwise, -1.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">an ASCII character</doc>
- <type name="gchar" c:type="gchar"/>
- </parameter>
- </parameters>
- </function>
- <function name="ascii_dtostr" c:identifier="g_ascii_dtostr">
- <doc xml:space="preserve">Converts a #gdouble to a string, using the '.' as
- decimal point.
- This function generates enough precision that converting
- the string back using g_ascii_strtod() gives the same machine-number
- (on machines with IEEE compatible 64bit doubles). It is
- guaranteed that the size of the resulting string will never
- be larger than @G_ASCII_DTOSTR_BUF_SIZE bytes, including the terminating
- nul character, which is always added.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">The pointer to the buffer with the converted string.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="buffer" transfer-ownership="none">
- <doc xml:space="preserve">A buffer to place the resulting string in</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="buf_len" transfer-ownership="none">
- <doc xml:space="preserve">The length of the buffer.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="d" transfer-ownership="none">
- <doc xml:space="preserve">The #gdouble to convert</doc>
- <type name="gdouble" c:type="gdouble"/>
- </parameter>
- </parameters>
- </function>
- <function name="ascii_formatd" c:identifier="g_ascii_formatd">
- <doc xml:space="preserve">Converts a #gdouble to a string, using the '.' as
- decimal point. To format the number you pass in
- a printf()-style format string. Allowed conversion
- specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'.
- The returned buffer is guaranteed to be nul-terminated.
- If you just want to want to serialize the value into a
- string, use g_ascii_dtostr().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">The pointer to the buffer with the converted string.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="buffer" transfer-ownership="none">
- <doc xml:space="preserve">A buffer to place the resulting string in</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="buf_len" transfer-ownership="none">
- <doc xml:space="preserve">The length of the buffer.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">The printf()-style format to use for the
- code to use for converting.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="d" transfer-ownership="none">
- <doc xml:space="preserve">The #gdouble to convert</doc>
- <type name="gdouble" c:type="gdouble"/>
- </parameter>
- </parameters>
- </function>
- <function name="ascii_strcasecmp" c:identifier="g_ascii_strcasecmp">
- <doc xml:space="preserve">Compare two strings, ignoring the case of ASCII characters.
- Unlike the BSD strcasecmp() function, this only recognizes standard
- ASCII letters and ignores the locale, treating all non-ASCII
- bytes as if they are not letters.
- This function should be used only on strings that are known to be
- in encodings where the bytes corresponding to ASCII letters always
- represent themselves. This includes UTF-8 and the ISO-8859-*
- charsets, but not for instance double-byte encodings like the
- Windows Codepage 932, where the trailing bytes of double-byte
- characters include all ASCII letters. If you compare two CP932
- strings using this function, you will get false matches.
- Both @s1 and @s2 must be non-%NULL.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">0 if the strings match, a negative value if @s1 < @s2,
- or a positive value if @s1 > @s2.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="s1" transfer-ownership="none">
- <doc xml:space="preserve">string to compare with @s2</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="s2" transfer-ownership="none">
- <doc xml:space="preserve">string to compare with @s1</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="ascii_strdown" c:identifier="g_ascii_strdown">
- <doc xml:space="preserve">Converts all upper case ASCII letters to lower case ASCII letters.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string, with all the upper case
- characters in @str converted to lower case, with semantics that
- exactly match g_ascii_tolower(). (Note that this is unlike the
- old g_strdown(), which modified the string in place.)</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">length of @str in bytes, or -1 if @str is nul-terminated</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="ascii_strncasecmp" c:identifier="g_ascii_strncasecmp">
- <doc xml:space="preserve">Compare @s1 and @s2, ignoring the case of ASCII characters and any
- characters after the first @n in each string.
- Unlike the BSD strcasecmp() function, this only recognizes standard
- ASCII letters and ignores the locale, treating all non-ASCII
- characters as if they are not letters.
- The same warning as in g_ascii_strcasecmp() applies: Use this
- function only on strings known to be in encodings where bytes
- corresponding to ASCII letters always represent themselves.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">0 if the strings match, a negative value if @s1 < @s2,
- or a positive value if @s1 > @s2.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="s1" transfer-ownership="none">
- <doc xml:space="preserve">string to compare with @s2</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="s2" transfer-ownership="none">
- <doc xml:space="preserve">string to compare with @s1</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">number of characters to compare</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="ascii_strtod" c:identifier="g_ascii_strtod">
- <doc xml:space="preserve">Converts a string to a #gdouble value.
- This function behaves like the standard strtod() function
- does in the C locale. It does this without actually changing
- the current locale, since that would not be thread-safe.
- A limitation of the implementation is that this function
- will still accept localized versions of infinities and NANs.
- This function is typically used when reading configuration
- files or other non-user input that should be locale independent.
- To handle input from the user you should normally use the
- locale-sensitive system strtod() function.
- To convert from a #gdouble to a string in a locale-insensitive
- way, use g_ascii_dtostr().
- If the correct value would cause overflow, plus or minus %HUGE_VAL
- is returned (according to the sign of the value), and %ERANGE is
- stored in %errno. If the correct value would cause underflow,
- zero is returned and %ERANGE is stored in %errno.
- This function resets %errno before calling strtod() so that
- you can reliably detect overflow and underflow.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the #gdouble value.</doc>
- <type name="gdouble" c:type="gdouble"/>
- </return-value>
- <parameters>
- <parameter name="nptr" transfer-ownership="none">
- <doc xml:space="preserve">the string to convert to a numeric value.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="endptr"
- direction="out"
- caller-allocates="0"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">if non-%NULL, it returns the
- character after the last character used in the conversion.</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- </parameters>
- </function>
- <function name="ascii_strtoll"
- c:identifier="g_ascii_strtoll"
- version="2.12">
- <doc xml:space="preserve">Converts a string to a #gint64 value.
- This function behaves like the standard strtoll() function
- does in the C locale. It does this without actually
- changing the current locale, since that would not be
- thread-safe.
- This function is typically used when reading configuration
- files or other non-user input that should be locale independent.
- To handle input from the user you should normally use the
- locale-sensitive system strtoll() function.
- If the correct value would cause overflow, %G_MAXINT64 or %G_MININT64
- is returned, and `ERANGE` is stored in `errno`.
- If the base is outside the valid range, zero is returned, and
- `EINVAL` is stored in `errno`. If the
- string conversion fails, zero is returned, and @endptr returns @nptr
- (if @endptr is non-%NULL).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the #gint64 value or zero on error.</doc>
- <type name="gint64" c:type="gint64"/>
- </return-value>
- <parameters>
- <parameter name="nptr" transfer-ownership="none">
- <doc xml:space="preserve">the string to convert to a numeric value.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="endptr"
- direction="out"
- caller-allocates="0"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">if non-%NULL, it returns the
- character after the last character used in the conversion.</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- <parameter name="base" transfer-ownership="none">
- <doc xml:space="preserve">to be used for the conversion, 2..36 or 0</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="ascii_strtoull"
- c:identifier="g_ascii_strtoull"
- version="2.2">
- <doc xml:space="preserve">Converts a string to a #guint64 value.
- This function behaves like the standard strtoull() function
- does in the C locale. It does this without actually
- changing the current locale, since that would not be
- thread-safe.
- This function is typically used when reading configuration
- files or other non-user input that should be locale independent.
- To handle input from the user you should normally use the
- locale-sensitive system strtoull() function.
- If the correct value would cause overflow, %G_MAXUINT64
- is returned, and `ERANGE` is stored in `errno`.
- If the base is outside the valid range, zero is returned, and
- `EINVAL` is stored in `errno`.
- If the string conversion fails, zero is returned, and @endptr returns
- @nptr (if @endptr is non-%NULL).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the #guint64 value or zero on error.</doc>
- <type name="guint64" c:type="guint64"/>
- </return-value>
- <parameters>
- <parameter name="nptr" transfer-ownership="none">
- <doc xml:space="preserve">the string to convert to a numeric value.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="endptr"
- direction="out"
- caller-allocates="0"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">if non-%NULL, it returns the
- character after the last character used in the conversion.</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- <parameter name="base" transfer-ownership="none">
- <doc xml:space="preserve">to be used for the conversion, 2..36 or 0</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="ascii_strup" c:identifier="g_ascii_strup">
- <doc xml:space="preserve">Converts all lower case ASCII letters to upper case ASCII letters.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string, with all the lower case
- characters in @str converted to upper case, with semantics that
- exactly match g_ascii_toupper(). (Note that this is unlike the
- old g_strup(), which modified the string in place.)</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">length of @str in bytes, or -1 if @str is nul-terminated</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="ascii_tolower" c:identifier="g_ascii_tolower">
- <doc xml:space="preserve">Convert a character to ASCII lower case.
- Unlike the standard C library tolower() function, this only
- recognizes standard ASCII letters and ignores the locale, returning
- all non-ASCII characters unchanged, even if they are lower case
- letters in a particular character set. Also unlike the standard
- library function, this takes and returns a char, not an int, so
- don't call it on %EOF but no need to worry about casting to #guchar
- before passing a possibly non-ASCII character in.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the result of converting @c to lower case. If @c is
- not an ASCII upper case letter, @c is returned unchanged.</doc>
- <type name="gchar" c:type="gchar"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">any character</doc>
- <type name="gchar" c:type="gchar"/>
- </parameter>
- </parameters>
- </function>
- <function name="ascii_toupper" c:identifier="g_ascii_toupper">
- <doc xml:space="preserve">Convert a character to ASCII upper case.
- Unlike the standard C library toupper() function, this only
- recognizes standard ASCII letters and ignores the locale, returning
- all non-ASCII characters unchanged, even if they are upper case
- letters in a particular character set. Also unlike the standard
- library function, this takes and returns a char, not an int, so
- don't call it on %EOF but no need to worry about casting to #guchar
- before passing a possibly non-ASCII character in.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the result of converting @c to upper case. If @c is not
- an ASCII lower case letter, @c is returned unchanged.</doc>
- <type name="gchar" c:type="gchar"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">any character</doc>
- <type name="gchar" c:type="gchar"/>
- </parameter>
- </parameters>
- </function>
- <function name="ascii_xdigit_value" c:identifier="g_ascii_xdigit_value">
- <doc xml:space="preserve">Determines the numeric value of a character as a hexidecimal
- digit. Differs from g_unichar_xdigit_value() because it takes
- a char, so there's no worry about sign extension if characters
- are signed.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">If @c is a hex digit (according to g_ascii_isxdigit()),
- its numeric value. Otherwise, -1.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">an ASCII character.</doc>
- <type name="gchar" c:type="gchar"/>
- </parameter>
- </parameters>
- </function>
- <function name="assert_warning" c:identifier="g_assert_warning">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="log_domain" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="file" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="line" transfer-ownership="none">
- <type name="gint" c:type="const int"/>
- </parameter>
- <parameter name="pretty_function" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="expression" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="assertion_message" c:identifier="g_assertion_message">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="domain" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="file" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="line" transfer-ownership="none">
- <type name="gint" c:type="int"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="message" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="assertion_message_cmpnum"
- c:identifier="g_assertion_message_cmpnum"
- introspectable="0">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="domain" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="file" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="line" transfer-ownership="none">
- <type name="gint" c:type="int"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="expr" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="arg1" transfer-ownership="none">
- <type name="long double" c:type="long double"/>
- </parameter>
- <parameter name="cmp" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="arg2" transfer-ownership="none">
- <type name="long double" c:type="long double"/>
- </parameter>
- <parameter name="numtype" transfer-ownership="none">
- <type name="gchar" c:type="char"/>
- </parameter>
- </parameters>
- </function>
- <function name="assertion_message_cmpstr"
- c:identifier="g_assertion_message_cmpstr">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="domain" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="file" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="line" transfer-ownership="none">
- <type name="gint" c:type="int"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="expr" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="arg1" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="cmp" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="arg2" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="assertion_message_error"
- c:identifier="g_assertion_message_error">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="domain" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="file" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="line" transfer-ownership="none">
- <type name="gint" c:type="int"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="expr" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="error" transfer-ownership="none">
- <type name="Error" c:type="const GError*"/>
- </parameter>
- <parameter name="error_domain" transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- <parameter name="error_code" transfer-ownership="none">
- <type name="gint" c:type="int"/>
- </parameter>
- </parameters>
- </function>
- <function name="assertion_message_expr"
- c:identifier="g_assertion_message_expr"
- introspectable="0">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="file" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="line" transfer-ownership="none">
- <type name="gint" c:type="int"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="expr"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="atexit"
- c:identifier="g_atexit"
- deprecated="1"
- deprecated-version="2.32">
- <doc xml:space="preserve">Specifies a function to be called at normal program termination.
- Since GLib 2.8.2, on Windows g_atexit() actually is a preprocessor
- macro that maps to a call to the atexit() function in the C
- library. This means that in case the code that calls g_atexit(),
- i.e. atexit(), is in a DLL, the function will be called when the
- DLL is detached from the program. This typically makes more sense
- than that the function is called when the GLib DLL is detached,
- which happened earlier when g_atexit() was a function in the GLib
- DLL.
- The behaviour of atexit() in the context of dynamically loaded
- modules is not formally specified and varies wildly.
- On POSIX systems, calling g_atexit() (or atexit()) in a dynamically
- loaded module which is unloaded before the program terminates might
- well cause a crash at program exit.
- Some POSIX systems implement atexit() like Windows, and have each
- dynamically loaded module maintain an own atexit chain that is
- called when the module is unloaded.
- On other POSIX systems, before a dynamically loaded module is
- unloaded, the registered atexit functions (if any) residing in that
- module are called, regardless where the code that registered them
- resided. This is presumably the most robust approach.
- As can be seen from the above, for portability it's best to avoid
- calling g_atexit() (or atexit()) except in the main executable of a
- program.</doc>
- <doc-deprecated xml:space="preserve">It is best to avoid g_atexit().</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="func" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">the function to call on normal program termination.</doc>
- <type name="VoidFunc" c:type="GVoidFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_int_add"
- c:identifier="g_atomic_int_add"
- version="2.4">
- <doc xml:space="preserve">Atomically adds @val to the value of @atomic.
- Think of this operation as an atomic version of
- `{ tmp = *atomic; *atomic += val; return tmp; }`.
- This call acts as a full compiler and hardware memory barrier.
- Before version 2.30, this function did not return a value
- (but g_atomic_int_exchange_and_add() did, and had the same meaning).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value of @atomic before the add, signed</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
- <type name="gint" c:type="volatile gint*"/>
- </parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">the value to add</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_int_and"
- c:identifier="g_atomic_int_and"
- version="2.30">
- <doc xml:space="preserve">Performs an atomic bitwise 'and' of the value of @atomic and @val,
- storing the result back in @atomic.
- This call acts as a full compiler and hardware memory barrier.
- Think of this operation as an atomic version of
- `{ tmp = *atomic; *atomic &= val; return tmp; }`.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value of @atomic before the operation, unsigned</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
- <type name="guint" c:type="volatile guint*"/>
- </parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">the value to 'and'</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_int_compare_and_exchange"
- c:identifier="g_atomic_int_compare_and_exchange"
- version="2.4">
- <doc xml:space="preserve">Compares @atomic to @oldval and, if equal, sets it to @newval.
- If @atomic was not equal to @oldval then no change occurs.
- This compare and exchange is done atomically.
- Think of this operation as an atomic version of
- `{ if (*atomic == oldval) { *atomic = newval; return TRUE; } else return FALSE; }`.
- This call acts as a full compiler and hardware memory barrier.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the exchange took place</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
- <type name="gint" c:type="volatile gint*"/>
- </parameter>
- <parameter name="oldval" transfer-ownership="none">
- <doc xml:space="preserve">the value to compare with</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="newval" transfer-ownership="none">
- <doc xml:space="preserve">the value to conditionally replace with</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_int_dec_and_test"
- c:identifier="g_atomic_int_dec_and_test"
- version="2.4">
- <doc xml:space="preserve">Decrements the value of @atomic by 1.
- Think of this operation as an atomic version of
- `{ *atomic -= 1; return (*atomic == 0); }`.
- This call acts as a full compiler and hardware memory barrier.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the resultant value is zero</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
- <type name="gint" c:type="volatile gint*"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_int_exchange_and_add"
- c:identifier="g_atomic_int_exchange_and_add"
- version="2.4"
- deprecated="1"
- deprecated-version="2.30">
- <doc xml:space="preserve">This function existed before g_atomic_int_add() returned the prior
- value of the integer (which it now does). It is retained only for
- compatibility reasons. Don't use this function in new code.</doc>
- <doc-deprecated xml:space="preserve">Use g_atomic_int_add() instead.</doc-deprecated>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value of @atomic before the add, signed</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint</doc>
- <type name="gint" c:type="volatile gint*"/>
- </parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">the value to add</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_int_get"
- c:identifier="g_atomic_int_get"
- version="2.4">
- <doc xml:space="preserve">Gets the current value of @atomic.
- This call acts as a full compiler and hardware
- memory barrier (before the get).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value of the integer</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
- <type name="gint" c:type="volatile const gint*"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_int_inc"
- c:identifier="g_atomic_int_inc"
- version="2.4">
- <doc xml:space="preserve">Increments the value of @atomic by 1.
- Think of this operation as an atomic version of `{ *atomic += 1; }`.
- This call acts as a full compiler and hardware memory barrier.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
- <type name="gint" c:type="volatile gint*"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_int_or"
- c:identifier="g_atomic_int_or"
- version="2.30">
- <doc xml:space="preserve">Performs an atomic bitwise 'or' of the value of @atomic and @val,
- storing the result back in @atomic.
- Think of this operation as an atomic version of
- `{ tmp = *atomic; *atomic |= val; return tmp; }`.
- This call acts as a full compiler and hardware memory barrier.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value of @atomic before the operation, unsigned</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
- <type name="guint" c:type="volatile guint*"/>
- </parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">the value to 'or'</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_int_set"
- c:identifier="g_atomic_int_set"
- version="2.4">
- <doc xml:space="preserve">Sets the value of @atomic to @newval.
- This call acts as a full compiler and hardware
- memory barrier (after the set).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
- <type name="gint" c:type="volatile gint*"/>
- </parameter>
- <parameter name="newval" transfer-ownership="none">
- <doc xml:space="preserve">a new value to store</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_int_xor"
- c:identifier="g_atomic_int_xor"
- version="2.30">
- <doc xml:space="preserve">Performs an atomic bitwise 'xor' of the value of @atomic and @val,
- storing the result back in @atomic.
- Think of this operation as an atomic version of
- `{ tmp = *atomic; *atomic ^= val; return tmp; }`.
- This call acts as a full compiler and hardware memory barrier.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value of @atomic before the operation, unsigned</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint or #guint</doc>
- <type name="guint" c:type="volatile guint*"/>
- </parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">the value to 'xor'</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_pointer_add"
- c:identifier="g_atomic_pointer_add"
- version="2.30">
- <doc xml:space="preserve">Atomically adds @val to the value of @atomic.
- Think of this operation as an atomic version of
- `{ tmp = *atomic; *atomic += val; return tmp; }`.
- This call acts as a full compiler and hardware memory barrier.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value of @atomic before the add, signed</doc>
- <type name="gssize" c:type="gssize"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
- <type name="gpointer" c:type="void*"/>
- </parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">the value to add</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_pointer_and"
- c:identifier="g_atomic_pointer_and"
- version="2.30">
- <doc xml:space="preserve">Performs an atomic bitwise 'and' of the value of @atomic and @val,
- storing the result back in @atomic.
- Think of this operation as an atomic version of
- `{ tmp = *atomic; *atomic &= val; return tmp; }`.
- This call acts as a full compiler and hardware memory barrier.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value of @atomic before the operation, unsigned</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
- <type name="gpointer" c:type="void*"/>
- </parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">the value to 'and'</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_pointer_compare_and_exchange"
- c:identifier="g_atomic_pointer_compare_and_exchange"
- version="2.4">
- <doc xml:space="preserve">Compares @atomic to @oldval and, if equal, sets it to @newval.
- If @atomic was not equal to @oldval then no change occurs.
- This compare and exchange is done atomically.
- Think of this operation as an atomic version of
- `{ if (*atomic == oldval) { *atomic = newval; return TRUE; } else return FALSE; }`.
- This call acts as a full compiler and hardware memory barrier.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the exchange took place</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
- <type name="gpointer" c:type="void*"/>
- </parameter>
- <parameter name="oldval"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the value to compare with</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="newval"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the value to conditionally replace with</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_pointer_get"
- c:identifier="g_atomic_pointer_get"
- version="2.4">
- <doc xml:space="preserve">Gets the current value of @atomic.
- This call acts as a full compiler and hardware
- memory barrier (before the get).</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the value of the pointer</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
- <type name="gpointer" c:type="void*"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_pointer_or"
- c:identifier="g_atomic_pointer_or"
- version="2.30">
- <doc xml:space="preserve">Performs an atomic bitwise 'or' of the value of @atomic and @val,
- storing the result back in @atomic.
- Think of this operation as an atomic version of
- `{ tmp = *atomic; *atomic |= val; return tmp; }`.
- This call acts as a full compiler and hardware memory barrier.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value of @atomic before the operation, unsigned</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
- <type name="gpointer" c:type="void*"/>
- </parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">the value to 'or'</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_pointer_set"
- c:identifier="g_atomic_pointer_set"
- version="2.4">
- <doc xml:space="preserve">Sets the value of @atomic to @newval.
- This call acts as a full compiler and hardware
- memory barrier (after the set).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
- <type name="gpointer" c:type="void*"/>
- </parameter>
- <parameter name="newval"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a new value to store</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="atomic_pointer_xor"
- c:identifier="g_atomic_pointer_xor"
- version="2.30">
- <doc xml:space="preserve">Performs an atomic bitwise 'xor' of the value of @atomic and @val,
- storing the result back in @atomic.
- Think of this operation as an atomic version of
- `{ tmp = *atomic; *atomic ^= val; return tmp; }`.
- This call acts as a full compiler and hardware memory barrier.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value of @atomic before the operation, unsigned</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <parameter name="atomic" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
- <type name="gpointer" c:type="void*"/>
- </parameter>
- <parameter name="val" transfer-ownership="none">
- <doc xml:space="preserve">the value to 'xor'</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="base64_decode"
- c:identifier="g_base64_decode"
- version="2.12">
- <doc xml:space="preserve">Decode a sequence of Base-64 encoded text into binary data. Note
- that the returned binary data is not necessarily zero-terminated,
- so it should not be used as a character string.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">
- newly allocated buffer containing the binary data
- that @text represents. The returned buffer must
- be freed with g_free().</doc>
- <array length="1" zero-terminated="0" c:type="guchar*">
- <type name="guint8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="text" transfer-ownership="none">
- <doc xml:space="preserve">zero-terminated string with base64 text to decode</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="out_len"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">The length of the decoded data is written here</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </function>
- <function name="base64_decode_inplace"
- c:identifier="g_base64_decode_inplace"
- version="2.20">
- <doc xml:space="preserve">Decode a sequence of Base-64 encoded text into binary data
- by overwriting the input data.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">The binary data that @text responds. This pointer
- is the same as the input @text.</doc>
- <type name="guint8" c:type="guchar*"/>
- </return-value>
- <parameters>
- <parameter name="text"
- direction="inout"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">zero-terminated
- string with base64 text to decode</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="out_len"
- direction="inout"
- caller-allocates="0"
- transfer-ownership="none">
- <doc xml:space="preserve">The length of the decoded data is written here</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </function>
- <function name="base64_decode_step"
- c:identifier="g_base64_decode_step"
- version="2.12">
- <doc xml:space="preserve">Incrementally decode a sequence of binary data from its Base-64 stringified
- representation. By calling this function multiple times you can convert
- data in chunks to avoid having to have the full encoded data in memory.
- The output buffer must be large enough to fit all the data that will
- be written to it. Since base64 encodes 3 bytes in 4 chars you need
- at least: (@len / 4) * 3 + 3 bytes (+ 3 may be needed in case of non-zero
- state).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">The number of bytes of output that was written</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <parameter name="in" transfer-ownership="none">
- <doc xml:space="preserve">binary input data</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">max length of @in data to decode</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="out"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">output buffer</doc>
- <array zero-terminated="0" c:type="guchar*">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="state"
- direction="inout"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">Saved state between steps, initialize to 0</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- <parameter name="save"
- direction="inout"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">Saved state between steps, initialize to 0</doc>
- <type name="guint" c:type="guint*"/>
- </parameter>
- </parameters>
- </function>
- <function name="base64_encode"
- c:identifier="g_base64_encode"
- version="2.12">
- <doc xml:space="preserve">Encode a sequence of binary data into its Base-64 stringified
- representation.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated, zero-terminated Base-64
- encoded string representing @data. The returned string must
- be freed with g_free().</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">the binary data to encode</doc>
- <array length="1" zero-terminated="0" c:type="guchar*">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the length of @data</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="base64_encode_close"
- c:identifier="g_base64_encode_close"
- version="2.12">
- <doc xml:space="preserve">Flush the status from a sequence of calls to g_base64_encode_step().
- The output buffer must be large enough to fit all the data that will
- be written to it. It will need up to 4 bytes, or up to 5 bytes if
- line-breaking is enabled.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">The number of bytes of output that was written</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <parameter name="break_lines" transfer-ownership="none">
- <doc xml:space="preserve">whether to break long lines</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="out"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">pointer to destination buffer</doc>
- <array zero-terminated="0" c:type="gchar*">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="state"
- direction="inout"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">Saved state from g_base64_encode_step()</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- <parameter name="save"
- direction="inout"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">Saved state from g_base64_encode_step()</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- </parameters>
- </function>
- <function name="base64_encode_step"
- c:identifier="g_base64_encode_step"
- version="2.12">
- <doc xml:space="preserve">Incrementally encode a sequence of binary data into its Base-64 stringified
- representation. By calling this function multiple times you can convert
- data in chunks to avoid having to have the full encoded data in memory.
- When all of the data has been converted you must call
- g_base64_encode_close() to flush the saved state.
- The output buffer must be large enough to fit all the data that will
- be written to it. Due to the way base64 encodes you will need
- at least: (@len / 3 + 1) * 4 + 4 bytes (+ 4 may be needed in case of
- non-zero state). If you enable line-breaking you will need at least:
- ((@len / 3 + 1) * 4 + 4) / 72 + 1 bytes of extra space.
- @break_lines is typically used when putting base64-encoded data in emails.
- It breaks the lines at 72 columns instead of putting all of the text on
- the same line. This avoids problems with long lines in the email system.
- Note however that it breaks the lines with `LF` characters, not
- `CR LF` sequences, so the result cannot be passed directly to SMTP
- or certain other protocols.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">The number of bytes of output that was written</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <parameter name="in" transfer-ownership="none">
- <doc xml:space="preserve">the binary data to encode</doc>
- <array length="1" zero-terminated="0" c:type="guchar*">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the length of @in</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="break_lines" transfer-ownership="none">
- <doc xml:space="preserve">whether to break long lines</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="out"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">pointer to destination buffer</doc>
- <array zero-terminated="0" c:type="gchar*">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="state"
- direction="inout"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">Saved state between steps, initialize to 0</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- <parameter name="save"
- direction="inout"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">Saved state between steps, initialize to 0</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- </parameters>
- </function>
- <function name="basename"
- c:identifier="g_basename"
- deprecated="1"
- deprecated-version="2.2">
- <doc xml:space="preserve">Gets the name of the file without any leading directory
- components. It returns a pointer into the given file name
- string.</doc>
- <doc-deprecated xml:space="preserve">Use g_path_get_basename() instead, but notice
- that g_path_get_basename() allocates new memory for the
- returned string, unlike this function which returns a pointer
- into the argument.</doc-deprecated>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the name of the file without any leading
- directory components</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="file_name" transfer-ownership="none">
- <doc xml:space="preserve">the name of the file</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="bit_lock" c:identifier="g_bit_lock" version="2.24">
- <doc xml:space="preserve">Sets the indicated @lock_bit in @address. If the bit is already
- set, this call will block until g_bit_unlock() unsets the
- corresponding bit.
- Attempting to lock on two different bits within the same integer is
- not supported and will very probably cause deadlocks.
- The value of the bit that is set is (1u << @bit). If @bit is not
- between 0 and 31 then the result is undefined.
- This function accesses @address atomically. All other accesses to
- @address must be atomic in order for this function to work
- reliably.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="address" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to an integer</doc>
- <type name="gint" c:type="volatile gint*"/>
- </parameter>
- <parameter name="lock_bit" transfer-ownership="none">
- <doc xml:space="preserve">a bit value between 0 and 31</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="bit_nth_lsf" c:identifier="g_bit_nth_lsf">
- <doc xml:space="preserve">Find the position of the first bit set in @mask, searching
- from (but not including) @nth_bit upwards. Bits are numbered
- from 0 (least significant) to sizeof(#gulong) * 8 - 1 (31 or 63,
- usually). To start searching from the 0th bit, set @nth_bit to -1.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the index of the first bit set which is higher than @nth_bit, or -1
- if no higher bits are set</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="mask" transfer-ownership="none">
- <doc xml:space="preserve">a #gulong containing flags</doc>
- <type name="gulong" c:type="gulong"/>
- </parameter>
- <parameter name="nth_bit" transfer-ownership="none">
- <doc xml:space="preserve">the index of the bit to start the search from</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="bit_nth_msf" c:identifier="g_bit_nth_msf">
- <doc xml:space="preserve">Find the position of the first bit set in @mask, searching
- from (but not including) @nth_bit downwards. Bits are numbered
- from 0 (least significant) to sizeof(#gulong) * 8 - 1 (31 or 63,
- usually). To start searching from the last bit, set @nth_bit to
- -1 or GLIB_SIZEOF_LONG * 8.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the index of the first bit set which is lower than @nth_bit, or -1
- if no lower bits are set</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="mask" transfer-ownership="none">
- <doc xml:space="preserve">a #gulong containing flags</doc>
- <type name="gulong" c:type="gulong"/>
- </parameter>
- <parameter name="nth_bit" transfer-ownership="none">
- <doc xml:space="preserve">the index of the bit to start the search from</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="bit_storage" c:identifier="g_bit_storage">
- <doc xml:space="preserve">Gets the number of bits used to hold @number,
- e.g. if @number is 4, 3 bits are needed.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of bits used to hold @number</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="number" transfer-ownership="none">
- <doc xml:space="preserve">a #guint</doc>
- <type name="gulong" c:type="gulong"/>
- </parameter>
- </parameters>
- </function>
- <function name="bit_trylock" c:identifier="g_bit_trylock" version="2.24">
- <doc xml:space="preserve">Sets the indicated @lock_bit in @address, returning %TRUE if
- successful. If the bit is already set, returns %FALSE immediately.
- Attempting to lock on two different bits within the same integer is
- not supported.
- The value of the bit that is set is (1u << @bit). If @bit is not
- between 0 and 31 then the result is undefined.
- This function accesses @address atomically. All other accesses to
- @address must be atomic in order for this function to work
- reliably.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the lock was acquired</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="address" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to an integer</doc>
- <type name="gint" c:type="volatile gint*"/>
- </parameter>
- <parameter name="lock_bit" transfer-ownership="none">
- <doc xml:space="preserve">a bit value between 0 and 31</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="bit_unlock" c:identifier="g_bit_unlock" version="2.24">
- <doc xml:space="preserve">Clears the indicated @lock_bit in @address. If another thread is
- currently blocked in g_bit_lock() on this same bit then it will be
- woken up.
- This function accesses @address atomically. All other accesses to
- @address must be atomic in order for this function to work
- reliably.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="address" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to an integer</doc>
- <type name="gint" c:type="volatile gint*"/>
- </parameter>
- <parameter name="lock_bit" transfer-ownership="none">
- <doc xml:space="preserve">a bit value between 0 and 31</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="bookmark_file_error_quark"
- c:identifier="g_bookmark_file_error_quark"
- moved-to="BookmarkFile.error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="build_filename"
- c:identifier="g_build_filename"
- introspectable="0">
- <doc xml:space="preserve">Creates a filename from a series of elements using the correct
- separator for filenames.
- On Unix, this function behaves identically to `g_build_path
- (G_DIR_SEPARATOR_S, first_element, ....)`.
- On Windows, it takes into account that either the backslash
- (`\` or slash (`/`) can be used as separator in filenames, but
- otherwise behaves as on UNIX. When file pathname separators need
- to be inserted, the one that last previously occurred in the
- parameters (reading from left to right) is used.
- No attempt is made to force the resulting filename to be an absolute
- path. If the first element is a relative path, the result will
- be a relative path.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string that must be freed with g_free().</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="first_element" transfer-ownership="none">
- <doc xml:space="preserve">the first element in the path</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">remaining elements in path, terminated by %NULL</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="build_filenamev"
- c:identifier="g_build_filenamev"
- version="2.8">
- <doc xml:space="preserve">Behaves exactly like g_build_filename(), but takes the path elements
- as a string array, instead of varargs. This function is mainly
- meant for language bindings.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string that must be freed with g_free().</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="args" transfer-ownership="none">
- <doc xml:space="preserve">%NULL-terminated array of strings containing the path elements.</doc>
- <array c:type="gchar**">
- <type name="utf8" c:type="gchar*"/>
- </array>
- </parameter>
- </parameters>
- </function>
- <function name="build_path" c:identifier="g_build_path" introspectable="0">
- <doc xml:space="preserve">Creates a path from a series of elements using @separator as the
- separator between elements. At the boundary between two elements,
- any trailing occurrences of separator in the first element, or
- leading occurrences of separator in the second element are removed
- and exactly one copy of the separator is inserted.
- Empty elements are ignored.
- The number of leading copies of the separator on the result is
- the same as the number of leading copies of the separator on
- the first non-empty element.
- The number of trailing copies of the separator on the result is
- the same as the number of trailing copies of the separator on
- the last non-empty element. (Determination of the number of
- trailing copies is done without stripping leading copies, so
- if the separator is `ABA`, then `ABABA` has 1 trailing copy.)
- However, if there is only a single non-empty element, and there
- are no characters in that element not part of the leading or
- trailing separators, then the result is exactly the original value
- of that element.
- Other than for determination of the number of leading and trailing
- copies of the separator, elements consisting only of copies
- of the separator are ignored.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string that must be freed with g_free().</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="separator" transfer-ownership="none">
- <doc xml:space="preserve">a string used to separator the elements of the path.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="first_element" transfer-ownership="none">
- <doc xml:space="preserve">the first element in the path</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">remaining elements in path, terminated by %NULL</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="build_pathv" c:identifier="g_build_pathv" version="2.8">
- <doc xml:space="preserve">Behaves exactly like g_build_path(), but takes the path elements
- as a string array, instead of varargs. This function is mainly
- meant for language bindings.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string that must be freed with g_free().</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="separator" transfer-ownership="none">
- <doc xml:space="preserve">a string used to separator the elements of the path.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="args" transfer-ownership="none">
- <doc xml:space="preserve">%NULL-terminated array of strings containing the path elements.</doc>
- <array c:type="gchar**">
- <type name="utf8" c:type="gchar*"/>
- </array>
- </parameter>
- </parameters>
- </function>
- <function name="byte_array_free"
- c:identifier="g_byte_array_free"
- moved-to="ByteArray.free">
- <doc xml:space="preserve">Frees the memory allocated by the #GByteArray. If @free_segment is
- %TRUE it frees the actual byte data. If the reference count of
- @array is greater than one, the #GByteArray wrapper is preserved but
- the size of @array will be set to zero.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the element data if @free_segment is %FALSE, otherwise
- %NULL. The element data should be freed using g_free().</doc>
- <type name="guint8" c:type="guint8*"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">a #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- <parameter name="free_segment" transfer-ownership="none">
- <doc xml:space="preserve">if %TRUE the actual byte data is freed as well</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </function>
- <function name="byte_array_free_to_bytes"
- c:identifier="g_byte_array_free_to_bytes"
- moved-to="ByteArray.free_to_bytes"
- version="2.32">
- <doc xml:space="preserve">Transfers the data from the #GByteArray into a new immutable #GBytes.
- The #GByteArray is freed unless the reference count of @array is greater
- than one, the #GByteArray wrapper is preserved but the size of @array
- will be set to zero.
- This is identical to using g_bytes_new_take() and g_byte_array_free()
- together.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new immutable #GBytes representing same
- byte data that was in the array</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="full">
- <doc xml:space="preserve">a #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- </parameters>
- </function>
- <function name="byte_array_new"
- c:identifier="g_byte_array_new"
- moved-to="ByteArray.new">
- <doc xml:space="preserve">Creates a new #GByteArray with a reference count of 1.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the new #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </return-value>
- </function>
- <function name="byte_array_new_take"
- c:identifier="g_byte_array_new_take"
- moved-to="ByteArray.new_take"
- version="2.32">
- <doc xml:space="preserve">Create byte array containing the data. The data will be owned by the array
- and will be freed with g_free(), i.e. it could be allocated using g_strdup().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="data" transfer-ownership="full">
- <doc xml:space="preserve">byte data for the array</doc>
- <array length="1" zero-terminated="0" c:type="guint8*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">length of @data</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="byte_array_unref"
- c:identifier="g_byte_array_unref"
- moved-to="ByteArray.unref"
- version="2.22">
- <doc xml:space="preserve">Atomically decrements the reference count of @array by one. If the
- reference count drops to 0, all memory allocated by the array is
- released. This function is thread-safe and may be called from any
- thread.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="array" transfer-ownership="none">
- <doc xml:space="preserve">A #GByteArray</doc>
- <array name="GLib.ByteArray" c:type="GByteArray*">
- <type name="guint8" c:type="guint8"/>
- </array>
- </parameter>
- </parameters>
- </function>
- <function name="chdir" c:identifier="g_chdir" version="2.8">
- <doc xml:space="preserve">A wrapper for the POSIX chdir() function. The function changes the
- current directory of the process to @path.
- See your C library manual for more details about chdir().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">0 on success, -1 if an error occurred.</doc>
- <type name="gint" c:type="int"/>
- </return-value>
- <parameters>
- <parameter name="path" transfer-ownership="none">
- <doc xml:space="preserve">a pathname in the GLib file name encoding (UTF-8 on Windows)</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="check_version"
- c:identifier="glib_check_version"
- version="2.6">
- <doc xml:space="preserve">Checks that the GLib library in use is compatible with the
- given version. Generally you would pass in the constants
- #GLIB_MAJOR_VERSION, #GLIB_MINOR_VERSION, #GLIB_MICRO_VERSION
- as the three arguments to this function; that produces
- a check that the library in use is compatible with
- the version of GLib the application or module was compiled
- against.
- Compatibility is defined by two things: first the version
- of the running library is newer than the version
- @required_major.required_minor.@required_micro. Second
- the running library must be binary compatible with the
- version @required_major.required_minor.@required_micro
- (same major version.)</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%NULL if the GLib library is compatible with the
- given version, or a string describing the version mismatch.
- The returned string is owned by GLib and must not be modified
- or freed.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="required_major" transfer-ownership="none">
- <doc xml:space="preserve">the required major version</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="required_minor" transfer-ownership="none">
- <doc xml:space="preserve">the required minor version</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="required_micro" transfer-ownership="none">
- <doc xml:space="preserve">the required micro version</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="checksum_type_get_length"
- c:identifier="g_checksum_type_get_length"
- moved-to="Checksum.type_get_length"
- version="2.16">
- <doc xml:space="preserve">Gets the length in bytes of digests of type @checksum_type</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the checksum length, or -1 if @checksum_type is
- not supported.</doc>
- <type name="gssize" c:type="gssize"/>
- </return-value>
- <parameters>
- <parameter name="checksum_type" transfer-ownership="none">
- <doc xml:space="preserve">a #GChecksumType</doc>
- <type name="ChecksumType" c:type="GChecksumType"/>
- </parameter>
- </parameters>
- </function>
- <function name="child_watch_add"
- c:identifier="g_child_watch_add"
- shadowed-by="child_watch_add_full"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Sets a function to be called when the child indicated by @pid
- exits, at a default priority, #G_PRIORITY_DEFAULT.
- If you obtain @pid from g_spawn_async() or g_spawn_async_with_pipes()
- you will need to pass #G_SPAWN_DO_NOT_REAP_CHILD as flag to
- the spawn function for the child watching to work.
- Note that on platforms where #GPid must be explicitly closed
- (see g_spawn_close_pid()) @pid must not be closed while the
- source is still active. Typically, you will want to call
- g_spawn_close_pid() in the callback function for the source.
- GLib supports only a single callback per process id.
- This internally creates a main loop source using
- g_child_watch_source_new() and attaches it to the main loop context
- using g_source_attach(). You can do these steps manually if you
- need greater control.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="pid" transfer-ownership="none">
- <doc xml:space="preserve">process id to watch. On POSIX the positive pid of a child
- process. On Windows a handle for a process (which doesn't have to be
- a child).</doc>
- <type name="Pid" c:type="GPid"/>
- </parameter>
- <parameter name="function" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">function to call</doc>
- <type name="ChildWatchFunc" c:type="GChildWatchFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="child_watch_add_full"
- c:identifier="g_child_watch_add_full"
- shadows="child_watch_add"
- version="2.4">
- <doc xml:space="preserve">Sets a function to be called when the child indicated by @pid
- exits, at the priority @priority.
- If you obtain @pid from g_spawn_async() or g_spawn_async_with_pipes()
- you will need to pass #G_SPAWN_DO_NOT_REAP_CHILD as flag to
- the spawn function for the child watching to work.
- In many programs, you will want to call g_spawn_check_exit_status()
- in the callback to determine whether or not the child exited
- successfully.
- Also, note that on platforms where #GPid must be explicitly closed
- (see g_spawn_close_pid()) @pid must not be closed while the source
- is still active. Typically, you should invoke g_spawn_close_pid()
- in the callback function for the source.
- GLib supports only a single callback per process id.
- This internally creates a main loop source using
- g_child_watch_source_new() and attaches it to the main loop context
- using g_source_attach(). You can do these steps manually if you
- need greater control.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="priority" transfer-ownership="none">
- <doc xml:space="preserve">the priority of the idle source. Typically this will be in the
- range between #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="pid" transfer-ownership="none">
- <doc xml:space="preserve">process to watch. On POSIX the positive pid of a child process. On
- Windows a handle for a process (which doesn't have to be a child).</doc>
- <type name="Pid" c:type="GPid"/>
- </parameter>
- <parameter name="function"
- transfer-ownership="none"
- scope="notified"
- closure="3"
- destroy="4">
- <doc xml:space="preserve">function to call</doc>
- <type name="ChildWatchFunc" c:type="GChildWatchFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="notify"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">function to call when the idle is removed, or %NULL</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="child_watch_source_new"
- c:identifier="g_child_watch_source_new"
- version="2.4">
- <doc xml:space="preserve">Creates a new child_watch source.
- The source will not initially be associated with any #GMainContext
- and must be added to one with g_source_attach() before it will be
- executed.
- Note that child watch sources can only be used in conjunction with
- `g_spawn...` when the %G_SPAWN_DO_NOT_REAP_CHILD flag is used.
- Note that on platforms where #GPid must be explicitly closed
- (see g_spawn_close_pid()) @pid must not be closed while the
- source is still active. Typically, you will want to call
- g_spawn_close_pid() in the callback function for the source.
- Note further that using g_child_watch_source_new() is not
- compatible with calling `waitpid` with a nonpositive first
- argument in the application. Calling waitpid() for individual
- pids will still work fine.
- Similarly, on POSIX platforms, the @pid passed to this function must
- be greater than 0 (i.e. this function must wait for a specific child,
- and cannot wait for one of many children by using a nonpositive argument).</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly-created child watch source</doc>
- <type name="Source" c:type="GSource*"/>
- </return-value>
- <parameters>
- <parameter name="pid" transfer-ownership="none">
- <doc xml:space="preserve">process to watch. On POSIX the positive pid of a child process. On
- Windows a handle for a process (which doesn't have to be a child).</doc>
- <type name="Pid" c:type="GPid"/>
- </parameter>
- </parameters>
- </function>
- <function name="clear_error" c:identifier="g_clear_error" throws="1">
- <doc xml:space="preserve">If @err or *@err is %NULL, does nothing. Otherwise,
- calls g_error_free() on *@err and sets *@err to %NULL.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- </function>
- <function name="clear_pointer"
- c:identifier="g_clear_pointer"
- version="2.34"
- introspectable="0">
- <doc xml:space="preserve">Clears a reference to a variable.
- @pp must not be %NULL.
- If the reference is %NULL then this function does nothing.
- Otherwise, the variable is destroyed using @destroy and the
- pointer is set to %NULL.
- A macro is also included that allows this function to be used without
- pointer casts.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="pp" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a variable, struct member etc. holding a
- pointer</doc>
- <type name="gpointer" c:type="gpointer*"/>
- </parameter>
- <parameter name="destroy" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">a function to which a gpointer can be passed, to destroy *@pp</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="close" c:identifier="g_close" version="2.36" throws="1">
- <doc xml:space="preserve">This wraps the close() call; in case of error, %errno will be
- preserved, but the error will also be stored as a #GError in @error.
- Besides using #GError, there is another major reason to prefer this
- function over the call provided by the system; on Unix, it will
- attempt to correctly handle %EINTR, which has platform-specific
- semantics.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on success, %FALSE if there was an error.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="fd" transfer-ownership="none">
- <doc xml:space="preserve">A file descriptor</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="compute_checksum_for_bytes"
- c:identifier="g_compute_checksum_for_bytes"
- version="2.34">
- <doc xml:space="preserve">Computes the checksum for a binary @data. This is a
- convenience wrapper for g_checksum_new(), g_checksum_get_string()
- and g_checksum_free().
- The hexadecimal string returned will be in lower case.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the digest of the binary data as a string in hexadecimal.
- The returned string should be freed with g_free() when done using it.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="checksum_type" transfer-ownership="none">
- <doc xml:space="preserve">a #GChecksumType</doc>
- <type name="ChecksumType" c:type="GChecksumType"/>
- </parameter>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">binary blob to compute the digest of</doc>
- <type name="Bytes" c:type="GBytes*"/>
- </parameter>
- </parameters>
- </function>
- <function name="compute_checksum_for_data"
- c:identifier="g_compute_checksum_for_data"
- version="2.16">
- <doc xml:space="preserve">Computes the checksum for a binary @data of @length. This is a
- convenience wrapper for g_checksum_new(), g_checksum_get_string()
- and g_checksum_free().
- The hexadecimal string returned will be in lower case.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the digest of the binary data as a string in hexadecimal.
- The returned string should be freed with g_free() when done using it.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="checksum_type" transfer-ownership="none">
- <doc xml:space="preserve">a #GChecksumType</doc>
- <type name="ChecksumType" c:type="GChecksumType"/>
- </parameter>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">binary blob to compute the digest of</doc>
- <array length="2" zero-terminated="0" c:type="guchar*">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">length of @data</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="compute_checksum_for_string"
- c:identifier="g_compute_checksum_for_string"
- version="2.16">
- <doc xml:space="preserve">Computes the checksum of a string.
- The hexadecimal string returned will be in lower case.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the checksum as a hexadecimal string. The returned string
- should be freed with g_free() when done using it.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="checksum_type" transfer-ownership="none">
- <doc xml:space="preserve">a #GChecksumType</doc>
- <type name="ChecksumType" c:type="GChecksumType"/>
- </parameter>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">the string to compute the checksum of</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of the string, or -1 if the string is null-terminated.</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="compute_hmac_for_data"
- c:identifier="g_compute_hmac_for_data"
- version="2.30">
- <doc xml:space="preserve">Computes the HMAC for a binary @data of @length. This is a
- convenience wrapper for g_hmac_new(), g_hmac_get_string()
- and g_hmac_unref().
- The hexadecimal string returned will be in lower case.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the HMAC of the binary data as a string in hexadecimal.
- The returned string should be freed with g_free() when done using it.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="digest_type" transfer-ownership="none">
- <doc xml:space="preserve">a #GChecksumType to use for the HMAC</doc>
- <type name="ChecksumType" c:type="GChecksumType"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">the key to use in the HMAC</doc>
- <array length="2" zero-terminated="0" c:type="guchar*">
- <type name="guint8" c:type="guchar"/>
- </array>
- </parameter>
- <parameter name="key_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of the key</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="data" transfer-ownership="none">
- <doc xml:space="preserve">binary blob to compute the HMAC of</doc>
- <type name="guint8" c:type="const guchar*"/>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">length of @data</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="compute_hmac_for_string"
- c:identifier="g_compute_hmac_for_string"
- version="2.30">
- <doc xml:space="preserve">Computes the HMAC for a string.
- The hexadecimal string returned will be in lower case.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the HMAC as a hexadecimal string.
- The returned string should be freed with g_free()
- when done using it.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="digest_type" transfer-ownership="none">
- <doc xml:space="preserve">a #GChecksumType to use for the HMAC</doc>
- <type name="ChecksumType" c:type="GChecksumType"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">the key to use in the HMAC</doc>
- <array length="2" zero-terminated="0" c:type="guchar*">
- <type name="guint8" c:type="guchar"/>
- </array>
- </parameter>
- <parameter name="key_len" transfer-ownership="none">
- <doc xml:space="preserve">the length of the key</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">the string to compute the HMAC for</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of the string, or -1 if the string is nul-terminated</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="convert" c:identifier="g_convert" throws="1">
- <doc xml:space="preserve">Converts a string from one character set to another.
- Note that you should use g_iconv() for streaming conversions.
- Despite the fact that @byes_read can return information about partial
- characters, the g_convert_... functions are not generally suitable
- for streaming. If the underlying converter maintains internal state,
- then this won't be preserved across successive calls to g_convert(),
- g_convert_with_iconv() or g_convert_with_fallback(). (An example of
- this is the GNU C converter for CP1255 which does not emit a base
- character until it knows that the next character is not a mark that
- could combine with the base character.)
- Using extensions such as "//TRANSLIT" may not work (or may not work
- well) on many platforms. Consider using g_str_to_ascii() instead.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">If the conversion was successful, a newly allocated
- nul-terminated string, which must be freed with
- g_free(). Otherwise %NULL and @error will be set.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">the string to convert</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the length of the string in bytes, or -1 if the string is
- nul-terminated (Note that some encodings may allow nul
- bytes to occur inside strings. In that case, using -1
- for the @len parameter is unsafe)</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="to_codeset" transfer-ownership="none">
- <doc xml:space="preserve">name of character set into which to convert @str</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="from_codeset" transfer-ownership="none">
- <doc xml:space="preserve">character set of @str.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="bytes_read"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">location to store the number of bytes in the
- input string that were successfully converted, or %NULL.
- Even if the conversion was successful, this may be
- less than @len if there were partial characters
- at the end of the input. If the error
- #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
- stored will the byte offset after the last valid
- input sequence.</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- <parameter name="bytes_written"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">the number of bytes stored in the output buffer (not
- including the terminating nul).</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </function>
- <function name="convert_error_quark" c:identifier="g_convert_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="convert_with_fallback"
- c:identifier="g_convert_with_fallback"
- throws="1">
- <doc xml:space="preserve">Converts a string from one character set to another, possibly
- including fallback sequences for characters not representable
- in the output. Note that it is not guaranteed that the specification
- for the fallback sequences in @fallback will be honored. Some
- systems may do an approximate conversion from @from_codeset
- to @to_codeset in their iconv() functions,
- in which case GLib will simply return that approximate conversion.
- Note that you should use g_iconv() for streaming conversions.
- Despite the fact that @byes_read can return information about partial
- characters, the g_convert_... functions are not generally suitable
- for streaming. If the underlying converter maintains internal state,
- then this won't be preserved across successive calls to g_convert(),
- g_convert_with_iconv() or g_convert_with_fallback(). (An example of
- this is the GNU C converter for CP1255 which does not emit a base
- character until it knows that the next character is not a mark that
- could combine with the base character.)</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">If the conversion was successful, a newly allocated
- nul-terminated string, which must be freed with
- g_free(). Otherwise %NULL and @error will be set.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">the string to convert</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the length of the string in bytes, or -1 if the string is
- nul-terminated (Note that some encodings may allow nul
- bytes to occur inside strings. In that case, using -1
- for the @len parameter is unsafe)</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="to_codeset" transfer-ownership="none">
- <doc xml:space="preserve">name of character set into which to convert @str</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="from_codeset" transfer-ownership="none">
- <doc xml:space="preserve">character set of @str.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="fallback" transfer-ownership="none">
- <doc xml:space="preserve">UTF-8 string to use in place of character not
- present in the target encoding. (The string must be
- representable in the target encoding).
- If %NULL, characters not in the target encoding will
- be represented as Unicode escapes \uxxxx or \Uxxxxyyyy.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="bytes_read" transfer-ownership="none">
- <doc xml:space="preserve">location to store the number of bytes in the
- input string that were successfully converted, or %NULL.
- Even if the conversion was successful, this may be
- less than @len if there were partial characters
- at the end of the input.</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- <parameter name="bytes_written" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes stored in the output buffer (not
- including the terminating nul).</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </function>
- <function name="convert_with_iconv"
- c:identifier="g_convert_with_iconv"
- throws="1">
- <doc xml:space="preserve">Converts a string from one character set to another.
- Note that you should use g_iconv() for streaming conversions.
- Despite the fact that @byes_read can return information about partial
- characters, the g_convert_... functions are not generally suitable
- for streaming. If the underlying converter maintains internal state,
- then this won't be preserved across successive calls to g_convert(),
- g_convert_with_iconv() or g_convert_with_fallback(). (An example of
- this is the GNU C converter for CP1255 which does not emit a base
- character until it knows that the next character is not a mark that
- could combine with the base character.)</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">If the conversion was successful, a newly allocated
- nul-terminated string, which must be freed with
- g_free(). Otherwise %NULL and @error will be set.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">the string to convert</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the length of the string in bytes, or -1 if the string is
- nul-terminated (Note that some encodings may allow nul
- bytes to occur inside strings. In that case, using -1
- for the @len parameter is unsafe)</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="converter" transfer-ownership="none">
- <doc xml:space="preserve">conversion descriptor from g_iconv_open()</doc>
- <type name="IConv" c:type="GIConv"/>
- </parameter>
- <parameter name="bytes_read" transfer-ownership="none">
- <doc xml:space="preserve">location to store the number of bytes in the
- input string that were successfully converted, or %NULL.
- Even if the conversion was successful, this may be
- less than @len if there were partial characters
- at the end of the input. If the error
- #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
- stored will the byte offset after the last valid
- input sequence.</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- <parameter name="bytes_written" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes stored in the output buffer (not
- including the terminating nul).</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </function>
- <function name="datalist_clear" c:identifier="g_datalist_clear">
- <doc xml:space="preserve">Frees all the data elements of the datalist.
- The data elements' destroy functions are called
- if they have been set.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="datalist" transfer-ownership="none">
- <doc xml:space="preserve">a datalist.</doc>
- <type name="Data" c:type="GData**"/>
- </parameter>
- </parameters>
- </function>
- <function name="datalist_foreach"
- c:identifier="g_datalist_foreach"
- introspectable="0">
- <doc xml:space="preserve">Calls the given function for each data element of the datalist. The
- function is called with each data element's #GQuark id and data,
- together with the given @user_data parameter. Note that this
- function is NOT thread-safe. So unless @datalist can be protected
- from any modifications during invocation of this function, it should
- not be called.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="datalist" transfer-ownership="none">
- <doc xml:space="preserve">a datalist.</doc>
- <type name="Data" c:type="GData**"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function to call for each data element.</doc>
- <type name="DataForeachFunc" c:type="GDataForeachFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="datalist_get_data" c:identifier="g_datalist_get_data">
- <doc xml:space="preserve">Gets a data element, using its string identifier. This is slower than
- g_datalist_id_get_data() because it compares strings.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the data element, or %NULL if it is not found.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="datalist" transfer-ownership="none">
- <doc xml:space="preserve">a datalist.</doc>
- <type name="Data" c:type="GData**"/>
- </parameter>
- <parameter name="key" transfer-ownership="none">
- <doc xml:space="preserve">the string identifying a data element.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="datalist_get_flags"
- c:identifier="g_datalist_get_flags"
- version="2.8">
- <doc xml:space="preserve">Gets flags values packed in together with the datalist.
- See g_datalist_set_flags().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the flags of the datalist</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="datalist" transfer-ownership="none">
- <doc xml:space="preserve">pointer to the location that holds a list</doc>
- <type name="Data" c:type="GData**"/>
- </parameter>
- </parameters>
- </function>
- <function name="datalist_id_dup_data"
- c:identifier="g_datalist_id_dup_data"
- version="2.34"
- introspectable="0">
- <doc xml:space="preserve">This is a variant of g_datalist_id_get_data() which
- returns a 'duplicate' of the value. @dup_func defines the
- meaning of 'duplicate' in this context, it could e.g.
- take a reference on a ref-counted object.
- If the @key_id is not set in the datalist then @dup_func
- will be called with a %NULL argument.
- Note that @dup_func is called while the datalist is locked, so it
- is not allowed to read or modify the datalist.
- This function can be useful to avoid races when multiple
- threads are using the same datalist and the same key.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the result of calling @dup_func on the value
- associated with @key_id in @datalist, or %NULL if not set.
- If @dup_func is %NULL, the value is returned unmodified.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="datalist" transfer-ownership="none">
- <doc xml:space="preserve">location of a datalist</doc>
- <type name="Data" c:type="GData**"/>
- </parameter>
- <parameter name="key_id" transfer-ownership="none">
- <doc xml:space="preserve">the #GQuark identifying a data element</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- <parameter name="dup_func"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- closure="3">
- <doc xml:space="preserve">function to duplicate the old value</doc>
- <type name="DuplicateFunc" c:type="GDuplicateFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">passed as user_data to @dup_func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="datalist_id_get_data"
- c:identifier="g_datalist_id_get_data">
- <doc xml:space="preserve">Retrieves the data element corresponding to @key_id.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the data element, or %NULL if it is not found.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="datalist" transfer-ownership="none">
- <doc xml:space="preserve">a datalist.</doc>
- <type name="Data" c:type="GData**"/>
- </parameter>
- <parameter name="key_id" transfer-ownership="none">
- <doc xml:space="preserve">the #GQuark identifying a data element.</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- </parameters>
- </function>
- <function name="datalist_id_remove_no_notify"
- c:identifier="g_datalist_id_remove_no_notify">
- <doc xml:space="preserve">Removes an element, without calling its destroy notification
- function.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the data previously stored at @key_id, or %NULL if none.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="datalist" transfer-ownership="none">
- <doc xml:space="preserve">a datalist.</doc>
- <type name="Data" c:type="GData**"/>
- </parameter>
- <parameter name="key_id" transfer-ownership="none">
- <doc xml:space="preserve">the #GQuark identifying a data element.</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- </parameters>
- </function>
- <function name="datalist_id_replace_data"
- c:identifier="g_datalist_id_replace_data"
- version="2.34">
- <doc xml:space="preserve">Compares the member that is associated with @key_id in
- @datalist to @oldval, and if they are the same, replace
- @oldval with @newval.
- This is like a typical atomic compare-and-exchange
- operation, for a member of @datalist.
- If the previous value was replaced then ownership of the
- old value (@oldval) is passed to the caller, including
- the registred destroy notify for it (passed out in @old_destroy).
- Its up to the caller to free this as he wishes, which may
- or may not include using @old_destroy as sometimes replacement
- should not destroy the object in the normal way.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the existing value for @key_id was replaced
- by @newval, %FALSE otherwise.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="datalist" transfer-ownership="none">
- <doc xml:space="preserve">location of a datalist</doc>
- <type name="Data" c:type="GData**"/>
- </parameter>
- <parameter name="key_id" transfer-ownership="none">
- <doc xml:space="preserve">the #GQuark identifying a data element</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- <parameter name="oldval"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the old value to compare against</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="newval"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the new value to replace it with</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="destroy"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">destroy notify for the new value</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- <parameter name="old_destroy"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">destroy notify for the existing value</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify*"/>
- </parameter>
- </parameters>
- </function>
- <function name="datalist_id_set_data_full"
- c:identifier="g_datalist_id_set_data_full">
- <doc xml:space="preserve">Sets the data corresponding to the given #GQuark id, and the
- function to be called when the element is removed from the datalist.
- Any previous data with the same key is removed, and its destroy
- function is called.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="datalist" transfer-ownership="none">
- <doc xml:space="preserve">a datalist.</doc>
- <type name="Data" c:type="GData**"/>
- </parameter>
- <parameter name="key_id" transfer-ownership="none">
- <doc xml:space="preserve">the #GQuark to identify the data element.</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data element or %NULL to remove any previous element
- corresponding to @key_id.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="destroy_func" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">the function to call when the data element is
- removed. This function will be called with the data
- element and can be used to free any memory allocated
- for it. If @data is %NULL, then @destroy_func must
- also be %NULL.</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="datalist_init" c:identifier="g_datalist_init">
- <doc xml:space="preserve">Resets the datalist to %NULL. It does not free any memory or call
- any destroy functions.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="datalist" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a pointer to a datalist.</doc>
- <type name="Data" c:type="GData**"/>
- </parameter>
- </parameters>
- </function>
- <function name="datalist_set_flags"
- c:identifier="g_datalist_set_flags"
- version="2.8">
- <doc xml:space="preserve">Turns on flag values for a data list. This function is used
- to keep a small number of boolean flags in an object with
- a data list without using any additional space. It is
- not generally useful except in circumstances where space
- is very tight. (It is used in the base #GObject type, for
- example.)</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="datalist" transfer-ownership="none">
- <doc xml:space="preserve">pointer to the location that holds a list</doc>
- <type name="Data" c:type="GData**"/>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">the flags to turn on. The values of the flags are
- restricted by %G_DATALIST_FLAGS_MASK (currently
- 3; giving two possible boolean flags).
- A value for @flags that doesn't fit within the mask is
- an error.</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="datalist_unset_flags"
- c:identifier="g_datalist_unset_flags"
- version="2.8">
- <doc xml:space="preserve">Turns off flag values for a data list. See g_datalist_unset_flags()</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="datalist" transfer-ownership="none">
- <doc xml:space="preserve">pointer to the location that holds a list</doc>
- <type name="Data" c:type="GData**"/>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">the flags to turn off. The values of the flags are
- restricted by %G_DATALIST_FLAGS_MASK (currently
- 3: giving two possible boolean flags).
- A value for @flags that doesn't fit within the mask is
- an error.</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="dataset_destroy" c:identifier="g_dataset_destroy">
- <doc xml:space="preserve">Destroys the dataset, freeing all memory allocated, and calling any
- destroy functions set for data elements.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="dataset_location" transfer-ownership="none">
- <doc xml:space="preserve">the location identifying the dataset.</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="dataset_foreach"
- c:identifier="g_dataset_foreach"
- introspectable="0">
- <doc xml:space="preserve">Calls the given function for each data element which is associated
- with the given location. Note that this function is NOT thread-safe.
- So unless @datalist can be protected from any modifications during
- invocation of this function, it should not be called.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="dataset_location" transfer-ownership="none">
- <doc xml:space="preserve">the location identifying the dataset.</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">the function to call for each data element.</doc>
- <type name="DataForeachFunc" c:type="GDataForeachFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to the function.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="dataset_id_get_data" c:identifier="g_dataset_id_get_data">
- <doc xml:space="preserve">Gets the data element corresponding to a #GQuark.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the data element corresponding to the #GQuark, or %NULL if
- it is not found.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="dataset_location" transfer-ownership="none">
- <doc xml:space="preserve">the location identifying the dataset.</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="key_id" transfer-ownership="none">
- <doc xml:space="preserve">the #GQuark id to identify the data element.</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- </parameters>
- </function>
- <function name="dataset_id_remove_no_notify"
- c:identifier="g_dataset_id_remove_no_notify">
- <doc xml:space="preserve">Removes an element, without calling its destroy notification
- function.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the data previously stored at @key_id, or %NULL if none.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="dataset_location" transfer-ownership="none">
- <doc xml:space="preserve">the location identifying the dataset.</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="key_id" transfer-ownership="none">
- <doc xml:space="preserve">the #GQuark ID identifying the data element.</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- </parameters>
- </function>
- <function name="dataset_id_set_data_full"
- c:identifier="g_dataset_id_set_data_full">
- <doc xml:space="preserve">Sets the data element associated with the given #GQuark id, and also
- the function to call when the data element is destroyed. Any
- previous data with the same key is removed, and its destroy function
- is called.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="dataset_location" transfer-ownership="none">
- <doc xml:space="preserve">the location identifying the dataset.</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="key_id" transfer-ownership="none">
- <doc xml:space="preserve">the #GQuark id to identify the data element.</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data element.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="destroy_func" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">the function to call when the data element is
- removed. This function will be called with the data
- element and can be used to free any memory allocated
- for it.</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="date_get_days_in_month"
- c:identifier="g_date_get_days_in_month"
- moved-to="Date.get_days_in_month">
- <doc xml:space="preserve">Returns the number of days in a month, taking leap
- years into account.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">number of days in @month during the @year</doc>
- <type name="guint8" c:type="guint8"/>
- </return-value>
- <parameters>
- <parameter name="month" transfer-ownership="none">
- <doc xml:space="preserve">month</doc>
- <type name="DateMonth" c:type="GDateMonth"/>
- </parameter>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">year</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </function>
- <function name="date_get_monday_weeks_in_year"
- c:identifier="g_date_get_monday_weeks_in_year"
- moved-to="Date.get_monday_weeks_in_year">
- <doc xml:space="preserve">Returns the number of weeks in the year, where weeks
- are taken to start on Monday. Will be 52 or 53. The
- date must be valid. (Years always have 52 7-day periods,
- plus 1 or 2 extra days depending on whether it's a leap
- year. This function is basically telling you how many
- Mondays are in the year, i.e. there are 53 Mondays if
- one of the extra days happens to be a Monday.)</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">number of Mondays in the year</doc>
- <type name="guint8" c:type="guint8"/>
- </return-value>
- <parameters>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">a year</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </function>
- <function name="date_get_sunday_weeks_in_year"
- c:identifier="g_date_get_sunday_weeks_in_year"
- moved-to="Date.get_sunday_weeks_in_year">
- <doc xml:space="preserve">Returns the number of weeks in the year, where weeks
- are taken to start on Sunday. Will be 52 or 53. The
- date must be valid. (Years always have 52 7-day periods,
- plus 1 or 2 extra days depending on whether it's a leap
- year. This function is basically telling you how many
- Sundays are in the year, i.e. there are 53 Sundays if
- one of the extra days happens to be a Sunday.)</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of weeks in @year</doc>
- <type name="guint8" c:type="guint8"/>
- </return-value>
- <parameters>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">year to count weeks in</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </function>
- <function name="date_is_leap_year"
- c:identifier="g_date_is_leap_year"
- moved-to="Date.is_leap_year">
- <doc xml:space="preserve">Returns %TRUE if the year is a leap year.
- For the purposes of this function, leap year is every year
- divisible by 4 unless that year is divisible by 100. If it
- is divisible by 100 it would be a leap year only if that year
- is also divisible by 400.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the year is a leap year</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">year to check</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </function>
- <function name="date_strftime"
- c:identifier="g_date_strftime"
- moved-to="Date.strftime">
- <doc xml:space="preserve">Generates a printed representation of the date, in a
- [locale][setlocale]-specific way.
- Works just like the platform's C library strftime() function,
- but only accepts date-related formats; time-related formats
- give undefined results. Date must be valid. Unlike strftime()
- (which uses the locale encoding), works on a UTF-8 format
- string and stores a UTF-8 result.
- This function does not provide any conversion specifiers in
- addition to those implemented by the platform's C library.
- For example, don't expect that using g_date_strftime() would
- make the \%F provided by the C99 strftime() work on Windows
- where the C library only complies to C89.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">number of characters written to the buffer, or 0 the buffer was too small</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <parameter name="s" transfer-ownership="none">
- <doc xml:space="preserve">destination buffer</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="slen" transfer-ownership="none">
- <doc xml:space="preserve">buffer size</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="date" transfer-ownership="none">
- <doc xml:space="preserve">valid #GDate</doc>
- <type name="Date" c:type="const GDate*"/>
- </parameter>
- </parameters>
- </function>
- <function name="date_time_compare"
- c:identifier="g_date_time_compare"
- moved-to="DateTime.compare"
- version="2.26">
- <doc xml:space="preserve">A comparison function for #GDateTimes that is suitable
- as a #GCompareFunc. Both #GDateTimes must be non-%NULL.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">-1, 0 or 1 if @dt1 is less than, equal to or greater
- than @dt2.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="dt1" transfer-ownership="none">
- <doc xml:space="preserve">first #GDateTime to compare</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="dt2" transfer-ownership="none">
- <doc xml:space="preserve">second #GDateTime to compare</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="date_time_equal"
- c:identifier="g_date_time_equal"
- moved-to="DateTime.equal"
- version="2.26">
- <doc xml:space="preserve">Checks to see if @dt1 and @dt2 are equal.
- Equal here means that they represent the same moment after converting
- them to the same time zone.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @dt1 and @dt2 are equal</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="dt1" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="dt2" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="date_time_hash"
- c:identifier="g_date_time_hash"
- moved-to="DateTime.hash"
- version="2.26">
- <doc xml:space="preserve">Hashes @datetime into a #guint, suitable for use within #GHashTable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #guint containing the hash</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="datetime" transfer-ownership="none">
- <doc xml:space="preserve">a #GDateTime</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="date_valid_day"
- c:identifier="g_date_valid_day"
- moved-to="Date.valid_day">
- <doc xml:space="preserve">Returns %TRUE if the day of the month is valid (a day is valid if it's
- between 1 and 31 inclusive).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the day is valid</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="day" transfer-ownership="none">
- <doc xml:space="preserve">day to check</doc>
- <type name="DateDay" c:type="GDateDay"/>
- </parameter>
- </parameters>
- </function>
- <function name="date_valid_dmy"
- c:identifier="g_date_valid_dmy"
- moved-to="Date.valid_dmy">
- <doc xml:space="preserve">Returns %TRUE if the day-month-year triplet forms a valid, existing day
- in the range of days #GDate understands (Year 1 or later, no more than
- a few thousand years in the future).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the date is a valid one</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="day" transfer-ownership="none">
- <doc xml:space="preserve">day</doc>
- <type name="DateDay" c:type="GDateDay"/>
- </parameter>
- <parameter name="month" transfer-ownership="none">
- <doc xml:space="preserve">month</doc>
- <type name="DateMonth" c:type="GDateMonth"/>
- </parameter>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">year</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </function>
- <function name="date_valid_julian"
- c:identifier="g_date_valid_julian"
- moved-to="Date.valid_julian">
- <doc xml:space="preserve">Returns %TRUE if the Julian day is valid. Anything greater than zero
- is basically a valid Julian, though there is a 32-bit limit.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the Julian day is valid</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="julian_date" transfer-ownership="none">
- <doc xml:space="preserve">Julian day to check</doc>
- <type name="guint32" c:type="guint32"/>
- </parameter>
- </parameters>
- </function>
- <function name="date_valid_month"
- c:identifier="g_date_valid_month"
- moved-to="Date.valid_month">
- <doc xml:space="preserve">Returns %TRUE if the month value is valid. The 12 #GDateMonth
- enumeration values are the only valid months.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the month is valid</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="month" transfer-ownership="none">
- <doc xml:space="preserve">month</doc>
- <type name="DateMonth" c:type="GDateMonth"/>
- </parameter>
- </parameters>
- </function>
- <function name="date_valid_weekday"
- c:identifier="g_date_valid_weekday"
- moved-to="Date.valid_weekday">
- <doc xml:space="preserve">Returns %TRUE if the weekday is valid. The seven #GDateWeekday enumeration
- values are the only valid weekdays.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the weekday is valid</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="weekday" transfer-ownership="none">
- <doc xml:space="preserve">weekday</doc>
- <type name="DateWeekday" c:type="GDateWeekday"/>
- </parameter>
- </parameters>
- </function>
- <function name="date_valid_year"
- c:identifier="g_date_valid_year"
- moved-to="Date.valid_year">
- <doc xml:space="preserve">Returns %TRUE if the year is valid. Any year greater than 0 is valid,
- though there is a 16-bit limit to what #GDate will understand.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the year is valid</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="year" transfer-ownership="none">
- <doc xml:space="preserve">year</doc>
- <type name="DateYear" c:type="GDateYear"/>
- </parameter>
- </parameters>
- </function>
- <function name="dcgettext" c:identifier="g_dcgettext" version="2.26">
- <doc xml:space="preserve">This is a variant of g_dgettext() that allows specifying a locale
- category instead of always using `LC_MESSAGES`. See g_dgettext() for
- more information about how this functions differs from calling
- dcgettext() directly.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the translated string for the given locale category</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the translation domain to use, or %NULL to use
- the domain set with textdomain()</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="msgid" transfer-ownership="none">
- <doc xml:space="preserve">message to translate</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="category" transfer-ownership="none">
- <doc xml:space="preserve">a locale category</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="dgettext" c:identifier="g_dgettext" version="2.18">
- <doc xml:space="preserve">This function is a wrapper of dgettext() which does not translate
- the message if the default domain as set with textdomain() has no
- translations for the current locale.
- The advantage of using this function over dgettext() proper is that
- libraries using this function (like GTK+) will not use translations
- if the application using the library does not have translations for
- the current locale. This results in a consistent English-only
- interface instead of one having partial translations. For this
- feature to work, the call to textdomain() and setlocale() should
- precede any g_dgettext() invocations. For GTK+, it means calling
- textdomain() before gtk_init or its variants.
- This function disables translations if and only if upon its first
- call all the following conditions hold:
- - @domain is not %NULL
- - textdomain() has been called to set a default text domain
- - there is no translations available for the default text domain
- and the current locale
- - current locale is not "C" or any English locales (those
- starting with "en_")
- Note that this behavior may not be desired for example if an application
- has its untranslated messages in a language other than English. In those
- cases the application should call textdomain() after initializing GTK+.
- Applications should normally not use this function directly,
- but use the _() macro for translations.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">The translated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the translation domain to use, or %NULL to use
- the domain set with textdomain()</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="msgid" transfer-ownership="none">
- <doc xml:space="preserve">message to translate</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="dir_make_tmp"
- c:identifier="g_dir_make_tmp"
- moved-to="Dir.make_tmp"
- version="2.30"
- throws="1">
- <doc xml:space="preserve">Creates a subdirectory in the preferred directory for temporary
- files (as returned by g_get_tmp_dir()).
- @tmpl should be a string in the GLib file name encoding containing
- a sequence of six 'X' characters, as the parameter to g_mkstemp().
- However, unlike these functions, the template should only be a
- basename, no directory components are allowed. If template is
- %NULL, a default template is used.
- Note that in contrast to g_mkdtemp() (and mkdtemp()) @tmpl is not
- modified, and might thus be a read-only literal string.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">The actual name used. This string
- should be freed with g_free() when not needed any longer and is
- is in the GLib file name encoding. In case of errors, %NULL is
- returned and @error will be set.</doc>
- <type name="filename" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="tmpl"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">Template for directory name,
- as in g_mkdtemp(), basename only, or %NULL for a default template</doc>
- <type name="filename" c:type="gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="direct_equal" c:identifier="g_direct_equal">
- <doc xml:space="preserve">Compares two #gpointer arguments and returns %TRUE if they are equal.
- It can be passed to g_hash_table_new() as the @key_equal_func
- parameter, when using opaque pointers compared by pointer value as
- keys in a #GHashTable.
- This equality function is also appropriate for keys that are integers
- stored in pointers, such as `GINT_TO_POINTER (n)`.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the two keys match.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="v1"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="v2"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key to compare with @v1</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="direct_hash" c:identifier="g_direct_hash">
- <doc xml:space="preserve">Converts a gpointer to a hash value.
- It can be passed to g_hash_table_new() as the @hash_func parameter,
- when using opaque pointers compared by pointer value as keys in a
- #GHashTable.
- This hash function is also appropriate for keys that are integers
- stored in pointers, such as `GINT_TO_POINTER (n)`.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a hash value corresponding to the key.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="v"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #gpointer key</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="dngettext" c:identifier="g_dngettext" version="2.18">
- <doc xml:space="preserve">This function is a wrapper of dngettext() which does not translate
- the message if the default domain as set with textdomain() has no
- translations for the current locale.
- See g_dgettext() for details of how this differs from dngettext()
- proper.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">The translated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the translation domain to use, or %NULL to use
- the domain set with textdomain()</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="msgid" transfer-ownership="none">
- <doc xml:space="preserve">message to translate</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="msgid_plural" transfer-ownership="none">
- <doc xml:space="preserve">plural form of the message</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the quantity for which translation is needed</doc>
- <type name="gulong" c:type="gulong"/>
- </parameter>
- </parameters>
- </function>
- <function name="double_equal" c:identifier="g_double_equal" version="2.22">
- <doc xml:space="preserve">Compares the two #gdouble values being pointed to and returns
- %TRUE if they are equal.
- It can be passed to g_hash_table_new() as the @key_equal_func
- parameter, when using non-%NULL pointers to doubles as keys in a
- #GHashTable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the two keys match.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="v1" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gdouble key</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="v2" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gdouble key to compare with @v1</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="double_hash" c:identifier="g_double_hash" version="2.22">
- <doc xml:space="preserve">Converts a pointer to a #gdouble to a hash value.
- It can be passed to g_hash_table_new() as the @hash_func parameter,
- It can be passed to g_hash_table_new() as the @hash_func parameter,
- when using non-%NULL pointers to doubles as keys in a #GHashTable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a hash value corresponding to the key.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="v" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gdouble key</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="dpgettext" c:identifier="g_dpgettext" version="2.16">
- <doc xml:space="preserve">This function is a variant of g_dgettext() which supports
- a disambiguating message context. GNU gettext uses the
- '\004' character to separate the message context and
- message id in @msgctxtid.
- If 0 is passed as @msgidoffset, this function will fall back to
- trying to use the deprecated convention of using "|" as a separation
- character.
- This uses g_dgettext() internally. See that functions for differences
- with dgettext() proper.
- Applications should normally not use this function directly,
- but use the C_() macro for translations with context.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">The translated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the translation domain to use, or %NULL to use
- the domain set with textdomain()</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="msgctxtid" transfer-ownership="none">
- <doc xml:space="preserve">a combined message context and message id, separated
- by a \004 character</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="msgidoffset" transfer-ownership="none">
- <doc xml:space="preserve">the offset of the message id in @msgctxid</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="dpgettext2" c:identifier="g_dpgettext2" version="2.18">
- <doc xml:space="preserve">This function is a variant of g_dgettext() which supports
- a disambiguating message context. GNU gettext uses the
- '\004' character to separate the message context and
- message id in @msgctxtid.
- This uses g_dgettext() internally. See that functions for differences
- with dgettext() proper.
- This function differs from C_() in that it is not a macro and
- thus you may use non-string-literals as context and msgid arguments.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">The translated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the translation domain to use, or %NULL to use
- the domain set with textdomain()</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="context" transfer-ownership="none">
- <doc xml:space="preserve">the message context</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="msgid" transfer-ownership="none">
- <doc xml:space="preserve">the message</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="environ_getenv"
- c:identifier="g_environ_getenv"
- version="2.32">
- <doc xml:space="preserve">Returns the value of the environment variable @variable in the
- provided list @envp.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value of the environment variable, or %NULL if
- the environment variable is not set in @envp. The returned
- string is owned by @envp, and will be freed if @variable is
- set or unset again.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="envp"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">an environment
- list (eg, as returned from g_get_environ()), or %NULL
- for an empty environment list</doc>
- <array c:type="gchar**">
- <type name="utf8" c:type="gchar*"/>
- </array>
- </parameter>
- <parameter name="variable" transfer-ownership="none">
- <doc xml:space="preserve">the environment variable to get</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="environ_setenv"
- c:identifier="g_environ_setenv"
- version="2.32">
- <doc xml:space="preserve">Sets the environment variable @variable in the provided list
- @envp to @value.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the
- updated environment list. Free it using g_strfreev().</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="envp"
- transfer-ownership="full"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">an
- environment list that can be freed using g_strfreev() (e.g., as
- returned from g_get_environ()), or %NULL for an empty
- environment list</doc>
- <array c:type="gchar**">
- <type name="utf8" c:type="gchar*"/>
- </array>
- </parameter>
- <parameter name="variable" transfer-ownership="none">
- <doc xml:space="preserve">the environment variable to set, must not contain '='</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">the value for to set the variable to</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="overwrite" transfer-ownership="none">
- <doc xml:space="preserve">whether to change the variable if it already exists</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </function>
- <function name="environ_unsetenv"
- c:identifier="g_environ_unsetenv"
- version="2.32">
- <doc xml:space="preserve">Removes the environment variable @variable from the provided
- environment @envp.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the
- updated environment list. Free it using g_strfreev().</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="envp"
- transfer-ownership="full"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">an environment
- list that can be freed using g_strfreev() (e.g., as returned from g_get_environ()),
- or %NULL for an empty environment list</doc>
- <array c:type="gchar**">
- <type name="utf8" c:type="gchar*"/>
- </array>
- </parameter>
- <parameter name="variable" transfer-ownership="none">
- <doc xml:space="preserve">the environment variable to remove, must not contain '='</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="file_error_from_errno"
- c:identifier="g_file_error_from_errno">
- <doc xml:space="preserve">Gets a #GFileError constant based on the passed-in @err_no.
- For example, if you pass in `EEXIST` this function returns
- #G_FILE_ERROR_EXIST. Unlike `errno` values, you can portably
- assume that all #GFileError values will exist.
- Normally a #GFileError value goes into a #GError returned
- from a function that manipulates files. So you would use
- g_file_error_from_errno() when constructing a #GError.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">#GFileError corresponding to the given @errno</doc>
- <type name="FileError" c:type="GFileError"/>
- </return-value>
- <parameters>
- <parameter name="err_no" transfer-ownership="none">
- <doc xml:space="preserve">an "errno" value</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="file_error_quark" c:identifier="g_file_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="file_get_contents"
- c:identifier="g_file_get_contents"
- throws="1">
- <doc xml:space="preserve">Reads an entire file into allocated memory, with good error
- checking.
- If the call was successful, it returns %TRUE and sets @contents to the file
- contents and @length to the length of the file contents in bytes. The string
- stored in @contents will be nul-terminated, so for text files you can pass
- %NULL for the @length argument. If the call was not successful, it returns
- %FALSE and sets @error. The error domain is #G_FILE_ERROR. Possible error
- codes are those in the #GFileError enumeration. In the error case,
- @contents is set to %NULL and @length is set to zero.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on success, %FALSE if an error occurred</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">name of a file to read contents from, in the GLib file name encoding</doc>
- <type name="filename" c:type="gchar*"/>
- </parameter>
- <parameter name="contents"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">location to store an allocated string, use g_free() to free
- the returned string</doc>
- <array length="2" zero-terminated="0" c:type="gchar**">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="length"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store length in bytes of the contents, or %NULL</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </function>
- <function name="file_open_tmp" c:identifier="g_file_open_tmp" throws="1">
- <doc xml:space="preserve">Opens a file for writing in the preferred directory for temporary
- files (as returned by g_get_tmp_dir()).
- @tmpl should be a string in the GLib file name encoding containing
- a sequence of six 'X' characters, as the parameter to g_mkstemp().
- However, unlike these functions, the template should only be a
- basename, no directory components are allowed. If template is
- %NULL, a default template is used.
- Note that in contrast to g_mkstemp() (and mkstemp()) @tmpl is not
- modified, and might thus be a read-only literal string.
- Upon success, and if @name_used is non-%NULL, the actual name used
- is returned in @name_used. This string should be freed with g_free()
- when not needed any longer. The returned name is in the GLib file
- name encoding.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">A file handle (as from open()) to the file opened for
- reading and writing. The file is opened in binary mode on platforms
- where there is a difference. The file handle should be closed with
- close(). In case of errors, -1 is returned and @error will be set.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="tmpl"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">Template for file name, as in
- g_mkstemp(), basename only, or %NULL for a default template</doc>
- <type name="filename" c:type="gchar*"/>
- </parameter>
- <parameter name="name_used"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">location to store actual name used,
- or %NULL</doc>
- <type name="filename" c:type="gchar**"/>
- </parameter>
- </parameters>
- </function>
- <function name="file_read_link"
- c:identifier="g_file_read_link"
- version="2.4"
- throws="1">
- <doc xml:space="preserve">Reads the contents of the symbolic link @filename like the POSIX
- readlink() function. The returned string is in the encoding used
- for filenames. Use g_filename_to_utf8() to convert it to UTF-8.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">A newly-allocated string with the contents of the symbolic link,
- or %NULL if an error occurred.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">the symbolic link</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="file_set_contents"
- c:identifier="g_file_set_contents"
- version="2.8"
- throws="1">
- <doc xml:space="preserve">Writes all of @contents to a file named @filename, with good error checking.
- If a file called @filename already exists it will be overwritten.
- This write is atomic in the sense that it is first written to a temporary
- file which is then renamed to the final name. Notes:
- - On UNIX, if @filename already exists hard links to @filename will break.
- Also since the file is recreated, existing permissions, access control
- lists, metadata etc. may be lost. If @filename is a symbolic link,
- the link itself will be replaced, not the linked file.
- - On Windows renaming a file will not remove an existing file with the
- new name, so on Windows there is a race condition between the existing
- file being removed and the temporary file being renamed.
- - On Windows there is no way to remove a file that is open to some
- process, or mapped into memory. Thus, this function will fail if
- @filename already exists and is open.
- If the call was successful, it returns %TRUE. If the call was not successful,
- it returns %FALSE and sets @error. The error domain is #G_FILE_ERROR.
- Possible error codes are those in the #GFileError enumeration.
- Note that the name for the temporary file is constructed by appending up
- to 7 characters to @filename.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on success, %FALSE if an error occurred</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">name of a file to write @contents to, in the GLib file name
- encoding</doc>
- <type name="filename" c:type="gchar*"/>
- </parameter>
- <parameter name="contents" transfer-ownership="none">
- <doc xml:space="preserve">string to write to the file</doc>
- <array length="2" zero-terminated="0" c:type="gchar*">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">length of @contents, or -1 if @contents is a nul-terminated string</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="file_test" c:identifier="g_file_test">
- <doc xml:space="preserve">Returns %TRUE if any of the tests in the bitfield @test are
- %TRUE. For example, `(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)`
- will return %TRUE if the file exists; the check whether it's a
- directory doesn't matter since the existence test is %TRUE. With
- the current set of available tests, there's no point passing in
- more than one test at a time.
- Apart from %G_FILE_TEST_IS_SYMLINK all tests follow symbolic links,
- so for a symbolic link to a regular file g_file_test() will return
- %TRUE for both %G_FILE_TEST_IS_SYMLINK and %G_FILE_TEST_IS_REGULAR.
- Note, that for a dangling symbolic link g_file_test() will return
- %TRUE for %G_FILE_TEST_IS_SYMLINK and %FALSE for all other flags.
- You should never use g_file_test() to test whether it is safe
- to perform an operation, because there is always the possibility
- of the condition changing before you actually perform the operation.
- For example, you might think you could use %G_FILE_TEST_IS_SYMLINK
- to know whether it is safe to write to a file without being
- tricked into writing into a different location. It doesn't work!
- |[<!-- language="C" -->
- // DON'T DO THIS
- if (!g_file_test (filename, G_FILE_TEST_IS_SYMLINK))
- {
- fd = g_open (filename, O_WRONLY);
- // write to fd
- }
- ]|
- Another thing to note is that %G_FILE_TEST_EXISTS and
- %G_FILE_TEST_IS_EXECUTABLE are implemented using the access()
- system call. This usually doesn't matter, but if your program
- is setuid or setgid it means that these tests will give you
- the answer for the real user ID and group ID, rather than the
- effective user ID and group ID.
- On Windows, there are no symlinks, so testing for
- %G_FILE_TEST_IS_SYMLINK will always return %FALSE. Testing for
- %G_FILE_TEST_IS_EXECUTABLE will just check that the file exists and
- its name indicates that it is executable, checking for well-known
- extensions and those listed in the `PATHEXT` environment variable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">whether a test was %TRUE</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">a filename to test in the GLib file name encoding</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="test" transfer-ownership="none">
- <doc xml:space="preserve">bitfield of #GFileTest flags</doc>
- <type name="FileTest" c:type="GFileTest"/>
- </parameter>
- </parameters>
- </function>
- <function name="filename_display_basename"
- c:identifier="g_filename_display_basename"
- version="2.6">
- <doc xml:space="preserve">Returns the display basename for the particular filename, guaranteed
- to be valid UTF-8. The display name might not be identical to the filename,
- for instance there might be problems converting it to UTF-8, and some files
- can be translated in the display.
- If GLib cannot make sense of the encoding of @filename, as a last resort it
- replaces unknown characters with U+FFFD, the Unicode replacement character.
- You can search the result for the UTF-8 encoding of this character (which is
- "\357\277\275" in octal notation) to find out if @filename was in an invalid
- encoding.
- You must pass the whole absolute pathname to this functions so that
- translation of well known locations can be done.
- This function is preferred over g_filename_display_name() if you know the
- whole path, as it allows translation.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string containing
- a rendition of the basename of the filename in valid UTF-8</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">an absolute pathname in the GLib file name encoding</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="filename_display_name"
- c:identifier="g_filename_display_name"
- version="2.6">
- <doc xml:space="preserve">Converts a filename into a valid UTF-8 string. The conversion is
- not necessarily reversible, so you should keep the original around
- and use the return value of this function only for display purposes.
- Unlike g_filename_to_utf8(), the result is guaranteed to be non-%NULL
- even if the filename actually isn't in the GLib file name encoding.
- If GLib cannot make sense of the encoding of @filename, as a last resort it
- replaces unknown characters with U+FFFD, the Unicode replacement character.
- You can search the result for the UTF-8 encoding of this character (which is
- "\357\277\275" in octal notation) to find out if @filename was in an invalid
- encoding.
- If you know the whole pathname of the file you should use
- g_filename_display_basename(), since that allows location-based
- translation of filenames.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string containing
- a rendition of the filename in valid UTF-8</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">a pathname hopefully in the GLib file name encoding</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="filename_from_uri"
- c:identifier="g_filename_from_uri"
- throws="1">
- <doc xml:space="preserve">Converts an escaped ASCII-encoded URI to a local filename in the
- encoding used for filenames.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string holding
- the resulting filename, or %NULL on an error.</doc>
- <type name="filename" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a uri describing a filename (escaped, encoded in ASCII).</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="hostname"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- nullable="1"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">Location to store hostname for the
- URI.
- If there is no hostname in the URI, %NULL will be
- stored in this location.</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- </parameters>
- </function>
- <function name="filename_from_utf8"
- c:identifier="g_filename_from_utf8"
- throws="1">
- <doc xml:space="preserve">Converts a string from UTF-8 to the encoding GLib uses for
- filenames. Note that on Windows GLib uses UTF-8 for filenames;
- on other platforms, this function indirectly depends on the
- [current locale][setlocale].</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">
- The converted string, or %NULL on an error.</doc>
- <array length="3" zero-terminated="0" c:type="gchar*">
- <type name="guint8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="utf8string" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the length of the string, or -1 if the string is
- nul-terminated.</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="bytes_read"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store the number of bytes in
- the input string that were successfully converted, or %NULL.
- Even if the conversion was successful, this may be
- less than @len if there were partial characters
- at the end of the input. If the error
- #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
- stored will the byte offset after the last valid
- input sequence.</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- <parameter name="bytes_written"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">the number of bytes stored in the output buffer (not
- including the terminating nul).</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </function>
- <function name="filename_to_uri"
- c:identifier="g_filename_to_uri"
- throws="1">
- <doc xml:space="preserve">Converts an absolute filename to an escaped ASCII-encoded URI, with the path
- component following Section 3.3. of RFC 2396.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string holding the resulting
- URI, or %NULL on an error.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">an absolute filename specified in the GLib file name encoding,
- which is the on-disk file name bytes on Unix, and UTF-8 on
- Windows</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="hostname"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">A UTF-8 encoded hostname, or %NULL for none.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="filename_to_utf8"
- c:identifier="g_filename_to_utf8"
- throws="1">
- <doc xml:space="preserve">Converts a string which is in the encoding used by GLib for
- filenames into a UTF-8 string. Note that on Windows GLib uses UTF-8
- for filenames; on other platforms, this function indirectly depends on
- the [current locale][setlocale].</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">The converted string, or %NULL on an error.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="opsysstring" transfer-ownership="none">
- <doc xml:space="preserve">a string in the encoding for filenames</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the length of the string, or -1 if the string is
- nul-terminated (Note that some encodings may allow nul
- bytes to occur inside strings. In that case, using -1
- for the @len parameter is unsafe)</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="bytes_read"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store the number of bytes in the
- input string that were successfully converted, or %NULL.
- Even if the conversion was successful, this may be
- less than @len if there were partial characters
- at the end of the input. If the error
- #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
- stored will the byte offset after the last valid
- input sequence.</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- <parameter name="bytes_written"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">the number of bytes stored in the output
- buffer (not including the terminating nul).</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </function>
- <function name="find_program_in_path"
- c:identifier="g_find_program_in_path">
- <doc xml:space="preserve">Locates the first executable named @program in the user's path, in the
- same way that execvp() would locate it. Returns an allocated string
- with the absolute path name, or %NULL if the program is not found in
- the path. If @program is already an absolute path, returns a copy of
- @program if @program exists and is executable, and %NULL otherwise.
-
- On Windows, if @program does not have a file type suffix, tries
- with the suffixes .exe, .cmd, .bat and .com, and the suffixes in
- the `PATHEXT` environment variable.
- On Windows, it looks for the file in the same way as CreateProcess()
- would. This means first in the directory where the executing
- program was loaded from, then in the current directory, then in the
- Windows 32-bit system directory, then in the Windows directory, and
- finally in the directories in the `PATH` environment variable. If
- the program is found, the return value contains the full name
- including the type suffix.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string with the absolute path, or %NULL</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="program" transfer-ownership="none">
- <doc xml:space="preserve">a program name in the GLib file name encoding</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="format_size" c:identifier="g_format_size" version="2.30">
- <doc xml:space="preserve">Formats a size (for example the size of a file) into a human readable
- string. Sizes are rounded to the nearest size prefix (kB, MB, GB)
- and are displayed rounded to the nearest tenth. E.g. the file size
- 3292528 bytes will be converted into the string "3.2 MB".
- The prefix units base is 1000 (i.e. 1 kB is 1000 bytes).
- This string should be freed with g_free() when not needed any longer.
- See g_format_size_full() for more options about how the size might be
- formatted.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated formatted string containing a human readable
- file size</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="size" transfer-ownership="none">
- <doc xml:space="preserve">a size in bytes</doc>
- <type name="guint64" c:type="guint64"/>
- </parameter>
- </parameters>
- </function>
- <function name="format_size_for_display"
- c:identifier="g_format_size_for_display"
- version="2.16"
- deprecated="1"
- deprecated-version="2.30">
- <doc xml:space="preserve">Formats a size (for example the size of a file) into a human
- readable string. Sizes are rounded to the nearest size prefix
- (KB, MB, GB) and are displayed rounded to the nearest tenth.
- E.g. the file size 3292528 bytes will be converted into the
- string "3.1 MB".
- The prefix units base is 1024 (i.e. 1 KB is 1024 bytes).
- This string should be freed with g_free() when not needed any longer.</doc>
- <doc-deprecated xml:space="preserve">This function is broken due to its use of SI
- suffixes to denote IEC units. Use g_format_size() instead.</doc-deprecated>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated formatted string containing a human
- readable file size</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="size" transfer-ownership="none">
- <doc xml:space="preserve">a size in bytes</doc>
- <type name="gint64" c:type="goffset"/>
- </parameter>
- </parameters>
- </function>
- <function name="format_size_full"
- c:identifier="g_format_size_full"
- version="2.30">
- <doc xml:space="preserve">Formats a size.
- This function is similar to g_format_size() but allows for flags
- that modify the output. See #GFormatSizeFlags.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated formatted string containing a human
- readable file size</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="size" transfer-ownership="none">
- <doc xml:space="preserve">a size in bytes</doc>
- <type name="guint64" c:type="guint64"/>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">#GFormatSizeFlags to modify the output</doc>
- <type name="FormatSizeFlags" c:type="GFormatSizeFlags"/>
- </parameter>
- </parameters>
- </function>
- <function name="fprintf"
- c:identifier="g_fprintf"
- version="2.2"
- introspectable="0">
- <doc xml:space="preserve">An implementation of the standard fprintf() function which supports
- positional parameters, as specified in the Single Unix Specification.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes printed.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="file" transfer-ownership="none">
- <doc xml:space="preserve">the stream to write to.</doc>
- <type name="gpointer" c:type="FILE*"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a standard printf() format string, but notice
- [string precision pitfalls][string-precision]</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the arguments to insert in the output.</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="free" c:identifier="g_free">
- <doc xml:space="preserve">Frees the memory pointed to by @mem.
- If @mem is %NULL it simply returns, so there is no need to check @mem
- against %NULL before calling this function.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="mem"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the memory to free</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="get_application_name"
- c:identifier="g_get_application_name"
- version="2.2">
- <doc xml:space="preserve">Gets a human-readable name for the application, as set by
- g_set_application_name(). This name should be localized if
- possible, and is intended for display to the user. Contrast with
- g_get_prgname(), which gets a non-localized name. If
- g_set_application_name() has not been called, returns the result of
- g_get_prgname() (which may be %NULL if g_set_prgname() has also not
- been called).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">human-readable application name. may return %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- </function>
- <function name="get_charset" c:identifier="g_get_charset">
- <doc xml:space="preserve">Obtains the character set for the [current locale][setlocale]; you
- might use this character set as an argument to g_convert(), to convert
- from the current locale's encoding to some other encoding. (Frequently
- g_locale_to_utf8() and g_locale_from_utf8() are nice shortcuts, though.)
- On Windows the character set returned by this function is the
- so-called system default ANSI code-page. That is the character set
- used by the "narrow" versions of C library and Win32 functions that
- handle file names. It might be different from the character set
- used by the C library's current locale.
- The return value is %TRUE if the locale's encoding is UTF-8, in that
- case you can perhaps avoid calling g_convert().
- The string returned in @charset is not allocated, and should not be
- freed.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the returned charset is UTF-8</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="charset"
- direction="out"
- caller-allocates="0"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for character set
- name, or %NULL.</doc>
- <type name="utf8" c:type="const char**"/>
- </parameter>
- </parameters>
- </function>
- <function name="get_codeset" c:identifier="g_get_codeset">
- <doc xml:space="preserve">Gets the character set for the current locale.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string containing the name
- of the character set. This string must be freed with g_free().</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- </function>
- <function name="get_current_dir" c:identifier="g_get_current_dir">
- <doc xml:space="preserve">Gets the current directory.
- The returned string should be freed when no longer needed.
- The encoding of the returned string is system defined.
- On Windows, it is always UTF-8.
- Since GLib 2.40, this function will return the value of the "PWD"
- environment variable if it is set and it happens to be the same as
- the current directory. This can make a difference in the case that
- the current directory is the target of a symbolic link.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the current directory</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- </function>
- <function name="get_current_time" c:identifier="g_get_current_time">
- <doc xml:space="preserve">Equivalent to the UNIX gettimeofday() function, but portable.
- You may find g_get_real_time() to be more convenient.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="result" transfer-ownership="none">
- <doc xml:space="preserve">#GTimeVal structure in which to store current time.</doc>
- <type name="TimeVal" c:type="GTimeVal*"/>
- </parameter>
- </parameters>
- </function>
- <function name="get_environ" c:identifier="g_get_environ" version="2.28">
- <doc xml:space="preserve">Gets the list of environment variables for the current process.
- The list is %NULL terminated and each item in the list is of the
- form 'NAME=VALUE'.
- This is equivalent to direct access to the 'environ' global variable,
- except portable.
- The return value is freshly allocated and it should be freed with
- g_strfreev() when it is no longer needed.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the list of
- environment variables</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- </function>
- <function name="get_filename_charsets"
- c:identifier="g_get_filename_charsets"
- version="2.6">
- <doc xml:space="preserve">Determines the preferred character sets used for filenames.
- The first character set from the @charsets is the filename encoding, the
- subsequent character sets are used when trying to generate a displayable
- representation of a filename, see g_filename_display_name().
- On Unix, the character sets are determined by consulting the
- environment variables `G_FILENAME_ENCODING` and `G_BROKEN_FILENAMES`.
- On Windows, the character set used in the GLib API is always UTF-8
- and said environment variables have no effect.
- `G_FILENAME_ENCODING` may be set to a comma-separated list of
- character set names. The special token "&commat;locale" is taken
- to mean the character set for the [current locale][setlocale].
- If `G_FILENAME_ENCODING` is not set, but `G_BROKEN_FILENAMES` is,
- the character set of the current locale is taken as the filename
- encoding. If neither environment variable is set, UTF-8 is taken
- as the filename encoding, but the character set of the current locale
- is also put in the list of encodings.
- The returned @charsets belong to GLib and must not be freed.
- Note that on Unix, regardless of the locale character set or
- `G_FILENAME_ENCODING` value, the actual file names present
- on a system might be in any random encoding or just gibberish.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the filename encoding is UTF-8.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="charsets" transfer-ownership="none">
- <doc xml:space="preserve">return location for the %NULL-terminated list of encoding names</doc>
- <type name="utf8" c:type="const gchar***"/>
- </parameter>
- </parameters>
- </function>
- <function name="get_home_dir" c:identifier="g_get_home_dir">
- <doc xml:space="preserve">Gets the current user's home directory.
- As with most UNIX tools, this function will return the value of the
- `HOME` environment variable if it is set to an existing absolute path
- name, falling back to the `passwd` file in the case that it is unset.
- If the path given in `HOME` is non-absolute, does not exist, or is
- not a directory, the result is undefined.
- Before version 2.36 this function would ignore the `HOME` environment
- variable, taking the value from the `passwd` database instead. This was
- changed to increase the compatibility of GLib with other programs (and
- the XDG basedir specification) and to increase testability of programs
- based on GLib (by making it easier to run them from test frameworks).
- If your program has a strong requirement for either the new or the
- old behaviour (and if you don't wish to increase your GLib
- dependency to ensure that the new behaviour is in effect) then you
- should either directly check the `HOME` environment variable yourself
- or unset it before calling any functions in GLib.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the current user's home directory</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- </function>
- <function name="get_host_name"
- c:identifier="g_get_host_name"
- version="2.8">
- <doc xml:space="preserve">Return a name for the machine.
- The returned name is not necessarily a fully-qualified domain name,
- or even present in DNS or some other name service at all. It need
- not even be unique on your local network or site, but usually it
- is. Callers should not rely on the return value having any specific
- properties like uniqueness for security purposes. Even if the name
- of the machine is changed while an application is running, the
- return value from this function does not change. The returned
- string is owned by GLib and should not be modified or freed. If no
- name can be determined, a default fixed string "localhost" is
- returned.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the host name of the machine.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- </function>
- <function name="get_language_names"
- c:identifier="g_get_language_names"
- version="2.6">
- <doc xml:space="preserve">Computes a list of applicable locale names, which can be used to
- e.g. construct locale-dependent filenames or search paths. The returned
- list is sorted from most desirable to least desirable and always contains
- the default locale "C".
- For example, if LANGUAGE=de:en_US, then the returned list is
- "de", "en_US", "en", "C".
- This function consults the environment variables `LANGUAGE`, `LC_ALL`,
- `LC_MESSAGES` and `LANG` to find the list of locales specified by the
- user.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a %NULL-terminated array of strings owned by GLib
- that must not be modified or freed.</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- </function>
- <function name="get_locale_variants"
- c:identifier="g_get_locale_variants"
- version="2.28">
- <doc xml:space="preserve">Returns a list of derived variants of @locale, which can be used to
- e.g. construct locale-dependent filenames or search paths. The returned
- list is sorted from most desirable to least desirable.
- This function handles territory, charset and extra locale modifiers.
- For example, if @locale is "fr_BE", then the returned list
- is "fr_BE", "fr".
- If you need the list of variants for the current locale,
- use g_get_language_names().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly
- allocated array of newly allocated strings with the locale variants. Free with
- g_strfreev().</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="locale" transfer-ownership="none">
- <doc xml:space="preserve">a locale identifier</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="get_monotonic_time"
- c:identifier="g_get_monotonic_time"
- version="2.28">
- <doc xml:space="preserve">Queries the system monotonic time.
- The monotonic clock will always increase and doesn't suffer
- discontinuities when the user (or NTP) changes the system time. It
- may or may not continue to tick during times where the machine is
- suspended.
- We try to use the clock that corresponds as closely as possible to
- the passage of time as measured by system calls such as poll() but it
- may not always be possible to do this.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the monotonic time, in microseconds</doc>
- <type name="gint64" c:type="gint64"/>
- </return-value>
- </function>
- <function name="get_num_processors"
- c:identifier="g_get_num_processors"
- version="2.36">
- <doc xml:space="preserve">Determine the approximate number of threads that the system will
- schedule simultaneously for this process. This is intended to be
- used as a parameter to g_thread_pool_new() for CPU bound tasks and
- similar cases.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">Number of schedulable threads, always greater than 0</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- </function>
- <function name="get_prgname" c:identifier="g_get_prgname">
- <doc xml:space="preserve">Gets the name of the program. This name should not be localized,
- in contrast to g_get_application_name().
- If you are using GDK or GTK+ the program name is set in gdk_init(),
- which is called by gtk_init(). The program name is found by taking
- the last component of @argv[0].</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the name of the program. The returned string belongs
- to GLib and must not be modified or freed.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- </function>
- <function name="get_real_name" c:identifier="g_get_real_name">
- <doc xml:space="preserve">Gets the real name of the user. This usually comes from the user's
- entry in the `passwd` file. The encoding of the returned string is
- system-defined. (On Windows, it is, however, always UTF-8.) If the
- real user name cannot be determined, the string "Unknown" is
- returned.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the user's real name.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- </function>
- <function name="get_real_time"
- c:identifier="g_get_real_time"
- version="2.28">
- <doc xml:space="preserve">Queries the system wall-clock time.
- This call is functionally equivalent to g_get_current_time() except
- that the return value is often more convenient than dealing with a
- #GTimeVal.
- You should only use this call if you are actually interested in the real
- wall-clock time. g_get_monotonic_time() is probably more useful for
- measuring intervals.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of microseconds since January 1, 1970 UTC.</doc>
- <type name="gint64" c:type="gint64"/>
- </return-value>
- </function>
- <function name="get_system_config_dirs"
- c:identifier="g_get_system_config_dirs"
- version="2.6">
- <doc xml:space="preserve">Returns an ordered list of base directories in which to access
- system-wide configuration information.
- On UNIX platforms this is determined using the mechanisms described
- in the
- [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec).
- In this case the list of directories retrieved will be `XDG_CONFIG_DIRS`.
- On Windows is the directory that contains application data for all users.
- A typical path is C:\Documents and Settings\All Users\Application Data.
- This folder is used for application data that is not user specific.
- For example, an application can store a spell-check dictionary, a database
- of clip art, or a log file in the CSIDL_COMMON_APPDATA folder.
- This information will not roam and is available to anyone using the computer.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a %NULL-terminated array of strings owned by GLib that must
- not be modified or freed.</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- </function>
- <function name="get_system_data_dirs"
- c:identifier="g_get_system_data_dirs"
- version="2.6">
- <doc xml:space="preserve">Returns an ordered list of base directories in which to access
- system-wide application data.
- On UNIX platforms this is determined using the mechanisms described
- in the
- [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec)
- In this case the list of directories retrieved will be XDG_DATA_DIRS.
- On Windows the first elements in the list are the Application Data
- and Documents folders for All Users. (These can be determined only
- on Windows 2000 or later and are not present in the list on other
- Windows versions.) See documentation for CSIDL_COMMON_APPDATA and
- CSIDL_COMMON_DOCUMENTS.
- Then follows the "share" subfolder in the installation folder for
- the package containing the DLL that calls this function, if it can
- be determined.
- Finally the list contains the "share" subfolder in the installation
- folder for GLib, and in the installation folder for the package the
- application's .exe file belongs to.
- The installation folders above are determined by looking up the
- folder where the module (DLL or EXE) in question is located. If the
- folder's name is "bin", its parent is used, otherwise the folder
- itself.
- Note that on Windows the returned list can vary depending on where
- this function is called.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a %NULL-terminated array of strings owned by GLib that must
- not be modified or freed.</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- </function>
- <function name="get_tmp_dir" c:identifier="g_get_tmp_dir">
- <doc xml:space="preserve">Gets the directory to use for temporary files.
- On UNIX, this is taken from the `TMPDIR` environment variable.
- If the variable is not set, `P_tmpdir` is
- used, as defined by the system C library. Failing that, a
- hard-coded default of "/tmp" is returned.
- On Windows, the `TEMP` environment variable is used, with the
- root directory of the Windows installation (eg: "C:\") used
- as a default.
- The encoding of the returned string is system-defined. On Windows,
- it is always UTF-8. The return value is never %NULL or the empty
- string.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the directory to use for temporary files.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- </function>
- <function name="get_user_cache_dir"
- c:identifier="g_get_user_cache_dir"
- version="2.6">
- <doc xml:space="preserve">Returns a base directory in which to store non-essential, cached
- data specific to particular user.
- On UNIX platforms this is determined using the mechanisms described
- in the
- [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec).
- In this case the directory retrieved will be XDG_CACHE_HOME.
- On Windows is the directory that serves as a common repository for
- temporary Internet files. A typical path is
- C:\Documents and Settings\username\Local Settings\Temporary Internet Files.
- See documentation for CSIDL_INTERNET_CACHE.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a string owned by GLib that must not be modified
- or freed.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- </function>
- <function name="get_user_config_dir"
- c:identifier="g_get_user_config_dir"
- version="2.6">
- <doc xml:space="preserve">Returns a base directory in which to store user-specific application
- configuration information such as user preferences and settings.
- On UNIX platforms this is determined using the mechanisms described
- in the
- [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec).
- In this case the directory retrieved will be `XDG_CONFIG_HOME`.
- On Windows this is the folder to use for local (as opposed to
- roaming) application data. See documentation for
- CSIDL_LOCAL_APPDATA. Note that on Windows it thus is the same as
- what g_get_user_data_dir() returns.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a string owned by GLib that must not be modified
- or freed.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- </function>
- <function name="get_user_data_dir"
- c:identifier="g_get_user_data_dir"
- version="2.6">
- <doc xml:space="preserve">Returns a base directory in which to access application data such
- as icons that is customized for a particular user.
- On UNIX platforms this is determined using the mechanisms described
- in the
- [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec).
- In this case the directory retrieved will be `XDG_DATA_HOME`.
- On Windows this is the folder to use for local (as opposed to
- roaming) application data. See documentation for
- CSIDL_LOCAL_APPDATA. Note that on Windows it thus is the same as
- what g_get_user_config_dir() returns.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a string owned by GLib that must not be modified
- or freed.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- </function>
- <function name="get_user_name" c:identifier="g_get_user_name">
- <doc xml:space="preserve">Gets the user name of the current user. The encoding of the returned
- string is system-defined. On UNIX, it might be the preferred file name
- encoding, or something else, and there is no guarantee that it is even
- consistent on a machine. On Windows, it is always UTF-8.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the user name of the current user.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- </function>
- <function name="get_user_runtime_dir"
- c:identifier="g_get_user_runtime_dir"
- version="2.28">
- <doc xml:space="preserve">Returns a directory that is unique to the current user on the local
- system.
- On UNIX platforms this is determined using the mechanisms described
- in the
- [XDG Base Directory Specification](http://www.freedesktop.org/Standards/basedir-spec).
- This is the directory
- specified in the `XDG_RUNTIME_DIR` environment variable.
- In the case that this variable is not set, we return the value of
- g_get_user_cache_dir(), after verifying that it exists.
- On Windows this is the folder to use for local (as opposed to
- roaming) application data. See documentation for
- CSIDL_LOCAL_APPDATA. Note that on Windows it thus is the same as
- what g_get_user_config_dir() returns.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a string owned by GLib that must not be modified or freed.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- </function>
- <function name="get_user_special_dir"
- c:identifier="g_get_user_special_dir"
- version="2.14">
- <doc xml:space="preserve">Returns the full path of a special directory using its logical id.
- On UNIX this is done using the XDG special user directories.
- For compatibility with existing practise, %G_USER_DIRECTORY_DESKTOP
- falls back to `$HOME/Desktop` when XDG special user directories have
- not been set up.
- Depending on the platform, the user might be able to change the path
- of the special directory without requiring the session to restart; GLib
- will not reflect any change once the special directories are loaded.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the path to the specified special directory, or %NULL
- if the logical id was not found. The returned string is owned by
- GLib and should not be modified or freed.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="directory" transfer-ownership="none">
- <doc xml:space="preserve">the logical id of special directory</doc>
- <type name="UserDirectory" c:type="GUserDirectory"/>
- </parameter>
- </parameters>
- </function>
- <function name="getenv" c:identifier="g_getenv">
- <doc xml:space="preserve">Returns the value of an environment variable.
- On UNIX, the name and value are byte strings which might or might not
- be in some consistent character set and encoding. On Windows, they are
- in UTF-8.
- On Windows, in case the environment variable's value contains
- references to other environment variables, they are expanded.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the value of the environment variable, or %NULL if
- the environment variable is not found. The returned string
- may be overwritten by the next call to g_getenv(), g_setenv()
- or g_unsetenv().</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="variable" transfer-ownership="none">
- <doc xml:space="preserve">the environment variable to get</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="hash_table_add"
- c:identifier="g_hash_table_add"
- moved-to="HashTable.add"
- version="2.32">
- <doc xml:space="preserve">This is a convenience function for using a #GHashTable as a set. It
- is equivalent to calling g_hash_table_replace() with @key as both the
- key and the value.
- When a hash table only ever contains keys that have themselves as the
- corresponding value it is able to be stored more efficiently. See
- the discussion in the section description.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key did not exist yet</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key to insert</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="hash_table_contains"
- c:identifier="g_hash_table_contains"
- moved-to="HashTable.contains"
- version="2.32">
- <doc xml:space="preserve">Checks if @key is in @hash_table.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @key is in @hash_table, %FALSE otherwise.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key to check</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="hash_table_destroy"
- c:identifier="g_hash_table_destroy"
- moved-to="HashTable.destroy">
- <doc xml:space="preserve">Destroys all keys and values in the #GHashTable and decrements its
- reference count by 1. If keys and/or values are dynamically allocated,
- you should either free them first or create the #GHashTable with destroy
- notifiers using g_hash_table_new_full(). In the latter case the destroy
- functions you supplied will be called on all keys and values during the
- destruction phase.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="hash_table_insert"
- c:identifier="g_hash_table_insert"
- moved-to="HashTable.insert">
- <doc xml:space="preserve">Inserts a new key and value into a #GHashTable.
- If the key already exists in the #GHashTable its current
- value is replaced with the new value. If you supplied a
- @value_destroy_func when creating the #GHashTable, the old
- value is freed using that function. If you supplied a
- @key_destroy_func when creating the #GHashTable, the passed
- key is freed using that function.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key did not exist yet</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key to insert</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="value"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the value to associate with the key</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="hash_table_lookup"
- c:identifier="g_hash_table_lookup"
- moved-to="HashTable.lookup">
- <doc xml:space="preserve">Looks up a key in a #GHashTable. Note that this function cannot
- distinguish between a key that is not present and one which is present
- and has the value %NULL. If you need this distinction, use
- g_hash_table_lookup_extended().</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the associated value, or %NULL if the key is not found</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the key to look up</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="hash_table_lookup_extended"
- c:identifier="g_hash_table_lookup_extended"
- moved-to="HashTable.lookup_extended">
- <doc xml:space="preserve">Looks up a key in the #GHashTable, returning the original key and the
- associated value and a #gboolean which is %TRUE if the key was found. This
- is useful if you need to free the memory allocated for the original key,
- for example before calling g_hash_table_remove().
- You can actually pass %NULL for @lookup_key to test
- whether the %NULL key exists, provided the hash and equal functions
- of @hash_table are %NULL-safe.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key was found in the #GHashTable</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="lookup_key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the key to look up</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="orig_key"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- nullable="1"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the original key</doc>
- <type name="gpointer" c:type="gpointer*"/>
- </parameter>
- <parameter name="value"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- nullable="1"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for the value associated
- with the key</doc>
- <type name="gpointer" c:type="gpointer*"/>
- </parameter>
- </parameters>
- </function>
- <function name="hash_table_remove"
- c:identifier="g_hash_table_remove"
- moved-to="HashTable.remove">
- <doc xml:space="preserve">Removes a key and its associated value from a #GHashTable.
- If the #GHashTable was created using g_hash_table_new_full(), the
- key and value are freed using the supplied destroy functions, otherwise
- you have to make sure that any dynamically allocated values are freed
- yourself.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key was found and removed from the #GHashTable</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the key to remove</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="hash_table_remove_all"
- c:identifier="g_hash_table_remove_all"
- moved-to="HashTable.remove_all"
- version="2.12">
- <doc xml:space="preserve">Removes all keys and their associated values from a #GHashTable.
- If the #GHashTable was created using g_hash_table_new_full(),
- the keys and values are freed using the supplied destroy functions,
- otherwise you have to make sure that any dynamically allocated
- values are freed yourself.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="hash_table_replace"
- c:identifier="g_hash_table_replace"
- moved-to="HashTable.replace">
- <doc xml:space="preserve">Inserts a new key and value into a #GHashTable similar to
- g_hash_table_insert(). The difference is that if the key
- already exists in the #GHashTable, it gets replaced by the
- new key. If you supplied a @value_destroy_func when creating
- the #GHashTable, the old value is freed using that function.
- If you supplied a @key_destroy_func when creating the
- #GHashTable, the old key is freed using that function.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key did not exist yet</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a key to insert</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="value"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the value to associate with the key</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="hash_table_size"
- c:identifier="g_hash_table_size"
- moved-to="HashTable.size">
- <doc xml:space="preserve">Returns the number of elements contained in the #GHashTable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of key/value pairs in the #GHashTable.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="hash_table_steal"
- c:identifier="g_hash_table_steal"
- moved-to="HashTable.steal">
- <doc xml:space="preserve">Removes a key and its associated value from a #GHashTable without
- calling the key and value destroy functions.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the key was found and removed from the #GHashTable</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- <parameter name="key"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the key to remove</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="hash_table_steal_all"
- c:identifier="g_hash_table_steal_all"
- moved-to="HashTable.steal_all"
- version="2.12">
- <doc xml:space="preserve">Removes all keys and their associated values from a #GHashTable
- without calling the key and value destroy functions.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="hash_table_unref"
- c:identifier="g_hash_table_unref"
- moved-to="HashTable.unref"
- version="2.10">
- <doc xml:space="preserve">Atomically decrements the reference count of @hash_table by one.
- If the reference count drops to 0, all keys and values will be
- destroyed, and all memory allocated by the hash table is released.
- This function is MT-safe and may be called from any thread.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hash_table" transfer-ownership="none">
- <doc xml:space="preserve">a valid #GHashTable</doc>
- <type name="GLib.HashTable" c:type="GHashTable*">
- <type name="gpointer" c:type="gpointer"/>
- <type name="gpointer" c:type="gpointer"/>
- </type>
- </parameter>
- </parameters>
- </function>
- <function name="hook_destroy"
- c:identifier="g_hook_destroy"
- moved-to="Hook.destroy">
- <doc xml:space="preserve">Destroys a #GHook, given its ID.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the #GHook was found in the #GHookList and destroyed</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook_id" transfer-ownership="none">
- <doc xml:space="preserve">a hook ID</doc>
- <type name="gulong" c:type="gulong"/>
- </parameter>
- </parameters>
- </function>
- <function name="hook_destroy_link"
- c:identifier="g_hook_destroy_link"
- moved-to="Hook.destroy_link">
- <doc xml:space="preserve">Removes one #GHook from a #GHookList, marking it
- inactive and calling g_hook_unref() on it.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">the #GHook to remove</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- </parameters>
- </function>
- <function name="hook_free" c:identifier="g_hook_free" moved-to="Hook.free">
- <doc xml:space="preserve">Calls the #GHookList @finalize_hook function if it exists,
- and frees the memory allocated for the #GHook.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">the #GHook to free</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- </parameters>
- </function>
- <function name="hook_insert_before"
- c:identifier="g_hook_insert_before"
- moved-to="Hook.insert_before">
- <doc xml:space="preserve">Inserts a #GHook into a #GHookList, before a given #GHook.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="sibling"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the #GHook to insert the new #GHook before</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">the #GHook to insert</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- </parameters>
- </function>
- <function name="hook_prepend"
- c:identifier="g_hook_prepend"
- moved-to="Hook.prepend">
- <doc xml:space="preserve">Prepends a #GHook on the start of a #GHookList.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">the #GHook to add to the start of @hook_list</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- </parameters>
- </function>
- <function name="hook_unref"
- c:identifier="g_hook_unref"
- moved-to="Hook.unref">
- <doc xml:space="preserve">Decrements the reference count of a #GHook.
- If the reference count falls to 0, the #GHook is removed
- from the #GHookList and g_hook_free() is called to free it.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="hook_list" transfer-ownership="none">
- <doc xml:space="preserve">a #GHookList</doc>
- <type name="HookList" c:type="GHookList*"/>
- </parameter>
- <parameter name="hook" transfer-ownership="none">
- <doc xml:space="preserve">the #GHook to unref</doc>
- <type name="Hook" c:type="GHook*"/>
- </parameter>
- </parameters>
- </function>
- <function name="hostname_is_ascii_encoded"
- c:identifier="g_hostname_is_ascii_encoded"
- version="2.22">
- <doc xml:space="preserve">Tests if @hostname contains segments with an ASCII-compatible
- encoding of an Internationalized Domain Name. If this returns
- %TRUE, you should decode the hostname with g_hostname_to_unicode()
- before displaying it to the user.
- Note that a hostname might contain a mix of encoded and unencoded
- segments, and so it is possible for g_hostname_is_non_ascii() and
- g_hostname_is_ascii_encoded() to both return %TRUE for a name.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @hostname contains any ASCII-encoded
- segments.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hostname" transfer-ownership="none">
- <doc xml:space="preserve">a hostname</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="hostname_is_ip_address"
- c:identifier="g_hostname_is_ip_address"
- version="2.22">
- <doc xml:space="preserve">Tests if @hostname is the string form of an IPv4 or IPv6 address.
- (Eg, "192.168.0.1".)</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @hostname is an IP address</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hostname" transfer-ownership="none">
- <doc xml:space="preserve">a hostname (or IP address in string form)</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="hostname_is_non_ascii"
- c:identifier="g_hostname_is_non_ascii"
- version="2.22">
- <doc xml:space="preserve">Tests if @hostname contains Unicode characters. If this returns
- %TRUE, you need to encode the hostname with g_hostname_to_ascii()
- before using it in non-IDN-aware contexts.
- Note that a hostname might contain a mix of encoded and unencoded
- segments, and so it is possible for g_hostname_is_non_ascii() and
- g_hostname_is_ascii_encoded() to both return %TRUE for a name.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @hostname contains any non-ASCII characters</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="hostname" transfer-ownership="none">
- <doc xml:space="preserve">a hostname</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="hostname_to_ascii"
- c:identifier="g_hostname_to_ascii"
- version="2.22">
- <doc xml:space="preserve">Converts @hostname to its canonical ASCII form; an ASCII-only
- string containing no uppercase letters and not ending with a
- trailing dot.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">an ASCII hostname, which must be freed, or %NULL if
- @hostname is in some way invalid.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="hostname" transfer-ownership="none">
- <doc xml:space="preserve">a valid UTF-8 or ASCII hostname</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="hostname_to_unicode"
- c:identifier="g_hostname_to_unicode"
- version="2.22">
- <doc xml:space="preserve">Converts @hostname to its canonical presentation form; a UTF-8
- string in Unicode normalization form C, containing no uppercase
- letters, no forbidden characters, and no ASCII-encoded segments,
- and not ending with a trailing dot.
- Of course if @hostname is not an internationalized hostname, then
- the canonical presentation form will be entirely ASCII.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a UTF-8 hostname, which must be freed, or %NULL if
- @hostname is in some way invalid.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="hostname" transfer-ownership="none">
- <doc xml:space="preserve">a valid UTF-8 or ASCII hostname</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="iconv" c:identifier="g_iconv">
- <doc xml:space="preserve">Same as the standard UNIX routine iconv(), but
- may be implemented via libiconv on UNIX flavors that lack
- a native implementation.
- GLib provides g_convert() and g_locale_to_utf8() which are likely
- more convenient than the raw iconv wrappers.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">count of non-reversible conversions, or -1 on error</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <parameter name="converter" transfer-ownership="none">
- <doc xml:space="preserve">conversion descriptor from g_iconv_open()</doc>
- <type name="IConv" c:type="GIConv"/>
- </parameter>
- <parameter name="inbuf" transfer-ownership="none">
- <doc xml:space="preserve">bytes to convert</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- <parameter name="inbytes_left" transfer-ownership="none">
- <doc xml:space="preserve">inout parameter, bytes remaining to convert in @inbuf</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- <parameter name="outbuf" transfer-ownership="none">
- <doc xml:space="preserve">converted output bytes</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- <parameter name="outbytes_left" transfer-ownership="none">
- <doc xml:space="preserve">inout parameter, bytes available to fill in @outbuf</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </function>
- <function name="idle_add"
- c:identifier="g_idle_add"
- shadowed-by="idle_add_full"
- introspectable="0">
- <doc xml:space="preserve">Adds a function to be called whenever there are no higher priority
- events pending to the default main loop. The function is given the
- default idle priority, #G_PRIORITY_DEFAULT_IDLE. If the function
- returns %FALSE it is automatically removed from the list of event
- sources and will not be called again.
- See [memory management of sources][mainloop-memory-management] for details
- on how to handle the return value and memory management of @data.
- This internally creates a main loop source using g_idle_source_new()
- and attaches it to the global #GMainContext using g_source_attach(), so
- the callback will be invoked in whichever thread is running that main
- context. You can do these steps manually if you need greater control or to
- use a custom main context.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="function" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">function to call</doc>
- <type name="SourceFunc" c:type="GSourceFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @function.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="idle_add_full"
- c:identifier="g_idle_add_full"
- shadows="idle_add">
- <doc xml:space="preserve">Adds a function to be called whenever there are no higher priority
- events pending. If the function returns %FALSE it is automatically
- removed from the list of event sources and will not be called again.
- See [memory management of sources][mainloop-memory-management] for details
- on how to handle the return value and memory management of @data.
- This internally creates a main loop source using g_idle_source_new()
- and attaches it to the global #GMainContext using g_source_attach(), so
- the callback will be invoked in whichever thread is running that main
- context. You can do these steps manually if you need greater control or to
- use a custom main context.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="priority" transfer-ownership="none">
- <doc xml:space="preserve">the priority of the idle source. Typically this will be in the
- range between #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="function"
- transfer-ownership="none"
- scope="notified"
- closure="2"
- destroy="3">
- <doc xml:space="preserve">function to call</doc>
- <type name="SourceFunc" c:type="GSourceFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="notify"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">function to call when the idle is removed, or %NULL</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="idle_remove_by_data" c:identifier="g_idle_remove_by_data">
- <doc xml:space="preserve">Removes the idle function with the given data.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if an idle source was found and removed.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the data for the idle source's callback.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="idle_source_new" c:identifier="g_idle_source_new">
- <doc xml:space="preserve">Creates a new idle source.
- The source will not initially be associated with any #GMainContext
- and must be added to one with g_source_attach() before it will be
- executed. Note that the default priority for idle sources is
- %G_PRIORITY_DEFAULT_IDLE, as compared to other sources which
- have a default priority of %G_PRIORITY_DEFAULT.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly-created idle source</doc>
- <type name="Source" c:type="GSource*"/>
- </return-value>
- </function>
- <function name="int64_equal" c:identifier="g_int64_equal" version="2.22">
- <doc xml:space="preserve">Compares the two #gint64 values being pointed to and returns
- %TRUE if they are equal.
- It can be passed to g_hash_table_new() as the @key_equal_func
- parameter, when using non-%NULL pointers to 64-bit integers as keys in a
- #GHashTable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the two keys match.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="v1" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint64 key</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="v2" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint64 key to compare with @v1</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="int64_hash" c:identifier="g_int64_hash" version="2.22">
- <doc xml:space="preserve">Converts a pointer to a #gint64 to a hash value.
- It can be passed to g_hash_table_new() as the @hash_func parameter,
- when using non-%NULL pointers to 64-bit integer values as keys in a
- #GHashTable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a hash value corresponding to the key.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="v" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint64 key</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="int_equal" c:identifier="g_int_equal">
- <doc xml:space="preserve">Compares the two #gint values being pointed to and returns
- %TRUE if they are equal.
- It can be passed to g_hash_table_new() as the @key_equal_func
- parameter, when using non-%NULL pointers to integers as keys in a
- #GHashTable.
- Note that this function acts on pointers to #gint, not on #gint
- directly: if your hash table's keys are of the form
- `GINT_TO_POINTER (n)`, use g_direct_equal() instead.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the two keys match.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="v1" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint key</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="v2" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint key to compare with @v1</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="int_hash" c:identifier="g_int_hash">
- <doc xml:space="preserve">Converts a pointer to a #gint to a hash value.
- It can be passed to g_hash_table_new() as the @hash_func parameter,
- when using non-%NULL pointers to integer values as keys in a #GHashTable.
- Note that this function acts on pointers to #gint, not on #gint
- directly: if your hash table's keys are of the form
- `GINT_TO_POINTER (n)`, use g_direct_hash() instead.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a hash value corresponding to the key.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="v" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gint key</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="intern_static_string"
- c:identifier="g_intern_static_string"
- version="2.10">
- <doc xml:space="preserve">Returns a canonical representation for @string. Interned strings
- can be compared for equality by comparing the pointers, instead of
- using strcmp(). g_intern_static_string() does not copy the string,
- therefore @string must not be freed or modified.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a canonical representation for the string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="string"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a static string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="intern_string"
- c:identifier="g_intern_string"
- version="2.10">
- <doc xml:space="preserve">Returns a canonical representation for @string. Interned strings
- can be compared for equality by comparing the pointers, instead of
- using strcmp().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a canonical representation for the string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="string"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="io_add_watch"
- c:identifier="g_io_add_watch"
- shadowed-by="io_add_watch_full"
- introspectable="0">
- <doc xml:space="preserve">Adds the #GIOChannel into the default main loop context
- with the default priority.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the event source id</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </parameter>
- <parameter name="condition" transfer-ownership="none">
- <doc xml:space="preserve">the condition to watch for</doc>
- <type name="IOCondition" c:type="GIOCondition"/>
- </parameter>
- <parameter name="func" transfer-ownership="none" closure="3">
- <doc xml:space="preserve">the function to call when the condition is satisfied</doc>
- <type name="IOFunc" c:type="GIOFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to @func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="io_add_watch_full"
- c:identifier="g_io_add_watch_full"
- shadows="io_add_watch">
- <doc xml:space="preserve">Adds the #GIOChannel into the default main loop context
- with the given priority.
- This internally creates a main loop source using g_io_create_watch()
- and attaches it to the main loop context with g_source_attach().
- You can do these steps manually if you need greater control.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the event source id</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </parameter>
- <parameter name="priority" transfer-ownership="none">
- <doc xml:space="preserve">the priority of the #GIOChannel source</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="condition" transfer-ownership="none">
- <doc xml:space="preserve">the condition to watch for</doc>
- <type name="IOCondition" c:type="GIOCondition"/>
- </parameter>
- <parameter name="func"
- transfer-ownership="none"
- scope="notified"
- closure="4"
- destroy="5">
- <doc xml:space="preserve">the function to call when the condition is satisfied</doc>
- <type name="IOFunc" c:type="GIOFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data to pass to @func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="notify" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">the function to call when the source is removed</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="io_channel_error_from_errno"
- c:identifier="g_io_channel_error_from_errno"
- moved-to="IOChannel.error_from_errno">
- <doc xml:space="preserve">Converts an `errno` error number to a #GIOChannelError.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannelError error number, e.g.
- %G_IO_CHANNEL_ERROR_INVAL.</doc>
- <type name="IOChannelError" c:type="GIOChannelError"/>
- </return-value>
- <parameters>
- <parameter name="en" transfer-ownership="none">
- <doc xml:space="preserve">an `errno` error number, e.g. `EINVAL`</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="io_channel_error_quark"
- c:identifier="g_io_channel_error_quark"
- moved-to="IOChannel.error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="io_create_watch" c:identifier="g_io_create_watch">
- <doc xml:space="preserve">Creates a #GSource that's dispatched when @condition is met for the
- given @channel. For example, if condition is #G_IO_IN, the source will
- be dispatched when there's data available for reading.
- g_io_add_watch() is a simpler interface to this same functionality, for
- the case where you want to add the source to the default main loop context
- at the default priority.
- On Windows, polling a #GSource created to watch a channel for a socket
- puts the socket in non-blocking mode. This is a side-effect of the
- implementation and unavoidable.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </return-value>
- <parameters>
- <parameter name="channel" transfer-ownership="none">
- <doc xml:space="preserve">a #GIOChannel to watch</doc>
- <type name="IOChannel" c:type="GIOChannel*"/>
- </parameter>
- <parameter name="condition" transfer-ownership="none">
- <doc xml:space="preserve">conditions to watch for</doc>
- <type name="IOCondition" c:type="GIOCondition"/>
- </parameter>
- </parameters>
- </function>
- <function name="key_file_error_quark"
- c:identifier="g_key_file_error_quark"
- moved-to="KeyFile.error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="listenv" c:identifier="g_listenv" version="2.8">
- <doc xml:space="preserve">Gets the names of all variables set in the environment.
- Programs that want to be portable to Windows should typically use
- this function and g_getenv() instead of using the environ array
- from the C library directly. On Windows, the strings in the environ
- array are in system codepage encoding, while in most of the typical
- use cases for environment variables in GLib-using programs you want
- the UTF-8 encoding that this function and g_getenv() provide.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a %NULL-terminated
- list of strings which must be freed with g_strfreev().</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- </function>
- <function name="locale_from_utf8"
- c:identifier="g_locale_from_utf8"
- throws="1">
- <doc xml:space="preserve">Converts a string from UTF-8 to the encoding used for strings by
- the C runtime (usually the same as that used by the operating
- system) in the [current locale][setlocale]. On Windows this means
- the system codepage.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">A newly-allocated buffer containing the converted string,
- or %NULL on an error, and error will be set.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="utf8string" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the length of the string, or -1 if the string is
- nul-terminated (Note that some encodings may allow nul
- bytes to occur inside strings. In that case, using -1
- for the @len parameter is unsafe)</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="bytes_read"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store the number of bytes in the
- input string that were successfully converted, or %NULL.
- Even if the conversion was successful, this may be
- less than @len if there were partial characters
- at the end of the input. If the error
- #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
- stored will the byte offset after the last valid
- input sequence.</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- <parameter name="bytes_written"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">the number of bytes stored in the output
- buffer (not including the terminating nul).</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </function>
- <function name="locale_to_utf8" c:identifier="g_locale_to_utf8" throws="1">
- <doc xml:space="preserve">Converts a string which is in the encoding used for strings by
- the C runtime (usually the same as that used by the operating
- system) in the [current locale][setlocale] into a UTF-8 string.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">A newly-allocated buffer containing the converted string,
- or %NULL on an error, and error will be set.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="opsysstring" transfer-ownership="none">
- <doc xml:space="preserve">a string in the encoding of the current locale. On Windows
- this means the system codepage.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the length of the string, or -1 if the string is
- nul-terminated (Note that some encodings may allow nul
- bytes to occur inside strings. In that case, using -1
- for the @len parameter is unsafe)</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="bytes_read"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store the number of bytes in the
- input string that were successfully converted, or %NULL.
- Even if the conversion was successful, this may be
- less than @len if there were partial characters
- at the end of the input. If the error
- #G_CONVERT_ERROR_ILLEGAL_SEQUENCE occurs, the value
- stored will the byte offset after the last valid
- input sequence.</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- <parameter name="bytes_written"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">the number of bytes stored in the output
- buffer (not including the terminating nul).</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </function>
- <function name="log" c:identifier="g_log" introspectable="0">
- <doc xml:space="preserve">Logs an error or debugging message.
- If the log level has been set as fatal, the abort()
- function is called to terminate the program.
- If g_log_default_handler() is used as the log handler function, a new-line
- character will automatically be appended to @..., and need not be entered
- manually.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="log_domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the log domain, usually #G_LOG_DOMAIN, or %NULL
- for the default</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="log_level" transfer-ownership="none">
- <doc xml:space="preserve">the log level, either from #GLogLevelFlags
- or a user-defined level</doc>
- <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">the message format. See the printf() documentation</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the parameters to insert into the format string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="log_default_handler" c:identifier="g_log_default_handler">
- <doc xml:space="preserve">The default log handler set up by GLib; g_log_set_default_handler()
- allows to install an alternate default log handler.
- This is used if no log handler has been set for the particular log
- domain and log level combination. It outputs the message to stderr
- or stdout and if the log level is fatal it calls abort(). It automatically
- prints a new-line character after the message, so one does not need to be
- manually included in @message.
- The behavior of this log handler can be influenced by a number of
- environment variables:
- - `G_MESSAGES_PREFIXED`: A :-separated list of log levels for which
- messages should be prefixed by the program name and PID of the
- aplication.
- - `G_MESSAGES_DEBUG`: A space-separated list of log domains for
- which debug and informational messages are printed. By default
- these messages are not printed.
- stderr is used for levels %G_LOG_LEVEL_ERROR, %G_LOG_LEVEL_CRITICAL,
- %G_LOG_LEVEL_WARNING and %G_LOG_LEVEL_MESSAGE. stdout is used for
- the rest.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="log_domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the log domain of the message, or %NULL for the
- default "" application domain</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="log_level" transfer-ownership="none">
- <doc xml:space="preserve">the level of the message</doc>
- <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
- </parameter>
- <parameter name="message"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the message</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="unused_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data passed from g_log() which is unused</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="log_remove_handler" c:identifier="g_log_remove_handler">
- <doc xml:space="preserve">Removes the log handler.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="log_domain" transfer-ownership="none">
- <doc xml:space="preserve">the log domain</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="handler_id" transfer-ownership="none">
- <doc xml:space="preserve">the id of the handler, which was returned
- in g_log_set_handler()</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="log_set_always_fatal"
- c:identifier="g_log_set_always_fatal">
- <doc xml:space="preserve">Sets the message levels which are always fatal, in any log domain.
- When a message with any of these levels is logged the program terminates.
- You can only set the levels defined by GLib to be fatal.
- %G_LOG_LEVEL_ERROR is always fatal.
- You can also make some message levels fatal at runtime by setting
- the `G_DEBUG` environment variable (see
- [Running GLib Applications](glib-running.html)).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the old fatal mask</doc>
- <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
- </return-value>
- <parameters>
- <parameter name="fatal_mask" transfer-ownership="none">
- <doc xml:space="preserve">the mask containing bits set for each level
- of error which is to be fatal</doc>
- <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
- </parameter>
- </parameters>
- </function>
- <function name="log_set_default_handler"
- c:identifier="g_log_set_default_handler"
- version="2.6"
- introspectable="0">
- <doc xml:space="preserve">Installs a default log handler which is used if no
- log handler has been set for the particular log domain
- and log level combination. By default, GLib uses
- g_log_default_handler() as default log handler.</doc>
- <return-value>
- <doc xml:space="preserve">the previous default log handler</doc>
- <type name="LogFunc" c:type="GLogFunc"/>
- </return-value>
- <parameters>
- <parameter name="log_func" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">the log handler function</doc>
- <type name="LogFunc" c:type="GLogFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data passed to the log handler</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="log_set_fatal_mask" c:identifier="g_log_set_fatal_mask">
- <doc xml:space="preserve">Sets the log levels which are fatal in the given domain.
- %G_LOG_LEVEL_ERROR is always fatal.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the old fatal mask for the log domain</doc>
- <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
- </return-value>
- <parameters>
- <parameter name="log_domain" transfer-ownership="none">
- <doc xml:space="preserve">the log domain</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="fatal_mask" transfer-ownership="none">
- <doc xml:space="preserve">the new fatal mask</doc>
- <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
- </parameter>
- </parameters>
- </function>
- <function name="log_set_handler"
- c:identifier="g_log_set_handler"
- shadowed-by="log_set_handler_full"
- introspectable="0">
- <doc xml:space="preserve">Sets the log handler for a domain and a set of log levels.
- To handle fatal and recursive messages the @log_levels parameter
- must be combined with the #G_LOG_FLAG_FATAL and #G_LOG_FLAG_RECURSION
- bit flags.
- Note that since the #G_LOG_LEVEL_ERROR log level is always fatal, if
- you want to set a handler for this log level you must combine it with
- #G_LOG_FLAG_FATAL.
- Here is an example for adding a log handler for all warning messages
- in the default domain:
- |[<!-- language="C" -->
- g_log_set_handler (NULL, G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL
- | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
- ]|
- This example adds a log handler for all critical messages from GTK+:
- |[<!-- language="C" -->
- g_log_set_handler ("Gtk", G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL
- | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
- ]|
- This example adds a log handler for all messages from GLib:
- |[<!-- language="C" -->
- g_log_set_handler ("GLib", G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL
- | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
- ]|</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the id of the new handler</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="log_domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the log domain, or %NULL for the default ""
- application domain</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="log_levels" transfer-ownership="none">
- <doc xml:space="preserve">the log levels to apply the log handler for.
- To handle fatal and recursive messages as well, combine
- the log levels with the #G_LOG_FLAG_FATAL and
- #G_LOG_FLAG_RECURSION bit flags.</doc>
- <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
- </parameter>
- <parameter name="log_func" transfer-ownership="none" closure="3">
- <doc xml:space="preserve">the log handler function</doc>
- <type name="LogFunc" c:type="GLogFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data passed to the log handler</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="log_set_handler_full"
- c:identifier="g_log_set_handler_full"
- shadows="log_set_handler"
- version="2.46">
- <doc xml:space="preserve">Like g_log_sets_handler(), but takes a destroy notify for the @user_data.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the id of the new handler</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="log_domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the log domain, or %NULL for the default ""
- application domain</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="log_levels" transfer-ownership="none">
- <doc xml:space="preserve">the log levels to apply the log handler for.
- To handle fatal and recursive messages as well, combine
- the log levels with the #G_LOG_FLAG_FATAL and
- #G_LOG_FLAG_RECURSION bit flags.</doc>
- <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
- </parameter>
- <parameter name="log_func"
- transfer-ownership="none"
- scope="notified"
- closure="3"
- destroy="4">
- <doc xml:space="preserve">the log handler function</doc>
- <type name="LogFunc" c:type="GLogFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data passed to the log handler</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="destroy" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">destroy notify for @user_data, or %NULL</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="logv" c:identifier="g_logv" introspectable="0">
- <doc xml:space="preserve">Logs an error or debugging message.
- If the log level has been set as fatal, the abort()
- function is called to terminate the program.
- If g_log_default_handler() is used as the log handler function, a new-line
- character will automatically be appended to @..., and need not be entered
- manually.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="log_domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the log domain, or %NULL for the default ""
- application domain</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="log_level" transfer-ownership="none">
- <doc xml:space="preserve">the log level</doc>
- <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">the message format. See the printf() documentation</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="args" transfer-ownership="none">
- <doc xml:space="preserve">the parameters to insert into the format string</doc>
- <type name="va_list" c:type="va_list"/>
- </parameter>
- </parameters>
- </function>
- <function name="main_context_default"
- c:identifier="g_main_context_default"
- moved-to="MainContext.default">
- <doc xml:space="preserve">Returns the global default main context. This is the main context
- used for main loop functions when a main loop is not explicitly
- specified, and corresponds to the "main" main loop. See also
- g_main_context_get_thread_default().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the global default main context.</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </return-value>
- </function>
- <function name="main_context_get_thread_default"
- c:identifier="g_main_context_get_thread_default"
- moved-to="MainContext.get_thread_default"
- version="2.22">
- <doc xml:space="preserve">Gets the thread-default #GMainContext for this thread. Asynchronous
- operations that want to be able to be run in contexts other than
- the default one should call this method or
- g_main_context_ref_thread_default() to get a #GMainContext to add
- their #GSources to. (Note that even in single-threaded
- programs applications may sometimes want to temporarily push a
- non-default context, so it is not safe to assume that this will
- always return %NULL if you are running in the default thread.)
- If you need to hold a reference on the context, use
- g_main_context_ref_thread_default() instead.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the thread-default #GMainContext, or
- %NULL if the thread-default context is the global default context.</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </return-value>
- </function>
- <function name="main_context_ref_thread_default"
- c:identifier="g_main_context_ref_thread_default"
- moved-to="MainContext.ref_thread_default"
- version="2.32">
- <doc xml:space="preserve">Gets the thread-default #GMainContext for this thread, as with
- g_main_context_get_thread_default(), but also adds a reference to
- it with g_main_context_ref(). In addition, unlike
- g_main_context_get_thread_default(), if the thread-default context
- is the global default context, this will return that #GMainContext
- (with a ref added to it) rather than returning %NULL.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the thread-default #GMainContext. Unref
- with g_main_context_unref() when you are done with it.</doc>
- <type name="MainContext" c:type="GMainContext*"/>
- </return-value>
- </function>
- <function name="main_current_source"
- c:identifier="g_main_current_source"
- version="2.12">
- <doc xml:space="preserve">Returns the currently firing source for this thread.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">The currently firing source or %NULL.</doc>
- <type name="Source" c:type="GSource*"/>
- </return-value>
- </function>
- <function name="main_depth" c:identifier="g_main_depth">
- <doc xml:space="preserve">Returns the depth of the stack of calls to
- g_main_context_dispatch() on any #GMainContext in the current thread.
- That is, when called from the toplevel, it gives 0. When
- called from within a callback from g_main_context_iteration()
- (or g_main_loop_run(), etc.) it returns 1. When called from within
- a callback to a recursive call to g_main_context_iteration(),
- it returns 2. And so forth.
- This function is useful in a situation like the following:
- Imagine an extremely simple "garbage collected" system.
- |[<!-- language="C" -->
- static GList *free_list;
- gpointer
- allocate_memory (gsize size)
- {
- gpointer result = g_malloc (size);
- free_list = g_list_prepend (free_list, result);
- return result;
- }
- void
- free_allocated_memory (void)
- {
- GList *l;
- for (l = free_list; l; l = l->next);
- g_free (l->data);
- g_list_free (free_list);
- free_list = NULL;
- }
- [...]
- while (TRUE);
- {
- g_main_context_iteration (NULL, TRUE);
- free_allocated_memory();
- }
- ]|
- This works from an application, however, if you want to do the same
- thing from a library, it gets more difficult, since you no longer
- control the main loop. You might think you can simply use an idle
- function to make the call to free_allocated_memory(), but that
- doesn't work, since the idle function could be called from a
- recursive callback. This can be fixed by using g_main_depth()
- |[<!-- language="C" -->
- gpointer
- allocate_memory (gsize size)
- {
- FreeListBlock *block = g_new (FreeListBlock, 1);
- block->mem = g_malloc (size);
- block->depth = g_main_depth ();
- free_list = g_list_prepend (free_list, block);
- return block->mem;
- }
- void
- free_allocated_memory (void)
- {
- GList *l;
-
- int depth = g_main_depth ();
- for (l = free_list; l; );
- {
- GList *next = l->next;
- FreeListBlock *block = l->data;
- if (block->depth > depth)
- {
- g_free (block->mem);
- g_free (block);
- free_list = g_list_delete_link (free_list, l);
- }
-
- l = next;
- }
- }
- ]|
- There is a temptation to use g_main_depth() to solve
- problems with reentrancy. For instance, while waiting for data
- to be received from the network in response to a menu item,
- the menu item might be selected again. It might seem that
- one could make the menu item's callback return immediately
- and do nothing if g_main_depth() returns a value greater than 1.
- However, this should be avoided since the user then sees selecting
- the menu item do nothing. Furthermore, you'll find yourself adding
- these checks all over your code, since there are doubtless many,
- many things that the user could do. Instead, you can use the
- following techniques:
- 1. Use gtk_widget_set_sensitive() or modal dialogs to prevent
- the user from interacting with elements while the main
- loop is recursing.
- 2. Avoid main loop recursion in situations where you can't handle
- arbitrary callbacks. Instead, structure your code so that you
- simply return to the main loop and then get called again when
- there is more work to do.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">The main loop recursion level in the current thread</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- </function>
- <function name="malloc" c:identifier="g_malloc">
- <doc xml:space="preserve">Allocates @n_bytes bytes of memory.
- If @n_bytes is 0 it returns %NULL.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">a pointer to the allocated memory</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="n_bytes" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes to allocate</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="malloc0" c:identifier="g_malloc0">
- <doc xml:space="preserve">Allocates @n_bytes bytes of memory, initialized to 0's.
- If @n_bytes is 0 it returns %NULL.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">a pointer to the allocated memory</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="n_bytes" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes to allocate</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="malloc0_n" c:identifier="g_malloc0_n" version="2.24">
- <doc xml:space="preserve">This function is similar to g_malloc0(), allocating (@n_blocks * @n_block_bytes) bytes,
- but care is taken to detect possible overflow during multiplication.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">a pointer to the allocated memory</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="n_blocks" transfer-ownership="none">
- <doc xml:space="preserve">the number of blocks to allocate</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="n_block_bytes" transfer-ownership="none">
- <doc xml:space="preserve">the size of each block in bytes</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="malloc_n" c:identifier="g_malloc_n" version="2.24">
- <doc xml:space="preserve">This function is similar to g_malloc(), allocating (@n_blocks * @n_block_bytes) bytes,
- but care is taken to detect possible overflow during multiplication.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">a pointer to the allocated memory</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="n_blocks" transfer-ownership="none">
- <doc xml:space="preserve">the number of blocks to allocate</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="n_block_bytes" transfer-ownership="none">
- <doc xml:space="preserve">the size of each block in bytes</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="markup_collect_attributes"
- c:identifier="g_markup_collect_attributes"
- version="2.16"
- introspectable="0">
- <doc xml:space="preserve">Collects the attributes of the element from the data passed to the
- #GMarkupParser start_element function, dealing with common error
- conditions and supporting boolean values.
- This utility function is not required to write a parser but can save
- a lot of typing.
- The @element_name, @attribute_names, @attribute_values and @error
- parameters passed to the start_element callback should be passed
- unmodified to this function.
- Following these arguments is a list of "supported" attributes to collect.
- It is an error to specify multiple attributes with the same name. If any
- attribute not in the list appears in the @attribute_names array then an
- unknown attribute error will result.
- The #GMarkupCollectType field allows specifying the type of collection
- to perform and if a given attribute must appear or is optional.
- The attribute name is simply the name of the attribute to collect.
- The pointer should be of the appropriate type (see the descriptions
- under #GMarkupCollectType) and may be %NULL in case a particular
- attribute is to be allowed but ignored.
- This function deals with issuing errors for missing attributes
- (of type %G_MARKUP_ERROR_MISSING_ATTRIBUTE), unknown attributes
- (of type %G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE) and duplicate
- attributes (of type %G_MARKUP_ERROR_INVALID_CONTENT) as well
- as parse errors for boolean-valued attributes (again of type
- %G_MARKUP_ERROR_INVALID_CONTENT). In all of these cases %FALSE
- will be returned and @error will be set as appropriate.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if successful</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="element_name" transfer-ownership="none">
- <doc xml:space="preserve">the current tag name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="attribute_names" transfer-ownership="none">
- <doc xml:space="preserve">the attribute names</doc>
- <type name="utf8" c:type="const gchar**"/>
- </parameter>
- <parameter name="attribute_values" transfer-ownership="none">
- <doc xml:space="preserve">the attribute values</doc>
- <type name="utf8" c:type="const gchar**"/>
- </parameter>
- <parameter name="error" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #GError or %NULL</doc>
- <type name="Error" c:type="GError**"/>
- </parameter>
- <parameter name="first_type" transfer-ownership="none">
- <doc xml:space="preserve">the #GMarkupCollectType of the first attribute</doc>
- <type name="MarkupCollectType" c:type="GMarkupCollectType"/>
- </parameter>
- <parameter name="first_attr" transfer-ownership="none">
- <doc xml:space="preserve">the name of the first attribute</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">a pointer to the storage location of the first attribute
- (or %NULL), followed by more types names and pointers, ending
- with %G_MARKUP_COLLECT_INVALID</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="markup_error_quark" c:identifier="g_markup_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="markup_escape_text" c:identifier="g_markup_escape_text">
- <doc xml:space="preserve">Escapes text so that the markup parser will parse it verbatim.
- Less than, greater than, ampersand, etc. are replaced with the
- corresponding entities. This function would typically be used
- when writing out a file to be parsed with the markup parser.
- Note that this function doesn't protect whitespace and line endings
- from being processed according to the XML rules for normalization
- of line endings and attribute values.
- Note also that this function will produce character references in
- the range of &#x1; ... &#x1f; for all control sequences
- except for tabstop, newline and carriage return. The character
- references in this range are not valid XML 1.0, but they are
- valid XML 1.1 and will be accepted by the GMarkup parser.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string with the escaped text</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="text" transfer-ownership="none">
- <doc xml:space="preserve">some valid UTF-8 text</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">length of @text in bytes, or -1 if the text is nul-terminated</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="markup_printf_escaped"
- c:identifier="g_markup_printf_escaped"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Formats arguments according to @format, escaping
- all string and character arguments in the fashion
- of g_markup_escape_text(). This is useful when you
- want to insert literal strings into XML-style markup
- output, without having to worry that the strings
- might themselves contain markup.
- |[<!-- language="C" -->
- const char *store = "Fortnum & Mason";
- const char *item = "Tea";
- char *output;
- output = g_markup_printf_escaped ("<purchase>"
- "<store>%s</store>"
- "<item>%s</item>"
- "</purchase>",
- store, item);
- ]|</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">newly allocated result from formatting
- operation. Free with g_free().</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">printf() style format string</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the arguments to insert in the format string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="markup_vprintf_escaped"
- c:identifier="g_markup_vprintf_escaped"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Formats the data in @args according to @format, escaping
- all string and character arguments in the fashion
- of g_markup_escape_text(). See g_markup_printf_escaped().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">newly allocated result from formatting
- operation. Free with g_free().</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">printf() style format string</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="args" transfer-ownership="none">
- <doc xml:space="preserve">variable argument list, similar to vprintf()</doc>
- <type name="va_list" c:type="va_list"/>
- </parameter>
- </parameters>
- </function>
- <function name="mem_is_system_malloc"
- c:identifier="g_mem_is_system_malloc"
- deprecated="1"
- deprecated-version="2.46">
- <doc xml:space="preserve">Checks whether the allocator used by g_malloc() is the system's
- malloc implementation. If it returns %TRUE memory allocated with
- malloc() can be used interchangeable with memory allocated using g_malloc().
- This function is useful for avoiding an extra copy of allocated memory returned
- by a non-GLib-based API.</doc>
- <doc-deprecated xml:space="preserve">GLib always uses the system malloc, so this function always
- returns %TRUE.</doc-deprecated>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">if %TRUE, malloc() and g_malloc() can be mixed.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- </function>
- <function name="mem_profile"
- c:identifier="g_mem_profile"
- deprecated="1"
- deprecated-version="2.46">
- <doc xml:space="preserve">GLib used to support some tools for memory profiling, but this
- no longer works. There are many other useful tools for memory
- profiling these days which can be used instead.</doc>
- <doc-deprecated xml:space="preserve">Use other memory profiling tools instead</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- </function>
- <function name="mem_set_vtable"
- c:identifier="g_mem_set_vtable"
- deprecated="1"
- deprecated-version="2.46">
- <doc xml:space="preserve">This function used to let you override the memory allocation function.
- However, its use was incompatible with the use of global constructors
- in GLib and GIO, because those use the GLib allocators before main is
- reached. Therefore this function is now deprecated and is just a stub.</doc>
- <doc-deprecated xml:space="preserve">Use other memory profiling tools instead</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="vtable" transfer-ownership="none">
- <doc xml:space="preserve">table of memory allocation routines.</doc>
- <type name="MemVTable" c:type="GMemVTable*"/>
- </parameter>
- </parameters>
- </function>
- <function name="memdup" c:identifier="g_memdup">
- <doc xml:space="preserve">Allocates @byte_size bytes of memory, and copies @byte_size bytes into it
- from @mem. If @mem is %NULL it returns %NULL.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">a pointer to the newly-allocated copy of the memory, or %NULL if @mem
- is %NULL.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="mem"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the memory to copy.</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="byte_size" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes to copy.</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="mkdir_with_parents"
- c:identifier="g_mkdir_with_parents"
- version="2.8">
- <doc xml:space="preserve">Create a directory if it doesn't already exist. Create intermediate
- parent directories as needed, too.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">0 if the directory already exists, or was successfully
- created. Returns -1 if an error occurred, with errno set.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="pathname" transfer-ownership="none">
- <doc xml:space="preserve">a pathname in the GLib file name encoding</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="mode" transfer-ownership="none">
- <doc xml:space="preserve">permissions to use for newly created directories</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="mkdtemp" c:identifier="g_mkdtemp" version="2.30">
- <doc xml:space="preserve">Creates a temporary directory. See the mkdtemp() documentation
- on most UNIX-like systems.
- The parameter is a string that should follow the rules for
- mkdtemp() templates, i.e. contain the string "XXXXXX".
- g_mkdtemp() is slightly more flexible than mkdtemp() in that the
- sequence does not have to occur at the very end of the template
- and you can pass a @mode and additional @flags. The X string will
- be modified to form the name of a directory that didn't exist.
- The string should be in the GLib file name encoding. Most importantly,
- on Windows it should be in UTF-8.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">A pointer to @tmpl, which has been modified
- to hold the directory name. In case of errors, %NULL is
- returned and %errno will be set.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="tmpl" transfer-ownership="none">
- <doc xml:space="preserve">template directory name</doc>
- <type name="filename" c:type="gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="mkdtemp_full" c:identifier="g_mkdtemp_full" version="2.30">
- <doc xml:space="preserve">Creates a temporary directory. See the mkdtemp() documentation
- on most UNIX-like systems.
- The parameter is a string that should follow the rules for
- mkdtemp() templates, i.e. contain the string "XXXXXX".
- g_mkdtemp() is slightly more flexible than mkdtemp() in that the
- sequence does not have to occur at the very end of the template
- and you can pass a @mode. The X string will be modified to form
- the name of a directory that didn't exist. The string should be
- in the GLib file name encoding. Most importantly, on Windows it
- should be in UTF-8.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">A pointer to @tmpl, which has been modified
- to hold the directory name. In case of errors, %NULL is
- returned, and %errno will be set.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="tmpl" transfer-ownership="none">
- <doc xml:space="preserve">template directory name</doc>
- <type name="filename" c:type="gchar*"/>
- </parameter>
- <parameter name="mode" transfer-ownership="none">
- <doc xml:space="preserve">permissions to create the temporary directory with</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="mkstemp" c:identifier="g_mkstemp">
- <doc xml:space="preserve">Opens a temporary file. See the mkstemp() documentation
- on most UNIX-like systems.
- The parameter is a string that should follow the rules for
- mkstemp() templates, i.e. contain the string "XXXXXX".
- g_mkstemp() is slightly more flexible than mkstemp() in that the
- sequence does not have to occur at the very end of the template.
- The X string will be modified to form the name of a file that
- didn't exist. The string should be in the GLib file name encoding.
- Most importantly, on Windows it should be in UTF-8.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">A file handle (as from open()) to the file
- opened for reading and writing. The file is opened in binary
- mode on platforms where there is a difference. The file handle
- should be closed with close(). In case of errors, -1 is
- returned and %errno will be set.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="tmpl" transfer-ownership="none">
- <doc xml:space="preserve">template filename</doc>
- <type name="filename" c:type="gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="mkstemp_full" c:identifier="g_mkstemp_full" version="2.22">
- <doc xml:space="preserve">Opens a temporary file. See the mkstemp() documentation
- on most UNIX-like systems.
- The parameter is a string that should follow the rules for
- mkstemp() templates, i.e. contain the string "XXXXXX".
- g_mkstemp_full() is slightly more flexible than mkstemp()
- in that the sequence does not have to occur at the very end of the
- template and you can pass a @mode and additional @flags. The X
- string will be modified to form the name of a file that didn't exist.
- The string should be in the GLib file name encoding. Most importantly,
- on Windows it should be in UTF-8.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">A file handle (as from open()) to the file
- opened for reading and writing. The file handle should be
- closed with close(). In case of errors, -1 is returned
- and %errno will be set.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="tmpl" transfer-ownership="none">
- <doc xml:space="preserve">template filename</doc>
- <type name="filename" c:type="gchar*"/>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">flags to pass to an open() call in addition to O_EXCL
- and O_CREAT, which are passed automatically</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="mode" transfer-ownership="none">
- <doc xml:space="preserve">permissions to create the temporary file with</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="nullify_pointer" c:identifier="g_nullify_pointer">
- <doc xml:space="preserve">Set the pointer at the specified location to %NULL.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="nullify_location" transfer-ownership="none">
- <doc xml:space="preserve">the memory address of the pointer.</doc>
- <type name="gpointer" c:type="gpointer*"/>
- </parameter>
- </parameters>
- </function>
- <function name="on_error_query" c:identifier="g_on_error_query">
- <doc xml:space="preserve">Prompts the user with
- `[E]xit, [H]alt, show [S]tack trace or [P]roceed`.
- This function is intended to be used for debugging use only.
- The following example shows how it can be used together with
- the g_log() functions.
- |[<!-- language="C" -->
- #include <glib.h>
- static void
- log_handler (const gchar *log_domain,
- GLogLevelFlags log_level,
- const gchar *message,
- gpointer user_data)
- {
- g_log_default_handler (log_domain, log_level, message, user_data);
- g_on_error_query (MY_PROGRAM_NAME);
- }
- int
- main (int argc, char *argv[])
- {
- g_log_set_handler (MY_LOG_DOMAIN,
- G_LOG_LEVEL_WARNING |
- G_LOG_LEVEL_ERROR |
- G_LOG_LEVEL_CRITICAL,
- log_handler,
- NULL);
- ...
- ]|
- If "[E]xit" is selected, the application terminates with a call
- to _exit(0).
- If "[S]tack" trace is selected, g_on_error_stack_trace() is called.
- This invokes gdb, which attaches to the current process and shows
- a stack trace. The prompt is then shown again.
- If "[P]roceed" is selected, the function returns.
- This function may cause different actions on non-UNIX platforms.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="prg_name" transfer-ownership="none">
- <doc xml:space="preserve">the program name, needed by gdb for the "[S]tack trace"
- option. If @prg_name is %NULL, g_get_prgname() is called to get
- the program name (which will work correctly if gdk_init() or
- gtk_init() has been called)</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="on_error_stack_trace"
- c:identifier="g_on_error_stack_trace">
- <doc xml:space="preserve">Invokes gdb, which attaches to the current process and shows a
- stack trace. Called by g_on_error_query() when the "[S]tack trace"
- option is selected. You can get the current process's program name
- with g_get_prgname(), assuming that you have called gtk_init() or
- gdk_init().
- This function may cause different actions on non-UNIX platforms.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="prg_name" transfer-ownership="none">
- <doc xml:space="preserve">the program name, needed by gdb for the "[S]tack trace"
- option</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="once_init_enter"
- c:identifier="g_once_init_enter"
- moved-to="Once.init_enter"
- version="2.14">
- <doc xml:space="preserve">Function to be called when starting a critical initialization
- section. The argument @location must point to a static
- 0-initialized variable that will be set to a value other than 0 at
- the end of the initialization section. In combination with
- g_once_init_leave() and the unique address @value_location, it can
- be ensured that an initialization section will be executed only once
- during a program's life time, and that concurrent threads are
- blocked until initialization completed. To be used in constructs
- like this:
- |[<!-- language="C" -->
- static gsize initialization_value = 0;
- if (g_once_init_enter (&initialization_value))
- {
- gsize setup_value = 42; // initialization code here
- g_once_init_leave (&initialization_value, setup_value);
- }
- // use initialization_value here
- ]|</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the initialization section should be entered,
- %FALSE and blocks otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="location" transfer-ownership="none">
- <doc xml:space="preserve">location of a static initializable variable
- containing 0</doc>
- <type name="gpointer" c:type="void*"/>
- </parameter>
- </parameters>
- </function>
- <function name="once_init_leave"
- c:identifier="g_once_init_leave"
- moved-to="Once.init_leave"
- version="2.14">
- <doc xml:space="preserve">Counterpart to g_once_init_enter(). Expects a location of a static
- 0-initialized initialization variable, and an initialization value
- other than 0. Sets the variable to the initialization value, and
- releases concurrent threads blocking in g_once_init_enter() on this
- initialization variable.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="location" transfer-ownership="none">
- <doc xml:space="preserve">location of a static initializable variable
- containing 0</doc>
- <type name="gpointer" c:type="void*"/>
- </parameter>
- <parameter name="result" transfer-ownership="none">
- <doc xml:space="preserve">new non-0 value for *@value_location</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="option_error_quark" c:identifier="g_option_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="parse_debug_string" c:identifier="g_parse_debug_string">
- <doc xml:space="preserve">Parses a string containing debugging options
- into a %guint containing bit flags. This is used
- within GDK and GTK+ to parse the debug options passed on the
- command line or through environment variables.
- If @string is equal to "all", all flags are set. Any flags
- specified along with "all" in @string are inverted; thus,
- "all,foo,bar" or "foo,bar,all" sets all flags except those
- corresponding to "foo" and "bar".
- If @string is equal to "help", all the available keys in @keys
- are printed out to standard error.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the combined set of bit flags.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="string"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a list of debug options separated by colons, spaces, or
- commas, or %NULL.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="keys" transfer-ownership="none">
- <doc xml:space="preserve">pointer to an array of #GDebugKey which associate
- strings with bit flags.</doc>
- <array length="2" zero-terminated="0" c:type="GDebugKey*">
- <type name="DebugKey" c:type="GDebugKey"/>
- </array>
- </parameter>
- <parameter name="nkeys" transfer-ownership="none">
- <doc xml:space="preserve">the number of #GDebugKeys in the array.</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="path_get_basename" c:identifier="g_path_get_basename">
- <doc xml:space="preserve">Gets the last component of the filename.
- If @file_name ends with a directory separator it gets the component
- before the last slash. If @file_name consists only of directory
- separators (and on Windows, possibly a drive letter), a single
- separator is returned. If @file_name is empty, it gets ".".</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string containing the last
- component of the filename</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="file_name" transfer-ownership="none">
- <doc xml:space="preserve">the name of the file</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="path_get_dirname" c:identifier="g_path_get_dirname">
- <doc xml:space="preserve">Gets the directory components of a file name.
- If the file name has no directory components "." is returned.
- The returned string should be freed when no longer needed.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the directory components of the file</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="file_name" transfer-ownership="none">
- <doc xml:space="preserve">the name of the file</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="path_is_absolute" c:identifier="g_path_is_absolute">
- <doc xml:space="preserve">Returns %TRUE if the given @file_name is an absolute file name.
- Note that this is a somewhat vague concept on Windows.
- On POSIX systems, an absolute file name is well-defined. It always
- starts from the single root directory. For example "/usr/local".
- On Windows, the concepts of current drive and drive-specific
- current directory introduce vagueness. This function interprets as
- an absolute file name one that either begins with a directory
- separator such as "\Users\tml" or begins with the root on a drive,
- for example "C:\Windows". The first case also includes UNC paths
- such as "\\myserver\docs\foo". In all cases, either slashes or
- backslashes are accepted.
- Note that a file name relative to the current drive root does not
- truly specify a file uniquely over time and across processes, as
- the current drive is a per-process value and can be changed.
- File names relative the current directory on some specific drive,
- such as "D:foo/bar", are not interpreted as absolute by this
- function, but they obviously are not relative to the normal current
- directory as returned by getcwd() or g_get_current_dir()
- either. Such paths should be avoided, or need to be handled using
- Windows-specific code.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @file_name is absolute</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="file_name" transfer-ownership="none">
- <doc xml:space="preserve">a file name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="path_skip_root" c:identifier="g_path_skip_root">
- <doc xml:space="preserve">Returns a pointer into @file_name after the root component,
- i.e. after the "/" in UNIX or "C:\" under Windows. If @file_name
- is not an absolute path it returns %NULL.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">a pointer into @file_name after the root component</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="file_name" transfer-ownership="none">
- <doc xml:space="preserve">a file name</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="pattern_match" c:identifier="g_pattern_match">
- <doc xml:space="preserve">Matches a string against a compiled pattern. Passing the correct
- length of the string given is mandatory. The reversed string can be
- omitted by passing %NULL, this is more efficient if the reversed
- version of the string to be matched is not at hand, as
- g_pattern_match() will only construct it if the compiled pattern
- requires reverse matches.
- Note that, if the user code will (possibly) match a string against a
- multitude of patterns containing wildcards, chances are high that
- some patterns will require a reversed string. In this case, it's
- more efficient to provide the reversed string to avoid multiple
- constructions thereof in the various calls to g_pattern_match().
- Note also that the reverse of a UTF-8 encoded string can in general
- not be obtained by g_strreverse(). This works only if the string
- does not contain any multibyte characters. GLib offers the
- g_utf8_strreverse() function to reverse UTF-8 encoded strings.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @string matches @pspec</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="pspec" transfer-ownership="none">
- <doc xml:space="preserve">a #GPatternSpec</doc>
- <type name="PatternSpec" c:type="GPatternSpec*"/>
- </parameter>
- <parameter name="string_length" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string (in bytes, i.e. strlen(),
- not g_utf8_strlen())</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the UTF-8 encoded string to match</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="string_reversed"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the reverse of @string or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="pattern_match_simple"
- c:identifier="g_pattern_match_simple">
- <doc xml:space="preserve">Matches a string against a pattern given as a string. If this
- function is to be called in a loop, it's more efficient to compile
- the pattern once with g_pattern_spec_new() and call
- g_pattern_match_string() repeatedly.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @string matches @pspec</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="pattern" transfer-ownership="none">
- <doc xml:space="preserve">the UTF-8 encoded pattern</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the UTF-8 encoded string to match</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="pattern_match_string"
- c:identifier="g_pattern_match_string">
- <doc xml:space="preserve">Matches a string against a compiled pattern. If the string is to be
- matched against more than one pattern, consider using
- g_pattern_match() instead while supplying the reversed string.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @string matches @pspec</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="pspec" transfer-ownership="none">
- <doc xml:space="preserve">a #GPatternSpec</doc>
- <type name="PatternSpec" c:type="GPatternSpec*"/>
- </parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the UTF-8 encoded string to match</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="pointer_bit_lock"
- c:identifier="g_pointer_bit_lock"
- version="2.30">
- <doc xml:space="preserve">This is equivalent to g_bit_lock, but working on pointers (or other
- pointer-sized values).
- For portability reasons, you may only lock on the bottom 32 bits of
- the pointer.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="address" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
- <type name="gpointer" c:type="void*"/>
- </parameter>
- <parameter name="lock_bit" transfer-ownership="none">
- <doc xml:space="preserve">a bit value between 0 and 31</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="pointer_bit_trylock"
- c:identifier="g_pointer_bit_trylock"
- version="2.30">
- <doc xml:space="preserve">This is equivalent to g_bit_trylock, but working on pointers (or
- other pointer-sized values).
- For portability reasons, you may only lock on the bottom 32 bits of
- the pointer.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the lock was acquired</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="address" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
- <type name="gpointer" c:type="void*"/>
- </parameter>
- <parameter name="lock_bit" transfer-ownership="none">
- <doc xml:space="preserve">a bit value between 0 and 31</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="pointer_bit_unlock"
- c:identifier="g_pointer_bit_unlock"
- version="2.30">
- <doc xml:space="preserve">This is equivalent to g_bit_unlock, but working on pointers (or other
- pointer-sized values).
- For portability reasons, you may only lock on the bottom 32 bits of
- the pointer.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="address" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a #gpointer-sized value</doc>
- <type name="gpointer" c:type="void*"/>
- </parameter>
- <parameter name="lock_bit" transfer-ownership="none">
- <doc xml:space="preserve">a bit value between 0 and 31</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="poll" c:identifier="g_poll" version="2.20">
- <doc xml:space="preserve">Polls @fds, as with the poll() system call, but portably. (On
- systems that don't have poll(), it is emulated using select().)
- This is used internally by #GMainContext, but it can be called
- directly if you need to block until a file descriptor is ready, but
- don't want to run the full main loop.
- Each element of @fds is a #GPollFD describing a single file
- descriptor to poll. The %fd field indicates the file descriptor,
- and the %events field indicates the events to poll for. On return,
- the %revents fields will be filled with the events that actually
- occurred.
- On POSIX systems, the file descriptors in @fds can be any sort of
- file descriptor, but the situation is much more complicated on
- Windows. If you need to use g_poll() in code that has to run on
- Windows, the easiest solution is to construct all of your
- #GPollFDs with g_io_channel_win32_make_pollfd().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of entries in @fds whose %revents fields
- were filled in, or 0 if the operation timed out, or -1 on error or
- if the call was interrupted.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="fds" transfer-ownership="none">
- <doc xml:space="preserve">file descriptors to poll</doc>
- <type name="PollFD" c:type="GPollFD*"/>
- </parameter>
- <parameter name="nfds" transfer-ownership="none">
- <doc xml:space="preserve">the number of file descriptors in @fds</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="timeout" transfer-ownership="none">
- <doc xml:space="preserve">amount of time to wait, in milliseconds, or -1 to wait forever</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="prefix_error"
- c:identifier="g_prefix_error"
- version="2.16"
- introspectable="0">
- <doc xml:space="preserve">Formats a string according to @format and prefix it to an existing
- error message. If @err is %NULL (ie: no error variable) then do
- nothing.
- If *@err is %NULL (ie: an error variable is present but there is no
- error condition) then also do nothing. Whether or not it makes sense
- to take advantage of this feature is up to you.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="err"
- direction="inout"
- caller-allocates="0"
- transfer-ownership="full"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a return location for a #GError</doc>
- <type name="Error" c:type="GError**"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">printf()-style format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">arguments to @format</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="print" c:identifier="g_print" introspectable="0">
- <doc xml:space="preserve">Outputs a formatted message via the print handler.
- The default print handler simply outputs the message to stdout, without
- appending a trailing new-line character. Typically, @format should end with
- its own new-line character.
- g_print() should not be used from within libraries for debugging
- messages, since it may be redirected by applications to special
- purpose message windows or even files. Instead, libraries should
- use g_log(), or the convenience functions g_message(), g_warning()
- and g_error().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">the message format. See the printf() documentation</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the parameters to insert into the format string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="printerr" c:identifier="g_printerr" introspectable="0">
- <doc xml:space="preserve">Outputs a formatted message via the error message handler.
- The default handler simply outputs the message to stderr, without appending
- a trailing new-line character. Typically, @format should end with its own
- new-line character.
- g_printerr() should not be used from within libraries.
- Instead g_log() should be used, or the convenience functions
- g_message(), g_warning() and g_error().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">the message format. See the printf() documentation</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the parameters to insert into the format string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="printf"
- c:identifier="g_printf"
- version="2.2"
- introspectable="0">
- <doc xml:space="preserve">An implementation of the standard printf() function which supports
- positional parameters, as specified in the Single Unix Specification.
- As with the standard printf(), this does not automatically append a trailing
- new-line character to the message, so typically @format should end with its
- own new-line character.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes printed.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a standard printf() format string, but notice
- [string precision pitfalls][string-precision]</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the arguments to insert in the output.</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="printf_string_upper_bound"
- c:identifier="g_printf_string_upper_bound"
- introspectable="0">
- <doc xml:space="preserve">Calculates the maximum space needed to store the output
- of the sprintf() function.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the maximum space needed to store the formatted string</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">the format string. See the printf() documentation</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="args" transfer-ownership="none">
- <doc xml:space="preserve">the parameters to be inserted into the format string</doc>
- <type name="va_list" c:type="va_list"/>
- </parameter>
- </parameters>
- </function>
- <function name="propagate_error" c:identifier="g_propagate_error">
- <doc xml:space="preserve">If @dest is %NULL, free @src; otherwise, moves @src into *@dest.
- The error variable @dest points to must be %NULL.
- @src must be non-%NULL.
- Note that @src is no longer valid after this call. If you want
- to keep using the same GError*, you need to set it to %NULL
- after calling this function on it.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="dest"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- nullable="1"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">error return location</doc>
- <type name="Error" c:type="GError**"/>
- </parameter>
- <parameter name="src" transfer-ownership="full">
- <doc xml:space="preserve">error to move into the return location</doc>
- <type name="Error" c:type="GError*"/>
- </parameter>
- </parameters>
- </function>
- <function name="propagate_prefixed_error"
- c:identifier="g_propagate_prefixed_error"
- version="2.16"
- introspectable="0">
- <doc xml:space="preserve">If @dest is %NULL, free @src; otherwise, moves @src into *@dest.
- *@dest must be %NULL. After the move, add a prefix as with
- g_prefix_error().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="dest" transfer-ownership="none">
- <doc xml:space="preserve">error return location</doc>
- <type name="Error" c:type="GError**"/>
- </parameter>
- <parameter name="src" transfer-ownership="none">
- <doc xml:space="preserve">error to move into the return location</doc>
- <type name="Error" c:type="GError*"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">printf()-style format string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">arguments to @format</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="qsort_with_data"
- c:identifier="g_qsort_with_data"
- introspectable="0">
- <doc xml:space="preserve">This is just like the standard C qsort() function, but
- the comparison routine accepts a user data argument.
- This is guaranteed to be a stable sort since version 2.32.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="pbase" transfer-ownership="none">
- <doc xml:space="preserve">start of array to sort</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="total_elems" transfer-ownership="none">
- <doc xml:space="preserve">elements in the array</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="size" transfer-ownership="none">
- <doc xml:space="preserve">size of each element</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="compare_func" transfer-ownership="none" closure="4">
- <doc xml:space="preserve">function to compare elements</doc>
- <type name="CompareDataFunc" c:type="GCompareDataFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @compare_func</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="quark_from_static_string"
- c:identifier="g_quark_from_static_string">
- <doc xml:space="preserve">Gets the #GQuark identifying the given (static) string. If the
- string does not currently have an associated #GQuark, a new #GQuark
- is created, linked to the given string.
- Note that this function is identical to g_quark_from_string() except
- that if a new #GQuark is created the string itself is used rather
- than a copy. This saves memory, but can only be used if the string
- will continue to exist until the program terminates. It can be used
- with statically allocated strings in the main program, but not with
- statically allocated memory in dynamically loaded modules, if you
- expect to ever unload the module again (e.g. do not use this
- function in GTK+ theme engines).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the #GQuark identifying the string, or 0 if @string is %NULL</doc>
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- <parameters>
- <parameter name="string"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="quark_from_string" c:identifier="g_quark_from_string">
- <doc xml:space="preserve">Gets the #GQuark identifying the given string. If the string does
- not currently have an associated #GQuark, a new #GQuark is created,
- using a copy of the string.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the #GQuark identifying the string, or 0 if @string is %NULL</doc>
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- <parameters>
- <parameter name="string"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="quark_to_string" c:identifier="g_quark_to_string">
- <doc xml:space="preserve">Gets the string associated with the given #GQuark.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the string associated with the #GQuark</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="quark" transfer-ownership="none">
- <doc xml:space="preserve">a #GQuark.</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- </parameters>
- </function>
- <function name="quark_try_string" c:identifier="g_quark_try_string">
- <doc xml:space="preserve">Gets the #GQuark associated with the given string, or 0 if string is
- %NULL or it has no associated #GQuark.
- If you want the GQuark to be created if it doesn't already exist,
- use g_quark_from_string() or g_quark_from_static_string().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the #GQuark associated with the string, or 0 if @string is
- %NULL or there is no #GQuark associated with it</doc>
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- <parameters>
- <parameter name="string"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="random_double" c:identifier="g_random_double">
- <doc xml:space="preserve">Returns a random #gdouble equally distributed over the range [0..1).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a random number</doc>
- <type name="gdouble" c:type="gdouble"/>
- </return-value>
- </function>
- <function name="random_double_range" c:identifier="g_random_double_range">
- <doc xml:space="preserve">Returns a random #gdouble equally distributed over the range
- [@begin..@end).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a random number</doc>
- <type name="gdouble" c:type="gdouble"/>
- </return-value>
- <parameters>
- <parameter name="begin" transfer-ownership="none">
- <doc xml:space="preserve">lower closed bound of the interval</doc>
- <type name="gdouble" c:type="gdouble"/>
- </parameter>
- <parameter name="end" transfer-ownership="none">
- <doc xml:space="preserve">upper open bound of the interval</doc>
- <type name="gdouble" c:type="gdouble"/>
- </parameter>
- </parameters>
- </function>
- <function name="random_int" c:identifier="g_random_int">
- <doc xml:space="preserve">Return a random #guint32 equally distributed over the range
- [0..2^32-1].</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a random number</doc>
- <type name="guint32" c:type="guint32"/>
- </return-value>
- </function>
- <function name="random_int_range" c:identifier="g_random_int_range">
- <doc xml:space="preserve">Returns a random #gint32 equally distributed over the range
- [@begin..@end-1].</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a random number</doc>
- <type name="gint32" c:type="gint32"/>
- </return-value>
- <parameters>
- <parameter name="begin" transfer-ownership="none">
- <doc xml:space="preserve">lower closed bound of the interval</doc>
- <type name="gint32" c:type="gint32"/>
- </parameter>
- <parameter name="end" transfer-ownership="none">
- <doc xml:space="preserve">upper open bound of the interval</doc>
- <type name="gint32" c:type="gint32"/>
- </parameter>
- </parameters>
- </function>
- <function name="random_set_seed" c:identifier="g_random_set_seed">
- <doc xml:space="preserve">Sets the seed for the global random number generator, which is used
- by the g_random_* functions, to @seed.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="seed" transfer-ownership="none">
- <doc xml:space="preserve">a value to reinitialize the global random number generator</doc>
- <type name="guint32" c:type="guint32"/>
- </parameter>
- </parameters>
- </function>
- <function name="realloc" c:identifier="g_realloc">
- <doc xml:space="preserve">Reallocates the memory pointed to by @mem, so that it now has space for
- @n_bytes bytes of memory. It returns the new address of the memory, which may
- have been moved. @mem may be %NULL, in which case it's considered to
- have zero-length. @n_bytes may be 0, in which case %NULL will be returned
- and @mem will be freed unless it is %NULL.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the new address of the allocated memory</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="mem"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the memory to reallocate</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="n_bytes" transfer-ownership="none">
- <doc xml:space="preserve">new size of the memory in bytes</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="realloc_n" c:identifier="g_realloc_n" version="2.24">
- <doc xml:space="preserve">This function is similar to g_realloc(), allocating (@n_blocks * @n_block_bytes) bytes,
- but care is taken to detect possible overflow during multiplication.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the new address of the allocated memory</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="mem"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the memory to reallocate</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="n_blocks" transfer-ownership="none">
- <doc xml:space="preserve">the number of blocks to allocate</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="n_block_bytes" transfer-ownership="none">
- <doc xml:space="preserve">the size of each block in bytes</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="regex_check_replacement"
- c:identifier="g_regex_check_replacement"
- moved-to="Regex.check_replacement"
- version="2.14"
- throws="1">
- <doc xml:space="preserve">Checks whether @replacement is a valid replacement string
- (see g_regex_replace()), i.e. that all escape sequences in
- it are valid.
- If @has_references is not %NULL then @replacement is checked
- for pattern references. For instance, replacement text 'foo\n'
- does not contain references and may be evaluated without information
- about actual match, but '\0\1' (whole match followed by first
- subpattern) requires valid #GMatchInfo object.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">whether @replacement is a valid replacement string</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="replacement" transfer-ownership="none">
- <doc xml:space="preserve">the replacement string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="has_references"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store information about
- references in @replacement or %NULL</doc>
- <type name="gboolean" c:type="gboolean*"/>
- </parameter>
- </parameters>
- </function>
- <function name="regex_error_quark"
- c:identifier="g_regex_error_quark"
- moved-to="Regex.error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="regex_escape_nul"
- c:identifier="g_regex_escape_nul"
- moved-to="Regex.escape_nul"
- version="2.30">
- <doc xml:space="preserve">Escapes the nul characters in @string to "\x00". It can be used
- to compile a regex with embedded nul characters.
- For completeness, @length can be -1 for a nul-terminated string.
- In this case the output string will be of course equal to @string.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated escaped string</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to escape</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="regex_escape_string"
- c:identifier="g_regex_escape_string"
- moved-to="Regex.escape_string"
- version="2.14">
- <doc xml:space="preserve">Escapes the special characters used for regular expressions
- in @string, for instance "a.b*c" becomes "a\.b\*c". This
- function is useful to dynamically generate regular expressions.
- @string can contain nul characters that are replaced with "\0",
- in this case remember to specify the correct length of @string
- in @length.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated escaped string</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to escape</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
- <type name="utf8" c:type="gchar"/>
- </array>
- </parameter>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of @string, or -1 if @string is nul-terminated</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="regex_match_simple"
- c:identifier="g_regex_match_simple"
- moved-to="Regex.match_simple"
- version="2.14">
- <doc xml:space="preserve">Scans for a match in @string for @pattern.
- This function is equivalent to g_regex_match() but it does not
- require to compile the pattern with g_regex_new(), avoiding some
- lines of code when you need just to do a match without extracting
- substrings, capture counts, and so on.
- If this function is to be called on the same @pattern more than
- once, it's more efficient to compile the pattern once with
- g_regex_new() and then use g_regex_match().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the string matched, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="pattern" transfer-ownership="none">
- <doc xml:space="preserve">the regular expression</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to scan for matches</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="compile_options" transfer-ownership="none">
- <doc xml:space="preserve">compile options for the regular expression, or 0</doc>
- <type name="RegexCompileFlags" c:type="GRegexCompileFlags"/>
- </parameter>
- <parameter name="match_options" transfer-ownership="none">
- <doc xml:space="preserve">match options, or 0</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </parameter>
- </parameters>
- </function>
- <function name="regex_split_simple"
- c:identifier="g_regex_split_simple"
- moved-to="Regex.split_simple"
- version="2.14">
- <doc xml:space="preserve">Breaks the string on the pattern, and returns an array of
- the tokens. If the pattern contains capturing parentheses,
- then the text for each of the substrings will also be returned.
- If the pattern does not match anywhere in the string, then the
- whole string is returned as the first token.
- This function is equivalent to g_regex_split() but it does
- not require to compile the pattern with g_regex_new(), avoiding
- some lines of code when you need just to do a split without
- extracting substrings, capture counts, and so on.
- If this function is to be called on the same @pattern more than
- once, it's more efficient to compile the pattern once with
- g_regex_new() and then use g_regex_split().
- As a special case, the result of splitting the empty string ""
- is an empty vector, not a vector containing a single string.
- The reason for this special case is that being able to represent
- a empty vector is typically more useful than consistent handling
- of empty elements. If you do need to represent empty elements,
- you'll need to check for the empty string before calling this
- function.
- A pattern that can match empty strings splits @string into
- separate characters wherever it matches the empty string between
- characters. For example splitting "ab c" using as a separator
- "\s*", you will get "a", "b" and "c".</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a %NULL-terminated array of strings. Free
- it using g_strfreev()</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="pattern" transfer-ownership="none">
- <doc xml:space="preserve">the regular expression</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to scan for matches</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="compile_options" transfer-ownership="none">
- <doc xml:space="preserve">compile options for the regular expression, or 0</doc>
- <type name="RegexCompileFlags" c:type="GRegexCompileFlags"/>
- </parameter>
- <parameter name="match_options" transfer-ownership="none">
- <doc xml:space="preserve">match options, or 0</doc>
- <type name="RegexMatchFlags" c:type="GRegexMatchFlags"/>
- </parameter>
- </parameters>
- </function>
- <function name="reload_user_special_dirs_cache"
- c:identifier="g_reload_user_special_dirs_cache"
- version="2.22">
- <doc xml:space="preserve">Resets the cache used for g_get_user_special_dir(), so
- that the latest on-disk version is used. Call this only
- if you just changed the data on disk yourself.
- Due to threadsafety issues this may cause leaking of strings
- that were previously returned from g_get_user_special_dir()
- that can't be freed. We ensure to only leak the data for
- the directories that actually changed value though.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- </function>
- <function name="return_if_fail_warning"
- c:identifier="g_return_if_fail_warning"
- introspectable="0">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="log_domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="pretty_function" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="expression"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="rmdir" c:identifier="g_rmdir" version="2.6">
- <doc xml:space="preserve">A wrapper for the POSIX rmdir() function. The rmdir() function
- deletes a directory from the filesystem.
- See your C library manual for more details about how rmdir() works
- on your system.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">0 if the directory was successfully removed, -1 if an error
- occurred</doc>
- <type name="gint" c:type="int"/>
- </return-value>
- <parameters>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">a pathname in the GLib file name encoding (UTF-8 on Windows)</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="sequence_get"
- c:identifier="g_sequence_get"
- moved-to="Sequence.get"
- version="2.14">
- <doc xml:space="preserve">Returns the data that @iter points to.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the data that @iter points to</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- </parameters>
- </function>
- <function name="sequence_move"
- c:identifier="g_sequence_move"
- moved-to="Sequence.move"
- version="2.14">
- <doc xml:space="preserve">Moves the item pointed to by @src to the position indicated by @dest.
- After calling this function @dest will point to the position immediately
- after @src. It is allowed for @src and @dest to point into different
- sequences.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="src" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter pointing to the item to move</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="dest" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter pointing to the position to which
- the item is moved</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- </parameters>
- </function>
- <function name="sequence_move_range"
- c:identifier="g_sequence_move_range"
- moved-to="Sequence.move_range"
- version="2.14">
- <doc xml:space="preserve">Inserts the (@begin, @end) range at the destination pointed to by ptr.
- The @begin and @end iters must point into the same sequence. It is
- allowed for @dest to point to a different sequence than the one pointed
- into by @begin and @end.
- If @dest is NULL, the range indicated by @begin and @end is
- removed from the sequence. If @dest iter points to a place within
- the (@begin, @end) range, the range does not move.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="dest" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="begin" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="end" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- </parameters>
- </function>
- <function name="sequence_remove"
- c:identifier="g_sequence_remove"
- moved-to="Sequence.remove"
- version="2.14">
- <doc xml:space="preserve">Removes the item pointed to by @iter. It is an error to pass the
- end iterator to this function.
- If the sequence has a data destroy function associated with it, this
- function is called on the data for the removed item.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- </parameters>
- </function>
- <function name="sequence_remove_range"
- c:identifier="g_sequence_remove_range"
- moved-to="Sequence.remove_range"
- version="2.14">
- <doc xml:space="preserve">Removes all items in the (@begin, @end) range.
- If the sequence has a data destroy function associated with it, this
- function is called on the data for the removed items.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="begin" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="end" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- </parameters>
- </function>
- <function name="sequence_set"
- c:identifier="g_sequence_set"
- moved-to="Sequence.set"
- version="2.14">
- <doc xml:space="preserve">Changes the data for the item pointed to by @iter to be @data. If
- the sequence has a data destroy function associated with it, that
- function is called on the existing data that @iter pointed to.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="iter" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">new data for the item</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="sequence_swap"
- c:identifier="g_sequence_swap"
- moved-to="Sequence.swap"
- version="2.14">
- <doc xml:space="preserve">Swaps the items pointed to by @a and @b. It is allowed for @a and @b
- to point into difference sequences.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="a" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- <parameter name="b" transfer-ownership="none">
- <doc xml:space="preserve">a #GSequenceIter</doc>
- <type name="SequenceIter" c:type="GSequenceIter*"/>
- </parameter>
- </parameters>
- </function>
- <function name="set_application_name"
- c:identifier="g_set_application_name"
- version="2.2">
- <doc xml:space="preserve">Sets a human-readable name for the application. This name should be
- localized if possible, and is intended for display to the user.
- Contrast with g_set_prgname(), which sets a non-localized name.
- g_set_prgname() will be called automatically by gtk_init(),
- but g_set_application_name() will not.
- Note that for thread safety reasons, this function can only
- be called once.
- The application name will be used in contexts such as error messages,
- or when displaying an application's name in the task list.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="application_name" transfer-ownership="none">
- <doc xml:space="preserve">localized name of the application</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="set_error" c:identifier="g_set_error" introspectable="0">
- <doc xml:space="preserve">Does nothing if @err is %NULL; if @err is non-%NULL, then *@err
- must be %NULL. A new #GError is created and assigned to *@err.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="err"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">a return location for a #GError</doc>
- <type name="Error" c:type="GError**"/>
- </parameter>
- <parameter name="domain" transfer-ownership="none">
- <doc xml:space="preserve">error domain</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- <parameter name="code" transfer-ownership="none">
- <doc xml:space="preserve">error code</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">printf()-style format</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">args for @format</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="set_error_literal"
- c:identifier="g_set_error_literal"
- version="2.18">
- <doc xml:space="preserve">Does nothing if @err is %NULL; if @err is non-%NULL, then *@err
- must be %NULL. A new #GError is created and assigned to *@err.
- Unlike g_set_error(), @message is not a printf()-style format string.
- Use this function if @message contains text you don't have control over,
- that could include printf() escape sequences.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="err"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">a return location for a #GError</doc>
- <type name="Error" c:type="GError**"/>
- </parameter>
- <parameter name="domain" transfer-ownership="none">
- <doc xml:space="preserve">error domain</doc>
- <type name="Quark" c:type="GQuark"/>
- </parameter>
- <parameter name="code" transfer-ownership="none">
- <doc xml:space="preserve">error code</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="message" transfer-ownership="none">
- <doc xml:space="preserve">error message</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="set_prgname" c:identifier="g_set_prgname">
- <doc xml:space="preserve">Sets the name of the program. This name should not be localized,
- in contrast to g_set_application_name().
- Note that for thread-safety reasons this function can only be called once.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="prgname" transfer-ownership="none">
- <doc xml:space="preserve">the name of the program.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="set_print_handler"
- c:identifier="g_set_print_handler"
- introspectable="0">
- <doc xml:space="preserve">Sets the print handler.
- Any messages passed to g_print() will be output via
- the new handler. The default handler simply outputs
- the message to stdout. By providing your own handler
- you can redirect the output, to a GTK+ widget or a
- log file for example.</doc>
- <return-value>
- <doc xml:space="preserve">the old print handler</doc>
- <type name="PrintFunc" c:type="GPrintFunc"/>
- </return-value>
- <parameters>
- <parameter name="func" transfer-ownership="none">
- <doc xml:space="preserve">the new print handler</doc>
- <type name="PrintFunc" c:type="GPrintFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="set_printerr_handler"
- c:identifier="g_set_printerr_handler"
- introspectable="0">
- <doc xml:space="preserve">Sets the handler for printing error messages.
- Any messages passed to g_printerr() will be output via
- the new handler. The default handler simply outputs the
- message to stderr. By providing your own handler you can
- redirect the output, to a GTK+ widget or a log file for
- example.</doc>
- <return-value>
- <doc xml:space="preserve">the old error message handler</doc>
- <type name="PrintFunc" c:type="GPrintFunc"/>
- </return-value>
- <parameters>
- <parameter name="func" transfer-ownership="none">
- <doc xml:space="preserve">the new error message handler</doc>
- <type name="PrintFunc" c:type="GPrintFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="setenv" c:identifier="g_setenv" version="2.4">
- <doc xml:space="preserve">Sets an environment variable. On UNIX, both the variable's name and
- value can be arbitrary byte strings, except that the variable's name
- cannot contain '='. On Windows, they should be in UTF-8.
- Note that on some systems, when variables are overwritten, the memory
- used for the previous variables and its value isn't reclaimed.
- You should be mindful of the fact that environment variable handling
- in UNIX is not thread-safe, and your program may crash if one thread
- calls g_setenv() while another thread is calling getenv(). (And note
- that many functions, such as gettext(), call getenv() internally.)
- This function is only safe to use at the very start of your program,
- before creating any other threads (or creating objects that create
- worker threads of their own).
- If you need to set up the environment for a child process, you can
- use g_get_environ() to get an environment array, modify that with
- g_environ_setenv() and g_environ_unsetenv(), and then pass that
- array directly to execvpe(), g_spawn_async(), or the like.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%FALSE if the environment variable couldn't be set.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="variable" transfer-ownership="none">
- <doc xml:space="preserve">the environment variable to set, must not contain '='.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="value" transfer-ownership="none">
- <doc xml:space="preserve">the value for to set the variable to.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="overwrite" transfer-ownership="none">
- <doc xml:space="preserve">whether to change the variable if it already exists.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </function>
- <function name="shell_error_quark" c:identifier="g_shell_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="shell_parse_argv"
- c:identifier="g_shell_parse_argv"
- throws="1">
- <doc xml:space="preserve">Parses a command line into an argument vector, in much the same way
- the shell would, but without many of the expansions the shell would
- perform (variable expansion, globs, operators, filename expansion,
- etc. are not supported). The results are defined to be the same as
- those you would get from a UNIX98 /bin/sh, as long as the input
- contains none of the unsupported shell expansions. If the input
- does contain such expansions, they are passed through
- literally. Possible errors are those from the #G_SHELL_ERROR
- domain. Free the returned vector with g_strfreev().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on success, %FALSE if error set</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="command_line" transfer-ownership="none">
- <doc xml:space="preserve">command line to parse</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="argcp"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for number of args</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- <parameter name="argvp"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return
- location for array of args</doc>
- <array length="1" zero-terminated="1" c:type="gchar***">
- <type name="utf8" c:type="gchar**"/>
- </array>
- </parameter>
- </parameters>
- </function>
- <function name="shell_quote" c:identifier="g_shell_quote">
- <doc xml:space="preserve">Quotes a string so that the shell (/bin/sh) will interpret the
- quoted string to mean @unquoted_string. If you pass a filename to
- the shell, for example, you should first quote it with this
- function. The return value must be freed with g_free(). The
- quoting style used is undefined (single or double quotes may be
- used).</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">quoted string</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="unquoted_string" transfer-ownership="none">
- <doc xml:space="preserve">a literal string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="shell_unquote" c:identifier="g_shell_unquote" throws="1">
- <doc xml:space="preserve">Unquotes a string as the shell (/bin/sh) would. Only handles
- quotes; if a string contains file globs, arithmetic operators,
- variables, backticks, redirections, or other special-to-the-shell
- features, the result will be different from the result a real shell
- would produce (the variables, backticks, etc. will be passed
- through literally instead of being expanded). This function is
- guaranteed to succeed if applied to the result of
- g_shell_quote(). If it fails, it returns %NULL and sets the
- error. The @quoted_string need not actually contain quoted or
- escaped text; g_shell_unquote() simply goes through the string and
- unquotes/unescapes anything that the shell would. Both single and
- double quotes are handled, as are escapes including escaped
- newlines. The return value must be freed with g_free(). Possible
- errors are in the #G_SHELL_ERROR domain.
- Shell quoting rules are a bit strange. Single quotes preserve the
- literal string exactly. escape sequences are not allowed; not even
- \' - if you want a ' in the quoted text, you have to do something
- like 'foo'\''bar'. Double quotes allow $, `, ", \, and newline to
- be escaped with backslash. Otherwise double quotes preserve things
- literally.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">an unquoted string</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="quoted_string" transfer-ownership="none">
- <doc xml:space="preserve">shell-quoted string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="slice_alloc" c:identifier="g_slice_alloc" version="2.10">
- <doc xml:space="preserve">Allocates a block of memory from the slice allocator.
- The block adress handed out can be expected to be aligned
- to at least 1 * sizeof (void*),
- though in general slices are 2 * sizeof (void*) bytes aligned,
- if a malloc() fallback implementation is used instead,
- the alignment may be reduced in a libc dependent fashion.
- Note that the underlying slice allocation mechanism can
- be changed with the [`G_SLICE=always-malloc`][G_SLICE]
- environment variable.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">a pointer to the allocated memory block, which will be %NULL if and
- only if @mem_size is 0</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="block_size" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes to allocate</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="slice_alloc0" c:identifier="g_slice_alloc0" version="2.10">
- <doc xml:space="preserve">Allocates a block of memory via g_slice_alloc() and initializes
- the returned memory to 0. Note that the underlying slice allocation
- mechanism can be changed with the [`G_SLICE=always-malloc`][G_SLICE]
- environment variable.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">a pointer to the allocated block, which will be %NULL if and only
- if @mem_size is 0</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="block_size" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes to allocate</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="slice_copy" c:identifier="g_slice_copy" version="2.14">
- <doc xml:space="preserve">Allocates a block of memory from the slice allocator
- and copies @block_size bytes into it from @mem_block.
- @mem_block must be non-%NULL if @block_size is non-zero.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">a pointer to the allocated memory block, which will be %NULL if and
- only if @mem_size is 0</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="block_size" transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes to allocate</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="mem_block"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the memory to copy</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="slice_free1" c:identifier="g_slice_free1" version="2.10">
- <doc xml:space="preserve">Frees a block of memory.
- The memory must have been allocated via g_slice_alloc() or
- g_slice_alloc0() and the @block_size has to match the size
- specified upon allocation. Note that the exact release behaviour
- can be changed with the [`G_DEBUG=gc-friendly`][G_DEBUG] environment
- variable, also see [`G_SLICE`][G_SLICE] for related debugging options.
- If @mem_block is %NULL, this function does nothing.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="block_size" transfer-ownership="none">
- <doc xml:space="preserve">the size of the block</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="mem_block"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a pointer to the block to free</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="slice_free_chain_with_offset"
- c:identifier="g_slice_free_chain_with_offset"
- version="2.10">
- <doc xml:space="preserve">Frees a linked list of memory blocks of structure type @type.
- The memory blocks must be equal-sized, allocated via
- g_slice_alloc() or g_slice_alloc0() and linked together by a
- @next pointer (similar to #GSList). The offset of the @next
- field in each block is passed as third argument.
- Note that the exact release behaviour can be changed with the
- [`G_DEBUG=gc-friendly`][G_DEBUG] environment variable, also see
- [`G_SLICE`][G_SLICE] for related debugging options.
- If @mem_chain is %NULL, this function does nothing.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="block_size" transfer-ownership="none">
- <doc xml:space="preserve">the size of the blocks</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="mem_chain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a pointer to the first block of the chain</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="next_offset" transfer-ownership="none">
- <doc xml:space="preserve">the offset of the @next field in the blocks</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="slice_get_config" c:identifier="g_slice_get_config">
- <return-value transfer-ownership="none">
- <type name="gint64" c:type="gint64"/>
- </return-value>
- <parameters>
- <parameter name="ckey" transfer-ownership="none">
- <type name="SliceConfig" c:type="GSliceConfig"/>
- </parameter>
- </parameters>
- </function>
- <function name="slice_get_config_state"
- c:identifier="g_slice_get_config_state">
- <return-value transfer-ownership="none">
- <type name="gint64" c:type="gint64*"/>
- </return-value>
- <parameters>
- <parameter name="ckey" transfer-ownership="none">
- <type name="SliceConfig" c:type="GSliceConfig"/>
- </parameter>
- <parameter name="address" transfer-ownership="none">
- <type name="gint64" c:type="gint64"/>
- </parameter>
- <parameter name="n_values" transfer-ownership="none">
- <type name="guint" c:type="guint*"/>
- </parameter>
- </parameters>
- </function>
- <function name="slice_set_config" c:identifier="g_slice_set_config">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="ckey" transfer-ownership="none">
- <type name="SliceConfig" c:type="GSliceConfig"/>
- </parameter>
- <parameter name="value" transfer-ownership="none">
- <type name="gint64" c:type="gint64"/>
- </parameter>
- </parameters>
- </function>
- <function name="snprintf" c:identifier="g_snprintf" introspectable="0">
- <doc xml:space="preserve">A safer form of the standard sprintf() function. The output is guaranteed
- to not exceed @n characters (including the terminating nul character), so
- it is easy to ensure that a buffer overflow cannot occur.
- See also g_strdup_printf().
- In versions of GLib prior to 1.2.3, this function may return -1 if the
- output was truncated, and the truncated string may not be nul-terminated.
- In versions prior to 1.3.12, this function returns the length of the output
- string.
- The return value of g_snprintf() conforms to the snprintf()
- function as standardized in ISO C99. Note that this is different from
- traditional snprintf(), which returns the length of the output string.
- The format string may contain positional parameters, as specified in
- the Single Unix Specification.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes which would be produced if the buffer
- was large enough.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the buffer to hold the output.</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the maximum number of bytes to produce (including the
- terminating nul character).</doc>
- <type name="gulong" c:type="gulong"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a standard printf() format string, but notice
- [string precision pitfalls][string-precision]</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the arguments to insert in the output.</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="source_remove"
- c:identifier="g_source_remove"
- moved-to="Source.remove">
- <doc xml:space="preserve">Removes the source with the given id from the default main context.
- The id of a #GSource is given by g_source_get_id(), or will be
- returned by the functions g_source_attach(), g_idle_add(),
- g_idle_add_full(), g_timeout_add(), g_timeout_add_full(),
- g_child_watch_add(), g_child_watch_add_full(), g_io_add_watch(), and
- g_io_add_watch_full().
- See also g_source_destroy(). You must use g_source_destroy() for sources
- added to a non-default main context.
- It is a programmer error to attempt to remove a non-existent source.
- More specifically: source IDs can be reissued after a source has been
- destroyed and therefore it is never valid to use this function with a
- source ID which may have already been removed. An example is when
- scheduling an idle to run in another thread with g_idle_add(): the
- idle may already have run and been removed by the time this function
- is called on its (now invalid) source ID. This source ID may have
- been reissued, leading to the operation being performed against the
- wrong source.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">For historical reasons, this function always returns %TRUE</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="tag" transfer-ownership="none">
- <doc xml:space="preserve">the ID of the source to remove.</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="source_remove_by_funcs_user_data"
- c:identifier="g_source_remove_by_funcs_user_data"
- moved-to="Source.remove_by_funcs_user_data">
- <doc xml:space="preserve">Removes a source from the default main loop context given the
- source functions and user data. If multiple sources exist with the
- same source functions and user data, only one will be destroyed.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a source was found and removed.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="funcs" transfer-ownership="none">
- <doc xml:space="preserve">The @source_funcs passed to g_source_new()</doc>
- <type name="SourceFuncs" c:type="GSourceFuncs*"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the user data for the callback</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="source_remove_by_user_data"
- c:identifier="g_source_remove_by_user_data"
- moved-to="Source.remove_by_user_data">
- <doc xml:space="preserve">Removes a source from the default main loop context given the user
- data for the callback. If multiple sources exist with the same user
- data, only one will be destroyed.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a source was found and removed.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the user_data for the callback.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="source_set_name_by_id"
- c:identifier="g_source_set_name_by_id"
- moved-to="Source.set_name_by_id"
- version="2.26">
- <doc xml:space="preserve">Sets the name of a source using its ID.
- This is a convenience utility to set source names from the return
- value of g_idle_add(), g_timeout_add(), etc.
- It is a programmer error to attempt to set the name of a non-existent
- source.
- More specifically: source IDs can be reissued after a source has been
- destroyed and therefore it is never valid to use this function with a
- source ID which may have already been removed. An example is when
- scheduling an idle to run in another thread with g_idle_add(): the
- idle may already have run and been removed by the time this function
- is called on its (now invalid) source ID. This source ID may have
- been reissued, leading to the operation being performed against the
- wrong source.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="tag" transfer-ownership="none">
- <doc xml:space="preserve">a #GSource ID</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="name" transfer-ownership="none">
- <doc xml:space="preserve">debug name for the source</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="spaced_primes_closest"
- c:identifier="g_spaced_primes_closest">
- <doc xml:space="preserve">Gets the smallest prime number from a built-in array of primes which
- is larger than @num. This is used within GLib to calculate the optimum
- size of a #GHashTable.
- The built-in array of primes ranges from 11 to 13845163 such that
- each prime is approximately 1.5-2 times the previous prime.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the smallest prime number from a built-in array of primes
- which is larger than @num</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="num" transfer-ownership="none">
- <doc xml:space="preserve">a #guint</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="spawn_async" c:identifier="g_spawn_async" throws="1">
- <doc xml:space="preserve">See g_spawn_async_with_pipes() for a full description; this function
- simply calls the g_spawn_async_with_pipes() without any pipes.
- You should call g_spawn_close_pid() on the returned child process
- reference when you don't need it any more.
- If you are writing a GTK+ application, and the program you are
- spawning is a graphical application, too, then you may want to
- use gdk_spawn_on_screen() instead to ensure that the spawned program
- opens its windows on the right screen.
- Note that the returned @child_pid on Windows is a handle to the child
- process and not its identifier. Process handles and process identifiers
- are different concepts on Windows.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on success, %FALSE if error is set</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="working_directory"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">child's current working directory, or %NULL to inherit parent's</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="argv" transfer-ownership="none">
- <doc xml:space="preserve">child's argument vector</doc>
- <array c:type="gchar**">
- <type name="utf8" c:type="gchar*"/>
- </array>
- </parameter>
- <parameter name="envp"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">child's environment, or %NULL to inherit parent's</doc>
- <array c:type="gchar**">
- <type name="utf8" c:type="gchar*"/>
- </array>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">flags from #GSpawnFlags</doc>
- <type name="SpawnFlags" c:type="GSpawnFlags"/>
- </parameter>
- <parameter name="child_setup"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async"
- closure="5">
- <doc xml:space="preserve">function to run in the child just before exec()</doc>
- <type name="SpawnChildSetupFunc" c:type="GSpawnChildSetupFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data for @child_setup</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="child_pid"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for child process reference, or %NULL</doc>
- <type name="Pid" c:type="GPid*"/>
- </parameter>
- </parameters>
- </function>
- <function name="spawn_async_with_pipes"
- c:identifier="g_spawn_async_with_pipes"
- throws="1">
- <doc xml:space="preserve">Executes a child program asynchronously (your program will not
- block waiting for the child to exit). The child program is
- specified by the only argument that must be provided, @argv.
- @argv should be a %NULL-terminated array of strings, to be passed
- as the argument vector for the child. The first string in @argv
- is of course the name of the program to execute. By default, the
- name of the program must be a full path. If @flags contains the
- %G_SPAWN_SEARCH_PATH flag, the `PATH` environment variable is
- used to search for the executable. If @flags contains the
- %G_SPAWN_SEARCH_PATH_FROM_ENVP flag, the `PATH` variable from
- @envp is used to search for the executable. If both the
- %G_SPAWN_SEARCH_PATH and %G_SPAWN_SEARCH_PATH_FROM_ENVP flags
- are set, the `PATH` variable from @envp takes precedence over
- the environment variable.
- If the program name is not a full path and %G_SPAWN_SEARCH_PATH flag is not
- used, then the program will be run from the current directory (or
- @working_directory, if specified); this might be unexpected or even
- dangerous in some cases when the current directory is world-writable.
- On Windows, note that all the string or string vector arguments to
- this function and the other g_spawn*() functions are in UTF-8, the
- GLib file name encoding. Unicode characters that are not part of
- the system codepage passed in these arguments will be correctly
- available in the spawned program only if it uses wide character API
- to retrieve its command line. For C programs built with Microsoft's
- tools it is enough to make the program have a wmain() instead of
- main(). wmain() has a wide character argument vector as parameter.
- At least currently, mingw doesn't support wmain(), so if you use
- mingw to develop the spawned program, it should call
- g_win32_get_command_line() to get arguments in UTF-8.
- On Windows the low-level child process creation API CreateProcess()
- doesn't use argument vectors, but a command line. The C runtime
- library's spawn*() family of functions (which g_spawn_async_with_pipes()
- eventually calls) paste the argument vector elements together into
- a command line, and the C runtime startup code does a corresponding
- reconstruction of an argument vector from the command line, to be
- passed to main(). Complications arise when you have argument vector
- elements that contain spaces of double quotes. The spawn*() functions
- don't do any quoting or escaping, but on the other hand the startup
- code does do unquoting and unescaping in order to enable receiving
- arguments with embedded spaces or double quotes. To work around this
- asymmetry, g_spawn_async_with_pipes() will do quoting and escaping on
- argument vector elements that need it before calling the C runtime
- spawn() function.
- The returned @child_pid on Windows is a handle to the child
- process, not its identifier. Process handles and process
- identifiers are different concepts on Windows.
- @envp is a %NULL-terminated array of strings, where each string
- has the form `KEY=VALUE`. This will become the child's environment.
- If @envp is %NULL, the child inherits its parent's environment.
- @flags should be the bitwise OR of any flags you want to affect the
- function's behaviour. The %G_SPAWN_DO_NOT_REAP_CHILD means that the
- child will not automatically be reaped; you must use a child watch to
- be notified about the death of the child process. Eventually you must
- call g_spawn_close_pid() on the @child_pid, in order to free
- resources which may be associated with the child process. (On Unix,
- using a child watch is equivalent to calling waitpid() or handling
- the %SIGCHLD signal manually. On Windows, calling g_spawn_close_pid()
- is equivalent to calling CloseHandle() on the process handle returned
- in @child_pid). See g_child_watch_add().
- %G_SPAWN_LEAVE_DESCRIPTORS_OPEN means that the parent's open file
- descriptors will be inherited by the child; otherwise all descriptors
- except stdin/stdout/stderr will be closed before calling exec() in
- the child. %G_SPAWN_SEARCH_PATH means that @argv[0] need not be an
- absolute path, it will be looked for in the `PATH` environment
- variable. %G_SPAWN_SEARCH_PATH_FROM_ENVP means need not be an
- absolute path, it will be looked for in the `PATH` variable from
- @envp. If both %G_SPAWN_SEARCH_PATH and %G_SPAWN_SEARCH_PATH_FROM_ENVP
- are used, the value from @envp takes precedence over the environment.
- %G_SPAWN_STDOUT_TO_DEV_NULL means that the child's standard output
- will be discarded, instead of going to the same location as the parent's
- standard output. If you use this flag, @standard_output must be %NULL.
- %G_SPAWN_STDERR_TO_DEV_NULL means that the child's standard error
- will be discarded, instead of going to the same location as the parent's
- standard error. If you use this flag, @standard_error must be %NULL.
- %G_SPAWN_CHILD_INHERITS_STDIN means that the child will inherit the parent's
- standard input (by default, the child's standard input is attached to
- /dev/null). If you use this flag, @standard_input must be %NULL.
- %G_SPAWN_FILE_AND_ARGV_ZERO means that the first element of @argv is
- the file to execute, while the remaining elements are the actual
- argument vector to pass to the file. Normally g_spawn_async_with_pipes()
- uses @argv[0] as the file to execute, and passes all of @argv to the child.
- @child_setup and @user_data are a function and user data. On POSIX
- platforms, the function is called in the child after GLib has
- performed all the setup it plans to perform (including creating
- pipes, closing file descriptors, etc.) but before calling exec().
- That is, @child_setup is called just before calling exec() in the
- child. Obviously actions taken in this function will only affect
- the child, not the parent.
- On Windows, there is no separate fork() and exec() functionality.
- Child processes are created and run with a single API call,
- CreateProcess(). There is no sensible thing @child_setup
- could be used for on Windows so it is ignored and not called.
- If non-%NULL, @child_pid will on Unix be filled with the child's
- process ID. You can use the process ID to send signals to the child,
- or to use g_child_watch_add() (or waitpid()) if you specified the
- %G_SPAWN_DO_NOT_REAP_CHILD flag. On Windows, @child_pid will be
- filled with a handle to the child process only if you specified the
- %G_SPAWN_DO_NOT_REAP_CHILD flag. You can then access the child
- process using the Win32 API, for example wait for its termination
- with the WaitFor*() functions, or examine its exit code with
- GetExitCodeProcess(). You should close the handle with CloseHandle()
- or g_spawn_close_pid() when you no longer need it.
- If non-%NULL, the @standard_input, @standard_output, @standard_error
- locations will be filled with file descriptors for writing to the child's
- standard input or reading from its standard output or standard error.
- The caller of g_spawn_async_with_pipes() must close these file descriptors
- when they are no longer in use. If these parameters are %NULL, the
- corresponding pipe won't be created.
- If @standard_input is NULL, the child's standard input is attached to
- /dev/null unless %G_SPAWN_CHILD_INHERITS_STDIN is set.
- If @standard_error is NULL, the child's standard error goes to the same
- location as the parent's standard error unless %G_SPAWN_STDERR_TO_DEV_NULL
- is set.
- If @standard_output is NULL, the child's standard output goes to the same
- location as the parent's standard output unless %G_SPAWN_STDOUT_TO_DEV_NULL
- is set.
- @error can be %NULL to ignore errors, or non-%NULL to report errors.
- If an error is set, the function returns %FALSE. Errors are reported
- even if they occur in the child (for example if the executable in
- @argv[0] is not found). Typically the `message` field of returned
- errors should be displayed to users. Possible errors are those from
- the #G_SPAWN_ERROR domain.
- If an error occurs, @child_pid, @standard_input, @standard_output,
- and @standard_error will not be filled with valid values.
- If @child_pid is not %NULL and an error does not occur then the returned
- process reference must be closed using g_spawn_close_pid().
- If you are writing a GTK+ application, and the program you
- are spawning is a graphical application, too, then you may
- want to use gdk_spawn_on_screen_with_pipes() instead to ensure that
- the spawned program opens its windows on the right screen.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on success, %FALSE if an error was set</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="working_directory"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">child's current working directory, or %NULL to inherit parent's, in the GLib file name encoding</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="argv" transfer-ownership="none">
- <doc xml:space="preserve">child's argument vector, in the GLib file name encoding</doc>
- <array c:type="gchar**">
- <type name="utf8" c:type="gchar*"/>
- </array>
- </parameter>
- <parameter name="envp"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">child's environment, or %NULL to inherit parent's, in the GLib file name encoding</doc>
- <array c:type="gchar**">
- <type name="utf8" c:type="gchar*"/>
- </array>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">flags from #GSpawnFlags</doc>
- <type name="SpawnFlags" c:type="GSpawnFlags"/>
- </parameter>
- <parameter name="child_setup"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async"
- closure="5">
- <doc xml:space="preserve">function to run in the child just before exec()</doc>
- <type name="SpawnChildSetupFunc" c:type="GSpawnChildSetupFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data for @child_setup</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="child_pid"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for child process ID, or %NULL</doc>
- <type name="Pid" c:type="GPid*"/>
- </parameter>
- <parameter name="standard_input"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for file descriptor to write to child's stdin, or %NULL</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- <parameter name="standard_output"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for file descriptor to read child's stdout, or %NULL</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- <parameter name="standard_error"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for file descriptor to read child's stderr, or %NULL</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- </parameters>
- </function>
- <function name="spawn_check_exit_status"
- c:identifier="g_spawn_check_exit_status"
- version="2.34"
- throws="1">
- <doc xml:space="preserve">Set @error if @exit_status indicates the child exited abnormally
- (e.g. with a nonzero exit code, or via a fatal signal).
- The g_spawn_sync() and g_child_watch_add() family of APIs return an
- exit status for subprocesses encoded in a platform-specific way.
- On Unix, this is guaranteed to be in the same format waitpid() returns,
- and on Windows it is guaranteed to be the result of GetExitCodeProcess().
- Prior to the introduction of this function in GLib 2.34, interpreting
- @exit_status required use of platform-specific APIs, which is problematic
- for software using GLib as a cross-platform layer.
- Additionally, many programs simply want to determine whether or not
- the child exited successfully, and either propagate a #GError or
- print a message to standard error. In that common case, this function
- can be used. Note that the error message in @error will contain
- human-readable information about the exit status.
- The @domain and @code of @error have special semantics in the case
- where the process has an "exit code", as opposed to being killed by
- a signal. On Unix, this happens if WIFEXITED() would be true of
- @exit_status. On Windows, it is always the case.
- The special semantics are that the actual exit code will be the
- code set in @error, and the domain will be %G_SPAWN_EXIT_ERROR.
- This allows you to differentiate between different exit codes.
- If the process was terminated by some means other than an exit
- status, the domain will be %G_SPAWN_ERROR, and the code will be
- %G_SPAWN_ERROR_FAILED.
- This function just offers convenience; you can of course also check
- the available platform via a macro such as %G_OS_UNIX, and use
- WIFEXITED() and WEXITSTATUS() on @exit_status directly. Do not attempt
- to scan or parse the error message string; it may be translated and/or
- change in future versions of GLib.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if child exited successfully, %FALSE otherwise (and
- @error will be set)</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="exit_status" transfer-ownership="none">
- <doc xml:space="preserve">An exit code as returned from g_spawn_sync()</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="spawn_close_pid" c:identifier="g_spawn_close_pid">
- <doc xml:space="preserve">On some platforms, notably Windows, the #GPid type represents a resource
- which must be closed to prevent resource leaking. g_spawn_close_pid()
- is provided for this purpose. It should be used on all platforms, even
- though it doesn't do anything under UNIX.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="pid" transfer-ownership="none">
- <doc xml:space="preserve">The process reference to close</doc>
- <type name="Pid" c:type="GPid"/>
- </parameter>
- </parameters>
- </function>
- <function name="spawn_command_line_async"
- c:identifier="g_spawn_command_line_async"
- throws="1">
- <doc xml:space="preserve">A simple version of g_spawn_async() that parses a command line with
- g_shell_parse_argv() and passes it to g_spawn_async(). Runs a
- command line in the background. Unlike g_spawn_async(), the
- %G_SPAWN_SEARCH_PATH flag is enabled, other flags are not. Note
- that %G_SPAWN_SEARCH_PATH can have security implications, so
- consider using g_spawn_async() directly if appropriate. Possible
- errors are those from g_shell_parse_argv() and g_spawn_async().
- The same concerns on Windows apply as for g_spawn_command_line_sync().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on success, %FALSE if error is set</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="command_line" transfer-ownership="none">
- <doc xml:space="preserve">a command line</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="spawn_command_line_sync"
- c:identifier="g_spawn_command_line_sync"
- throws="1">
- <doc xml:space="preserve">A simple version of g_spawn_sync() with little-used parameters
- removed, taking a command line instead of an argument vector. See
- g_spawn_sync() for full details. @command_line will be parsed by
- g_shell_parse_argv(). Unlike g_spawn_sync(), the %G_SPAWN_SEARCH_PATH flag
- is enabled. Note that %G_SPAWN_SEARCH_PATH can have security
- implications, so consider using g_spawn_sync() directly if
- appropriate. Possible errors are those from g_spawn_sync() and those
- from g_shell_parse_argv().
- If @exit_status is non-%NULL, the platform-specific exit status of
- the child is stored there; see the documentation of
- g_spawn_check_exit_status() for how to use and interpret this.
- On Windows, please note the implications of g_shell_parse_argv()
- parsing @command_line. Parsing is done according to Unix shell rules, not
- Windows command interpreter rules.
- Space is a separator, and backslashes are
- special. Thus you cannot simply pass a @command_line containing
- canonical Windows paths, like "c:\\program files\\app\\app.exe", as
- the backslashes will be eaten, and the space will act as a
- separator. You need to enclose such paths with single quotes, like
- "'c:\\program files\\app\\app.exe' 'e:\\folder\\argument.txt'".</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on success, %FALSE if an error was set</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="command_line" transfer-ownership="none">
- <doc xml:space="preserve">a command line</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="standard_output"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for child output</doc>
- <array c:type="gchar**">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="standard_error"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for child errors</doc>
- <array c:type="gchar**">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="exit_status"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for child exit status, as returned by waitpid()</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- </parameters>
- </function>
- <function name="spawn_error_quark" c:identifier="g_spawn_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="spawn_exit_error_quark"
- c:identifier="g_spawn_exit_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="spawn_sync" c:identifier="g_spawn_sync" throws="1">
- <doc xml:space="preserve">Executes a child synchronously (waits for the child to exit before returning).
- All output from the child is stored in @standard_output and @standard_error,
- if those parameters are non-%NULL. Note that you must set the
- %G_SPAWN_STDOUT_TO_DEV_NULL and %G_SPAWN_STDERR_TO_DEV_NULL flags when
- passing %NULL for @standard_output and @standard_error.
- If @exit_status is non-%NULL, the platform-specific exit status of
- the child is stored there; see the documentation of
- g_spawn_check_exit_status() for how to use and interpret this.
- Note that it is invalid to pass %G_SPAWN_DO_NOT_REAP_CHILD in
- @flags.
- If an error occurs, no data is returned in @standard_output,
- @standard_error, or @exit_status.
- This function calls g_spawn_async_with_pipes() internally; see that
- function for full details on the other parameters and details on
- how these functions work on Windows.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on success, %FALSE if an error was set</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="working_directory"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">child's current working directory, or %NULL to inherit parent's</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="argv" transfer-ownership="none">
- <doc xml:space="preserve">child's argument vector</doc>
- <array c:type="gchar**">
- <type name="utf8" c:type="gchar*"/>
- </array>
- </parameter>
- <parameter name="envp"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">child's environment, or %NULL to inherit parent's</doc>
- <array c:type="gchar**">
- <type name="utf8" c:type="gchar*"/>
- </array>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">flags from #GSpawnFlags</doc>
- <type name="SpawnFlags" c:type="GSpawnFlags"/>
- </parameter>
- <parameter name="child_setup"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async"
- closure="5">
- <doc xml:space="preserve">function to run in the child just before exec()</doc>
- <type name="SpawnChildSetupFunc" c:type="GSpawnChildSetupFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">user data for @child_setup</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="standard_output"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for child output, or %NULL</doc>
- <array c:type="gchar**">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="standard_error"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for child error messages, or %NULL</doc>
- <array c:type="gchar**">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="exit_status"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for child exit status, as returned by waitpid(), or %NULL</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- </parameters>
- </function>
- <function name="sprintf"
- c:identifier="g_sprintf"
- version="2.2"
- introspectable="0">
- <doc xml:space="preserve">An implementation of the standard sprintf() function which supports
- positional parameters, as specified in the Single Unix Specification.
- Note that it is usually better to use g_snprintf(), to avoid the
- risk of buffer overflow.
- See also g_strdup_printf().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes printed.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">A pointer to a memory buffer to contain the resulting string. It
- is up to the caller to ensure that the allocated buffer is large
- enough to hold the formatted result</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a standard printf() format string, but notice
- [string precision pitfalls][string-precision]</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the arguments to insert in the output.</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="stpcpy" c:identifier="g_stpcpy">
- <doc xml:space="preserve">Copies a nul-terminated string into the dest buffer, include the
- trailing nul, and return a pointer to the trailing nul byte.
- This is useful for concatenating multiple strings together
- without having to repeatedly scan for the end.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a pointer to trailing nul byte.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="dest" transfer-ownership="none">
- <doc xml:space="preserve">destination buffer.</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="src" transfer-ownership="none">
- <doc xml:space="preserve">source string.</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="str_equal" c:identifier="g_str_equal">
- <doc xml:space="preserve">Compares two strings for byte-by-byte equality and returns %TRUE
- if they are equal. It can be passed to g_hash_table_new() as the
- @key_equal_func parameter, when using non-%NULL strings as keys in a
- #GHashTable.
- Note that this function is primarily meant as a hash table comparison
- function. For a general-purpose, %NULL-safe string comparison function,
- see g_strcmp0().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the two keys match</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="v1" transfer-ownership="none">
- <doc xml:space="preserve">a key</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="v2" transfer-ownership="none">
- <doc xml:space="preserve">a key to compare with @v1</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="str_has_prefix"
- c:identifier="g_str_has_prefix"
- version="2.2">
- <doc xml:space="preserve">Looks whether the string @str begins with @prefix.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @str begins with @prefix, %FALSE otherwise.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a nul-terminated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="prefix" transfer-ownership="none">
- <doc xml:space="preserve">the nul-terminated prefix to look for</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="str_has_suffix"
- c:identifier="g_str_has_suffix"
- version="2.2">
- <doc xml:space="preserve">Looks whether the string @str ends with @suffix.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @str end with @suffix, %FALSE otherwise.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a nul-terminated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="suffix" transfer-ownership="none">
- <doc xml:space="preserve">the nul-terminated suffix to look for</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="str_hash" c:identifier="g_str_hash">
- <doc xml:space="preserve">Converts a string to a hash value.
- This function implements the widely used "djb" hash apparently
- posted by Daniel Bernstein to comp.lang.c some time ago. The 32
- bit unsigned hash value starts at 5381 and for each byte 'c' in
- the string, is updated: `hash = hash * 33 + c`. This function
- uses the signed value of each byte.
- It can be passed to g_hash_table_new() as the @hash_func parameter,
- when using non-%NULL strings as keys in a #GHashTable.
- Note that this function may not be a perfect fit for all use cases.
- For example, it produces some hash collisions with strings as short
- as 2.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a hash value corresponding to the key</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="v" transfer-ownership="none">
- <doc xml:space="preserve">a string key</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="str_is_ascii" c:identifier="g_str_is_ascii" version="2.40">
- <doc xml:space="preserve">Determines if a string is pure ASCII. A string is pure ASCII if it
- contains no bytes with the high bit set.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @str is ASCII</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="str_match_string"
- c:identifier="g_str_match_string"
- version="2.40">
- <doc xml:space="preserve">Checks if a search conducted for @search_term should match
- @potential_hit.
- This function calls g_str_tokenize_and_fold() on both
- @search_term and @potential_hit. ASCII alternates are never taken
- for @search_term but will be taken for @potential_hit according to
- the value of @accept_alternates.
- A hit occurs when each folded token in @search_term is a prefix of a
- folded token from @potential_hit.
- Depending on how you're performing the search, it will typically be
- faster to call g_str_tokenize_and_fold() on each string in
- your corpus and build an index on the returned folded tokens, then
- call g_str_tokenize_and_fold() on the search term and
- perform lookups into that index.
- As some examples, searching for "fred" would match the potential hit
- "Smith, Fred" and also "Frédéric". Searching for "Fréd" would match
- "Frédéric" but not "Frederic" (due to the one-directional nature of
- accent matching). Searching "fo" would match "Foo" and "Bar Foo
- Baz", but not "SFO" (because no word as "fo" as a prefix).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @potential_hit is a hit</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="search_term" transfer-ownership="none">
- <doc xml:space="preserve">the search term from the user</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="potential_hit" transfer-ownership="none">
- <doc xml:space="preserve">the text that may be a hit</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="accept_alternates" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE to accept ASCII alternates</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </function>
- <function name="str_to_ascii" c:identifier="g_str_to_ascii" version="2.40">
- <doc xml:space="preserve">Transliterate @str to plain ASCII.
- For best results, @str should be in composed normalised form.
- This function performs a reasonably good set of character
- replacements. The particular set of replacements that is done may
- change by version or even by runtime environment.
- If the source language of @str is known, it can used to improve the
- accuracy of the translation by passing it as @from_locale. It should
- be a valid POSIX locale string (of the form
- "language[_territory][.codeset][@modifier]").
- If @from_locale is %NULL then the current locale is used.
- If you want to do translation for no specific locale, and you want it
- to be done independently of the currently locale, specify "C" for
- @from_locale.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a string in plain ASCII</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a string, in UTF-8</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="from_locale"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the source locale, if known</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="str_tokenize_and_fold"
- c:identifier="g_str_tokenize_and_fold"
- version="2.40">
- <doc xml:space="preserve">Tokenises @string and performs folding on each token.
- A token is a non-empty sequence of alphanumeric characters in the
- source string, separated by non-alphanumeric characters. An
- "alphanumeric" character for this purpose is one that matches
- g_unichar_isalnum() or g_unichar_ismark().
- Each token is then (Unicode) normalised and case-folded. If
- @ascii_alternates is non-%NULL and some of the returned tokens
- contain non-ASCII characters, ASCII alternatives will be generated.
- The number of ASCII alternatives that are generated and the method
- for doing so is unspecified, but @translit_locale (if specified) may
- improve the transliteration if the language of the source string is
- known.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the folded tokens</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="translit_locale"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the language code (like 'de' or
- 'en_GB') from which @string originates</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="ascii_alternates"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full">
- <doc xml:space="preserve">a
- return location for ASCII alternates</doc>
- <array c:type="gchar***">
- <type name="utf8" c:type="gchar**"/>
- </array>
- </parameter>
- </parameters>
- </function>
- <function name="strcanon" c:identifier="g_strcanon">
- <doc xml:space="preserve">For each character in @string, if the character is not in @valid_chars,
- replaces the character with @substitutor. Modifies @string in place,
- and return @string itself, not a copy. The return value is to allow
- nesting such as
- |[<!-- language="C" -->
- g_ascii_strup (g_strcanon (str, "abc", '?'))
- ]|</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">@string</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a nul-terminated array of bytes</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="valid_chars" transfer-ownership="none">
- <doc xml:space="preserve">bytes permitted in @string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="substitutor" transfer-ownership="none">
- <doc xml:space="preserve">replacement character for disallowed bytes</doc>
- <type name="gchar" c:type="gchar"/>
- </parameter>
- </parameters>
- </function>
- <function name="strcasecmp"
- c:identifier="g_strcasecmp"
- deprecated="1"
- deprecated-version="2.2">
- <doc xml:space="preserve">A case-insensitive string comparison, corresponding to the standard
- strcasecmp() function on platforms which support it.</doc>
- <doc-deprecated xml:space="preserve">See g_strncasecmp() for a discussion of why this
- function is deprecated and how to replace it.</doc-deprecated>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">0 if the strings match, a negative value if @s1 < @s2,
- or a positive value if @s1 > @s2.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="s1" transfer-ownership="none">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="s2" transfer-ownership="none">
- <doc xml:space="preserve">a string to compare with @s1</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strchomp" c:identifier="g_strchomp">
- <doc xml:space="preserve">Removes trailing whitespace from a string.
- This function doesn't allocate or reallocate any memory;
- it modifies @string in place. Therefore, it cannot be used
- on statically allocated strings.
- The pointer to @string is returned to allow the nesting of functions.
- Also see g_strchug() and g_strstrip().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">@string</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a string to remove the trailing whitespace from</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strchug" c:identifier="g_strchug">
- <doc xml:space="preserve">Removes leading whitespace from a string, by moving the rest
- of the characters forward.
- This function doesn't allocate or reallocate any memory;
- it modifies @string in place. Therefore, it cannot be used on
- statically allocated strings.
- The pointer to @string is returned to allow the nesting of functions.
- Also see g_strchomp() and g_strstrip().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">@string</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a string to remove the leading whitespace from</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strcmp0" c:identifier="g_strcmp0" version="2.16">
- <doc xml:space="preserve">Compares @str1 and @str2 like strcmp(). Handles %NULL
- gracefully by sorting it before non-%NULL strings.
- Comparing two %NULL pointers returns 0.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">an integer less than, equal to, or greater than zero, if @str1 is <, == or > than @str2.</doc>
- <type name="gint" c:type="int"/>
- </return-value>
- <parameters>
- <parameter name="str1"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a C string or %NULL</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="str2"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">another C string or %NULL</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strcompress" c:identifier="g_strcompress">
- <doc xml:space="preserve">Replaces all escaped characters with their one byte equivalent.
- This function does the reverse conversion of g_strescape().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated copy of @source with all escaped
- character compressed</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a string to compress</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strconcat" c:identifier="g_strconcat" introspectable="0">
- <doc xml:space="preserve">Concatenates all of the given strings into one long string. The
- returned string should be freed with g_free() when no longer needed.
- The variable argument list must end with %NULL. If you forget the %NULL,
- g_strconcat() will start appending random memory junk to your string.
- Note that this function is usually not the right function to use to
- assemble a translated message from pieces, since proper translation
- often requires the pieces to be reordered.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string containing all the string arguments</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="string1" transfer-ownership="none">
- <doc xml:space="preserve">the first string to add, which must not be %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">a %NULL-terminated list of strings to append to the string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="strdelimit" c:identifier="g_strdelimit">
- <doc xml:space="preserve">Converts any delimiter characters in @string to @new_delimiter.
- Any characters in @string which are found in @delimiters are
- changed to the @new_delimiter character. Modifies @string in place,
- and returns @string itself, not a copy. The return value is to
- allow nesting such as
- |[<!-- language="C" -->
- g_ascii_strup (g_strdelimit (str, "abc", '?'))
- ]|</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">@string</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to convert</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="delimiters"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a string containing the current delimiters,
- or %NULL to use the standard delimiters defined in #G_STR_DELIMITERS</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="new_delimiter" transfer-ownership="none">
- <doc xml:space="preserve">the new delimiter character</doc>
- <type name="gchar" c:type="gchar"/>
- </parameter>
- </parameters>
- </function>
- <function name="strdown"
- c:identifier="g_strdown"
- deprecated="1"
- deprecated-version="2.2">
- <doc xml:space="preserve">Converts a string to lower case.</doc>
- <doc-deprecated xml:space="preserve">This function is totally broken for the reasons discussed
- in the g_strncasecmp() docs - use g_ascii_strdown() or g_utf8_strdown()
- instead.</doc-deprecated>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the string</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to convert.</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strdup" c:identifier="g_strdup">
- <doc xml:space="preserve">Duplicates a string. If @str is %NULL it returns %NULL.
- The returned string should be freed with g_free()
- when no longer needed.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated copy of @str</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the string to duplicate</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strdup_printf"
- c:identifier="g_strdup_printf"
- introspectable="0">
- <doc xml:space="preserve">Similar to the standard C sprintf() function but safer, since it
- calculates the maximum space required and allocates memory to hold
- the result. The returned string should be freed with g_free() when no
- longer needed.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string holding the result</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a standard printf() format string, but notice
- [string precision pitfalls][string-precision]</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">the parameters to insert into the format string</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="strdup_vprintf"
- c:identifier="g_strdup_vprintf"
- introspectable="0">
- <doc xml:space="preserve">Similar to the standard C vsprintf() function but safer, since it
- calculates the maximum space required and allocates memory to hold
- the result. The returned string should be freed with g_free() when
- no longer needed.
- See also g_vasprintf(), which offers the same functionality, but
- additionally returns the length of the allocated string.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string holding the result</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a standard printf() format string, but notice
- [string precision pitfalls][string-precision]</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="args" transfer-ownership="none">
- <doc xml:space="preserve">the list of parameters to insert into the format string</doc>
- <type name="va_list" c:type="va_list"/>
- </parameter>
- </parameters>
- </function>
- <function name="strdupv" c:identifier="g_strdupv" introspectable="0">
- <doc xml:space="preserve">Copies %NULL-terminated array of strings. The copy is a deep copy;
- the new array should be freed by first freeing each string, then
- the array itself. g_strfreev() does this for you. If called
- on a %NULL value, g_strdupv() simply returns %NULL.</doc>
- <return-value nullable="1">
- <doc xml:space="preserve">a new %NULL-terminated array of strings.</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="str_array"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a %NULL-terminated array of strings</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- </parameters>
- </function>
- <function name="strerror" c:identifier="g_strerror">
- <doc xml:space="preserve">Returns a string corresponding to the given error code, e.g. "no
- such process". Unlike strerror(), this always returns a string in
- UTF-8 encoding, and the pointer is guaranteed to remain valid for
- the lifetime of the process.
- Note that the string may be translated according to the current locale.
- The value of %errno will not be changed by this function.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 string describing the error code. If the error code
- is unknown, it returns a string like "unknown error (<code>)".</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="errnum" transfer-ownership="none">
- <doc xml:space="preserve">the system error number. See the standard C %errno
- documentation</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="strescape" c:identifier="g_strescape">
- <doc xml:space="preserve">Escapes the special characters '\b', '\f', '\n', '\r', '\t', '\v', '\'
- and '&quot;' in the string @source by inserting a '\' before
- them. Additionally all characters in the range 0x01-0x1F (everything
- below SPACE) and in the range 0x7F-0xFF (all non-ASCII chars) are
- replaced with a '\' followed by their octal representation.
- Characters supplied in @exceptions are not escaped.
- g_strcompress() does the reverse conversion.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated copy of @source with certain
- characters escaped. See above.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="source" transfer-ownership="none">
- <doc xml:space="preserve">a string to escape</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="exceptions"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a string of characters not to escape in @source</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strfreev" c:identifier="g_strfreev">
- <doc xml:space="preserve">Frees a %NULL-terminated array of strings, as well as each
- string it contains.
- If @str_array is %NULL, this function simply returns.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="str_array"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a %NULL-terminated array of strings to free</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- </parameters>
- </function>
- <function name="string_new" c:identifier="g_string_new">
- <doc xml:space="preserve">Creates a new #GString, initialized with the given string.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the new #GString</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <parameter name="init"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the initial text to copy into the string, or %NULL to
- start with an empty string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="string_new_len" c:identifier="g_string_new_len">
- <doc xml:space="preserve">Creates a new #GString with @len bytes of the @init buffer.
- Because a length is provided, @init need not be nul-terminated,
- and can contain embedded nul bytes.
- Since this function does not stop at nul bytes, it is the caller's
- responsibility to ensure that @init has at least @len addressable
- bytes.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a new #GString</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <parameter name="init" transfer-ownership="none">
- <doc xml:space="preserve">initial contents of the string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">length of @init to use</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="string_sized_new" c:identifier="g_string_sized_new">
- <doc xml:space="preserve">Creates a new #GString, with enough space for @dfl_size
- bytes. This is useful if you are going to add a lot of
- text to the string and don't want it to be reallocated
- too often.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the new #GString</doc>
- <type name="String" c:type="GString*"/>
- </return-value>
- <parameters>
- <parameter name="dfl_size" transfer-ownership="none">
- <doc xml:space="preserve">the default size of the space allocated to
- hold the string</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="strip_context"
- c:identifier="g_strip_context"
- version="2.4">
- <doc xml:space="preserve">An auxiliary function for gettext() support (see Q_()).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">@msgval, unless @msgval is identical to @msgid
- and contains a '|' character, in which case a pointer to
- the substring of msgid after the first '|' character is returned.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="msgid" transfer-ownership="none">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="msgval" transfer-ownership="none">
- <doc xml:space="preserve">another string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strjoin" c:identifier="g_strjoin" introspectable="0">
- <doc xml:space="preserve">Joins a number of strings together to form one long string, with the
- optional @separator inserted between each of them. The returned string
- should be freed with g_free().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string containing all of the strings joined
- together, with @separator between them</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="separator"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a string to insert between each of the
- strings, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">a %NULL-terminated list of strings to join</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="strjoinv" c:identifier="g_strjoinv">
- <doc xml:space="preserve">Joins a number of strings together to form one long string, with the
- optional @separator inserted between each of them. The returned string
- should be freed with g_free().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string containing all of the strings joined
- together, with @separator between them</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="separator"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a string to insert between each of the
- strings, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="str_array" transfer-ownership="none">
- <doc xml:space="preserve">a %NULL-terminated array of strings to join</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- </parameters>
- </function>
- <function name="strlcat" c:identifier="g_strlcat">
- <doc xml:space="preserve">Portability wrapper that calls strlcat() on systems which have it,
- and emulates it otherwise. Appends nul-terminated @src string to @dest,
- guaranteeing nul-termination for @dest. The total size of @dest won't
- exceed @dest_size.
- At most @dest_size - 1 characters will be copied. Unlike strncat(),
- @dest_size is the full size of dest, not the space left over. This
- function does not allocate memory. It always nul-terminates (unless
- @dest_size == 0 or there were no nul characters in the @dest_size
- characters of dest to start with).
- Caveat: this is supposedly a more secure alternative to strcat() or
- strncat(), but for real security g_strconcat() is harder to mess up.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">size of attempted result, which is MIN (dest_size, strlen
- (original dest)) + strlen (src), so if retval >= dest_size,
- truncation occurred.</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <parameter name="dest" transfer-ownership="none">
- <doc xml:space="preserve">destination buffer, already containing one nul-terminated string</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="src" transfer-ownership="none">
- <doc xml:space="preserve">source buffer</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="dest_size" transfer-ownership="none">
- <doc xml:space="preserve">length of @dest buffer in bytes (not length of existing string
- inside @dest)</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="strlcpy" c:identifier="g_strlcpy">
- <doc xml:space="preserve">Portability wrapper that calls strlcpy() on systems which have it,
- and emulates strlcpy() otherwise. Copies @src to @dest; @dest is
- guaranteed to be nul-terminated; @src must be nul-terminated;
- @dest_size is the buffer size, not the number of bytes to copy.
- At most @dest_size - 1 characters will be copied. Always nul-terminates
- (unless @dest_size is 0). This function does not allocate memory. Unlike
- strncpy(), this function doesn't pad @dest (so it's often faster). It
- returns the size of the attempted result, strlen (src), so if
- @retval >= @dest_size, truncation occurred.
- Caveat: strlcpy() is supposedly more secure than strcpy() or strncpy(),
- but if you really want to avoid screwups, g_strdup() is an even better
- idea.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">length of @src</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <parameter name="dest" transfer-ownership="none">
- <doc xml:space="preserve">destination buffer</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="src" transfer-ownership="none">
- <doc xml:space="preserve">source buffer</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="dest_size" transfer-ownership="none">
- <doc xml:space="preserve">length of @dest in bytes</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="strncasecmp"
- c:identifier="g_strncasecmp"
- deprecated="1"
- deprecated-version="2.2">
- <doc xml:space="preserve">A case-insensitive string comparison, corresponding to the standard
- strncasecmp() function on platforms which support it. It is similar
- to g_strcasecmp() except it only compares the first @n characters of
- the strings.</doc>
- <doc-deprecated xml:space="preserve">The problem with g_strncasecmp() is that it does
- the comparison by calling toupper()/tolower(). These functions
- are locale-specific and operate on single bytes. However, it is
- impossible to handle things correctly from an internationalization
- standpoint by operating on bytes, since characters may be multibyte.
- Thus g_strncasecmp() is broken if your string is guaranteed to be
- ASCII, since it is locale-sensitive, and it's broken if your string
- is localized, since it doesn't work on many encodings at all,
- including UTF-8, EUC-JP, etc.
- There are therefore two replacement techniques: g_ascii_strncasecmp(),
- which only works on ASCII and is not locale-sensitive, and
- g_utf8_casefold() followed by strcmp() on the resulting strings,
- which is good for case-insensitive sorting of UTF-8.</doc-deprecated>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">0 if the strings match, a negative value if @s1 < @s2,
- or a positive value if @s1 > @s2.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="s1" transfer-ownership="none">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="s2" transfer-ownership="none">
- <doc xml:space="preserve">a string to compare with @s1</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the maximum number of characters to compare</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="strndup" c:identifier="g_strndup">
- <doc xml:space="preserve">Duplicates the first @n bytes of a string, returning a newly-allocated
- buffer @n + 1 bytes long which will always be nul-terminated. If @str
- is less than @n bytes long the buffer is padded with nuls. If @str is
- %NULL it returns %NULL. The returned value should be freed when no longer
- needed.
- To copy a number of characters from a UTF-8 encoded string,
- use g_utf8_strncpy() instead.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated buffer containing the first @n bytes
- of @str, nul-terminated</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">the string to duplicate</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the maximum number of bytes to copy from @str</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="strnfill" c:identifier="g_strnfill">
- <doc xml:space="preserve">Creates a new string @length bytes long filled with @fill_char.
- The returned string should be freed when no longer needed.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string filled the @fill_char</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="length" transfer-ownership="none">
- <doc xml:space="preserve">the length of the new string</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="fill_char" transfer-ownership="none">
- <doc xml:space="preserve">the byte to fill the string with</doc>
- <type name="gchar" c:type="gchar"/>
- </parameter>
- </parameters>
- </function>
- <function name="strreverse" c:identifier="g_strreverse">
- <doc xml:space="preserve">Reverses all of the bytes in a string. For example,
- `g_strreverse ("abcdef")` will result in "fedcba".
- Note that g_strreverse() doesn't work on UTF-8 strings
- containing multibyte characters. For that purpose, use
- g_utf8_strreverse().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the same pointer passed in as @string</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to reverse</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strrstr" c:identifier="g_strrstr">
- <doc xml:space="preserve">Searches the string @haystack for the last occurrence
- of the string @needle.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a pointer to the found occurrence, or
- %NULL if not found.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="haystack" transfer-ownership="none">
- <doc xml:space="preserve">a nul-terminated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="needle" transfer-ownership="none">
- <doc xml:space="preserve">the nul-terminated string to search for</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strrstr_len" c:identifier="g_strrstr_len">
- <doc xml:space="preserve">Searches the string @haystack for the last occurrence
- of the string @needle, limiting the length of the search
- to @haystack_len.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a pointer to the found occurrence, or
- %NULL if not found.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="haystack" transfer-ownership="none">
- <doc xml:space="preserve">a nul-terminated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="haystack_len" transfer-ownership="none">
- <doc xml:space="preserve">the maximum length of @haystack</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="needle" transfer-ownership="none">
- <doc xml:space="preserve">the nul-terminated string to search for</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strsignal" c:identifier="g_strsignal">
- <doc xml:space="preserve">Returns a string describing the given signal, e.g. "Segmentation fault".
- You should use this function in preference to strsignal(), because it
- returns a string in UTF-8 encoding, and since not all platforms support
- the strsignal() function.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 string describing the signal. If the signal is unknown,
- it returns "unknown signal (<signum>)".</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="signum" transfer-ownership="none">
- <doc xml:space="preserve">the signal number. See the `signal` documentation</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="strsplit" c:identifier="g_strsplit" introspectable="0">
- <doc xml:space="preserve">Splits a string into a maximum of @max_tokens pieces, using the given
- @delimiter. If @max_tokens is reached, the remainder of @string is
- appended to the last token.
- As an example, the result of g_strsplit (":a:bc::d:", ":", -1) is a
- %NULL-terminated vector containing the six strings "", "a", "bc", "", "d"
- and "".
- As a special case, the result of splitting the empty string "" is an empty
- vector, not a vector containing a single string. The reason for this
- special case is that being able to represent a empty vector is typically
- more useful than consistent handling of empty elements. If you do need
- to represent empty elements, you'll need to check for the empty string
- before calling g_strsplit().</doc>
- <return-value>
- <doc xml:space="preserve">a newly-allocated %NULL-terminated array of strings. Use
- g_strfreev() to free it.</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a string to split</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="delimiter" transfer-ownership="none">
- <doc xml:space="preserve">a string which specifies the places at which to split
- the string. The delimiter is not included in any of the resulting
- strings, unless @max_tokens is reached.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="max_tokens" transfer-ownership="none">
- <doc xml:space="preserve">the maximum number of pieces to split @string into.
- If this is less than 1, the string is split completely.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="strsplit_set"
- c:identifier="g_strsplit_set"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">Splits @string into a number of tokens not containing any of the characters
- in @delimiter. A token is the (possibly empty) longest string that does not
- contain any of the characters in @delimiters. If @max_tokens is reached, the
- remainder is appended to the last token.
- For example the result of g_strsplit_set ("abc:def/ghi", ":/", -1) is a
- %NULL-terminated vector containing the three strings "abc", "def",
- and "ghi".
- The result of g_strsplit_set (":def/ghi:", ":/", -1) is a %NULL-terminated
- vector containing the four strings "", "def", "ghi", and "".
- As a special case, the result of splitting the empty string "" is an empty
- vector, not a vector containing a single string. The reason for this
- special case is that being able to represent a empty vector is typically
- more useful than consistent handling of empty elements. If you do need
- to represent empty elements, you'll need to check for the empty string
- before calling g_strsplit_set().
- Note that this function works on bytes not characters, so it can't be used
- to delimit UTF-8 strings for anything but ASCII characters.</doc>
- <return-value>
- <doc xml:space="preserve">a newly-allocated %NULL-terminated array of strings. Use
- g_strfreev() to free it.</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">The string to be tokenized</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="delimiters" transfer-ownership="none">
- <doc xml:space="preserve">A nul-terminated string containing bytes that are used
- to split the string.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="max_tokens" transfer-ownership="none">
- <doc xml:space="preserve">The maximum number of tokens to split @string into.
- If this is less than 1, the string is split completely</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="strstr_len" c:identifier="g_strstr_len">
- <doc xml:space="preserve">Searches the string @haystack for the first occurrence
- of the string @needle, limiting the length of the search
- to @haystack_len.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a pointer to the found occurrence, or
- %NULL if not found.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="haystack" transfer-ownership="none">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="haystack_len" transfer-ownership="none">
- <doc xml:space="preserve">the maximum length of @haystack. Note that -1 is
- a valid length, if @haystack is nul-terminated, meaning it will
- search through the whole string.</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="needle" transfer-ownership="none">
- <doc xml:space="preserve">the string to search for</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strtod" c:identifier="g_strtod">
- <doc xml:space="preserve">Converts a string to a #gdouble value.
- It calls the standard strtod() function to handle the conversion, but
- if the string is not completely converted it attempts the conversion
- again with g_ascii_strtod(), and returns the best match.
- This function should seldom be used. The normal situation when reading
- numbers not for human consumption is to use g_ascii_strtod(). Only when
- you know that you must expect both locale formatted and C formatted numbers
- should you use this. Make sure that you don't pass strings such as comma
- separated lists of values, since the commas may be interpreted as a decimal
- point in some locales, causing unexpected results.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the #gdouble value.</doc>
- <type name="gdouble" c:type="gdouble"/>
- </return-value>
- <parameters>
- <parameter name="nptr" transfer-ownership="none">
- <doc xml:space="preserve">the string to convert to a numeric value.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="endptr"
- direction="out"
- caller-allocates="0"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">if non-%NULL, it returns the
- character after the last character used in the conversion.</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- </parameters>
- </function>
- <function name="strup"
- c:identifier="g_strup"
- deprecated="1"
- deprecated-version="2.2">
- <doc xml:space="preserve">Converts a string to upper case.</doc>
- <doc-deprecated xml:space="preserve">This function is totally broken for the reasons
- discussed in the g_strncasecmp() docs - use g_ascii_strup()
- or g_utf8_strup() instead.</doc-deprecated>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the string</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the string to convert</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strv_contains"
- c:identifier="g_strv_contains"
- version="2.44">
- <doc xml:space="preserve">Checks if @strv contains @str. @strv must not be %NULL.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @str is an element of @strv, according to g_str_equal().</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="strv" transfer-ownership="none">
- <doc xml:space="preserve">a %NULL-terminated array of strings</doc>
- <type name="utf8" c:type="const gchar* const*"/>
- </parameter>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="strv_get_type" c:identifier="g_strv_get_type">
- <return-value transfer-ownership="none">
- <type name="GType" c:type="GType"/>
- </return-value>
- </function>
- <function name="strv_length" c:identifier="g_strv_length" version="2.6">
- <doc xml:space="preserve">Returns the length of the given %NULL-terminated
- string array @str_array.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">length of @str_array.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="str_array" transfer-ownership="none">
- <doc xml:space="preserve">a %NULL-terminated array of strings</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_add_data_func"
- c:identifier="g_test_add_data_func"
- version="2.16">
- <doc xml:space="preserve">Create a new test case, similar to g_test_create_case(). However
- the test is assumed to use no fixture, and test suites are automatically
- created on the fly and added to the root fixture, based on the
- slash-separated portions of @testpath. The @test_data argument
- will be passed as first argument to @test_func.
- If @testpath includes the component "subprocess" anywhere in it,
- the test will be skipped by default, and only run if explicitly
- required via the `-p` command-line option or g_test_trap_subprocess().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="testpath" transfer-ownership="none">
- <doc xml:space="preserve">/-separated test case path name for the test.</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="test_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">Test data argument for the test function.</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="test_func" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">The test function to invoke for this test.</doc>
- <type name="TestDataFunc" c:type="GTestDataFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_add_data_func_full"
- c:identifier="g_test_add_data_func_full"
- version="2.34">
- <doc xml:space="preserve">Create a new test case, as with g_test_add_data_func(), but freeing
- @test_data after the test run is complete.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="testpath" transfer-ownership="none">
- <doc xml:space="preserve">/-separated test case path name for the test.</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="test_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">Test data argument for the test function.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="test_func"
- transfer-ownership="none"
- scope="notified"
- destroy="3">
- <doc xml:space="preserve">The test function to invoke for this test.</doc>
- <type name="TestDataFunc" c:type="GTestDataFunc"/>
- </parameter>
- <parameter name="data_free_func"
- transfer-ownership="none"
- scope="async">
- <doc xml:space="preserve">#GDestroyNotify for @test_data.</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_add_func"
- c:identifier="g_test_add_func"
- version="2.16">
- <doc xml:space="preserve">Create a new test case, similar to g_test_create_case(). However
- the test is assumed to use no fixture, and test suites are automatically
- created on the fly and added to the root fixture, based on the
- slash-separated portions of @testpath.
- If @testpath includes the component "subprocess" anywhere in it,
- the test will be skipped by default, and only run if explicitly
- required via the `-p` command-line option or g_test_trap_subprocess().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="testpath" transfer-ownership="none">
- <doc xml:space="preserve">/-separated test case path name for the test.</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="test_func" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">The test function to invoke for this test.</doc>
- <type name="TestFunc" c:type="GTestFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_add_vtable"
- c:identifier="g_test_add_vtable"
- introspectable="0">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="testpath" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="data_size" transfer-ownership="none">
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="test_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="data_setup" transfer-ownership="none">
- <type name="TestFixtureFunc" c:type="GTestFixtureFunc"/>
- </parameter>
- <parameter name="data_test" transfer-ownership="none">
- <type name="TestFixtureFunc" c:type="GTestFixtureFunc"/>
- </parameter>
- <parameter name="data_teardown" transfer-ownership="none">
- <type name="TestFixtureFunc" c:type="GTestFixtureFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_assert_expected_messages_internal"
- c:identifier="g_test_assert_expected_messages_internal">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="domain" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="file" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="line" transfer-ownership="none">
- <type name="gint" c:type="int"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_bug" c:identifier="g_test_bug" version="2.16">
- <doc xml:space="preserve">This function adds a message to test reports that
- associates a bug URI with a test case.
- Bug URIs are constructed from a base URI set with g_test_bug_base()
- and @bug_uri_snippet.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="bug_uri_snippet" transfer-ownership="none">
- <doc xml:space="preserve">Bug specific bug tracker URI portion.</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_bug_base"
- c:identifier="g_test_bug_base"
- version="2.16">
- <doc xml:space="preserve">Specify the base URI for bug reports.
- The base URI is used to construct bug report messages for
- g_test_message() when g_test_bug() is called.
- Calling this function outside of a test case sets the
- default base URI for all test cases. Calling it from within
- a test case changes the base URI for the scope of the test
- case only.
- Bug URIs are constructed by appending a bug specific URI
- portion to @uri_pattern, or by replacing the special string
- '\%s' within @uri_pattern if that is present.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="uri_pattern" transfer-ownership="none">
- <doc xml:space="preserve">the base pattern for bug URIs</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_build_filename"
- c:identifier="g_test_build_filename"
- version="2.38"
- introspectable="0">
- <doc xml:space="preserve">Creates the pathname to a data file that is required for a test.
- This function is conceptually similar to g_build_filename() except
- that the first argument has been replaced with a #GTestFileType
- argument.
- The data file should either have been distributed with the module
- containing the test (%G_TEST_DIST) or built as part of the build
- system of that module (%G_TEST_BUILT).
- In order for this function to work in srcdir != builddir situations,
- the G_TEST_SRCDIR and G_TEST_BUILDDIR environment variables need to
- have been defined. As of 2.38, this is done by the glib.mk
- included in GLib. Please ensure that your copy is up to date before
- using this function.
- In case neither variable is set, this function will fall back to
- using the dirname portion of argv[0], possibly removing ".libs".
- This allows for casual running of tests directly from the commandline
- in the srcdir == builddir case and should also support running of
- installed tests, assuming the data files have been installed in the
- same relative path as the test binary.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the path of the file, to be freed using g_free()</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="file_type" transfer-ownership="none">
- <doc xml:space="preserve">the type of file (built vs. distributed)</doc>
- <type name="TestFileType" c:type="GTestFileType"/>
- </parameter>
- <parameter name="first_path" transfer-ownership="none">
- <doc xml:space="preserve">the first segment of the pathname</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">%NULL-terminated additional path segments</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="test_create_case"
- c:identifier="g_test_create_case"
- version="2.16"
- introspectable="0">
- <doc xml:space="preserve">Create a new #GTestCase, named @test_name, this API is fairly
- low level, calling g_test_add() or g_test_add_func() is preferable.
- When this test is executed, a fixture structure of size @data_size
- will be automatically allocated and filled with zeros. Then @data_setup is
- called to initialize the fixture. After fixture setup, the actual test
- function @data_test is called. Once the test run completes, the
- fixture structure is torn down by calling @data_teardown and
- after that the memory is automatically released by the test framework.
- Splitting up a test run into fixture setup, test function and
- fixture teardown is most useful if the same fixture is used for
- multiple tests. In this cases, g_test_create_case() will be
- called with the same fixture, but varying @test_name and
- @data_test arguments.</doc>
- <return-value>
- <doc xml:space="preserve">a newly allocated #GTestCase.</doc>
- <type name="TestCase" c:type="GTestCase*"/>
- </return-value>
- <parameters>
- <parameter name="test_name" transfer-ownership="none">
- <doc xml:space="preserve">the name for the test case</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="data_size" transfer-ownership="none">
- <doc xml:space="preserve">the size of the fixture data structure</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="test_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">test data argument for the test functions</doc>
- <type name="gpointer" c:type="gconstpointer"/>
- </parameter>
- <parameter name="data_setup" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">the function to set up the fixture data</doc>
- <type name="TestFixtureFunc" c:type="GTestFixtureFunc"/>
- </parameter>
- <parameter name="data_test" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">the actual test function</doc>
- <type name="TestFixtureFunc" c:type="GTestFixtureFunc"/>
- </parameter>
- <parameter name="data_teardown"
- transfer-ownership="none"
- scope="async">
- <doc xml:space="preserve">the function to teardown the fixture data</doc>
- <type name="TestFixtureFunc" c:type="GTestFixtureFunc"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_create_suite"
- c:identifier="g_test_create_suite"
- version="2.16"
- introspectable="0">
- <doc xml:space="preserve">Create a new test suite with the name @suite_name.</doc>
- <return-value>
- <doc xml:space="preserve">A newly allocated #GTestSuite instance.</doc>
- <type name="TestSuite" c:type="GTestSuite*"/>
- </return-value>
- <parameters>
- <parameter name="suite_name" transfer-ownership="none">
- <doc xml:space="preserve">a name for the suite</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_expect_message"
- c:identifier="g_test_expect_message"
- version="2.34">
- <doc xml:space="preserve">Indicates that a message with the given @log_domain and @log_level,
- with text matching @pattern, is expected to be logged. When this
- message is logged, it will not be printed, and the test case will
- not abort.
- Use g_test_assert_expected_messages() to assert that all
- previously-expected messages have been seen and suppressed.
- You can call this multiple times in a row, if multiple messages are
- expected as a result of a single call. (The messages must appear in
- the same order as the calls to g_test_expect_message().)
- For example:
- |[<!-- language="C" -->
- // g_main_context_push_thread_default() should fail if the
- // context is already owned by another thread.
- g_test_expect_message (G_LOG_DOMAIN,
- G_LOG_LEVEL_CRITICAL,
- "assertion*acquired_context*failed");
- g_main_context_push_thread_default (bad_context);
- g_test_assert_expected_messages ();
- ]|
- Note that you cannot use this to test g_error() messages, since
- g_error() intentionally never returns even if the program doesn't
- abort; use g_test_trap_subprocess() in this case.
- If messages at %G_LOG_LEVEL_DEBUG are emitted, but not explicitly
- expected via g_test_expect_message() then they will be ignored.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="log_domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the log domain of the message</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="log_level" transfer-ownership="none">
- <doc xml:space="preserve">the log level of the message</doc>
- <type name="LogLevelFlags" c:type="GLogLevelFlags"/>
- </parameter>
- <parameter name="pattern" transfer-ownership="none">
- <doc xml:space="preserve">a glob-style [pattern][glib-Glob-style-pattern-matching]</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_fail" c:identifier="g_test_fail" version="2.30">
- <doc xml:space="preserve">Indicates that a test failed. This function can be called
- multiple times from the same test. You can use this function
- if your test failed in a recoverable way.
- Do not use this function if the failure of a test could cause
- other tests to malfunction.
- Calling this function will not stop the test from running, you
- need to return from the test function yourself. So you can
- produce additional diagnostic messages or even continue running
- the test.
- If not called from inside a test, this function does nothing.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- </function>
- <function name="test_failed" c:identifier="g_test_failed" version="2.38">
- <doc xml:space="preserve">Returns whether a test has already failed. This will
- be the case when g_test_fail(), g_test_incomplete()
- or g_test_skip() have been called, but also if an
- assertion has failed.
- This can be useful to return early from a test if
- continuing after a failed assertion might be harmful.
- The return value of this function is only meaningful
- if it is called from inside a test function.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the test has failed</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- </function>
- <function name="test_get_dir" c:identifier="g_test_get_dir" version="2.38">
- <doc xml:space="preserve">Gets the pathname of the directory containing test files of the type
- specified by @file_type.
- This is approximately the same as calling g_test_build_filename("."),
- but you don't need to free the return value.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the path of the directory, owned by GLib</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="file_type" transfer-ownership="none">
- <doc xml:space="preserve">the type of file (built vs. distributed)</doc>
- <type name="TestFileType" c:type="GTestFileType"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_get_filename"
- c:identifier="g_test_get_filename"
- version="2.38"
- introspectable="0">
- <doc xml:space="preserve">Gets the pathname to a data file that is required for a test.
- This is the same as g_test_build_filename() with two differences.
- The first difference is that must only use this function from within
- a testcase function. The second difference is that you need not free
- the return value -- it will be automatically freed when the testcase
- finishes running.
- It is safe to use this function from a thread inside of a testcase
- but you must ensure that all such uses occur before the main testcase
- function returns (ie: it is best to ensure that all threads have been
- joined).</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the path, automatically freed at the end of the testcase</doc>
- <type name="utf8" c:type="const gchar*"/>
- </return-value>
- <parameters>
- <parameter name="file_type" transfer-ownership="none">
- <doc xml:space="preserve">the type of file (built vs. distributed)</doc>
- <type name="TestFileType" c:type="GTestFileType"/>
- </parameter>
- <parameter name="first_path" transfer-ownership="none">
- <doc xml:space="preserve">the first segment of the pathname</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">%NULL-terminated additional path segments</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="test_get_root"
- c:identifier="g_test_get_root"
- version="2.16"
- introspectable="0">
- <doc xml:space="preserve">Get the toplevel test suite for the test path API.</doc>
- <return-value>
- <doc xml:space="preserve">the toplevel #GTestSuite</doc>
- <type name="TestSuite" c:type="GTestSuite*"/>
- </return-value>
- </function>
- <function name="test_incomplete"
- c:identifier="g_test_incomplete"
- version="2.38">
- <doc xml:space="preserve">Indicates that a test failed because of some incomplete
- functionality. This function can be called multiple times
- from the same test.
- Calling this function will not stop the test from running, you
- need to return from the test function yourself. So you can
- produce additional diagnostic messages or even continue running
- the test.
- If not called from inside a test, this function does nothing.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="msg"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">explanation</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_init"
- c:identifier="g_test_init"
- version="2.16"
- introspectable="0">
- <doc xml:space="preserve">Initialize the GLib testing framework, e.g. by seeding the
- test random number generator, the name for g_get_prgname()
- and parsing test related command line args.
- So far, the following arguments are understood:
- - `-l`: List test cases available in a test executable.
- - `--seed=SEED`: Provide a random seed to reproduce test
- runs using random numbers.
- - `--verbose`: Run tests verbosely.
- - `-q`, `--quiet`: Run tests quietly.
- - `-p PATH`: Execute all tests matching the given path.
- This can also be used to force a test to run that would otherwise
- be skipped (ie, a test whose name contains "/subprocess").
- - `-m {perf|slow|thorough|quick|undefined|no-undefined}`: Execute tests according to these test modes:
- `perf`: Performance tests, may take long and report results.
- `slow`, `thorough`: Slow and thorough tests, may take quite long and maximize coverage.
- `quick`: Quick tests, should run really quickly and give good coverage.
- `undefined`: Tests for undefined behaviour, may provoke programming errors
- under g_test_trap_subprocess() or g_test_expect_messages() to check
- that appropriate assertions or warnings are given
- `no-undefined`: Avoid tests for undefined behaviour
- - `--debug-log`: Debug test logging output.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="argc" transfer-ownership="none">
- <doc xml:space="preserve">Address of the @argc parameter of the main() function.
- Changed if any arguments were handled.</doc>
- <type name="gint" c:type="int*"/>
- </parameter>
- <parameter name="argv" transfer-ownership="none">
- <doc xml:space="preserve">Address of the @argv parameter of main().
- Any parameters understood by g_test_init() stripped before return.</doc>
- <type name="utf8" c:type="char***"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">%NULL-terminated list of special options. Currently the only
- defined option is `"no_g_set_prgname"`, which
- will cause g_test_init() to not call g_set_prgname().</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="test_log_set_fatal_handler"
- c:identifier="g_test_log_set_fatal_handler"
- version="2.22"
- introspectable="0">
- <doc xml:space="preserve">Installs a non-error fatal log handler which can be
- used to decide whether log messages which are counted
- as fatal abort the program.
- The use case here is that you are running a test case
- that depends on particular libraries or circumstances
- and cannot prevent certain known critical or warning
- messages. So you install a handler that compares the
- domain and message to precisely not abort in such a case.
- Note that the handler is reset at the beginning of
- any test case, so you have to set it inside each test
- function which needs the special behavior.
- This handler has no effect on g_error messages.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="log_func" transfer-ownership="none" closure="1">
- <doc xml:space="preserve">the log handler function.</doc>
- <type name="TestLogFatalFunc" c:type="GTestLogFatalFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data passed to the log handler.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_log_type_name" c:identifier="g_test_log_type_name">
- <return-value transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </return-value>
- <parameters>
- <parameter name="log_type" transfer-ownership="none">
- <type name="TestLogType" c:type="GTestLogType"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_maximized_result"
- c:identifier="g_test_maximized_result"
- version="2.16"
- introspectable="0">
- <doc xml:space="preserve">Report the result of a performance or measurement test.
- The test should generally strive to maximize the reported
- quantities (larger values are better than smaller ones),
- this and @maximized_quantity can determine sorting
- order for test result reports.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="maximized_quantity" transfer-ownership="none">
- <doc xml:space="preserve">the reported value</doc>
- <type name="gdouble" c:type="double"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">the format string of the report message</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">arguments to pass to the printf() function</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="test_message"
- c:identifier="g_test_message"
- version="2.16"
- introspectable="0">
- <doc xml:space="preserve">Add a message to the test report.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">the format string</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">printf-like arguments to @format</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="test_minimized_result"
- c:identifier="g_test_minimized_result"
- version="2.16"
- introspectable="0">
- <doc xml:space="preserve">Report the result of a performance or measurement test.
- The test should generally strive to minimize the reported
- quantities (smaller values are better than larger ones),
- this and @minimized_quantity can determine sorting
- order for test result reports.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="minimized_quantity" transfer-ownership="none">
- <doc xml:space="preserve">the reported value</doc>
- <type name="gdouble" c:type="double"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">the format string of the report message</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="..." transfer-ownership="none">
- <doc xml:space="preserve">arguments to pass to the printf() function</doc>
- <varargs/>
- </parameter>
- </parameters>
- </function>
- <function name="test_queue_destroy"
- c:identifier="g_test_queue_destroy"
- version="2.16">
- <doc xml:space="preserve">This function enqueus a callback @destroy_func to be executed
- during the next test case teardown phase. This is most useful
- to auto destruct allocted test resources at the end of a test run.
- Resources are released in reverse queue order, that means enqueueing
- callback A before callback B will cause B() to be called before
- A() during teardown.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="destroy_func" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">Destroy callback for teardown phase.</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- <parameter name="destroy_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">Destroy callback data.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_queue_free"
- c:identifier="g_test_queue_free"
- version="2.16">
- <doc xml:space="preserve">Enqueue a pointer to be released with g_free() during the next
- teardown phase. This is equivalent to calling g_test_queue_destroy()
- with a destroy callback of g_free().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="gfree_pointer"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the pointer to be stored.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_rand_double"
- c:identifier="g_test_rand_double"
- version="2.16">
- <doc xml:space="preserve">Get a reproducible random floating point number,
- see g_test_rand_int() for details on test case random numbers.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a random number from the seeded random number generator.</doc>
- <type name="gdouble" c:type="double"/>
- </return-value>
- </function>
- <function name="test_rand_double_range"
- c:identifier="g_test_rand_double_range"
- version="2.16">
- <doc xml:space="preserve">Get a reproducible random floating pointer number out of a specified range,
- see g_test_rand_int() for details on test case random numbers.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a number with @range_start <= number < @range_end.</doc>
- <type name="gdouble" c:type="double"/>
- </return-value>
- <parameters>
- <parameter name="range_start" transfer-ownership="none">
- <doc xml:space="preserve">the minimum value returned by this function</doc>
- <type name="gdouble" c:type="double"/>
- </parameter>
- <parameter name="range_end" transfer-ownership="none">
- <doc xml:space="preserve">the minimum value not returned by this function</doc>
- <type name="gdouble" c:type="double"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_rand_int"
- c:identifier="g_test_rand_int"
- version="2.16">
- <doc xml:space="preserve">Get a reproducible random integer number.
- The random numbers generated by the g_test_rand_*() family of functions
- change with every new test program start, unless the --seed option is
- given when starting test programs.
- For individual test cases however, the random number generator is
- reseeded, to avoid dependencies between tests and to make --seed
- effective for all test cases.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a random number from the seeded random number generator.</doc>
- <type name="gint32" c:type="gint32"/>
- </return-value>
- </function>
- <function name="test_rand_int_range"
- c:identifier="g_test_rand_int_range"
- version="2.16">
- <doc xml:space="preserve">Get a reproducible random integer number out of a specified range,
- see g_test_rand_int() for details on test case random numbers.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a number with @begin <= number < @end.</doc>
- <type name="gint32" c:type="gint32"/>
- </return-value>
- <parameters>
- <parameter name="begin" transfer-ownership="none">
- <doc xml:space="preserve">the minimum value returned by this function</doc>
- <type name="gint32" c:type="gint32"/>
- </parameter>
- <parameter name="end" transfer-ownership="none">
- <doc xml:space="preserve">the smallest value not to be returned by this function</doc>
- <type name="gint32" c:type="gint32"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_run" c:identifier="g_test_run" version="2.16">
- <doc xml:space="preserve">Runs all tests under the toplevel suite which can be retrieved
- with g_test_get_root(). Similar to g_test_run_suite(), the test
- cases to be run are filtered according to test path arguments
- (`-p testpath`) as parsed by g_test_init(). g_test_run_suite()
- or g_test_run() may only be called once in a program.
- In general, the tests and sub-suites within each suite are run in
- the order in which they are defined. However, note that prior to
- GLib 2.36, there was a bug in the `g_test_add_*`
- functions which caused them to create multiple suites with the same
- name, meaning that if you created tests "/foo/simple",
- "/bar/simple", and "/foo/using-bar" in that order, they would get
- run in that order (since g_test_run() would run the first "/foo"
- suite, then the "/bar" suite, then the second "/foo" suite). As of
- 2.36, this bug is fixed, and adding the tests in that order would
- result in a running order of "/foo/simple", "/foo/using-bar",
- "/bar/simple". If this new ordering is sub-optimal (because it puts
- more-complicated tests before simpler ones, making it harder to
- figure out exactly what has failed), you can fix it by changing the
- test paths to group tests by suite in a way that will result in the
- desired running order. Eg, "/simple/foo", "/simple/bar",
- "/complex/foo-using-bar".
- However, you should never make the actual result of a test depend
- on the order that tests are run in. If you need to ensure that some
- particular code runs before or after a given test case, use
- g_test_add(), which lets you specify setup and teardown functions.
- If all tests are skipped, this function will return 0 if
- producing TAP output, or 77 (treated as "skip test" by Automake) otherwise.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">0 on success, 1 on failure (assuming it returns at all),
- 0 or 77 if all tests were skipped with g_test_skip()</doc>
- <type name="gint" c:type="int"/>
- </return-value>
- </function>
- <function name="test_run_suite"
- c:identifier="g_test_run_suite"
- version="2.16">
- <doc xml:space="preserve">Execute the tests within @suite and all nested #GTestSuites.
- The test suites to be executed are filtered according to
- test path arguments (`-p testpath`) as parsed by g_test_init().
- See the g_test_run() documentation for more information on the
- order that tests are run in.
- g_test_run_suite() or g_test_run() may only be called once
- in a program.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">0 on success</doc>
- <type name="gint" c:type="int"/>
- </return-value>
- <parameters>
- <parameter name="suite" transfer-ownership="none">
- <doc xml:space="preserve">a #GTestSuite</doc>
- <type name="TestSuite" c:type="GTestSuite*"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_set_nonfatal_assertions"
- c:identifier="g_test_set_nonfatal_assertions"
- version="2.38">
- <doc xml:space="preserve">Changes the behaviour of g_assert_cmpstr(), g_assert_cmpint(),
- g_assert_cmpuint(), g_assert_cmphex(), g_assert_cmpfloat(),
- g_assert_true(), g_assert_false(), g_assert_null(), g_assert_no_error(),
- g_assert_error(), g_test_assert_expected_messages() and the various
- g_test_trap_assert_*() macros to not abort to program, but instead
- call g_test_fail() and continue. (This also changes the behavior of
- g_test_fail() so that it will not cause the test program to abort
- after completing the failed test.)
- Note that the g_assert_not_reached() and g_assert() are not
- affected by this.
- This function can only be called after g_test_init().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- </function>
- <function name="test_skip" c:identifier="g_test_skip" version="2.38">
- <doc xml:space="preserve">Indicates that a test was skipped.
- Calling this function will not stop the test from running, you
- need to return from the test function yourself. So you can
- produce additional diagnostic messages or even continue running
- the test.
- If not called from inside a test, this function does nothing.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="msg"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">explanation</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_subprocess"
- c:identifier="g_test_subprocess"
- version="2.38">
- <doc xml:space="preserve">Returns %TRUE (after g_test_init() has been called) if the test
- program is running under g_test_trap_subprocess().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the test program is running under
- g_test_trap_subprocess().</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- </function>
- <function name="test_timer_elapsed"
- c:identifier="g_test_timer_elapsed"
- version="2.16">
- <doc xml:space="preserve">Get the time since the last start of the timer with g_test_timer_start().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the time since the last start of the timer, as a double</doc>
- <type name="gdouble" c:type="double"/>
- </return-value>
- </function>
- <function name="test_timer_last"
- c:identifier="g_test_timer_last"
- version="2.16">
- <doc xml:space="preserve">Report the last result of g_test_timer_elapsed().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the last result of g_test_timer_elapsed(), as a double</doc>
- <type name="gdouble" c:type="double"/>
- </return-value>
- </function>
- <function name="test_timer_start"
- c:identifier="g_test_timer_start"
- version="2.16">
- <doc xml:space="preserve">Start a timing test. Call g_test_timer_elapsed() when the task is supposed
- to be done. Call this function again to restart the timer.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- </function>
- <function name="test_trap_assertions"
- c:identifier="g_test_trap_assertions">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="domain" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="file" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="line" transfer-ownership="none">
- <type name="gint" c:type="int"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="assertion_flags" transfer-ownership="none">
- <type name="guint64" c:type="guint64"/>
- </parameter>
- <parameter name="pattern" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_trap_fork"
- c:identifier="g_test_trap_fork"
- version="2.16"
- deprecated="1">
- <doc xml:space="preserve">Fork the current test program to execute a test case that might
- not return or that might abort.
- If @usec_timeout is non-0, the forked test case is aborted and
- considered failing if its run time exceeds it.
- The forking behavior can be configured with the #GTestTrapFlags flags.
- In the following example, the test code forks, the forked child
- process produces some sample output and exits successfully.
- The forking parent process then asserts successful child program
- termination and validates child program outputs.
- |[<!-- language="C" -->
- static void
- test_fork_patterns (void)
- {
- if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR))
- {
- g_print ("some stdout text: somagic17\n");
- g_printerr ("some stderr text: semagic43\n");
- exit (0); // successful test run
- }
- g_test_trap_assert_passed ();
- g_test_trap_assert_stdout ("*somagic17*");
- g_test_trap_assert_stderr ("*semagic43*");
- }
- ]|</doc>
- <doc-deprecated xml:space="preserve">This function is implemented only on Unix platforms,
- and is not always reliable due to problems inherent in
- fork-without-exec. Use g_test_trap_subprocess() instead.</doc-deprecated>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE for the forked child and %FALSE for the executing parent process.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="usec_timeout" transfer-ownership="none">
- <doc xml:space="preserve">Timeout for the forked test in micro seconds.</doc>
- <type name="guint64" c:type="guint64"/>
- </parameter>
- <parameter name="test_trap_flags" transfer-ownership="none">
- <doc xml:space="preserve">Flags to modify forking behaviour.</doc>
- <type name="TestTrapFlags" c:type="GTestTrapFlags"/>
- </parameter>
- </parameters>
- </function>
- <function name="test_trap_has_passed"
- c:identifier="g_test_trap_has_passed"
- version="2.16">
- <doc xml:space="preserve">Check the result of the last g_test_trap_subprocess() call.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the last test subprocess terminated successfully.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- </function>
- <function name="test_trap_reached_timeout"
- c:identifier="g_test_trap_reached_timeout"
- version="2.16">
- <doc xml:space="preserve">Check the result of the last g_test_trap_subprocess() call.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the last test subprocess got killed due to a timeout.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- </function>
- <function name="test_trap_subprocess"
- c:identifier="g_test_trap_subprocess"
- version="2.38">
- <doc xml:space="preserve">Respawns the test program to run only @test_path in a subprocess.
- This can be used for a test case that might not return, or that
- might abort.
- If @test_path is %NULL then the same test is re-run in a subprocess.
- You can use g_test_subprocess() to determine whether the test is in
- a subprocess or not.
- @test_path can also be the name of the parent test, followed by
- "`/subprocess/`" and then a name for the specific subtest (or just
- ending with "`/subprocess`" if the test only has one child test);
- tests with names of this form will automatically be skipped in the
- parent process.
- If @usec_timeout is non-0, the test subprocess is aborted and
- considered failing if its run time exceeds it.
- The subprocess behavior can be configured with the
- #GTestSubprocessFlags flags.
- You can use methods such as g_test_trap_assert_passed(),
- g_test_trap_assert_failed(), and g_test_trap_assert_stderr() to
- check the results of the subprocess. (But note that
- g_test_trap_assert_stdout() and g_test_trap_assert_stderr()
- cannot be used if @test_flags specifies that the child should
- inherit the parent stdout/stderr.)
- If your `main ()` needs to behave differently in
- the subprocess, you can call g_test_subprocess() (after calling
- g_test_init()) to see whether you are in a subprocess.
- The following example tests that calling
- `my_object_new(1000000)` will abort with an error
- message.
- |[<!-- language="C" -->
- static void
- test_create_large_object (void)
- {
- if (g_test_subprocess ())
- {
- my_object_new (1000000);
- return;
- }
- // Reruns this same test in a subprocess
- g_test_trap_subprocess (NULL, 0, 0);
- g_test_trap_assert_failed ();
- g_test_trap_assert_stderr ("*ERROR*too large*");
- }
- int
- main (int argc, char **argv)
- {
- g_test_init (&argc, &argv, NULL);
- g_test_add_func ("/myobject/create_large_object",
- test_create_large_object);
- return g_test_run ();
- }
- ]|</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="test_path"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">Test to run in a subprocess</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="usec_timeout" transfer-ownership="none">
- <doc xml:space="preserve">Timeout for the subprocess test in micro seconds.</doc>
- <type name="guint64" c:type="guint64"/>
- </parameter>
- <parameter name="test_flags" transfer-ownership="none">
- <doc xml:space="preserve">Flags to modify subprocess behaviour.</doc>
- <type name="TestSubprocessFlags" c:type="GTestSubprocessFlags"/>
- </parameter>
- </parameters>
- </function>
- <function name="thread_error_quark"
- c:identifier="g_thread_error_quark"
- moved-to="Thread.error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="thread_exit"
- c:identifier="g_thread_exit"
- moved-to="Thread.exit">
- <doc xml:space="preserve">Terminates the current thread.
- If another thread is waiting for us using g_thread_join() then the
- waiting thread will be woken up and get @retval as the return value
- of g_thread_join().
- Calling g_thread_exit() with a parameter @retval is equivalent to
- returning @retval from the function @func, as given to g_thread_new().
- You must only call g_thread_exit() from a thread that you created
- yourself with g_thread_new() or related APIs. You must not call
- this function from a thread created with another threading library
- or or from within a #GThreadPool.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="retval"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the return value of this thread</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="thread_pool_get_max_idle_time"
- c:identifier="g_thread_pool_get_max_idle_time"
- moved-to="ThreadPool.get_max_idle_time"
- version="2.10">
- <doc xml:space="preserve">This function will return the maximum @interval that a
- thread will wait in the thread pool for new tasks before
- being stopped.
- If this function returns 0, threads waiting in the thread
- pool for new work are not stopped.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the maximum @interval (milliseconds) to wait
- for new tasks in the thread pool before stopping the
- thread</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- </function>
- <function name="thread_pool_get_max_unused_threads"
- c:identifier="g_thread_pool_get_max_unused_threads"
- moved-to="ThreadPool.get_max_unused_threads">
- <doc xml:space="preserve">Returns the maximal allowed number of unused threads.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the maximal number of unused threads</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- </function>
- <function name="thread_pool_get_num_unused_threads"
- c:identifier="g_thread_pool_get_num_unused_threads"
- moved-to="ThreadPool.get_num_unused_threads">
- <doc xml:space="preserve">Returns the number of currently unused threads.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of currently unused threads</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- </function>
- <function name="thread_pool_set_max_idle_time"
- c:identifier="g_thread_pool_set_max_idle_time"
- moved-to="ThreadPool.set_max_idle_time"
- version="2.10">
- <doc xml:space="preserve">This function will set the maximum @interval that a thread
- waiting in the pool for new tasks can be idle for before
- being stopped. This function is similar to calling
- g_thread_pool_stop_unused_threads() on a regular timeout,
- except this is done on a per thread basis.
- By setting @interval to 0, idle threads will not be stopped.
- The default value is 15000 (15 seconds).</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="interval" transfer-ownership="none">
- <doc xml:space="preserve">the maximum @interval (in milliseconds)
- a thread can be idle</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="thread_pool_set_max_unused_threads"
- c:identifier="g_thread_pool_set_max_unused_threads"
- moved-to="ThreadPool.set_max_unused_threads">
- <doc xml:space="preserve">Sets the maximal number of unused threads to @max_threads.
- If @max_threads is -1, no limit is imposed on the number
- of unused threads.
- The default value is 2.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="max_threads" transfer-ownership="none">
- <doc xml:space="preserve">maximal number of unused threads</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="thread_pool_stop_unused_threads"
- c:identifier="g_thread_pool_stop_unused_threads"
- moved-to="ThreadPool.stop_unused_threads">
- <doc xml:space="preserve">Stops all currently unused threads. This does not change the
- maximal number of unused threads. This function can be used to
- regularly stop all unused threads e.g. from g_timeout_add().</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- </function>
- <function name="thread_self"
- c:identifier="g_thread_self"
- moved-to="Thread.self">
- <doc xml:space="preserve">This function returns the #GThread corresponding to the
- current thread. Note that this function does not increase
- the reference count of the returned struct.
- This function will return a #GThread even for threads that
- were not created by GLib (i.e. those created by other threading
- APIs). This may be useful for thread identification purposes
- (i.e. comparisons) but you must not use GLib functions (such
- as g_thread_join()) on these threads.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the #GThread representing the current thread</doc>
- <type name="Thread" c:type="GThread*"/>
- </return-value>
- </function>
- <function name="thread_yield"
- c:identifier="g_thread_yield"
- moved-to="Thread.yield">
- <doc xml:space="preserve">Causes the calling thread to voluntarily relinquish the CPU, so
- that other threads can run.
- This function is often used as a method to make busy wait less evil.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- </function>
- <function name="time_val_from_iso8601"
- c:identifier="g_time_val_from_iso8601"
- moved-to="TimeVal.from_iso8601"
- version="2.12">
- <doc xml:space="preserve">Converts a string containing an ISO 8601 encoded date and time
- to a #GTimeVal and puts it into @time_.
- @iso_date must include year, month, day, hours, minutes, and
- seconds. It can optionally include fractions of a second and a time
- zone indicator. (In the absence of any time zone indication, the
- timestamp is assumed to be in local time.)</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the conversion was successful.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="iso_date" transfer-ownership="none">
- <doc xml:space="preserve">an ISO 8601 encoded date string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="time_"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none">
- <doc xml:space="preserve">a #GTimeVal</doc>
- <type name="TimeVal" c:type="GTimeVal*"/>
- </parameter>
- </parameters>
- </function>
- <function name="timeout_add"
- c:identifier="g_timeout_add"
- shadowed-by="timeout_add_full"
- introspectable="0">
- <doc xml:space="preserve">Sets a function to be called at regular intervals, with the default
- priority, #G_PRIORITY_DEFAULT. The function is called repeatedly
- until it returns %FALSE, at which point the timeout is automatically
- destroyed and the function will not be called again. The first call
- to the function will be at the end of the first @interval.
- Note that timeout functions may be delayed, due to the processing of other
- event sources. Thus they should not be relied on for precise timing.
- After each call to the timeout function, the time of the next
- timeout is recalculated based on the current time and the given interval
- (it does not try to 'catch up' time lost in delays).
- See [memory management of sources][mainloop-memory-management] for details
- on how to handle the return value and memory management of @data.
- If you want to have a timer in the "seconds" range and do not care
- about the exact time of the first call of the timer, use the
- g_timeout_add_seconds() function; this function allows for more
- optimizations and more efficient system power usage.
- This internally creates a main loop source using g_timeout_source_new()
- and attaches it to the global #GMainContext using g_source_attach(), so
- the callback will be invoked in whichever thread is running that main
- context. You can do these steps manually if you need greater control or to
- use a custom main context.
- The interval given is in terms of monotonic time, not wall clock
- time. See g_get_monotonic_time().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="interval" transfer-ownership="none">
- <doc xml:space="preserve">the time between calls to the function, in milliseconds
- (1/1000ths of a second)</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="function" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">function to call</doc>
- <type name="SourceFunc" c:type="GSourceFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="timeout_add_full"
- c:identifier="g_timeout_add_full"
- shadows="timeout_add">
- <doc xml:space="preserve">Sets a function to be called at regular intervals, with the given
- priority. The function is called repeatedly until it returns
- %FALSE, at which point the timeout is automatically destroyed and
- the function will not be called again. The @notify function is
- called when the timeout is destroyed. The first call to the
- function will be at the end of the first @interval.
- Note that timeout functions may be delayed, due to the processing of other
- event sources. Thus they should not be relied on for precise timing.
- After each call to the timeout function, the time of the next
- timeout is recalculated based on the current time and the given interval
- (it does not try to 'catch up' time lost in delays).
- See [memory management of sources][mainloop-memory-management] for details
- on how to handle the return value and memory management of @data.
- This internally creates a main loop source using g_timeout_source_new()
- and attaches it to the global #GMainContext using g_source_attach(), so
- the callback will be invoked in whichever thread is running that main
- context. You can do these steps manually if you need greater control or to
- use a custom main context.
- The interval given in terms of monotonic time, not wall clock time.
- See g_get_monotonic_time().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="priority" transfer-ownership="none">
- <doc xml:space="preserve">the priority of the timeout source. Typically this will be in
- the range between #G_PRIORITY_DEFAULT and #G_PRIORITY_HIGH.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="interval" transfer-ownership="none">
- <doc xml:space="preserve">the time between calls to the function, in milliseconds
- (1/1000ths of a second)</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="function"
- transfer-ownership="none"
- scope="notified"
- closure="3"
- destroy="4">
- <doc xml:space="preserve">function to call</doc>
- <type name="SourceFunc" c:type="GSourceFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="notify"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">function to call when the timeout is removed, or %NULL</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="timeout_add_seconds"
- c:identifier="g_timeout_add_seconds"
- shadowed-by="timeout_add_seconds_full"
- version="2.14"
- introspectable="0">
- <doc xml:space="preserve">Sets a function to be called at regular intervals with the default
- priority, #G_PRIORITY_DEFAULT. The function is called repeatedly until
- it returns %FALSE, at which point the timeout is automatically destroyed
- and the function will not be called again.
- This internally creates a main loop source using
- g_timeout_source_new_seconds() and attaches it to the main loop context
- using g_source_attach(). You can do these steps manually if you need
- greater control. Also see g_timeout_add_seconds_full().
- Note that the first call of the timer may not be precise for timeouts
- of one second. If you need finer precision and have such a timeout,
- you may want to use g_timeout_add() instead.
- See [memory management of sources][mainloop-memory-management] for details
- on how to handle the return value and memory management of @data.
- The interval given is in terms of monotonic time, not wall clock
- time. See g_get_monotonic_time().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="interval" transfer-ownership="none">
- <doc xml:space="preserve">the time between calls to the function, in seconds</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="function" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">function to call</doc>
- <type name="SourceFunc" c:type="GSourceFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="timeout_add_seconds_full"
- c:identifier="g_timeout_add_seconds_full"
- shadows="timeout_add_seconds"
- version="2.14">
- <doc xml:space="preserve">Sets a function to be called at regular intervals, with @priority.
- The function is called repeatedly until it returns %FALSE, at which
- point the timeout is automatically destroyed and the function will
- not be called again.
- Unlike g_timeout_add(), this function operates at whole second granularity.
- The initial starting point of the timer is determined by the implementation
- and the implementation is expected to group multiple timers together so that
- they fire all at the same time.
- To allow this grouping, the @interval to the first timer is rounded
- and can deviate up to one second from the specified interval.
- Subsequent timer iterations will generally run at the specified interval.
- Note that timeout functions may be delayed, due to the processing of other
- event sources. Thus they should not be relied on for precise timing.
- After each call to the timeout function, the time of the next
- timeout is recalculated based on the current time and the given @interval
- See [memory management of sources][mainloop-memory-management] for details
- on how to handle the return value and memory management of @data.
- If you want timing more precise than whole seconds, use g_timeout_add()
- instead.
- The grouping of timers to fire at the same time results in a more power
- and CPU efficient behavior so if your timer is in multiples of seconds
- and you don't require the first timer exactly one second from now, the
- use of g_timeout_add_seconds() is preferred over g_timeout_add().
- This internally creates a main loop source using
- g_timeout_source_new_seconds() and attaches it to the main loop context
- using g_source_attach(). You can do these steps manually if you need
- greater control.
- The interval given is in terms of monotonic time, not wall clock
- time. See g_get_monotonic_time().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ID (greater than 0) of the event source.</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="priority" transfer-ownership="none">
- <doc xml:space="preserve">the priority of the timeout source. Typically this will be in
- the range between #G_PRIORITY_DEFAULT and #G_PRIORITY_HIGH.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="interval" transfer-ownership="none">
- <doc xml:space="preserve">the time between calls to the function, in seconds</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- <parameter name="function"
- transfer-ownership="none"
- scope="notified"
- closure="3"
- destroy="4">
- <doc xml:space="preserve">function to call</doc>
- <type name="SourceFunc" c:type="GSourceFunc"/>
- </parameter>
- <parameter name="data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="notify"
- transfer-ownership="none"
- nullable="1"
- allow-none="1"
- scope="async">
- <doc xml:space="preserve">function to call when the timeout is removed, or %NULL</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="timeout_source_new" c:identifier="g_timeout_source_new">
- <doc xml:space="preserve">Creates a new timeout source.
- The source will not initially be associated with any #GMainContext
- and must be added to one with g_source_attach() before it will be
- executed.
- The interval given is in terms of monotonic time, not wall clock
- time. See g_get_monotonic_time().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly-created timeout source</doc>
- <type name="Source" c:type="GSource*"/>
- </return-value>
- <parameters>
- <parameter name="interval" transfer-ownership="none">
- <doc xml:space="preserve">the timeout interval in milliseconds.</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="timeout_source_new_seconds"
- c:identifier="g_timeout_source_new_seconds"
- version="2.14">
- <doc xml:space="preserve">Creates a new timeout source.
- The source will not initially be associated with any #GMainContext
- and must be added to one with g_source_attach() before it will be
- executed.
- The scheduling granularity/accuracy of this timeout source will be
- in seconds.
- The interval given in terms of monotonic time, not wall clock time.
- See g_get_monotonic_time().</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly-created timeout source</doc>
- <type name="Source" c:type="GSource*"/>
- </return-value>
- <parameters>
- <parameter name="interval" transfer-ownership="none">
- <doc xml:space="preserve">the timeout interval in seconds</doc>
- <type name="guint" c:type="guint"/>
- </parameter>
- </parameters>
- </function>
- <function name="trash_stack_height"
- c:identifier="g_trash_stack_height"
- moved-to="TrashStack.height"
- deprecated="1"
- deprecated-version="2.48">
- <doc xml:space="preserve">Returns the height of a #GTrashStack.
- Note that execution of this function is of O(N) complexity
- where N denotes the number of items on the stack.</doc>
- <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the height of the stack</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="stack_p" transfer-ownership="none">
- <doc xml:space="preserve">a #GTrashStack</doc>
- <type name="TrashStack" c:type="GTrashStack**"/>
- </parameter>
- </parameters>
- </function>
- <function name="trash_stack_peek"
- c:identifier="g_trash_stack_peek"
- moved-to="TrashStack.peek"
- deprecated="1"
- deprecated-version="2.48">
- <doc xml:space="preserve">Returns the element at the top of a #GTrashStack
- which may be %NULL.</doc>
- <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the element at the top of the stack</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="stack_p" transfer-ownership="none">
- <doc xml:space="preserve">a #GTrashStack</doc>
- <type name="TrashStack" c:type="GTrashStack**"/>
- </parameter>
- </parameters>
- </function>
- <function name="trash_stack_pop"
- c:identifier="g_trash_stack_pop"
- moved-to="TrashStack.pop"
- deprecated="1"
- deprecated-version="2.48">
- <doc xml:space="preserve">Pops a piece of memory off a #GTrashStack.</doc>
- <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the element at the top of the stack</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="stack_p" transfer-ownership="none">
- <doc xml:space="preserve">a #GTrashStack</doc>
- <type name="TrashStack" c:type="GTrashStack**"/>
- </parameter>
- </parameters>
- </function>
- <function name="trash_stack_push"
- c:identifier="g_trash_stack_push"
- moved-to="TrashStack.push"
- deprecated="1"
- deprecated-version="2.48">
- <doc xml:space="preserve">Pushes a piece of memory onto a #GTrashStack.</doc>
- <doc-deprecated xml:space="preserve">#GTrashStack is deprecated without replacement</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="stack_p" transfer-ownership="none">
- <doc xml:space="preserve">a #GTrashStack</doc>
- <type name="TrashStack" c:type="GTrashStack**"/>
- </parameter>
- <parameter name="data_p" transfer-ownership="none">
- <doc xml:space="preserve">the piece of memory to push on the stack</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="try_malloc" c:identifier="g_try_malloc">
- <doc xml:space="preserve">Attempts to allocate @n_bytes, and returns %NULL on failure.
- Contrast with g_malloc(), which aborts the program on failure.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the allocated memory, or %NULL.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="n_bytes" transfer-ownership="none">
- <doc xml:space="preserve">number of bytes to allocate.</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="try_malloc0" c:identifier="g_try_malloc0" version="2.8">
- <doc xml:space="preserve">Attempts to allocate @n_bytes, initialized to 0's, and returns %NULL on
- failure. Contrast with g_malloc0(), which aborts the program on failure.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the allocated memory, or %NULL</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="n_bytes" transfer-ownership="none">
- <doc xml:space="preserve">number of bytes to allocate</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="try_malloc0_n"
- c:identifier="g_try_malloc0_n"
- version="2.24">
- <doc xml:space="preserve">This function is similar to g_try_malloc0(), allocating (@n_blocks * @n_block_bytes) bytes,
- but care is taken to detect possible overflow during multiplication.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the allocated memory, or %NULL</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="n_blocks" transfer-ownership="none">
- <doc xml:space="preserve">the number of blocks to allocate</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="n_block_bytes" transfer-ownership="none">
- <doc xml:space="preserve">the size of each block in bytes</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="try_malloc_n" c:identifier="g_try_malloc_n" version="2.24">
- <doc xml:space="preserve">This function is similar to g_try_malloc(), allocating (@n_blocks * @n_block_bytes) bytes,
- but care is taken to detect possible overflow during multiplication.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the allocated memory, or %NULL.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="n_blocks" transfer-ownership="none">
- <doc xml:space="preserve">the number of blocks to allocate</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="n_block_bytes" transfer-ownership="none">
- <doc xml:space="preserve">the size of each block in bytes</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="try_realloc" c:identifier="g_try_realloc">
- <doc xml:space="preserve">Attempts to realloc @mem to a new size, @n_bytes, and returns %NULL
- on failure. Contrast with g_realloc(), which aborts the program
- on failure.
- If @mem is %NULL, behaves the same as g_try_malloc().</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the allocated memory, or %NULL.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="mem"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">previously-allocated memory, or %NULL.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="n_bytes" transfer-ownership="none">
- <doc xml:space="preserve">number of bytes to allocate.</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="try_realloc_n"
- c:identifier="g_try_realloc_n"
- version="2.24">
- <doc xml:space="preserve">This function is similar to g_try_realloc(), allocating (@n_blocks * @n_block_bytes) bytes,
- but care is taken to detect possible overflow during multiplication.</doc>
- <return-value transfer-ownership="none" nullable="1">
- <doc xml:space="preserve">the allocated memory, or %NULL.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </return-value>
- <parameters>
- <parameter name="mem"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">previously-allocated memory, or %NULL.</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="n_blocks" transfer-ownership="none">
- <doc xml:space="preserve">the number of blocks to allocate</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- <parameter name="n_block_bytes" transfer-ownership="none">
- <doc xml:space="preserve">the size of each block in bytes</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="ucs4_to_utf16" c:identifier="g_ucs4_to_utf16" throws="1">
- <doc xml:space="preserve">Convert a string from UCS-4 to UTF-16. A 0 character will be
- added to the result after the converted text.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a newly allocated UTF-16 string.
- This value must be freed with g_free(). If an error occurs,
- %NULL will be returned and @error set.</doc>
- <type name="guint16" c:type="gunichar2*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UCS-4 encoded string</doc>
- <type name="gunichar" c:type="const gunichar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the maximum length (number of characters) of @str to use.
- If @len < 0, then the string is nul-terminated.</doc>
- <type name="glong" c:type="glong"/>
- </parameter>
- <parameter name="items_read"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store number of
- bytes read, or %NULL. If an error occurs then the index of the invalid
- input is stored here.</doc>
- <type name="glong" c:type="glong*"/>
- </parameter>
- <parameter name="items_written"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store number
- of #gunichar2 written, or %NULL. The value stored here does not include
- the trailing 0.</doc>
- <type name="glong" c:type="glong*"/>
- </parameter>
- </parameters>
- </function>
- <function name="ucs4_to_utf8" c:identifier="g_ucs4_to_utf8" throws="1">
- <doc xml:space="preserve">Convert a string from a 32-bit fixed width representation as UCS-4.
- to UTF-8. The result will be terminated with a 0 byte.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a pointer to a newly allocated UTF-8 string.
- This value must be freed with g_free(). If an error occurs,
- %NULL will be returned and @error set. In that case, @items_read
- will be set to the position of the first invalid input character.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UCS-4 encoded string</doc>
- <type name="gunichar" c:type="const gunichar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the maximum length (number of characters) of @str to use.
- If @len < 0, then the string is nul-terminated.</doc>
- <type name="glong" c:type="glong"/>
- </parameter>
- <parameter name="items_read"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store number of
- characters read, or %NULL.</doc>
- <type name="glong" c:type="glong*"/>
- </parameter>
- <parameter name="items_written"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store number
- of bytes written or %NULL. The value here stored does not include the
- trailing 0 byte.</doc>
- <type name="glong" c:type="glong*"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_break_type" c:identifier="g_unichar_break_type">
- <doc xml:space="preserve">Determines the break type of @c. @c should be a Unicode character
- (to derive a character from UTF-8 encoded text, use
- g_utf8_get_char()). The break type is used to find word and line
- breaks ("text boundaries"), Pango implements the Unicode boundary
- resolution algorithms and normally you would use a function such
- as pango_break() instead of caring about break types yourself.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the break type of @c</doc>
- <type name="UnicodeBreakType" c:type="GUnicodeBreakType"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_combining_class"
- c:identifier="g_unichar_combining_class"
- version="2.14">
- <doc xml:space="preserve">Determines the canonical combining class of a Unicode character.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the combining class of the character</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="uc" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_compose"
- c:identifier="g_unichar_compose"
- version="2.30">
- <doc xml:space="preserve">Performs a single composition step of the
- Unicode canonical composition algorithm.
- This function includes algorithmic Hangul Jamo composition,
- but it is not exactly the inverse of g_unichar_decompose().
- No composition can have either of @a or @b equal to zero.
- To be precise, this function composes if and only if
- there exists a Primary Composite P which is canonically
- equivalent to the sequence <@a,@b>. See the Unicode
- Standard for the definition of Primary Composite.
- If @a and @b do not compose a new character, @ch is set to zero.
- See
- [UAX#15](http://unicode.org/reports/tr15/)
- for details.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the characters could be composed</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="a" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- <parameter name="b" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- <parameter name="ch" transfer-ownership="none">
- <doc xml:space="preserve">return location for the composed character</doc>
- <type name="gunichar" c:type="gunichar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_decompose"
- c:identifier="g_unichar_decompose"
- version="2.30">
- <doc xml:space="preserve">Performs a single decomposition step of the
- Unicode canonical decomposition algorithm.
- This function does not include compatibility
- decompositions. It does, however, include algorithmic
- Hangul Jamo decomposition, as well as 'singleton'
- decompositions which replace a character by a single
- other character. In the case of singletons *@b will
- be set to zero.
- If @ch is not decomposable, *@a is set to @ch and *@b
- is set to zero.
- Note that the way Unicode decomposition pairs are
- defined, it is guaranteed that @b would not decompose
- further, but @a may itself decompose. To get the full
- canonical decomposition for @ch, one would need to
- recursively call this function on @a. Or use
- g_unichar_fully_decompose().
- See
- [UAX#15](http://unicode.org/reports/tr15/)
- for details.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the character could be decomposed</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="ch" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- <parameter name="a" transfer-ownership="none">
- <doc xml:space="preserve">return location for the first component of @ch</doc>
- <type name="gunichar" c:type="gunichar*"/>
- </parameter>
- <parameter name="b" transfer-ownership="none">
- <doc xml:space="preserve">return location for the second component of @ch</doc>
- <type name="gunichar" c:type="gunichar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_digit_value" c:identifier="g_unichar_digit_value">
- <doc xml:space="preserve">Determines the numeric value of a character as a decimal
- digit.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">If @c is a decimal digit (according to
- g_unichar_isdigit()), its numeric value. Otherwise, -1.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_fully_decompose"
- c:identifier="g_unichar_fully_decompose"
- version="2.30">
- <doc xml:space="preserve">Computes the canonical or compatibility decomposition of a
- Unicode character. For compatibility decomposition,
- pass %TRUE for @compat; for canonical decomposition
- pass %FALSE for @compat.
- The decomposed sequence is placed in @result. Only up to
- @result_len characters are written into @result. The length
- of the full decomposition (irrespective of @result_len) is
- returned by the function. For canonical decomposition,
- currently all decompositions are of length at most 4, but
- this may change in the future (very unlikely though).
- At any rate, Unicode does guarantee that a buffer of length
- 18 is always enough for both compatibility and canonical
- decompositions, so that is the size recommended. This is provided
- as %G_UNICHAR_MAX_DECOMPOSITION_LENGTH.
- See
- [UAX#15](http://unicode.org/reports/tr15/)
- for details.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the length of the full decomposition.</doc>
- <type name="gsize" c:type="gsize"/>
- </return-value>
- <parameters>
- <parameter name="ch" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character.</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- <parameter name="compat" transfer-ownership="none">
- <doc xml:space="preserve">whether perform canonical or compatibility decomposition</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- <parameter name="result"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">location to store decomposed result, or %NULL</doc>
- <type name="gunichar" c:type="gunichar*"/>
- </parameter>
- <parameter name="result_len" transfer-ownership="none">
- <doc xml:space="preserve">length of @result</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_get_mirror_char"
- c:identifier="g_unichar_get_mirror_char"
- version="2.4">
- <doc xml:space="preserve">In Unicode, some characters are "mirrored". This means that their
- images are mirrored horizontally in text that is laid out from right
- to left. For instance, "(" would become its mirror image, ")", in
- right-to-left text.
- If @ch has the Unicode mirrored property and there is another unicode
- character that typically has a glyph that is the mirror image of @ch's
- glyph and @mirrored_ch is set, it puts that character in the address
- pointed to by @mirrored_ch. Otherwise the original character is put.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @ch has a mirrored character, %FALSE otherwise</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="ch" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- <parameter name="mirrored_ch" transfer-ownership="none">
- <doc xml:space="preserve">location to store the mirrored character</doc>
- <type name="gunichar" c:type="gunichar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_get_script"
- c:identifier="g_unichar_get_script"
- version="2.14">
- <doc xml:space="preserve">Looks up the #GUnicodeScript for a particular character (as defined
- by Unicode Standard Annex \#24). No check is made for @ch being a
- valid Unicode character; if you pass in invalid character, the
- result is undefined.
- This function is equivalent to pango_script_for_unichar() and the
- two are interchangeable.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the #GUnicodeScript for the character.</doc>
- <type name="UnicodeScript" c:type="GUnicodeScript"/>
- </return-value>
- <parameters>
- <parameter name="ch" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_isalnum" c:identifier="g_unichar_isalnum">
- <doc xml:space="preserve">Determines whether a character is alphanumeric.
- Given some UTF-8 text, obtain a character value
- with g_utf8_get_char().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @c is an alphanumeric character</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_isalpha" c:identifier="g_unichar_isalpha">
- <doc xml:space="preserve">Determines whether a character is alphabetic (i.e. a letter).
- Given some UTF-8 text, obtain a character value with
- g_utf8_get_char().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @c is an alphabetic character</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_iscntrl" c:identifier="g_unichar_iscntrl">
- <doc xml:space="preserve">Determines whether a character is a control character.
- Given some UTF-8 text, obtain a character value with
- g_utf8_get_char().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @c is a control character</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_isdefined" c:identifier="g_unichar_isdefined">
- <doc xml:space="preserve">Determines if a given character is assigned in the Unicode
- standard.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the character has an assigned value</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_isdigit" c:identifier="g_unichar_isdigit">
- <doc xml:space="preserve">Determines whether a character is numeric (i.e. a digit). This
- covers ASCII 0-9 and also digits in other languages/scripts. Given
- some UTF-8 text, obtain a character value with g_utf8_get_char().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @c is a digit</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_isgraph" c:identifier="g_unichar_isgraph">
- <doc xml:space="preserve">Determines whether a character is printable and not a space
- (returns %FALSE for control characters, format characters, and
- spaces). g_unichar_isprint() is similar, but returns %TRUE for
- spaces. Given some UTF-8 text, obtain a character value with
- g_utf8_get_char().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @c is printable unless it's a space</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_islower" c:identifier="g_unichar_islower">
- <doc xml:space="preserve">Determines whether a character is a lowercase letter.
- Given some UTF-8 text, obtain a character value with
- g_utf8_get_char().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @c is a lowercase letter</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_ismark"
- c:identifier="g_unichar_ismark"
- version="2.14">
- <doc xml:space="preserve">Determines whether a character is a mark (non-spacing mark,
- combining mark, or enclosing mark in Unicode speak).
- Given some UTF-8 text, obtain a character value
- with g_utf8_get_char().
- Note: in most cases where isalpha characters are allowed,
- ismark characters should be allowed to as they are essential
- for writing most European languages as well as many non-Latin
- scripts.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @c is a mark character</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_isprint" c:identifier="g_unichar_isprint">
- <doc xml:space="preserve">Determines whether a character is printable.
- Unlike g_unichar_isgraph(), returns %TRUE for spaces.
- Given some UTF-8 text, obtain a character value with
- g_utf8_get_char().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @c is printable</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_ispunct" c:identifier="g_unichar_ispunct">
- <doc xml:space="preserve">Determines whether a character is punctuation or a symbol.
- Given some UTF-8 text, obtain a character value with
- g_utf8_get_char().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @c is a punctuation or symbol character</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_isspace" c:identifier="g_unichar_isspace">
- <doc xml:space="preserve">Determines whether a character is a space, tab, or line separator
- (newline, carriage return, etc.). Given some UTF-8 text, obtain a
- character value with g_utf8_get_char().
- (Note: don't use this to do word breaking; you have to use
- Pango or equivalent to get word breaking right, the algorithm
- is fairly complex.)</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @c is a space character</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_istitle" c:identifier="g_unichar_istitle">
- <doc xml:space="preserve">Determines if a character is titlecase. Some characters in
- Unicode which are composites, such as the DZ digraph
- have three case variants instead of just two. The titlecase
- form is used at the beginning of a word where only the
- first letter is capitalized. The titlecase form of the DZ
- digraph is U+01F2 LATIN CAPITAL LETTTER D WITH SMALL LETTER Z.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the character is titlecase</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_isupper" c:identifier="g_unichar_isupper">
- <doc xml:space="preserve">Determines if a character is uppercase.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @c is an uppercase character</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_iswide" c:identifier="g_unichar_iswide">
- <doc xml:space="preserve">Determines if a character is typically rendered in a double-width
- cell.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the character is wide</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_iswide_cjk"
- c:identifier="g_unichar_iswide_cjk"
- version="2.12">
- <doc xml:space="preserve">Determines if a character is typically rendered in a double-width
- cell under legacy East Asian locales. If a character is wide according to
- g_unichar_iswide(), then it is also reported wide with this function, but
- the converse is not necessarily true. See the
- [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/)
- for details.
- If a character passes the g_unichar_iswide() test then it will also pass
- this test, but not the other way around. Note that some characters may
- pass both this test and g_unichar_iszerowidth().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the character is wide in legacy East Asian locales</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_isxdigit" c:identifier="g_unichar_isxdigit">
- <doc xml:space="preserve">Determines if a character is a hexidecimal digit.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the character is a hexadecimal digit</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character.</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_iszerowidth"
- c:identifier="g_unichar_iszerowidth"
- version="2.14">
- <doc xml:space="preserve">Determines if a given character typically takes zero width when rendered.
- The return value is %TRUE for all non-spacing and enclosing marks
- (e.g., combining accents), format characters, zero-width
- space, but not U+00AD SOFT HYPHEN.
- A typical use of this function is with one of g_unichar_iswide() or
- g_unichar_iswide_cjk() to determine the number of cells a string occupies
- when displayed on a grid display (terminals). However, note that not all
- terminals support zero-width rendering of zero-width marks.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the character has zero width</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_to_utf8" c:identifier="g_unichar_to_utf8">
- <doc xml:space="preserve">Converts a single character to UTF-8.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">number of bytes written</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character code</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- <parameter name="outbuf"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">output buffer, must have at
- least 6 bytes of space. If %NULL, the length will be computed and
- returned and nothing will be written to @outbuf.</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_tolower" c:identifier="g_unichar_tolower">
- <doc xml:space="preserve">Converts a character to lower case.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the result of converting @c to lower case.
- If @c is not an upperlower or titlecase character,
- or has no lowercase equivalent @c is returned unchanged.</doc>
- <type name="gunichar" c:type="gunichar"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character.</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_totitle" c:identifier="g_unichar_totitle">
- <doc xml:space="preserve">Converts a character to the titlecase.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the result of converting @c to titlecase.
- If @c is not an uppercase or lowercase character,
- @c is returned unchanged.</doc>
- <type name="gunichar" c:type="gunichar"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_toupper" c:identifier="g_unichar_toupper">
- <doc xml:space="preserve">Converts a character to uppercase.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the result of converting @c to uppercase.
- If @c is not an lowercase or titlecase character,
- or has no upper case equivalent @c is returned unchanged.</doc>
- <type name="gunichar" c:type="gunichar"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_type" c:identifier="g_unichar_type">
- <doc xml:space="preserve">Classifies a Unicode character by type.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the type of the character.</doc>
- <type name="UnicodeType" c:type="GUnicodeType"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_validate" c:identifier="g_unichar_validate">
- <doc xml:space="preserve">Checks whether @ch is a valid Unicode character. Some possible
- integer values of @ch will not be valid. 0 is considered a valid
- character, though it's normally a string terminator.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @ch is a valid Unicode character</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="ch" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unichar_xdigit_value"
- c:identifier="g_unichar_xdigit_value">
- <doc xml:space="preserve">Determines the numeric value of a character as a hexidecimal
- digit.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">If @c is a hex digit (according to
- g_unichar_isxdigit()), its numeric value. Otherwise, -1.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="unicode_canonical_decomposition"
- c:identifier="g_unicode_canonical_decomposition"
- deprecated="1"
- deprecated-version="2.30">
- <doc xml:space="preserve">Computes the canonical decomposition of a Unicode character.</doc>
- <doc-deprecated xml:space="preserve">Use the more flexible g_unichar_fully_decompose()
- instead.</doc-deprecated>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a newly allocated string of Unicode characters.
- @result_len is set to the resulting length of the string.</doc>
- <type name="gunichar" c:type="gunichar*"/>
- </return-value>
- <parameters>
- <parameter name="ch" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character.</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- <parameter name="result_len" transfer-ownership="none">
- <doc xml:space="preserve">location to store the length of the return value.</doc>
- <type name="gsize" c:type="gsize*"/>
- </parameter>
- </parameters>
- </function>
- <function name="unicode_canonical_ordering"
- c:identifier="g_unicode_canonical_ordering">
- <doc xml:space="preserve">Computes the canonical ordering of a string in-place.
- This rearranges decomposed characters in the string
- according to their combining classes. See the Unicode
- manual for more information.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a UCS-4 encoded string.</doc>
- <type name="gunichar" c:type="gunichar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the maximum length of @string to use.</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="unicode_script_from_iso15924"
- c:identifier="g_unicode_script_from_iso15924"
- version="2.30">
- <doc xml:space="preserve">Looks up the Unicode script for @iso15924. ISO 15924 assigns four-letter
- codes to scripts. For example, the code for Arabic is 'Arab'.
- This function accepts four letter codes encoded as a @guint32 in a
- big-endian fashion. That is, the code expected for Arabic is
- 0x41726162 (0x41 is ASCII code for 'A', 0x72 is ASCII code for 'r', etc).
- See
- [Codes for the representation of names of scripts](http://unicode.org/iso15924/codelists.html)
- for details.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the Unicode script for @iso15924, or
- of %G_UNICODE_SCRIPT_INVALID_CODE if @iso15924 is zero and
- %G_UNICODE_SCRIPT_UNKNOWN if @iso15924 is unknown.</doc>
- <type name="UnicodeScript" c:type="GUnicodeScript"/>
- </return-value>
- <parameters>
- <parameter name="iso15924" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode script</doc>
- <type name="guint32" c:type="guint32"/>
- </parameter>
- </parameters>
- </function>
- <function name="unicode_script_to_iso15924"
- c:identifier="g_unicode_script_to_iso15924"
- version="2.30">
- <doc xml:space="preserve">Looks up the ISO 15924 code for @script. ISO 15924 assigns four-letter
- codes to scripts. For example, the code for Arabic is 'Arab'. The
- four letter codes are encoded as a @guint32 by this function in a
- big-endian fashion. That is, the code returned for Arabic is
- 0x41726162 (0x41 is ASCII code for 'A', 0x72 is ASCII code for 'r', etc).
- See
- [Codes for the representation of names of scripts](http://unicode.org/iso15924/codelists.html)
- for details.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ISO 15924 code for @script, encoded as an integer,
- of zero if @script is %G_UNICODE_SCRIPT_INVALID_CODE or
- ISO 15924 code 'Zzzz' (script code for UNKNOWN) if @script is not understood.</doc>
- <type name="guint32" c:type="guint32"/>
- </return-value>
- <parameters>
- <parameter name="script" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode script</doc>
- <type name="UnicodeScript" c:type="GUnicodeScript"/>
- </parameter>
- </parameters>
- </function>
- <function name="unix_error_quark" c:identifier="g_unix_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="unix_fd_add"
- c:identifier="g_unix_fd_add"
- version="2.36"
- introspectable="0">
- <doc xml:space="preserve">Sets a function to be called when the IO condition, as specified by
- @condition becomes true for @fd.
- @function will be called when the specified IO condition becomes
- %TRUE. The function is expected to clear whatever event caused the
- IO condition to become true and return %TRUE in order to be notified
- when it happens again. If @function returns %FALSE then the watch
- will be cancelled.
- The return value of this function can be passed to g_source_remove()
- to cancel the watch at any time that it exists.
- The source will never close the fd -- you must do it yourself.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ID (greater than 0) of the event source</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="fd" transfer-ownership="none">
- <doc xml:space="preserve">a file descriptor</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="condition" transfer-ownership="none">
- <doc xml:space="preserve">IO conditions to watch for on @fd</doc>
- <type name="IOCondition" c:type="GIOCondition"/>
- </parameter>
- <parameter name="function" transfer-ownership="none" closure="3">
- <doc xml:space="preserve">a #GPollFDFunc</doc>
- <type name="UnixFDSourceFunc" c:type="GUnixFDSourceFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="unix_fd_add_full"
- c:identifier="g_unix_fd_add_full"
- version="2.36">
- <doc xml:space="preserve">Sets a function to be called when the IO condition, as specified by
- @condition becomes true for @fd.
- This is the same as g_unix_fd_add(), except that it allows you to
- specify a non-default priority and a provide a #GDestroyNotify for
- @user_data.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the ID (greater than 0) of the event source</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="priority" transfer-ownership="none">
- <doc xml:space="preserve">the priority of the source</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="fd" transfer-ownership="none">
- <doc xml:space="preserve">a file descriptor</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="condition" transfer-ownership="none">
- <doc xml:space="preserve">IO conditions to watch for on @fd</doc>
- <type name="IOCondition" c:type="GIOCondition"/>
- </parameter>
- <parameter name="function"
- transfer-ownership="none"
- scope="notified"
- closure="4"
- destroy="5">
- <doc xml:space="preserve">a #GUnixFDSourceFunc</doc>
- <type name="UnixFDSourceFunc" c:type="GUnixFDSourceFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">data to pass to @function</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="notify" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">function to call when the idle is removed, or %NULL</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="unix_fd_source_new"
- c:identifier="g_unix_fd_source_new"
- version="2.36">
- <doc xml:space="preserve">Creates a #GSource to watch for a particular IO condition on a file
- descriptor.
- The source will never close the fd -- you must do it yourself.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the newly created #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </return-value>
- <parameters>
- <parameter name="fd" transfer-ownership="none">
- <doc xml:space="preserve">a file descriptor</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="condition" transfer-ownership="none">
- <doc xml:space="preserve">IO conditions to watch for on @fd</doc>
- <type name="IOCondition" c:type="GIOCondition"/>
- </parameter>
- </parameters>
- </function>
- <function name="unix_open_pipe"
- c:identifier="g_unix_open_pipe"
- version="2.30"
- throws="1">
- <doc xml:space="preserve">Similar to the UNIX pipe() call, but on modern systems like Linux
- uses the pipe2() system call, which atomically creates a pipe with
- the configured flags. The only supported flag currently is
- %FD_CLOEXEC. If for example you want to configure %O_NONBLOCK, that
- must still be done separately with fcntl().
- This function does not take %O_CLOEXEC, it takes %FD_CLOEXEC as if
- for fcntl(); these are different on Linux/glibc.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE on success, %FALSE if not (and errno will be set).</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="fds" transfer-ownership="none">
- <doc xml:space="preserve">Array of two integers</doc>
- <type name="gint" c:type="gint*"/>
- </parameter>
- <parameter name="flags" transfer-ownership="none">
- <doc xml:space="preserve">Bitfield of file descriptor flags, as for fcntl()</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="unix_set_fd_nonblocking"
- c:identifier="g_unix_set_fd_nonblocking"
- version="2.30"
- throws="1">
- <doc xml:space="preserve">Control the non-blocking state of the given file descriptor,
- according to @nonblock. On most systems this uses %O_NONBLOCK, but
- on some older ones may use %O_NDELAY.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if successful</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="fd" transfer-ownership="none">
- <doc xml:space="preserve">A file descriptor</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="nonblock" transfer-ownership="none">
- <doc xml:space="preserve">If %TRUE, set the descriptor to be non-blocking</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </function>
- <function name="unix_signal_add"
- c:identifier="g_unix_signal_add"
- shadowed-by="unix_signal_add_full"
- version="2.30"
- introspectable="0">
- <doc xml:space="preserve">A convenience function for g_unix_signal_source_new(), which
- attaches to the default #GMainContext. You can remove the watch
- using g_source_remove().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">An ID (greater than 0) for the event source</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="signum" transfer-ownership="none">
- <doc xml:space="preserve">Signal number</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="handler" transfer-ownership="none" closure="2">
- <doc xml:space="preserve">Callback</doc>
- <type name="SourceFunc" c:type="GSourceFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">Data for @handler</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- </parameters>
- </function>
- <function name="unix_signal_add_full"
- c:identifier="g_unix_signal_add_full"
- shadows="unix_signal_add"
- version="2.30">
- <doc xml:space="preserve">A convenience function for g_unix_signal_source_new(), which
- attaches to the default #GMainContext. You can remove the watch
- using g_source_remove().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">An ID (greater than 0) for the event source</doc>
- <type name="guint" c:type="guint"/>
- </return-value>
- <parameters>
- <parameter name="priority" transfer-ownership="none">
- <doc xml:space="preserve">the priority of the signal source. Typically this will be in
- the range between #G_PRIORITY_DEFAULT and #G_PRIORITY_HIGH.</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="signum" transfer-ownership="none">
- <doc xml:space="preserve">Signal number</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- <parameter name="handler"
- transfer-ownership="none"
- scope="notified"
- closure="3"
- destroy="4">
- <doc xml:space="preserve">Callback</doc>
- <type name="SourceFunc" c:type="GSourceFunc"/>
- </parameter>
- <parameter name="user_data"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">Data for @handler</doc>
- <type name="gpointer" c:type="gpointer"/>
- </parameter>
- <parameter name="notify" transfer-ownership="none" scope="async">
- <doc xml:space="preserve">#GDestroyNotify for @handler</doc>
- <type name="DestroyNotify" c:type="GDestroyNotify"/>
- </parameter>
- </parameters>
- </function>
- <function name="unix_signal_source_new"
- c:identifier="g_unix_signal_source_new"
- version="2.30">
- <doc xml:space="preserve">Create a #GSource that will be dispatched upon delivery of the UNIX
- signal @signum. In GLib versions before 2.36, only `SIGHUP`, `SIGINT`,
- `SIGTERM` can be monitored. In GLib 2.36, `SIGUSR1` and `SIGUSR2`
- were added.
- Note that unlike the UNIX default, all sources which have created a
- watch will be dispatched, regardless of which underlying thread
- invoked g_unix_signal_source_new().
- For example, an effective use of this function is to handle `SIGTERM`
- cleanly; flushing any outstanding files, and then calling
- g_main_loop_quit (). It is not safe to do any of this a regular
- UNIX signal handler; your handler may be invoked while malloc() or
- another library function is running, causing reentrancy if you
- attempt to use it from the handler. None of the GLib/GObject API
- is safe against this kind of reentrancy.
- The interaction of this source when combined with native UNIX
- functions like sigprocmask() is not defined.
- The source will not initially be associated with any #GMainContext
- and must be added to one with g_source_attach() before it will be
- executed.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">A newly created #GSource</doc>
- <type name="Source" c:type="GSource*"/>
- </return-value>
- <parameters>
- <parameter name="signum" transfer-ownership="none">
- <doc xml:space="preserve">A signal number</doc>
- <type name="gint" c:type="gint"/>
- </parameter>
- </parameters>
- </function>
- <function name="unlink" c:identifier="g_unlink" version="2.6">
- <doc xml:space="preserve">A wrapper for the POSIX unlink() function. The unlink() function
- deletes a name from the filesystem. If this was the last link to the
- file and no processes have it opened, the diskspace occupied by the
- file is freed.
- See your C library manual for more details about unlink(). Note
- that on Windows, it is in general not possible to delete files that
- are open to some process, or mapped into memory.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">0 if the name was successfully deleted, -1 if an error
- occurred</doc>
- <type name="gint" c:type="int"/>
- </return-value>
- <parameters>
- <parameter name="filename" transfer-ownership="none">
- <doc xml:space="preserve">a pathname in the GLib file name encoding (UTF-8 on Windows)</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="unsetenv" c:identifier="g_unsetenv" version="2.4">
- <doc xml:space="preserve">Removes an environment variable from the environment.
- Note that on some systems, when variables are overwritten, the
- memory used for the previous variables and its value isn't reclaimed.
- You should be mindful of the fact that environment variable handling
- in UNIX is not thread-safe, and your program may crash if one thread
- calls g_unsetenv() while another thread is calling getenv(). (And note
- that many functions, such as gettext(), call getenv() internally.) This
- function is only safe to use at the very start of your program, before
- creating any other threads (or creating objects that create worker
- threads of their own).
- If you need to set up the environment for a child process, you can
- use g_get_environ() to get an environment array, modify that with
- g_environ_setenv() and g_environ_unsetenv(), and then pass that
- array directly to execvpe(), g_spawn_async(), or the like.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="variable" transfer-ownership="none">
- <doc xml:space="preserve">the environment variable to remove, must not contain '='</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="uri_escape_string"
- c:identifier="g_uri_escape_string"
- version="2.16">
- <doc xml:space="preserve">Escapes a string for use in a URI.
- Normally all characters that are not "unreserved" (i.e. ASCII alphanumerical
- characters plus dash, dot, underscore and tilde) are escaped.
- But if you specify characters in @reserved_chars_allowed they are not
- escaped. This is useful for the "reserved" characters in the URI
- specification, since those are allowed unescaped in some portions of
- a URI.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">an escaped version of @unescaped. The returned string should be
- freed when no longer needed.</doc>
- <type name="utf8" c:type="char*"/>
- </return-value>
- <parameters>
- <parameter name="unescaped" transfer-ownership="none">
- <doc xml:space="preserve">the unescaped input string.</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="reserved_chars_allowed"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a string of reserved characters that
- are allowed to be used, or %NULL.</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="allow_utf8" transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the result can include UTF-8 characters.</doc>
- <type name="gboolean" c:type="gboolean"/>
- </parameter>
- </parameters>
- </function>
- <function name="uri_list_extract_uris"
- c:identifier="g_uri_list_extract_uris"
- version="2.6">
- <doc xml:space="preserve">Splits an URI list conforming to the text/uri-list
- mime type defined in RFC 2483 into individual URIs,
- discarding any comments. The URIs are not validated.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated %NULL-terminated list
- of strings holding the individual URIs. The array should be freed
- with g_strfreev().</doc>
- <array c:type="gchar**">
- <type name="utf8"/>
- </array>
- </return-value>
- <parameters>
- <parameter name="uri_list" transfer-ownership="none">
- <doc xml:space="preserve">an URI list</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="uri_parse_scheme"
- c:identifier="g_uri_parse_scheme"
- version="2.16">
- <doc xml:space="preserve">Gets the scheme portion of a URI string. RFC 3986 decodes the scheme as:
- |[
- URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
- ]|
- Common schemes include "file", "http", "svn+ssh", etc.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">The "Scheme" component of the URI, or %NULL on error.
- The returned string should be freed when no longer needed.</doc>
- <type name="utf8" c:type="char*"/>
- </return-value>
- <parameters>
- <parameter name="uri" transfer-ownership="none">
- <doc xml:space="preserve">a valid URI.</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="uri_unescape_segment"
- c:identifier="g_uri_unescape_segment"
- version="2.16">
- <doc xml:space="preserve">Unescapes a segment of an escaped string.
- If any of the characters in @illegal_characters or the character zero appears
- as an escaped character in @escaped_string then that is an error and %NULL
- will be returned. This is useful it you want to avoid for instance having a
- slash being expanded in an escaped path element, which might confuse pathname
- handling.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">an unescaped version of @escaped_string or %NULL on error.
- The returned string should be freed when no longer needed. As a
- special case if %NULL is given for @escaped_string, this function
- will return %NULL.</doc>
- <type name="utf8" c:type="char*"/>
- </return-value>
- <parameters>
- <parameter name="escaped_string"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">A string, may be %NULL</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="escaped_string_end"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">Pointer to end of @escaped_string, may be %NULL</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="illegal_characters"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">An optional string of illegal characters not to be allowed, may be %NULL</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="uri_unescape_string"
- c:identifier="g_uri_unescape_string"
- version="2.16">
- <doc xml:space="preserve">Unescapes a whole escaped string.
- If any of the characters in @illegal_characters or the character zero appears
- as an escaped character in @escaped_string then that is an error and %NULL
- will be returned. This is useful it you want to avoid for instance having a
- slash being expanded in an escaped path element, which might confuse pathname
- handling.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">an unescaped version of @escaped_string. The returned string
- should be freed when no longer needed.</doc>
- <type name="utf8" c:type="char*"/>
- </return-value>
- <parameters>
- <parameter name="escaped_string" transfer-ownership="none">
- <doc xml:space="preserve">an escaped string to be unescaped.</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="illegal_characters"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a string of illegal characters not to be
- allowed, or %NULL.</doc>
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- <function name="usleep" c:identifier="g_usleep">
- <doc xml:space="preserve">Pauses the current thread for the given number of microseconds.
- There are 1 million microseconds per second (represented by the
- #G_USEC_PER_SEC macro). g_usleep() may have limited precision,
- depending on hardware and operating system; don't rely on the exact
- length of the sleep.</doc>
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="microseconds" transfer-ownership="none">
- <doc xml:space="preserve">number of microseconds to pause</doc>
- <type name="gulong" c:type="gulong"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf16_to_ucs4" c:identifier="g_utf16_to_ucs4" throws="1">
- <doc xml:space="preserve">Convert a string from UTF-16 to UCS-4. The result will be
- nul-terminated.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a newly allocated UCS-4 string.
- This value must be freed with g_free(). If an error occurs,
- %NULL will be returned and @error set.</doc>
- <type name="gunichar" c:type="gunichar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-16 encoded string</doc>
- <type name="guint16" c:type="const gunichar2*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the maximum length (number of #gunichar2) of @str to use.
- If @len < 0, then the string is nul-terminated.</doc>
- <type name="glong" c:type="glong"/>
- </parameter>
- <parameter name="items_read"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store number of
- words read, or %NULL. If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will
- be returned in case @str contains a trailing partial character. If
- an error occurs then the index of the invalid input is stored here.</doc>
- <type name="glong" c:type="glong*"/>
- </parameter>
- <parameter name="items_written"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store number
- of characters written, or %NULL. The value stored here does not include
- the trailing 0 character.</doc>
- <type name="glong" c:type="glong*"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf16_to_utf8" c:identifier="g_utf16_to_utf8" throws="1">
- <doc xml:space="preserve">Convert a string from UTF-16 to UTF-8. The result will be
- terminated with a 0 byte.
- Note that the input is expected to be already in native endianness,
- an initial byte-order-mark character is not handled specially.
- g_convert() can be used to convert a byte buffer of UTF-16 data of
- ambiguous endianess.
- Further note that this function does not validate the result
- string; it may e.g. include embedded NUL characters. The only
- validation done by this function is to ensure that the input can
- be correctly interpreted as UTF-16, i.e. it doesn't contain
- things unpaired surrogates.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a pointer to a newly allocated UTF-8 string.
- This value must be freed with g_free(). If an error occurs,
- %NULL will be returned and @error set.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-16 encoded string</doc>
- <type name="guint16" c:type="const gunichar2*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the maximum length (number of #gunichar2) of @str to use.
- If @len < 0, then the string is nul-terminated.</doc>
- <type name="glong" c:type="glong"/>
- </parameter>
- <parameter name="items_read"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store number of
- words read, or %NULL. If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will
- be returned in case @str contains a trailing partial character. If
- an error occurs then the index of the invalid input is stored here.</doc>
- <type name="glong" c:type="glong*"/>
- </parameter>
- <parameter name="items_written"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store number
- of bytes written, or %NULL. The value stored here does not include the
- trailing 0 byte.</doc>
- <type name="glong" c:type="glong*"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_casefold" c:identifier="g_utf8_casefold">
- <doc xml:space="preserve">Converts a string into a form that is independent of case. The
- result will not correspond to any particular case, but can be
- compared for equality or ordered with the results of calling
- g_utf8_casefold() on other strings.
- Note that calling g_utf8_casefold() followed by g_utf8_collate() is
- only an approximation to the correct linguistic case insensitive
- ordering, though it is a fairly good one. Getting this exactly
- right would require a more sophisticated collation function that
- takes case sensitivity into account. GLib does not currently
- provide such a function.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string, that is a
- case independent form of @str.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">length of @str, in bytes, or -1 if @str is nul-terminated.</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_collate" c:identifier="g_utf8_collate">
- <doc xml:space="preserve">Compares two strings for ordering using the linguistically
- correct rules for the [current locale][setlocale].
- When sorting a large number of strings, it will be significantly
- faster to obtain collation keys with g_utf8_collate_key() and
- compare the keys with strcmp() when sorting instead of sorting
- the original strings.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">< 0 if @str1 compares before @str2,
- 0 if they compare equal, > 0 if @str1 compares after @str2.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="str1" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="str2" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_collate_key" c:identifier="g_utf8_collate_key">
- <doc xml:space="preserve">Converts a string into a collation key that can be compared
- with other collation keys produced by the same function using
- strcmp().
- The results of comparing the collation keys of two strings
- with strcmp() will always be the same as comparing the two
- original keys with g_utf8_collate().
- Note that this function depends on the [current locale][setlocale].</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string. This string should
- be freed with g_free() when you are done with it.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">length of @str, in bytes, or -1 if @str is nul-terminated.</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_collate_key_for_filename"
- c:identifier="g_utf8_collate_key_for_filename"
- version="2.8">
- <doc xml:space="preserve">Converts a string into a collation key that can be compared
- with other collation keys produced by the same function using strcmp().
- In order to sort filenames correctly, this function treats the dot '.'
- as a special case. Most dictionary orderings seem to consider it
- insignificant, thus producing the ordering "event.c" "eventgenerator.c"
- "event.h" instead of "event.c" "event.h" "eventgenerator.c". Also, we
- would like to treat numbers intelligently so that "file1" "file10" "file5"
- is sorted as "file1" "file5" "file10".
- Note that this function depends on the [current locale][setlocale].</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string. This string should
- be freed with g_free() when you are done with it.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">length of @str, in bytes, or -1 if @str is nul-terminated.</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_find_next_char" c:identifier="g_utf8_find_next_char">
- <doc xml:space="preserve">Finds the start of the next UTF-8 character in the string after @p.
- @p does not have to be at the beginning of a UTF-8 character. No check
- is made to see if the character found is actually valid other than
- it starts with an appropriate byte.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a pointer to the found character or %NULL</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="p" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a position within a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="end"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a pointer to the byte following the end of the string,
- or %NULL to indicate that the string is nul-terminated</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_find_prev_char" c:identifier="g_utf8_find_prev_char">
- <doc xml:space="preserve">Given a position @p with a UTF-8 encoded string @str, find the start
- of the previous UTF-8 character starting before @p. Returns %NULL if no
- UTF-8 characters are present in @str before @p.
- @p does not have to be at the beginning of a UTF-8 character. No check
- is made to see if the character found is actually valid other than
- it starts with an appropriate byte.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a pointer to the found character or %NULL.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">pointer to the beginning of a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="p" transfer-ownership="none">
- <doc xml:space="preserve">pointer to some position within @str</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_get_char" c:identifier="g_utf8_get_char">
- <doc xml:space="preserve">Converts a sequence of bytes encoded as UTF-8 to a Unicode character.
- If @p does not point to a valid UTF-8 encoded character, results
- are undefined. If you are not sure that the bytes are complete
- valid Unicode characters, you should use g_utf8_get_char_validated()
- instead.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the resulting character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </return-value>
- <parameters>
- <parameter name="p" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to Unicode character encoded as UTF-8</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_get_char_validated"
- c:identifier="g_utf8_get_char_validated">
- <doc xml:space="preserve">Convert a sequence of bytes encoded as UTF-8 to a Unicode character.
- This function checks for incomplete characters, for invalid characters
- such as characters that are out of the range of Unicode, and for
- overlong encodings of valid characters.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the resulting character. If @p points to a partial
- sequence at the end of a string that could begin a valid
- character (or if @max_len is zero), returns (gunichar)-2;
- otherwise, if @p does not point to a valid UTF-8 encoded
- Unicode character, returns (gunichar)-1.</doc>
- <type name="gunichar" c:type="gunichar"/>
- </return-value>
- <parameters>
- <parameter name="p" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to Unicode character encoded as UTF-8</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="max_len" transfer-ownership="none">
- <doc xml:space="preserve">the maximum number of bytes to read, or -1, for no maximum or
- if @p is nul-terminated</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_normalize" c:identifier="g_utf8_normalize">
- <doc xml:space="preserve">Converts a string into canonical form, standardizing
- such issues as whether a character with an accent
- is represented as a base character and combining
- accent or as a single precomposed character. The
- string has to be valid UTF-8, otherwise %NULL is
- returned. You should generally call g_utf8_normalize()
- before comparing two Unicode strings.
- The normalization mode %G_NORMALIZE_DEFAULT only
- standardizes differences that do not affect the
- text content, such as the above-mentioned accent
- representation. %G_NORMALIZE_ALL also standardizes
- the "compatibility" characters in Unicode, such
- as SUPERSCRIPT THREE to the standard forms
- (in this case DIGIT THREE). Formatting information
- may be lost but for most text operations such
- characters should be considered the same.
- %G_NORMALIZE_DEFAULT_COMPOSE and %G_NORMALIZE_ALL_COMPOSE
- are like %G_NORMALIZE_DEFAULT and %G_NORMALIZE_ALL,
- but returned a result with composed forms rather
- than a maximally decomposed form. This is often
- useful if you intend to convert the string to
- a legacy encoding or pass it to a system with
- less capable Unicode handling.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string, that is the
- normalized form of @str, or %NULL if @str is not
- valid UTF-8.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string.</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">length of @str, in bytes, or -1 if @str is nul-terminated.</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="mode" transfer-ownership="none">
- <doc xml:space="preserve">the type of normalization to perform.</doc>
- <type name="NormalizeMode" c:type="GNormalizeMode"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_offset_to_pointer"
- c:identifier="g_utf8_offset_to_pointer">
- <doc xml:space="preserve">Converts from an integer character offset to a pointer to a position
- within the string.
- Since 2.10, this function allows to pass a negative @offset to
- step backwards. It is usually worth stepping backwards from the end
- instead of forwards if @offset is in the last fourth of the string,
- since moving forward is about 3 times faster than moving backward.
- Note that this function doesn't abort when reaching the end of @str.
- Therefore you should be sure that @offset is within string boundaries
- before calling that function. Call g_utf8_strlen() when unsure.
- This limitation exists as this function is called frequently during
- text rendering and therefore has to be as fast as possible.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the resulting pointer</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="offset" transfer-ownership="none">
- <doc xml:space="preserve">a character offset within @str</doc>
- <type name="glong" c:type="glong"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_pointer_to_offset"
- c:identifier="g_utf8_pointer_to_offset">
- <doc xml:space="preserve">Converts from a pointer to position within a string to a integer
- character offset.
- Since 2.10, this function allows @pos to be before @str, and returns
- a negative offset in this case.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the resulting character offset</doc>
- <type name="glong" c:type="glong"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="pos" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a position within @str</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_prev_char" c:identifier="g_utf8_prev_char">
- <doc xml:space="preserve">Finds the previous UTF-8 character in the string before @p.
- @p does not have to be at the beginning of a UTF-8 character. No check
- is made to see if the character found is actually valid other than
- it starts with an appropriate byte. If @p might be the first
- character of the string, you must use g_utf8_find_prev_char() instead.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a pointer to the found character</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="p" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a position within a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_strchr" c:identifier="g_utf8_strchr">
- <doc xml:space="preserve">Finds the leftmost occurrence of the given Unicode character
- in a UTF-8 encoded string, while limiting the search to @len bytes.
- If @len is -1, allow unbounded search.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">%NULL if the string does not contain the character,
- otherwise, a pointer to the start of the leftmost occurrence
- of the character in the string.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="p" transfer-ownership="none">
- <doc xml:space="preserve">a nul-terminated UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the maximum length of @p</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_strdown" c:identifier="g_utf8_strdown">
- <doc xml:space="preserve">Converts all Unicode characters in the string that have a case
- to lowercase. The exact manner that this is done depends
- on the current locale, and may result in the number of
- characters in the string changing.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string, with all characters
- converted to lowercase.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">length of @str, in bytes, or -1 if @str is nul-terminated.</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_strlen" c:identifier="g_utf8_strlen">
- <doc xml:space="preserve">Computes the length of the string in characters, not including
- the terminating nul character. If the @max'th byte falls in the
- middle of a character, the last (partial) character is not counted.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the length of the string in characters</doc>
- <type name="glong" c:type="glong"/>
- </return-value>
- <parameters>
- <parameter name="p" transfer-ownership="none">
- <doc xml:space="preserve">pointer to the start of a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="max" transfer-ownership="none">
- <doc xml:space="preserve">the maximum number of bytes to examine. If @max
- is less than 0, then the string is assumed to be
- nul-terminated. If @max is 0, @p will not be examined and
- may be %NULL. If @max is greater than 0, up to @max
- bytes are examined</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_strncpy" c:identifier="g_utf8_strncpy">
- <doc xml:space="preserve">Like the standard C strncpy() function, but copies a given number
- of characters instead of a given number of bytes. The @src string
- must be valid UTF-8 encoded text. (Use g_utf8_validate() on all
- text before trying to use UTF-8 utility functions with it.)</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">@dest</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="dest" transfer-ownership="none">
- <doc xml:space="preserve">buffer to fill with characters from @src</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="src" transfer-ownership="none">
- <doc xml:space="preserve">UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">character count</doc>
- <type name="gsize" c:type="gsize"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_strrchr" c:identifier="g_utf8_strrchr">
- <doc xml:space="preserve">Find the rightmost occurrence of the given Unicode character
- in a UTF-8 encoded string, while limiting the search to @len bytes.
- If @len is -1, allow unbounded search.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">%NULL if the string does not contain the character,
- otherwise, a pointer to the start of the rightmost occurrence
- of the character in the string.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="p" transfer-ownership="none">
- <doc xml:space="preserve">a nul-terminated UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the maximum length of @p</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="c" transfer-ownership="none">
- <doc xml:space="preserve">a Unicode character</doc>
- <type name="gunichar" c:type="gunichar"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_strreverse"
- c:identifier="g_utf8_strreverse"
- version="2.2">
- <doc xml:space="preserve">Reverses a UTF-8 string. @str must be valid UTF-8 encoded text.
- (Use g_utf8_validate() on all text before trying to use UTF-8
- utility functions with it.)
- This function is intended for programmatic uses of reversed strings.
- It pays no attention to decomposed characters, combining marks, byte
- order marks, directional indicators (LRM, LRO, etc) and similar
- characters which might need special handling when reversing a string
- for display purposes.
- Note that unlike g_strreverse(), this function returns
- newly-allocated memory, which should be freed with g_free() when
- no longer needed.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly-allocated string which is the reverse of @str</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the maximum length of @str to use, in bytes. If @len < 0,
- then the string is nul-terminated.</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_strup" c:identifier="g_utf8_strup">
- <doc xml:space="preserve">Converts all Unicode characters in the string that have a case
- to uppercase. The exact manner that this is done depends
- on the current locale, and may result in the number of
- characters in the string increasing. (For instance, the
- German ess-zet will be changed to SS.)</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated string, with all characters
- converted to uppercase.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">length of @str, in bytes, or -1 if @str is nul-terminated.</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_substring"
- c:identifier="g_utf8_substring"
- version="2.30">
- <doc xml:space="preserve">Copies a substring out of a UTF-8 encoded string.
- The substring will contain @end_pos - @start_pos characters.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a newly allocated copy of the requested
- substring. Free with g_free() when no longer needed.</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="start_pos" transfer-ownership="none">
- <doc xml:space="preserve">a character offset within @str</doc>
- <type name="glong" c:type="glong"/>
- </parameter>
- <parameter name="end_pos" transfer-ownership="none">
- <doc xml:space="preserve">another character offset within @str</doc>
- <type name="glong" c:type="glong"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_to_ucs4" c:identifier="g_utf8_to_ucs4" throws="1">
- <doc xml:space="preserve">Convert a string from UTF-8 to a 32-bit fixed width
- representation as UCS-4. A trailing 0 character will be added to the
- string after the converted text.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a newly allocated UCS-4 string.
- This value must be freed with g_free(). If an error occurs,
- %NULL will be returned and @error set.</doc>
- <type name="gunichar" c:type="gunichar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the maximum length of @str to use, in bytes. If @len < 0,
- then the string is nul-terminated.</doc>
- <type name="glong" c:type="glong"/>
- </parameter>
- <parameter name="items_read"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store number of
- bytes read, or %NULL.
- If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be
- returned in case @str contains a trailing partial
- character. If an error occurs then the index of the
- invalid input is stored here.</doc>
- <type name="glong" c:type="glong*"/>
- </parameter>
- <parameter name="items_written"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store number
- of characters written or %NULL. The value here stored does not include
- the trailing 0 character.</doc>
- <type name="glong" c:type="glong*"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_to_ucs4_fast" c:identifier="g_utf8_to_ucs4_fast">
- <doc xml:space="preserve">Convert a string from UTF-8 to a 32-bit fixed width
- representation as UCS-4, assuming valid UTF-8 input.
- This function is roughly twice as fast as g_utf8_to_ucs4()
- but does no error checking on the input. A trailing 0 character
- will be added to the string after the converted text.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a newly allocated UCS-4 string.
- This value must be freed with g_free().</doc>
- <type name="gunichar" c:type="gunichar*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the maximum length of @str to use, in bytes. If @len < 0,
- then the string is nul-terminated.</doc>
- <type name="glong" c:type="glong"/>
- </parameter>
- <parameter name="items_written"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store the
- number of characters in the result, or %NULL.</doc>
- <type name="glong" c:type="glong*"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_to_utf16" c:identifier="g_utf8_to_utf16" throws="1">
- <doc xml:space="preserve">Convert a string from UTF-8 to UTF-16. A 0 character will be
- added to the result after the converted text.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">a pointer to a newly allocated UTF-16 string.
- This value must be freed with g_free(). If an error occurs,
- %NULL will be returned and @error set.</doc>
- <type name="guint16" c:type="gunichar2*"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a UTF-8 encoded string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="len" transfer-ownership="none">
- <doc xml:space="preserve">the maximum length (number of bytes) of @str to use.
- If @len < 0, then the string is nul-terminated.</doc>
- <type name="glong" c:type="glong"/>
- </parameter>
- <parameter name="items_read"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store number of
- bytes read, or %NULL. If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will
- be returned in case @str contains a trailing partial character. If
- an error occurs then the index of the invalid input is stored here.</doc>
- <type name="glong" c:type="glong*"/>
- </parameter>
- <parameter name="items_written"
- direction="out"
- caller-allocates="1"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store number
- of #gunichar2 written, or %NULL. The value stored here does not include
- the trailing 0.</doc>
- <type name="glong" c:type="glong*"/>
- </parameter>
- </parameters>
- </function>
- <function name="utf8_validate" c:identifier="g_utf8_validate">
- <doc xml:space="preserve">Validates UTF-8 encoded text. @str is the text to validate;
- if @str is nul-terminated, then @max_len can be -1, otherwise
- @max_len should be the number of bytes to validate.
- If @end is non-%NULL, then the end of the valid range
- will be stored there (i.e. the start of the first invalid
- character if some bytes were invalid, or the end of the text
- being validated otherwise).
- Note that g_utf8_validate() returns %FALSE if @max_len is
- positive and any of the @max_len bytes are nul.
- Returns %TRUE if all of @str was valid. Many GLib and GTK+
- routines require valid UTF-8 as input; so data read from a file
- or the network should be checked with g_utf8_validate() before
- doing anything else with it.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if the text was valid UTF-8</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="str" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to character data</doc>
- <array length="1" zero-terminated="0" c:type="gchar*">
- <type name="guint8"/>
- </array>
- </parameter>
- <parameter name="max_len" transfer-ownership="none">
- <doc xml:space="preserve">max bytes to validate, or -1 to go until NUL</doc>
- <type name="gssize" c:type="gssize"/>
- </parameter>
- <parameter name="end"
- direction="out"
- caller-allocates="0"
- transfer-ownership="none"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">return location for end of valid data</doc>
- <type name="utf8" c:type="const gchar**"/>
- </parameter>
- </parameters>
- </function>
- <function name="variant_get_gtype" c:identifier="g_variant_get_gtype">
- <return-value transfer-ownership="none">
- <type name="GType" c:type="GType"/>
- </return-value>
- </function>
- <function name="variant_is_object_path"
- c:identifier="g_variant_is_object_path"
- moved-to="Variant.is_object_path"
- version="2.24">
- <doc xml:space="preserve">Determines if a given string is a valid D-Bus object path. You
- should ensure that a string is a valid D-Bus object path before
- passing it to g_variant_new_object_path().
- A valid object path starts with '/' followed by zero or more
- sequences of characters separated by '/' characters. Each sequence
- must contain only the characters "[A-Z][a-z][0-9]_". No sequence
- (including the one following the final '/' character) may be empty.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @string is a D-Bus object path</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a normal C nul-terminated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="variant_is_signature"
- c:identifier="g_variant_is_signature"
- moved-to="Variant.is_signature"
- version="2.24">
- <doc xml:space="preserve">Determines if a given string is a valid D-Bus type signature. You
- should ensure that a string is a valid D-Bus type signature before
- passing it to g_variant_new_signature().
- D-Bus type signatures consist of zero or more definite #GVariantType
- strings in sequence.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @string is a D-Bus type signature</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a normal C nul-terminated string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="variant_parse"
- c:identifier="g_variant_parse"
- moved-to="Variant.parse"
- throws="1">
- <doc xml:space="preserve">Parses a #GVariant from a text representation.
- A single #GVariant is parsed from the content of @text.
- The format is described [here][gvariant-text].
- The memory at @limit will never be accessed and the parser behaves as
- if the character at @limit is the nul terminator. This has the
- effect of bounding @text.
- If @endptr is non-%NULL then @text is permitted to contain data
- following the value that this function parses and @endptr will be
- updated to point to the first character past the end of the text
- parsed by this function. If @endptr is %NULL and there is extra data
- then an error is returned.
- If @type is non-%NULL then the value will be parsed to have that
- type. This may result in additional parse errors (in the case that
- the parsed value doesn't fit the type) but may also result in fewer
- errors (in the case that the type would have been ambiguous, such as
- with empty arrays).
- In the event that the parsing is successful, the resulting #GVariant
- is returned. It is never floating, and must be freed with
- g_variant_unref().
- In case of any error, %NULL will be returned. If @error is non-%NULL
- then it will be set to reflect the error that occurred.
- Officially, the language understood by the parser is "any string
- produced by g_variant_print()".</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">a non-floating reference to a #GVariant, or %NULL</doc>
- <type name="Variant" c:type="GVariant*"/>
- </return-value>
- <parameters>
- <parameter name="type"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a #GVariantType, or %NULL</doc>
- <type name="VariantType" c:type="const GVariantType*"/>
- </parameter>
- <parameter name="text" transfer-ownership="none">
- <doc xml:space="preserve">a string containing a GVariant in text form</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="limit"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a pointer to the end of @text, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="endptr"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">a location to store the end pointer, or %NULL</doc>
- <type name="utf8" c:type="const gchar**"/>
- </parameter>
- </parameters>
- </function>
- <function name="variant_parse_error_print_context"
- c:identifier="g_variant_parse_error_print_context"
- moved-to="Variant.parse_error_print_context"
- version="2.40">
- <doc xml:space="preserve">Pretty-prints a message showing the context of a #GVariant parse
- error within the string for which parsing was attempted.
- The resulting string is suitable for output to the console or other
- monospace media where newlines are treated in the usual way.
- The message will typically look something like one of the following:
- |[
- unterminated string constant:
- (1, 2, 3, 'abc
- ^^^^
- ]|
- or
- |[
- unable to find a common type:
- [1, 2, 3, 'str']
- ^ ^^^^^
- ]|
- The format of the message may change in a future version.
- @error must have come from a failed attempt to g_variant_parse() and
- @source_str must be exactly the same string that caused the error.
- If @source_str was not nul-terminated when you passed it to
- g_variant_parse() then you must add nul termination before using this
- function.</doc>
- <return-value transfer-ownership="full">
- <doc xml:space="preserve">the printed message</doc>
- <type name="utf8" c:type="gchar*"/>
- </return-value>
- <parameters>
- <parameter name="error" transfer-ownership="none">
- <doc xml:space="preserve">a #GError from the #GVariantParseError domain</doc>
- <type name="Error" c:type="GError*"/>
- </parameter>
- <parameter name="source_str" transfer-ownership="none">
- <doc xml:space="preserve">the string that was given to the parser</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="variant_parse_error_quark"
- c:identifier="g_variant_parse_error_quark"
- moved-to="Variant.parse_error_quark">
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="variant_parser_get_error_quark"
- c:identifier="g_variant_parser_get_error_quark"
- moved-to="Variant.parser_get_error_quark"
- deprecated="1">
- <doc xml:space="preserve">Same as g_variant_error_quark().</doc>
- <doc-deprecated xml:space="preserve">Use g_variant_parse_error_quark() instead.</doc-deprecated>
- <return-value transfer-ownership="none">
- <type name="Quark" c:type="GQuark"/>
- </return-value>
- </function>
- <function name="variant_type_checked_"
- c:identifier="g_variant_type_checked_"
- moved-to="VariantType.checked_">
- <return-value transfer-ownership="none">
- <type name="VariantType" c:type="const GVariantType*"/>
- </return-value>
- <parameters>
- <parameter name="arg0" transfer-ownership="none">
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="variant_type_string_is_valid"
- c:identifier="g_variant_type_string_is_valid"
- moved-to="VariantType.string_is_valid">
- <doc xml:space="preserve">Checks if @type_string is a valid GVariant type string. This call is
- equivalent to calling g_variant_type_string_scan() and confirming
- that the following character is a nul terminator.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if @type_string is exactly one valid type string
- Since 2.24</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="type_string" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to any string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- </parameters>
- </function>
- <function name="variant_type_string_scan"
- c:identifier="g_variant_type_string_scan"
- moved-to="VariantType.string_scan"
- version="2.24">
- <doc xml:space="preserve">Scan for a single complete and valid GVariant type string in @string.
- The memory pointed to by @limit (or bytes beyond it) is never
- accessed.
- If a valid type string is found, @endptr is updated to point to the
- first character past the end of the string that was found and %TRUE
- is returned.
- If there is no valid type string starting at @string, or if the type
- string does not end before @limit then %FALSE is returned.
- For the simple case of checking if a string is a valid type string,
- see g_variant_type_string_is_valid().</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">%TRUE if a valid type string was found</doc>
- <type name="gboolean" c:type="gboolean"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">a pointer to any string</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="limit"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <doc xml:space="preserve">the end of @string, or %NULL</doc>
- <type name="utf8" c:type="const gchar*"/>
- </parameter>
- <parameter name="endptr"
- direction="out"
- caller-allocates="0"
- transfer-ownership="full"
- optional="1"
- allow-none="1">
- <doc xml:space="preserve">location to store the end pointer, or %NULL</doc>
- <type name="utf8" c:type="const gchar**"/>
- </parameter>
- </parameters>
- </function>
- <function name="vasprintf"
- c:identifier="g_vasprintf"
- version="2.4"
- introspectable="0">
- <doc xml:space="preserve">An implementation of the GNU vasprintf() function which supports
- positional parameters, as specified in the Single Unix Specification.
- This function is similar to g_vsprintf(), except that it allocates a
- string to hold the output, instead of putting the output in a buffer
- you allocate in advance.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes printed.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the return location for the newly-allocated string.</doc>
- <type name="utf8" c:type="gchar**"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a standard printf() format string, but notice
- [string precision pitfalls][string-precision]</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="args" transfer-ownership="none">
- <doc xml:space="preserve">the list of arguments to insert in the output.</doc>
- <type name="va_list" c:type="va_list"/>
- </parameter>
- </parameters>
- </function>
- <function name="vfprintf"
- c:identifier="g_vfprintf"
- version="2.2"
- introspectable="0">
- <doc xml:space="preserve">An implementation of the standard fprintf() function which supports
- positional parameters, as specified in the Single Unix Specification.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes printed.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="file" transfer-ownership="none">
- <doc xml:space="preserve">the stream to write to.</doc>
- <type name="gpointer" c:type="FILE*"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a standard printf() format string, but notice
- [string precision pitfalls][string-precision]</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="args" transfer-ownership="none">
- <doc xml:space="preserve">the list of arguments to insert in the output.</doc>
- <type name="va_list" c:type="va_list"/>
- </parameter>
- </parameters>
- </function>
- <function name="vprintf"
- c:identifier="g_vprintf"
- version="2.2"
- introspectable="0">
- <doc xml:space="preserve">An implementation of the standard vprintf() function which supports
- positional parameters, as specified in the Single Unix Specification.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes printed.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a standard printf() format string, but notice
- [string precision pitfalls][string-precision]</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="args" transfer-ownership="none">
- <doc xml:space="preserve">the list of arguments to insert in the output.</doc>
- <type name="va_list" c:type="va_list"/>
- </parameter>
- </parameters>
- </function>
- <function name="vsnprintf" c:identifier="g_vsnprintf" introspectable="0">
- <doc xml:space="preserve">A safer form of the standard vsprintf() function. The output is guaranteed
- to not exceed @n characters (including the terminating nul character), so
- it is easy to ensure that a buffer overflow cannot occur.
- See also g_strdup_vprintf().
- In versions of GLib prior to 1.2.3, this function may return -1 if the
- output was truncated, and the truncated string may not be nul-terminated.
- In versions prior to 1.3.12, this function returns the length of the output
- string.
- The return value of g_vsnprintf() conforms to the vsnprintf() function
- as standardized in ISO C99. Note that this is different from traditional
- vsnprintf(), which returns the length of the output string.
- The format string may contain positional parameters, as specified in
- the Single Unix Specification.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes which would be produced if the buffer
- was large enough.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the buffer to hold the output.</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="n" transfer-ownership="none">
- <doc xml:space="preserve">the maximum number of bytes to produce (including the
- terminating nul character).</doc>
- <type name="gulong" c:type="gulong"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a standard printf() format string, but notice
- string precision pitfalls][string-precision]</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="args" transfer-ownership="none">
- <doc xml:space="preserve">the list of arguments to insert in the output.</doc>
- <type name="va_list" c:type="va_list"/>
- </parameter>
- </parameters>
- </function>
- <function name="vsprintf"
- c:identifier="g_vsprintf"
- version="2.2"
- introspectable="0">
- <doc xml:space="preserve">An implementation of the standard vsprintf() function which supports
- positional parameters, as specified in the Single Unix Specification.</doc>
- <return-value transfer-ownership="none">
- <doc xml:space="preserve">the number of bytes printed.</doc>
- <type name="gint" c:type="gint"/>
- </return-value>
- <parameters>
- <parameter name="string" transfer-ownership="none">
- <doc xml:space="preserve">the buffer to hold the output.</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="format" transfer-ownership="none">
- <doc xml:space="preserve">a standard printf() format string, but notice
- [string precision pitfalls][string-precision]</doc>
- <type name="utf8" c:type="gchar*"/>
- </parameter>
- <parameter name="args" transfer-ownership="none">
- <doc xml:space="preserve">the list of arguments to insert in the output.</doc>
- <type name="va_list" c:type="va_list"/>
- </parameter>
- </parameters>
- </function>
- <function name="warn_message"
- c:identifier="g_warn_message"
- introspectable="0">
- <return-value transfer-ownership="none">
- <type name="none" c:type="void"/>
- </return-value>
- <parameters>
- <parameter name="domain"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="file" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="line" transfer-ownership="none">
- <type name="gint" c:type="int"/>
- </parameter>
- <parameter name="func" transfer-ownership="none">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- <parameter name="warnexpr"
- transfer-ownership="none"
- nullable="1"
- allow-none="1">
- <type name="utf8" c:type="const char*"/>
- </parameter>
- </parameters>
- </function>
- </namespace>
- </repository>
|