repo_name
stringlengths
9
74
language
stringclasses
1 value
length_bytes
int64
11
9.34M
extension
stringclasses
2 values
content
stringlengths
11
9.34M
oresat/oresat-c3-rf
Ada
49,440
adb
M:config F:G$ax5043_set_registers$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$ax5043_set_registers_tx$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$ax5043_set_registers_rx$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$ax5043_set_registers_rxwor$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$ax5043_set_registers_rxcont$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$ax5043_set_registers_rxcont_singleparamset$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$axradio_setup_pincfg1$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$axradio_setup_pincfg2$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$axradio_conv_freq_fromhz$0$0({2}DF,SL:S),Z,0,0,0,0,0 F:G$axradio_conv_freq_tohz$0$0({2}DF,SL:S),Z,0,0,0,0,0 F:G$axradio_conv_freq_fromreg$0$0({2}DF,SL:S),Z,0,0,0,0,0 F:G$axradio_conv_timeinterval_totimer0$0$0({2}DF,SL:S),Z,0,0,0,0,0 F:G$axradio_byteconv$0$0({2}DF,SC:U),C,0,0,0,0,0 S:Lconfig.axradio_byteconv$b$1$339({1}SC:U),R,0,0,[r7] F:G$axradio_byteconv_buffer$0$0({2}DF,SV:S),C,0,0,0,0,0 S:Lconfig.axradio_byteconv_buffer$buflen$1$341({2}SI:U),B,1,-4 S:Lconfig.axradio_byteconv_buffer$buf$1$341({2}DX,SC:U),R,0,0,[] F:G$axradio_framing_check_crc$0$0({2}DF,SI:U),Z,0,0,0,0,0 S:Lconfig.axradio_framing_check_crc$cnt$1$343({2}SI:U),B,1,-4 S:Lconfig.axradio_framing_check_crc$pkt$1$343({2}DX,SC:U),R,0,0,[r6,r7] F:G$axradio_framing_append_crc$0$0({2}DF,SI:U),Z,0,0,0,0,0 S:Lconfig.axradio_framing_append_crc$cnt$1$345({2}SI:U),B,1,-4 S:Lconfig.axradio_framing_append_crc$pkt$1$345({2}DX,SC:U),R,0,0,[r6,r7] S:Lconfig.axradio_framing_append_crc$s$1$346({2}SI:U),R,0,0,[r4,r5] T:Fconfig$axradio_status_receive[({0}S:S$phy$0$0({10}STaxradio_status_receive_phy:S),Z,0,0)({10}S:S$mac$0$0({12}STaxradio_status_receive_mac:S),Z,0,0)({22}S:S$pktdata$0$0({2}DX,SC:U),Z,0,0)({24}S:S$pktlen$0$0({2}SI:U),Z,0,0)] T:Fconfig$axradio_address[({0}S:S$addr$0$0({5}DA5d,SC:U),Z,0,0)] T:Fconfig$axradio_address_mask[({0}S:S$addr$0$0({5}DA5d,SC:U),Z,0,0)({5}S:S$mask$0$0({5}DA5d,SC:U),Z,0,0)] T:Fconfig$__00000000[({0}S:S$rx$0$0({26}STaxradio_status_receive:S),Z,0,0)({0}S:S$cs$0$0({3}STaxradio_status_channelstate:S),Z,0,0)] T:Fconfig$axradio_status_channelstate[({0}S:S$rssi$0$0({2}SI:S),Z,0,0)({2}S:S$busy$0$0({1}SC:U),Z,0,0)] T:Fconfig$axradio_status_receive_mac[({0}S:S$remoteaddr$0$0({5}DA5d,SC:U),Z,0,0)({5}S:S$localaddr$0$0({5}DA5d,SC:U),Z,0,0)({10}S:S$raw$0$0({2}DX,SC:U),Z,0,0)] T:Fconfig$axradio_status_receive_phy[({0}S:S$rssi$0$0({2}SI:S),Z,0,0)({2}S:S$offset$0$0({4}SL:S),Z,0,0)({6}S:S$timeoffset$0$0({2}SI:S),Z,0,0)({8}S:S$period$0$0({2}SI:S),Z,0,0)] T:Fconfig$axradio_status[({0}S:S$status$0$0({1}SC:U),Z,0,0)({1}S:S$error$0$0({1}SC:U),Z,0,0)({2}S:S$time$0$0({4}SL:U),Z,0,0)({6}S:S$u$0$0({26}ST__00000000:S),Z,0,0)] S:G$random_seed$0$0({2}SI:U),E,0,0 S:G$axradio_trxstate$0$0({1}SC:U),E,0,0 S:G$EASY_RADIO_ax5043_powermode_after_send_packet$0$0({1}SC:U),E,0,0 S:G$EASY_RADIO_ax5043_powermode_after_rx_packet$0$0({1}SC:U),E,0,0 S:G$EASY_RADIO_saved_radiostate$0$0({1}SC:U),E,0,0 S:Lconfig.enter_critical$crit$1$29({1}SC:U),E,0,0 S:Lconfig.exit_critical$crit$1$30({1}SC:U),E,0,0 S:Lconfig.axradio_conv_freq_fromhz$f$1$331({4}SL:S),R,0,0,[] S:Lconfig.axradio_conv_freq_tohz$f$1$333({4}SL:S),R,0,0,[] S:Lconfig.axradio_conv_freq_fromreg$f$1$335({4}SL:S),R,0,0,[] S:Lconfig.axradio_conv_timeinterval_totimer0$dt$1$337({4}SL:S),R,0,0,[r4,r5,r6,r7] S:Lconfig.axradio_conv_timeinterval_totimer0$r$1$338({4}SL:S),R,0,0,[r0,r1,r2,r3] S:G$ADCCH0VAL0$0$0({1}SC:U),F,0,0 S:G$ADCCH0VAL1$0$0({1}SC:U),F,0,0 S:G$ADCCH0VAL$0$0({2}SI:U),F,0,0 S:G$ADCCH1VAL0$0$0({1}SC:U),F,0,0 S:G$ADCCH1VAL1$0$0({1}SC:U),F,0,0 S:G$ADCCH1VAL$0$0({2}SI:U),F,0,0 S:G$ADCCH2VAL0$0$0({1}SC:U),F,0,0 S:G$ADCCH2VAL1$0$0({1}SC:U),F,0,0 S:G$ADCCH2VAL$0$0({2}SI:U),F,0,0 S:G$ADCCH3VAL0$0$0({1}SC:U),F,0,0 S:G$ADCCH3VAL1$0$0({1}SC:U),F,0,0 S:G$ADCCH3VAL$0$0({2}SI:U),F,0,0 S:G$ADCTUNE0$0$0({1}SC:U),F,0,0 S:G$ADCTUNE1$0$0({1}SC:U),F,0,0 S:G$ADCTUNE2$0$0({1}SC:U),F,0,0 S:G$DMA0ADDR0$0$0({1}SC:U),F,0,0 S:G$DMA0ADDR1$0$0({1}SC:U),F,0,0 S:G$DMA0ADDR$0$0({2}SI:U),F,0,0 S:G$DMA0CONFIG$0$0({1}SC:U),F,0,0 S:G$DMA1ADDR0$0$0({1}SC:U),F,0,0 S:G$DMA1ADDR1$0$0({1}SC:U),F,0,0 S:G$DMA1ADDR$0$0({2}SI:U),F,0,0 S:G$DMA1CONFIG$0$0({1}SC:U),F,0,0 S:G$FRCOSCCONFIG$0$0({1}SC:U),F,0,0 S:G$FRCOSCCTRL$0$0({1}SC:U),F,0,0 S:G$FRCOSCFREQ0$0$0({1}SC:U),F,0,0 S:G$FRCOSCFREQ1$0$0({1}SC:U),F,0,0 S:G$FRCOSCFREQ$0$0({2}SI:U),F,0,0 S:G$FRCOSCKFILT0$0$0({1}SC:U),F,0,0 S:G$FRCOSCKFILT1$0$0({1}SC:U),F,0,0 S:G$FRCOSCKFILT$0$0({2}SI:U),F,0,0 S:G$FRCOSCPER0$0$0({1}SC:U),F,0,0 S:G$FRCOSCPER1$0$0({1}SC:U),F,0,0 S:G$FRCOSCPER$0$0({2}SI:U),F,0,0 S:G$FRCOSCREF0$0$0({1}SC:U),F,0,0 S:G$FRCOSCREF1$0$0({1}SC:U),F,0,0 S:G$FRCOSCREF$0$0({2}SI:U),F,0,0 S:G$ANALOGA$0$0({1}SC:U),F,0,0 S:G$GPIOENABLE$0$0({1}SC:U),F,0,0 S:G$EXTIRQ$0$0({1}SC:U),F,0,0 S:G$INTCHGA$0$0({1}SC:U),F,0,0 S:G$INTCHGB$0$0({1}SC:U),F,0,0 S:G$INTCHGC$0$0({1}SC:U),F,0,0 S:G$PALTA$0$0({1}SC:U),F,0,0 S:G$PALTB$0$0({1}SC:U),F,0,0 S:G$PALTC$0$0({1}SC:U),F,0,0 S:G$PALTRADIO$0$0({1}SC:U),F,0,0 S:G$PINCHGA$0$0({1}SC:U),F,0,0 S:G$PINCHGB$0$0({1}SC:U),F,0,0 S:G$PINCHGC$0$0({1}SC:U),F,0,0 S:G$PINSEL$0$0({1}SC:U),F,0,0 S:G$LPOSCCONFIG$0$0({1}SC:U),F,0,0 S:G$LPOSCFREQ0$0$0({1}SC:U),F,0,0 S:G$LPOSCFREQ1$0$0({1}SC:U),F,0,0 S:G$LPOSCFREQ$0$0({2}SI:U),F,0,0 S:G$LPOSCKFILT0$0$0({1}SC:U),F,0,0 S:G$LPOSCKFILT1$0$0({1}SC:U),F,0,0 S:G$LPOSCKFILT$0$0({2}SI:U),F,0,0 S:G$LPOSCPER0$0$0({1}SC:U),F,0,0 S:G$LPOSCPER1$0$0({1}SC:U),F,0,0 S:G$LPOSCPER$0$0({2}SI:U),F,0,0 S:G$LPOSCREF0$0$0({1}SC:U),F,0,0 S:G$LPOSCREF1$0$0({1}SC:U),F,0,0 S:G$LPOSCREF$0$0({2}SI:U),F,0,0 S:G$LPXOSCGM$0$0({1}SC:U),F,0,0 S:G$MISCCTRL$0$0({1}SC:U),F,0,0 S:G$OSCCALIB$0$0({1}SC:U),F,0,0 S:G$OSCFORCERUN$0$0({1}SC:U),F,0,0 S:G$OSCREADY$0$0({1}SC:U),F,0,0 S:G$OSCRUN$0$0({1}SC:U),F,0,0 S:G$RADIOFDATAADDR0$0$0({1}SC:U),F,0,0 S:G$RADIOFDATAADDR1$0$0({1}SC:U),F,0,0 S:G$RADIOFDATAADDR$0$0({2}SI:U),F,0,0 S:G$RADIOFSTATADDR0$0$0({1}SC:U),F,0,0 S:G$RADIOFSTATADDR1$0$0({1}SC:U),F,0,0 S:G$RADIOFSTATADDR$0$0({2}SI:U),F,0,0 S:G$RADIOMUX$0$0({1}SC:U),F,0,0 S:G$SCRATCH0$0$0({1}SC:U),F,0,0 S:G$SCRATCH1$0$0({1}SC:U),F,0,0 S:G$SCRATCH2$0$0({1}SC:U),F,0,0 S:G$SCRATCH3$0$0({1}SC:U),F,0,0 S:G$SILICONREV$0$0({1}SC:U),F,0,0 S:G$XTALAMPL$0$0({1}SC:U),F,0,0 S:G$XTALOSC$0$0({1}SC:U),F,0,0 S:G$XTALREADY$0$0({1}SC:U),F,0,0 S:G$AX5043_AFSKCTRL$0$0({1}SC:U),F,0,0 S:G$AX5043_AFSKMARK0$0$0({1}SC:U),F,0,0 S:G$AX5043_AFSKMARK1$0$0({1}SC:U),F,0,0 S:G$AX5043_AFSKSPACE0$0$0({1}SC:U),F,0,0 S:G$AX5043_AFSKSPACE1$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCCOUNTER$0$0({1}SC:U),F,0,0 S:G$AX5043_AMPLFILTER$0$0({1}SC:U),F,0,0 S:G$AX5043_BBOFFSCAP$0$0({1}SC:U),F,0,0 S:G$AX5043_BBTUNE$0$0({1}SC:U),F,0,0 S:G$AX5043_BGNDRSSI$0$0({1}SC:U),F,0,0 S:G$AX5043_BGNDRSSIGAIN$0$0({1}SC:U),F,0,0 S:G$AX5043_BGNDRSSITHR$0$0({1}SC:U),F,0,0 S:G$AX5043_CRCINIT0$0$0({1}SC:U),F,0,0 S:G$AX5043_CRCINIT1$0$0({1}SC:U),F,0,0 S:G$AX5043_CRCINIT2$0$0({1}SC:U),F,0,0 S:G$AX5043_CRCINIT3$0$0({1}SC:U),F,0,0 S:G$AX5043_DACCONFIG$0$0({1}SC:U),F,0,0 S:G$AX5043_DACVALUE0$0$0({1}SC:U),F,0,0 S:G$AX5043_DACVALUE1$0$0({1}SC:U),F,0,0 S:G$AX5043_DECIMATION$0$0({1}SC:U),F,0,0 S:G$AX5043_DIVERSITY$0$0({1}SC:U),F,0,0 S:G$AX5043_ENCODING$0$0({1}SC:U),F,0,0 S:G$AX5043_FEC$0$0({1}SC:U),F,0,0 S:G$AX5043_FECSTATUS$0$0({1}SC:U),F,0,0 S:G$AX5043_FECSYNC$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFOCOUNT0$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFOCOUNT1$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFODATA$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFOFREE0$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFOFREE1$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFOSTAT$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFOTHRESH0$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFOTHRESH1$0$0({1}SC:U),F,0,0 S:G$AX5043_FRAMING$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQA0$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQA1$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQA2$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQA3$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQB0$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQB1$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQB2$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQB3$0$0({1}SC:U),F,0,0 S:G$AX5043_FSKDEV0$0$0({1}SC:U),F,0,0 S:G$AX5043_FSKDEV1$0$0({1}SC:U),F,0,0 S:G$AX5043_FSKDEV2$0$0({1}SC:U),F,0,0 S:G$AX5043_FSKDMAX0$0$0({1}SC:U),F,0,0 S:G$AX5043_FSKDMAX1$0$0({1}SC:U),F,0,0 S:G$AX5043_FSKDMIN0$0$0({1}SC:U),F,0,0 S:G$AX5043_FSKDMIN1$0$0({1}SC:U),F,0,0 S:G$AX5043_GPADC13VALUE0$0$0({1}SC:U),F,0,0 S:G$AX5043_GPADC13VALUE1$0$0({1}SC:U),F,0,0 S:G$AX5043_GPADCCTRL$0$0({1}SC:U),F,0,0 S:G$AX5043_GPADCPERIOD$0$0({1}SC:U),F,0,0 S:G$AX5043_IFFREQ0$0$0({1}SC:U),F,0,0 S:G$AX5043_IFFREQ1$0$0({1}SC:U),F,0,0 S:G$AX5043_IRQINVERSION0$0$0({1}SC:U),F,0,0 S:G$AX5043_IRQINVERSION1$0$0({1}SC:U),F,0,0 S:G$AX5043_IRQMASK0$0$0({1}SC:U),F,0,0 S:G$AX5043_IRQMASK1$0$0({1}SC:U),F,0,0 S:G$AX5043_IRQREQUEST0$0$0({1}SC:U),F,0,0 S:G$AX5043_IRQREQUEST1$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCCONFIG$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCFREQ0$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCFREQ1$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCKFILT0$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCKFILT1$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCPER0$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCPER1$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCREF0$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCREF1$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCSTATUS$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH0LEN$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH0MAX$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH0MIN$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH0PAT0$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH0PAT1$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH0PAT2$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH0PAT3$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH1LEN$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH1MAX$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH1MIN$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH1PAT0$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH1PAT1$0$0({1}SC:U),F,0,0 S:G$AX5043_MAXDROFFSET0$0$0({1}SC:U),F,0,0 S:G$AX5043_MAXDROFFSET1$0$0({1}SC:U),F,0,0 S:G$AX5043_MAXDROFFSET2$0$0({1}SC:U),F,0,0 S:G$AX5043_MAXRFOFFSET0$0$0({1}SC:U),F,0,0 S:G$AX5043_MAXRFOFFSET1$0$0({1}SC:U),F,0,0 S:G$AX5043_MAXRFOFFSET2$0$0({1}SC:U),F,0,0 S:G$AX5043_MODCFGA$0$0({1}SC:U),F,0,0 S:G$AX5043_MODCFGF$0$0({1}SC:U),F,0,0 S:G$AX5043_MODCFGP$0$0({1}SC:U),F,0,0 S:G$AX5043_MODULATION$0$0({1}SC:U),F,0,0 S:G$AX5043_PINFUNCANTSEL$0$0({1}SC:U),F,0,0 S:G$AX5043_PINFUNCDATA$0$0({1}SC:U),F,0,0 S:G$AX5043_PINFUNCDCLK$0$0({1}SC:U),F,0,0 S:G$AX5043_PINFUNCIRQ$0$0({1}SC:U),F,0,0 S:G$AX5043_PINFUNCPWRAMP$0$0({1}SC:U),F,0,0 S:G$AX5043_PINFUNCSYSCLK$0$0({1}SC:U),F,0,0 S:G$AX5043_PINSTATE$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTACCEPTFLAGS$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTCHUNKSIZE$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTMISCFLAGS$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTSTOREFLAGS$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLCPI$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLCPIBOOST$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLLOCKDET$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLLOOP$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLLOOPBOOST$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLRANGINGA$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLRANGINGB$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLRNGCLK$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLVCODIV$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLVCOI$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLVCOIR$0$0({1}SC:U),F,0,0 S:G$AX5043_POWCTRL1$0$0({1}SC:U),F,0,0 S:G$AX5043_POWIRQMASK$0$0({1}SC:U),F,0,0 S:G$AX5043_POWSTAT$0$0({1}SC:U),F,0,0 S:G$AX5043_POWSTICKYSTAT$0$0({1}SC:U),F,0,0 S:G$AX5043_PWRAMP$0$0({1}SC:U),F,0,0 S:G$AX5043_PWRMODE$0$0({1}SC:U),F,0,0 S:G$AX5043_RADIOEVENTMASK0$0$0({1}SC:U),F,0,0 S:G$AX5043_RADIOEVENTMASK1$0$0({1}SC:U),F,0,0 S:G$AX5043_RADIOEVENTREQ0$0$0({1}SC:U),F,0,0 S:G$AX5043_RADIOEVENTREQ1$0$0({1}SC:U),F,0,0 S:G$AX5043_RADIOSTATE$0$0({1}SC:U),F,0,0 S:G$AX5043_REF$0$0({1}SC:U),F,0,0 S:G$AX5043_RSSI$0$0({1}SC:U),F,0,0 S:G$AX5043_RSSIABSTHR$0$0({1}SC:U),F,0,0 S:G$AX5043_RSSIREFERENCE$0$0({1}SC:U),F,0,0 S:G$AX5043_RXDATARATE0$0$0({1}SC:U),F,0,0 S:G$AX5043_RXDATARATE1$0$0({1}SC:U),F,0,0 S:G$AX5043_RXDATARATE2$0$0({1}SC:U),F,0,0 S:G$AX5043_SCRATCH$0$0({1}SC:U),F,0,0 S:G$AX5043_SILICONREVISION$0$0({1}SC:U),F,0,0 S:G$AX5043_TIMER0$0$0({1}SC:U),F,0,0 S:G$AX5043_TIMER1$0$0({1}SC:U),F,0,0 S:G$AX5043_TIMER2$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXAGC$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXBOOST$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXCOARSEAGC$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXOFFSACQ$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXPREAMBLE1$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXPREAMBLE2$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXPREAMBLE3$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXRSSI$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXSETTLE$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGTXBOOST$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGTXSETTLE$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKAFSKDEMOD0$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKAFSKDEMOD1$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKAMPLITUDE0$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKAMPLITUDE1$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKDATARATE0$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKDATARATE1$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKDATARATE2$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKFREQ0$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKFREQ1$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKFSKDEMOD0$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKFSKDEMOD1$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKPHASE0$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKPHASE1$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKRFFREQ0$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKRFFREQ1$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKRFFREQ2$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFA0$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFA1$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFB0$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFB1$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFC0$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFC1$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFD0$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFD1$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFE0$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFE1$0$0({1}SC:U),F,0,0 S:G$AX5043_TXRATE0$0$0({1}SC:U),F,0,0 S:G$AX5043_TXRATE1$0$0({1}SC:U),F,0,0 S:G$AX5043_TXRATE2$0$0({1}SC:U),F,0,0 S:G$AX5043_WAKEUP0$0$0({1}SC:U),F,0,0 S:G$AX5043_WAKEUP1$0$0({1}SC:U),F,0,0 S:G$AX5043_WAKEUPFREQ0$0$0({1}SC:U),F,0,0 S:G$AX5043_WAKEUPFREQ1$0$0({1}SC:U),F,0,0 S:G$AX5043_WAKEUPTIMER0$0$0({1}SC:U),F,0,0 S:G$AX5043_WAKEUPTIMER1$0$0({1}SC:U),F,0,0 S:G$AX5043_WAKEUPXOEARLY$0$0({1}SC:U),F,0,0 S:G$AX5043_XTALAMPL$0$0({1}SC:U),F,0,0 S:G$AX5043_XTALCAP$0$0({1}SC:U),F,0,0 S:G$AX5043_XTALOSC$0$0({1}SC:U),F,0,0 S:G$AX5043_XTALSTATUS$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF00$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF0C$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF18$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF1C$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF21$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF22$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF23$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF26$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF30$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF31$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF32$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF33$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF34$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF35$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF44$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCAHYST0$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCAHYST1$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCAHYST2$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCAHYST3$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCGAIN0$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCGAIN1$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCGAIN2$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCGAIN3$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCMINMAX0$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCMINMAX1$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCMINMAX2$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCMINMAX3$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCTARGET0$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCTARGET1$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCTARGET2$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCTARGET3$0$0({1}SC:U),F,0,0 S:G$AX5043_AMPLITUDEGAIN0$0$0({1}SC:U),F,0,0 S:G$AX5043_AMPLITUDEGAIN1$0$0({1}SC:U),F,0,0 S:G$AX5043_AMPLITUDEGAIN2$0$0({1}SC:U),F,0,0 S:G$AX5043_AMPLITUDEGAIN3$0$0({1}SC:U),F,0,0 S:G$AX5043_BBOFFSRES0$0$0({1}SC:U),F,0,0 S:G$AX5043_BBOFFSRES1$0$0({1}SC:U),F,0,0 S:G$AX5043_BBOFFSRES2$0$0({1}SC:U),F,0,0 S:G$AX5043_BBOFFSRES3$0$0({1}SC:U),F,0,0 S:G$AX5043_DRGAIN0$0$0({1}SC:U),F,0,0 S:G$AX5043_DRGAIN1$0$0({1}SC:U),F,0,0 S:G$AX5043_DRGAIN2$0$0({1}SC:U),F,0,0 S:G$AX5043_DRGAIN3$0$0({1}SC:U),F,0,0 S:G$AX5043_FOURFSK0$0$0({1}SC:U),F,0,0 S:G$AX5043_FOURFSK1$0$0({1}SC:U),F,0,0 S:G$AX5043_FOURFSK2$0$0({1}SC:U),F,0,0 S:G$AX5043_FOURFSK3$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV00$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV01$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV02$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV03$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV10$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV11$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV12$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV13$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINA0$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINA1$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINA2$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINA3$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINB0$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINB1$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINB2$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINB3$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINC0$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINC1$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINC2$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINC3$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAIND0$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAIND1$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAIND2$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAIND3$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYLEAK$0$0({1}SC:U),F,0,0 S:G$AX5043_PHASEGAIN0$0$0({1}SC:U),F,0,0 S:G$AX5043_PHASEGAIN1$0$0({1}SC:U),F,0,0 S:G$AX5043_PHASEGAIN2$0$0({1}SC:U),F,0,0 S:G$AX5043_PHASEGAIN3$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDR0$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDR1$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDR2$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDR3$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDRCFG$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDRMASK0$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDRMASK1$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDRMASK2$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDRMASK3$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTLENCFG$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTLENOFFSET$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTMAXLEN$0$0({1}SC:U),F,0,0 S:G$AX5043_RXPARAMCURSET$0$0({1}SC:U),F,0,0 S:G$AX5043_RXPARAMSETS$0$0({1}SC:U),F,0,0 S:G$AX5043_TIMEGAIN0$0$0({1}SC:U),F,0,0 S:G$AX5043_TIMEGAIN1$0$0({1}SC:U),F,0,0 S:G$AX5043_TIMEGAIN2$0$0({1}SC:U),F,0,0 S:G$AX5043_TIMEGAIN3$0$0({1}SC:U),F,0,0 S:G$AX5043_AFSKCTRLNB$0$0({1}SC:U),F,0,0 S:G$AX5043_AFSKMARK0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AFSKMARK1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AFSKSPACE0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AFSKSPACE1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCCOUNTERNB$0$0({1}SC:U),F,0,0 S:G$AX5043_AMPLFILTERNB$0$0({1}SC:U),F,0,0 S:G$AX5043_BBOFFSCAPNB$0$0({1}SC:U),F,0,0 S:G$AX5043_BBTUNENB$0$0({1}SC:U),F,0,0 S:G$AX5043_BGNDRSSINB$0$0({1}SC:U),F,0,0 S:G$AX5043_BGNDRSSIGAINNB$0$0({1}SC:U),F,0,0 S:G$AX5043_BGNDRSSITHRNB$0$0({1}SC:U),F,0,0 S:G$AX5043_CRCINIT0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_CRCINIT1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_CRCINIT2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_CRCINIT3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_DACCONFIGNB$0$0({1}SC:U),F,0,0 S:G$AX5043_DACVALUE0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_DACVALUE1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_DECIMATIONNB$0$0({1}SC:U),F,0,0 S:G$AX5043_DIVERSITYNB$0$0({1}SC:U),F,0,0 S:G$AX5043_ENCODINGNB$0$0({1}SC:U),F,0,0 S:G$AX5043_FECNB$0$0({1}SC:U),F,0,0 S:G$AX5043_FECSTATUSNB$0$0({1}SC:U),F,0,0 S:G$AX5043_FECSYNCNB$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFOCOUNT0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFOCOUNT1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFODATANB$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFOFREE0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFOFREE1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFOSTATNB$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFOTHRESH0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FIFOTHRESH1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FRAMINGNB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQA0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQA1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQA2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQA3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQB0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQB1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQB2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQB3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FSKDEV0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FSKDEV1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FSKDEV2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FSKDMAX0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FSKDMAX1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FSKDMIN0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FSKDMIN1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_GPADC13VALUE0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_GPADC13VALUE1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_GPADCCTRLNB$0$0({1}SC:U),F,0,0 S:G$AX5043_GPADCPERIODNB$0$0({1}SC:U),F,0,0 S:G$AX5043_IFFREQ0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_IFFREQ1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_IRQINVERSION0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_IRQINVERSION1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_IRQMASK0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_IRQMASK1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_IRQREQUEST0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_IRQREQUEST1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCCONFIGNB$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCFREQ0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCFREQ1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCKFILT0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCKFILT1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCPER0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCPER1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCREF0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCREF1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_LPOSCSTATUSNB$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH0LENNB$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH0MAXNB$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH0MINNB$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH0PAT0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH0PAT1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH0PAT2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH0PAT3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH1LENNB$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH1MAXNB$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH1MINNB$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH1PAT0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_MATCH1PAT1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_MAXDROFFSET0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_MAXDROFFSET1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_MAXDROFFSET2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_MAXRFOFFSET0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_MAXRFOFFSET1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_MAXRFOFFSET2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_MODCFGANB$0$0({1}SC:U),F,0,0 S:G$AX5043_MODCFGFNB$0$0({1}SC:U),F,0,0 S:G$AX5043_MODCFGPNB$0$0({1}SC:U),F,0,0 S:G$AX5043_MODULATIONNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PINFUNCANTSELNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PINFUNCDATANB$0$0({1}SC:U),F,0,0 S:G$AX5043_PINFUNCDCLKNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PINFUNCIRQNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PINFUNCPWRAMPNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PINFUNCSYSCLKNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PINSTATENB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTACCEPTFLAGSNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTCHUNKSIZENB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTMISCFLAGSNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTSTOREFLAGSNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLCPINB$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLCPIBOOSTNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLLOCKDETNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLLOOPNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLLOOPBOOSTNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLRANGINGANB$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLRANGINGBNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLRNGCLKNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLVCODIVNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLVCOINB$0$0({1}SC:U),F,0,0 S:G$AX5043_PLLVCOIRNB$0$0({1}SC:U),F,0,0 S:G$AX5043_POWCTRL1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_POWIRQMASKNB$0$0({1}SC:U),F,0,0 S:G$AX5043_POWSTATNB$0$0({1}SC:U),F,0,0 S:G$AX5043_POWSTICKYSTATNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PWRAMPNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PWRMODENB$0$0({1}SC:U),F,0,0 S:G$AX5043_RADIOEVENTMASK0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_RADIOEVENTMASK1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_RADIOEVENTREQ0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_RADIOEVENTREQ1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_RADIOSTATENB$0$0({1}SC:U),F,0,0 S:G$AX5043_REFNB$0$0({1}SC:U),F,0,0 S:G$AX5043_RSSINB$0$0({1}SC:U),F,0,0 S:G$AX5043_RSSIABSTHRNB$0$0({1}SC:U),F,0,0 S:G$AX5043_RSSIREFERENCENB$0$0({1}SC:U),F,0,0 S:G$AX5043_RXDATARATE0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_RXDATARATE1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_RXDATARATE2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_SCRATCHNB$0$0({1}SC:U),F,0,0 S:G$AX5043_SILICONREVISIONNB$0$0({1}SC:U),F,0,0 S:G$AX5043_TIMER0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TIMER1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TIMER2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXAGCNB$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXBOOSTNB$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXCOARSEAGCNB$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXOFFSACQNB$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXPREAMBLE1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXPREAMBLE2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXPREAMBLE3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXRSSINB$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGRXSETTLENB$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGTXBOOSTNB$0$0({1}SC:U),F,0,0 S:G$AX5043_TMGTXSETTLENB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKAFSKDEMOD0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKAFSKDEMOD1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKAMPLITUDE0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKAMPLITUDE1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKDATARATE0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKDATARATE1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKDATARATE2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKFREQ0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKFREQ1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKFSKDEMOD0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKFSKDEMOD1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKPHASE0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKPHASE1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKRFFREQ0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKRFFREQ1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TRKRFFREQ2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFA0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFA1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFB0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFB1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFC0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFC1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFD0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFD1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFE0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TXPWRCOEFFE1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TXRATE0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TXRATE1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TXRATE2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_WAKEUP0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_WAKEUP1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_WAKEUPFREQ0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_WAKEUPFREQ1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_WAKEUPTIMER0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_WAKEUPTIMER1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_WAKEUPXOEARLYNB$0$0({1}SC:U),F,0,0 S:G$AX5043_XTALAMPLNB$0$0({1}SC:U),F,0,0 S:G$AX5043_XTALCAPNB$0$0({1}SC:U),F,0,0 S:G$AX5043_XTALOSCNB$0$0({1}SC:U),F,0,0 S:G$AX5043_XTALSTATUSNB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF00NB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF0CNB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF18NB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF1CNB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF21NB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF22NB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF23NB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF26NB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF30NB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF31NB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF32NB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF33NB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF34NB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF35NB$0$0({1}SC:U),F,0,0 S:G$AX5043_0xF44NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCAHYST0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCAHYST1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCAHYST2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCAHYST3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCGAIN0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCGAIN1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCGAIN2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCGAIN3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCMINMAX0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCMINMAX1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCMINMAX2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCMINMAX3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCTARGET0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCTARGET1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCTARGET2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AGCTARGET3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AMPLITUDEGAIN0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AMPLITUDEGAIN1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AMPLITUDEGAIN2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_AMPLITUDEGAIN3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_BBOFFSRES0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_BBOFFSRES1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_BBOFFSRES2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_BBOFFSRES3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_DRGAIN0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_DRGAIN1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_DRGAIN2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_DRGAIN3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FOURFSK0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FOURFSK1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FOURFSK2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FOURFSK3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV00NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV01NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV02NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV03NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV10NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV11NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV12NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQDEV13NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINA0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINA1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINA2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINA3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINB0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINB1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINB2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINB3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINC0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINC1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINC2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAINC3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAIND0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAIND1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAIND2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYGAIND3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_FREQUENCYLEAKNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PHASEGAIN0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_PHASEGAIN1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_PHASEGAIN2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_PHASEGAIN3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDR0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDR1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDR2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDR3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDRCFGNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDRMASK0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDRMASK1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDRMASK2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTADDRMASK3NB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTLENCFGNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTLENOFFSETNB$0$0({1}SC:U),F,0,0 S:G$AX5043_PKTMAXLENNB$0$0({1}SC:U),F,0,0 S:G$AX5043_RXPARAMCURSETNB$0$0({1}SC:U),F,0,0 S:G$AX5043_RXPARAMSETSNB$0$0({1}SC:U),F,0,0 S:G$AX5043_TIMEGAIN0NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TIMEGAIN1NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TIMEGAIN2NB$0$0({1}SC:U),F,0,0 S:G$AX5043_TIMEGAIN3NB$0$0({1}SC:U),F,0,0 S:G$axradio_phy_chanpllrng$0$0({2}DA1d,SI:U),F,0,0 S:G$axradio_phy_chanvcoi$0$0({1}DA1d,SC:U),F,0,0 S:G$ACC$0$0({1}SC:U),I,0,0 S:G$B$0$0({1}SC:U),I,0,0 S:G$DPH$0$0({1}SC:U),I,0,0 S:G$DPH1$0$0({1}SC:U),I,0,0 S:G$DPL$0$0({1}SC:U),I,0,0 S:G$DPL1$0$0({1}SC:U),I,0,0 S:G$DPTR0$0$0({2}SI:U),I,0,0 S:G$DPTR1$0$0({2}SI:U),I,0,0 S:G$DPS$0$0({1}SC:U),I,0,0 S:G$E2IE$0$0({1}SC:U),I,0,0 S:G$E2IP$0$0({1}SC:U),I,0,0 S:G$EIE$0$0({1}SC:U),I,0,0 S:G$EIP$0$0({1}SC:U),I,0,0 S:G$IE$0$0({1}SC:U),I,0,0 S:G$IP$0$0({1}SC:U),I,0,0 S:G$PCON$0$0({1}SC:U),I,0,0 S:G$PSW$0$0({1}SC:U),I,0,0 S:G$SP$0$0({1}SC:U),I,0,0 S:G$XPAGE$0$0({1}SC:U),I,0,0 S:G$_XPAGE$0$0({1}SC:U),I,0,0 S:G$ADCCH0CONFIG$0$0({1}SC:U),I,0,0 S:G$ADCCH1CONFIG$0$0({1}SC:U),I,0,0 S:G$ADCCH2CONFIG$0$0({1}SC:U),I,0,0 S:G$ADCCH3CONFIG$0$0({1}SC:U),I,0,0 S:G$ADCCLKSRC$0$0({1}SC:U),I,0,0 S:G$ADCCONV$0$0({1}SC:U),I,0,0 S:G$ANALOGCOMP$0$0({1}SC:U),I,0,0 S:G$CLKCON$0$0({1}SC:U),I,0,0 S:G$CLKSTAT$0$0({1}SC:U),I,0,0 S:G$CODECONFIG$0$0({1}SC:U),I,0,0 S:G$DBGLNKBUF$0$0({1}SC:U),I,0,0 S:G$DBGLNKSTAT$0$0({1}SC:U),I,0,0 S:G$DIRA$0$0({1}SC:U),I,0,0 S:G$DIRB$0$0({1}SC:U),I,0,0 S:G$DIRC$0$0({1}SC:U),I,0,0 S:G$DIRR$0$0({1}SC:U),I,0,0 S:G$PINA$0$0({1}SC:U),I,0,0 S:G$PINB$0$0({1}SC:U),I,0,0 S:G$PINC$0$0({1}SC:U),I,0,0 S:G$PINR$0$0({1}SC:U),I,0,0 S:G$PORTA$0$0({1}SC:U),I,0,0 S:G$PORTB$0$0({1}SC:U),I,0,0 S:G$PORTC$0$0({1}SC:U),I,0,0 S:G$PORTR$0$0({1}SC:U),I,0,0 S:G$IC0CAPT0$0$0({1}SC:U),I,0,0 S:G$IC0CAPT1$0$0({1}SC:U),I,0,0 S:G$IC0CAPT$0$0({2}SI:U),I,0,0 S:G$IC0MODE$0$0({1}SC:U),I,0,0 S:G$IC0STATUS$0$0({1}SC:U),I,0,0 S:G$IC1CAPT0$0$0({1}SC:U),I,0,0 S:G$IC1CAPT1$0$0({1}SC:U),I,0,0 S:G$IC1CAPT$0$0({2}SI:U),I,0,0 S:G$IC1MODE$0$0({1}SC:U),I,0,0 S:G$IC1STATUS$0$0({1}SC:U),I,0,0 S:G$NVADDR0$0$0({1}SC:U),I,0,0 S:G$NVADDR1$0$0({1}SC:U),I,0,0 S:G$NVADDR$0$0({2}SI:U),I,0,0 S:G$NVDATA0$0$0({1}SC:U),I,0,0 S:G$NVDATA1$0$0({1}SC:U),I,0,0 S:G$NVDATA$0$0({2}SI:U),I,0,0 S:G$NVKEY$0$0({1}SC:U),I,0,0 S:G$NVSTATUS$0$0({1}SC:U),I,0,0 S:G$OC0COMP0$0$0({1}SC:U),I,0,0 S:G$OC0COMP1$0$0({1}SC:U),I,0,0 S:G$OC0COMP$0$0({2}SI:U),I,0,0 S:G$OC0MODE$0$0({1}SC:U),I,0,0 S:G$OC0PIN$0$0({1}SC:U),I,0,0 S:G$OC0STATUS$0$0({1}SC:U),I,0,0 S:G$OC1COMP0$0$0({1}SC:U),I,0,0 S:G$OC1COMP1$0$0({1}SC:U),I,0,0 S:G$OC1COMP$0$0({2}SI:U),I,0,0 S:G$OC1MODE$0$0({1}SC:U),I,0,0 S:G$OC1PIN$0$0({1}SC:U),I,0,0 S:G$OC1STATUS$0$0({1}SC:U),I,0,0 S:G$RADIOACC$0$0({1}SC:U),I,0,0 S:G$RADIOADDR0$0$0({1}SC:U),I,0,0 S:G$RADIOADDR1$0$0({1}SC:U),I,0,0 S:G$RADIOADDR$0$0({2}SI:U),I,0,0 S:G$RADIODATA0$0$0({1}SC:U),I,0,0 S:G$RADIODATA1$0$0({1}SC:U),I,0,0 S:G$RADIODATA2$0$0({1}SC:U),I,0,0 S:G$RADIODATA3$0$0({1}SC:U),I,0,0 S:G$RADIODATA$0$0({4}SL:U),I,0,0 S:G$RADIOSTAT0$0$0({1}SC:U),I,0,0 S:G$RADIOSTAT1$0$0({1}SC:U),I,0,0 S:G$RADIOSTAT$0$0({2}SI:U),I,0,0 S:G$SPCLKSRC$0$0({1}SC:U),I,0,0 S:G$SPMODE$0$0({1}SC:U),I,0,0 S:G$SPSHREG$0$0({1}SC:U),I,0,0 S:G$SPSTATUS$0$0({1}SC:U),I,0,0 S:G$T0CLKSRC$0$0({1}SC:U),I,0,0 S:G$T0CNT0$0$0({1}SC:U),I,0,0 S:G$T0CNT1$0$0({1}SC:U),I,0,0 S:G$T0CNT$0$0({2}SI:U),I,0,0 S:G$T0MODE$0$0({1}SC:U),I,0,0 S:G$T0PERIOD0$0$0({1}SC:U),I,0,0 S:G$T0PERIOD1$0$0({1}SC:U),I,0,0 S:G$T0PERIOD$0$0({2}SI:U),I,0,0 S:G$T0STATUS$0$0({1}SC:U),I,0,0 S:G$T1CLKSRC$0$0({1}SC:U),I,0,0 S:G$T1CNT0$0$0({1}SC:U),I,0,0 S:G$T1CNT1$0$0({1}SC:U),I,0,0 S:G$T1CNT$0$0({2}SI:U),I,0,0 S:G$T1MODE$0$0({1}SC:U),I,0,0 S:G$T1PERIOD0$0$0({1}SC:U),I,0,0 S:G$T1PERIOD1$0$0({1}SC:U),I,0,0 S:G$T1PERIOD$0$0({2}SI:U),I,0,0 S:G$T1STATUS$0$0({1}SC:U),I,0,0 S:G$T2CLKSRC$0$0({1}SC:U),I,0,0 S:G$T2CNT0$0$0({1}SC:U),I,0,0 S:G$T2CNT1$0$0({1}SC:U),I,0,0 S:G$T2CNT$0$0({2}SI:U),I,0,0 S:G$T2MODE$0$0({1}SC:U),I,0,0 S:G$T2PERIOD0$0$0({1}SC:U),I,0,0 S:G$T2PERIOD1$0$0({1}SC:U),I,0,0 S:G$T2PERIOD$0$0({2}SI:U),I,0,0 S:G$T2STATUS$0$0({1}SC:U),I,0,0 S:G$U0CTRL$0$0({1}SC:U),I,0,0 S:G$U0MODE$0$0({1}SC:U),I,0,0 S:G$U0SHREG$0$0({1}SC:U),I,0,0 S:G$U0STATUS$0$0({1}SC:U),I,0,0 S:G$U1CTRL$0$0({1}SC:U),I,0,0 S:G$U1MODE$0$0({1}SC:U),I,0,0 S:G$U1SHREG$0$0({1}SC:U),I,0,0 S:G$U1STATUS$0$0({1}SC:U),I,0,0 S:G$WDTCFG$0$0({1}SC:U),I,0,0 S:G$WDTRESET$0$0({1}SC:U),I,0,0 S:G$WTCFGA$0$0({1}SC:U),I,0,0 S:G$WTCFGB$0$0({1}SC:U),I,0,0 S:G$WTCNTA0$0$0({1}SC:U),I,0,0 S:G$WTCNTA1$0$0({1}SC:U),I,0,0 S:G$WTCNTA$0$0({2}SI:U),I,0,0 S:G$WTCNTB0$0$0({1}SC:U),I,0,0 S:G$WTCNTB1$0$0({1}SC:U),I,0,0 S:G$WTCNTB$0$0({2}SI:U),I,0,0 S:G$WTCNTR1$0$0({1}SC:U),I,0,0 S:G$WTEVTA0$0$0({1}SC:U),I,0,0 S:G$WTEVTA1$0$0({1}SC:U),I,0,0 S:G$WTEVTA$0$0({2}SI:U),I,0,0 S:G$WTEVTB0$0$0({1}SC:U),I,0,0 S:G$WTEVTB1$0$0({1}SC:U),I,0,0 S:G$WTEVTB$0$0({2}SI:U),I,0,0 S:G$WTEVTC0$0$0({1}SC:U),I,0,0 S:G$WTEVTC1$0$0({1}SC:U),I,0,0 S:G$WTEVTC$0$0({2}SI:U),I,0,0 S:G$WTEVTD0$0$0({1}SC:U),I,0,0 S:G$WTEVTD1$0$0({1}SC:U),I,0,0 S:G$WTEVTD$0$0({2}SI:U),I,0,0 S:G$WTIRQEN$0$0({1}SC:U),I,0,0 S:G$WTSTAT$0$0({1}SC:U),I,0,0 S:G$ACC_0$0$0({1}SX:U),J,0,0 S:G$ACC_1$0$0({1}SX:U),J,0,0 S:G$ACC_2$0$0({1}SX:U),J,0,0 S:G$ACC_3$0$0({1}SX:U),J,0,0 S:G$ACC_4$0$0({1}SX:U),J,0,0 S:G$ACC_5$0$0({1}SX:U),J,0,0 S:G$ACC_6$0$0({1}SX:U),J,0,0 S:G$ACC_7$0$0({1}SX:U),J,0,0 S:G$B_0$0$0({1}SX:U),J,0,0 S:G$B_1$0$0({1}SX:U),J,0,0 S:G$B_2$0$0({1}SX:U),J,0,0 S:G$B_3$0$0({1}SX:U),J,0,0 S:G$B_4$0$0({1}SX:U),J,0,0 S:G$B_5$0$0({1}SX:U),J,0,0 S:G$B_6$0$0({1}SX:U),J,0,0 S:G$B_7$0$0({1}SX:U),J,0,0 S:G$E2IE_0$0$0({1}SX:U),J,0,0 S:G$E2IE_1$0$0({1}SX:U),J,0,0 S:G$E2IE_2$0$0({1}SX:U),J,0,0 S:G$E2IE_3$0$0({1}SX:U),J,0,0 S:G$E2IE_4$0$0({1}SX:U),J,0,0 S:G$E2IE_5$0$0({1}SX:U),J,0,0 S:G$E2IE_6$0$0({1}SX:U),J,0,0 S:G$E2IE_7$0$0({1}SX:U),J,0,0 S:G$E2IP_0$0$0({1}SX:U),J,0,0 S:G$E2IP_1$0$0({1}SX:U),J,0,0 S:G$E2IP_2$0$0({1}SX:U),J,0,0 S:G$E2IP_3$0$0({1}SX:U),J,0,0 S:G$E2IP_4$0$0({1}SX:U),J,0,0 S:G$E2IP_5$0$0({1}SX:U),J,0,0 S:G$E2IP_6$0$0({1}SX:U),J,0,0 S:G$E2IP_7$0$0({1}SX:U),J,0,0 S:G$EIE_0$0$0({1}SX:U),J,0,0 S:G$EIE_1$0$0({1}SX:U),J,0,0 S:G$EIE_2$0$0({1}SX:U),J,0,0 S:G$EIE_3$0$0({1}SX:U),J,0,0 S:G$EIE_4$0$0({1}SX:U),J,0,0 S:G$EIE_5$0$0({1}SX:U),J,0,0 S:G$EIE_6$0$0({1}SX:U),J,0,0 S:G$EIE_7$0$0({1}SX:U),J,0,0 S:G$EIP_0$0$0({1}SX:U),J,0,0 S:G$EIP_1$0$0({1}SX:U),J,0,0 S:G$EIP_2$0$0({1}SX:U),J,0,0 S:G$EIP_3$0$0({1}SX:U),J,0,0 S:G$EIP_4$0$0({1}SX:U),J,0,0 S:G$EIP_5$0$0({1}SX:U),J,0,0 S:G$EIP_6$0$0({1}SX:U),J,0,0 S:G$EIP_7$0$0({1}SX:U),J,0,0 S:G$IE_0$0$0({1}SX:U),J,0,0 S:G$IE_1$0$0({1}SX:U),J,0,0 S:G$IE_2$0$0({1}SX:U),J,0,0 S:G$IE_3$0$0({1}SX:U),J,0,0 S:G$IE_4$0$0({1}SX:U),J,0,0 S:G$IE_5$0$0({1}SX:U),J,0,0 S:G$IE_6$0$0({1}SX:U),J,0,0 S:G$IE_7$0$0({1}SX:U),J,0,0 S:G$EA$0$0({1}SX:U),J,0,0 S:G$IP_0$0$0({1}SX:U),J,0,0 S:G$IP_1$0$0({1}SX:U),J,0,0 S:G$IP_2$0$0({1}SX:U),J,0,0 S:G$IP_3$0$0({1}SX:U),J,0,0 S:G$IP_4$0$0({1}SX:U),J,0,0 S:G$IP_5$0$0({1}SX:U),J,0,0 S:G$IP_6$0$0({1}SX:U),J,0,0 S:G$IP_7$0$0({1}SX:U),J,0,0 S:G$P$0$0({1}SX:U),J,0,0 S:G$F1$0$0({1}SX:U),J,0,0 S:G$OV$0$0({1}SX:U),J,0,0 S:G$RS0$0$0({1}SX:U),J,0,0 S:G$RS1$0$0({1}SX:U),J,0,0 S:G$F0$0$0({1}SX:U),J,0,0 S:G$AC$0$0({1}SX:U),J,0,0 S:G$CY$0$0({1}SX:U),J,0,0 S:G$PINA_0$0$0({1}SX:U),J,0,0 S:G$PINA_1$0$0({1}SX:U),J,0,0 S:G$PINA_2$0$0({1}SX:U),J,0,0 S:G$PINA_3$0$0({1}SX:U),J,0,0 S:G$PINA_4$0$0({1}SX:U),J,0,0 S:G$PINA_5$0$0({1}SX:U),J,0,0 S:G$PINA_6$0$0({1}SX:U),J,0,0 S:G$PINA_7$0$0({1}SX:U),J,0,0 S:G$PINB_0$0$0({1}SX:U),J,0,0 S:G$PINB_1$0$0({1}SX:U),J,0,0 S:G$PINB_2$0$0({1}SX:U),J,0,0 S:G$PINB_3$0$0({1}SX:U),J,0,0 S:G$PINB_4$0$0({1}SX:U),J,0,0 S:G$PINB_5$0$0({1}SX:U),J,0,0 S:G$PINB_6$0$0({1}SX:U),J,0,0 S:G$PINB_7$0$0({1}SX:U),J,0,0 S:G$PINC_0$0$0({1}SX:U),J,0,0 S:G$PINC_1$0$0({1}SX:U),J,0,0 S:G$PINC_2$0$0({1}SX:U),J,0,0 S:G$PINC_3$0$0({1}SX:U),J,0,0 S:G$PINC_4$0$0({1}SX:U),J,0,0 S:G$PINC_5$0$0({1}SX:U),J,0,0 S:G$PINC_6$0$0({1}SX:U),J,0,0 S:G$PINC_7$0$0({1}SX:U),J,0,0 S:G$PORTA_0$0$0({1}SX:U),J,0,0 S:G$PORTA_1$0$0({1}SX:U),J,0,0 S:G$PORTA_2$0$0({1}SX:U),J,0,0 S:G$PORTA_3$0$0({1}SX:U),J,0,0 S:G$PORTA_4$0$0({1}SX:U),J,0,0 S:G$PORTA_5$0$0({1}SX:U),J,0,0 S:G$PORTA_6$0$0({1}SX:U),J,0,0 S:G$PORTA_7$0$0({1}SX:U),J,0,0 S:G$PORTB_0$0$0({1}SX:U),J,0,0 S:G$PORTB_1$0$0({1}SX:U),J,0,0 S:G$PORTB_2$0$0({1}SX:U),J,0,0 S:G$PORTB_3$0$0({1}SX:U),J,0,0 S:G$PORTB_4$0$0({1}SX:U),J,0,0 S:G$PORTB_5$0$0({1}SX:U),J,0,0 S:G$PORTB_6$0$0({1}SX:U),J,0,0 S:G$PORTB_7$0$0({1}SX:U),J,0,0 S:G$PORTC_0$0$0({1}SX:U),J,0,0 S:G$PORTC_1$0$0({1}SX:U),J,0,0 S:G$PORTC_2$0$0({1}SX:U),J,0,0 S:G$PORTC_3$0$0({1}SX:U),J,0,0 S:G$PORTC_4$0$0({1}SX:U),J,0,0 S:G$PORTC_5$0$0({1}SX:U),J,0,0 S:G$PORTC_6$0$0({1}SX:U),J,0,0 S:G$PORTC_7$0$0({1}SX:U),J,0,0 S:G$delay$0$0({2}DF,SV:S),C,0,0 S:G$random$0$0({2}DF,SI:U),C,0,0 S:G$signextend12$0$0({2}DF,SL:S),C,0,0 S:G$signextend16$0$0({2}DF,SL:S),C,0,0 S:G$signextend20$0$0({2}DF,SL:S),C,0,0 S:G$signextend24$0$0({2}DF,SL:S),C,0,0 S:G$hweight8$0$0({2}DF,SC:U),C,0,0 S:G$hweight16$0$0({2}DF,SC:U),C,0,0 S:G$hweight32$0$0({2}DF,SC:U),C,0,0 S:G$signedlimit16$0$0({2}DF,SI:S),C,0,0 S:G$checksignedlimit16$0$0({2}DF,SC:U),C,0,0 S:G$signedlimit32$0$0({2}DF,SL:S),C,0,0 S:G$checksignedlimit32$0$0({2}DF,SC:U),C,0,0 S:G$gray_encode8$0$0({2}DF,SC:U),C,0,0 S:G$gray_decode8$0$0({2}DF,SC:U),C,0,0 S:G$rev8$0$0({2}DF,SC:U),C,0,0 S:G$fmemset$0$0({2}DF,SV:S),C,0,0 S:G$fmemcpy$0$0({2}DF,SV:S),C,0,0 S:G$get_startcause$0$0({2}DF,SC:U),C,0,0 S:G$wtimer_standby$0$0({2}DF,SV:S),C,0,0 S:G$enter_standby$0$0({2}DF,SV:S),C,0,0 S:G$enter_deepsleep$0$0({2}DF,SV:S),C,0,0 S:G$enter_sleep$0$0({2}DF,SV:S),C,0,0 S:G$enter_sleep_cont$0$0({2}DF,SV:S),C,0,0 S:G$reset_cpu$0$0({2}DF,SV:S),C,0,0 S:G$turn_off_xosc$0$0({2}DF,SV:S),C,0,0 S:G$turn_off_lpxosc$0$0({2}DF,SV:S),C,0,0 S:G$enter_critical$0$0({2}DF,SC:U),C,0,0 S:G$exit_critical$0$0({2}DF,SV:S),C,0,0 S:G$reenter_critical$0$0({2}DF,SV:S),C,0,0 S:G$__enable_irq$0$0({2}DF,SV:S),C,0,0 S:G$__disable_irq$0$0({2}DF,SV:S),C,0,0 S:G$axradio_init$0$0({2}DF,SC:U),C,0,0 S:G$axradio_cansleep$0$0({2}DF,SC:U),C,0,0 S:G$axradio_set_mode$0$0({2}DF,SC:U),C,0,0 S:G$axradio_get_mode$0$0({2}DF,SC:U),C,0,0 S:G$axradio_set_channel$0$0({2}DF,SC:U),C,0,0 S:G$axradio_get_channel$0$0({2}DF,SC:U),C,0,0 S:G$axradio_get_pllrange$0$0({2}DF,SI:U),C,0,0 S:G$axradio_get_pllvcoi$0$0({2}DF,SC:U),C,0,0 S:G$axradio_set_local_address$0$0({2}DF,SV:S),C,0,0 S:G$axradio_get_local_address$0$0({2}DF,SV:S),C,0,0 S:G$axradio_set_default_remote_address$0$0({2}DF,SV:S),C,0,0 S:G$axradio_get_default_remote_address$0$0({2}DF,SV:S),C,0,0 S:G$axradio_transmit$0$0({2}DF,SC:U),C,0,0 S:G$axradio_set_freqoffset$0$0({2}DF,SC:U),C,0,0 S:G$axradio_get_freqoffset$0$0({2}DF,SL:S),C,0,0 S:G$axradio_conv_time_totimer0$0$0({2}DF,SL:U),C,0,0 S:G$axradio_statuschange$0$0({2}DF,SV:S),C,0,0 S:G$axradio_agc_freeze$0$0({2}DF,SC:U),C,0,0 S:G$axradio_agc_thaw$0$0({2}DF,SC:U),C,0,0 S:G$axradio_calibrate_lposc$0$0({2}DF,SV:S),C,0,0 S:G$axradio_check_fourfsk_modulation$0$0({2}DF,SC:U),C,0,0 S:G$axradio_get_transmitter_pa_type$0$0({2}DF,SC:U),C,0,0 S:G$axradio_commsleepexit$0$0({2}DF,SV:S),C,0,0 S:G$axradio_dbgpkt_enableIRQ$0$0({2}DF,SV:S),C,0,0 S:G$axradio_isr$0$0({2}DF,SV:S),C,0,0 S:G$axradio_wait_for_xtal$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_receiver_on_continuous$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_receiver_on_wor$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_off$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_off_xtal$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_prepare_tx$0$0({2}DF,SV:S),C,0,0 S:G$radio_read16$0$0({2}DF,SI:U),C,0,0 S:G$radio_read24$0$0({2}DF,SL:U),C,0,0 S:G$radio_read32$0$0({2}DF,SL:U),C,0,0 S:G$radio_write16$0$0({2}DF,SV:S),C,0,0 S:G$radio_write24$0$0({2}DF,SV:S),C,0,0 S:G$radio_write32$0$0({2}DF,SV:S),C,0,0 S:G$ax5031_comminit$0$0({2}DF,SV:S),C,0,0 S:G$ax5031_commsleepexit$0$0({2}DF,SV:S),C,0,0 S:G$ax5031_reset$0$0({2}DF,SC:U),C,0,0 S:G$ax5031_rclk_enable$0$0({2}DF,SV:S),C,0,0 S:G$ax5031_rclk_disable$0$0({2}DF,SV:S),C,0,0 S:G$ax5031_readfifo$0$0({2}DF,SV:S),C,0,0 S:G$ax5031_writefifo$0$0({2}DF,SV:S),C,0,0 S:G$ax5042_comminit$0$0({2}DF,SV:S),C,0,0 S:G$ax5042_commsleepexit$0$0({2}DF,SV:S),C,0,0 S:G$ax5042_reset$0$0({2}DF,SC:U),C,0,0 S:G$ax5042_rclk_enable$0$0({2}DF,SV:S),C,0,0 S:G$ax5042_rclk_disable$0$0({2}DF,SV:S),C,0,0 S:G$ax5042_readfifo$0$0({2}DF,SV:S),C,0,0 S:G$ax5042_writefifo$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_comminit$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_commsleepexit$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_reset$0$0({2}DF,SC:U),C,0,0 S:G$ax5043_enter_deepsleep$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_wakeup_deepsleep$0$0({2}DF,SC:U),C,0,0 S:G$ax5043_rclk_enable$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_rclk_disable$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_rclk_wait_stable$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_readfifo$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_writefifo$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_set_pwramp_pin$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_get_pwramp_pin$0$0({2}DF,SC:U),C,0,0 S:G$ax5043_set_antsel_pin$0$0({2}DF,SV:S),C,0,0 S:G$ax5043_get_antsel_pin$0$0({2}DF,SC:U),C,0,0 S:G$ax5044_45_comminit$0$0({2}DF,SV:S),C,0,0 S:G$ax5044_45_commsleepexit$0$0({2}DF,SV:S),C,0,0 S:G$ax5044_45_reset$0$0({2}DF,SC:U),C,0,0 S:G$ax5044_45_enter_deepsleep$0$0({2}DF,SV:S),C,0,0 S:G$ax5044_45_wakeup_deepsleep$0$0({2}DF,SC:U),C,0,0 S:G$ax5044_45_rclk_enable$0$0({2}DF,SV:S),C,0,0 S:G$ax5044_45_rclk_disable$0$0({2}DF,SV:S),C,0,0 S:G$ax5044_45_rclk_wait_stable$0$0({2}DF,SV:S),C,0,0 S:G$ax5044_45_readfifo$0$0({2}DF,SV:S),C,0,0 S:G$ax5044_45_writefifo$0$0({2}DF,SV:S),C,0,0 S:G$ax5044_45_set_pwramp_pin$0$0({2}DF,SV:S),C,0,0 S:G$ax5044_45_get_pwramp_pin$0$0({2}DF,SC:U),C,0,0 S:G$ax5044_45_set_antsel_pin$0$0({2}DF,SV:S),C,0,0 S:G$ax5044_45_get_antsel_pin$0$0({2}DF,SC:U),C,0,0 S:G$ax5051_comminit$0$0({2}DF,SV:S),C,0,0 S:G$ax5051_commsleepexit$0$0({2}DF,SV:S),C,0,0 S:G$ax5051_reset$0$0({2}DF,SC:U),C,0,0 S:G$ax5051_rclk_enable$0$0({2}DF,SV:S),C,0,0 S:G$ax5051_rclk_disable$0$0({2}DF,SV:S),C,0,0 S:G$ax5051_readfifo$0$0({2}DF,SV:S),C,0,0 S:G$ax5051_writefifo$0$0({2}DF,SV:S),C,0,0 S:G$crc_ccitt_byte$0$0({2}DF,SI:U),C,0,0 S:G$crc_ccitt_msb_byte$0$0({2}DF,SI:U),C,0,0 S:G$crc_ccitt$0$0({2}DF,SI:U),C,0,0 S:G$crc_ccitt_msb$0$0({2}DF,SI:U),C,0,0 S:G$crc_crc16_byte$0$0({2}DF,SI:U),C,0,0 S:G$crc_crc16_msb_byte$0$0({2}DF,SI:U),C,0,0 S:G$crc_crc16$0$0({2}DF,SI:U),C,0,0 S:G$crc_crc16_msb$0$0({2}DF,SI:U),C,0,0 S:G$crc_crc16dnp_byte$0$0({2}DF,SI:U),C,0,0 S:G$crc_crc16dnp_msb_byte$0$0({2}DF,SI:U),C,0,0 S:G$crc_crc16dnp$0$0({2}DF,SI:U),C,0,0 S:G$crc_crc16dnp_msb$0$0({2}DF,SI:U),C,0,0 S:G$crc_crc32_byte$0$0({2}DF,SL:U),C,0,0 S:G$crc_crc32_msb_byte$0$0({2}DF,SL:U),C,0,0 S:G$crc_crc32$0$0({2}DF,SL:U),C,0,0 S:G$crc_crc32_msb$0$0({2}DF,SL:U),C,0,0 S:G$crc_crc8ccitt_byte$0$0({2}DF,SC:U),C,0,0 S:G$crc_crc8ccitt_msb_byte$0$0({2}DF,SC:U),C,0,0 S:G$crc_crc8ccitt$0$0({2}DF,SC:U),C,0,0 S:G$crc_crc8ccitt_msb$0$0({2}DF,SC:U),C,0,0 S:G$crc_crc8onewire_byte$0$0({2}DF,SC:U),C,0,0 S:G$crc_crc8onewire_msb_byte$0$0({2}DF,SC:U),C,0,0 S:G$crc_crc8onewire$0$0({2}DF,SC:U),C,0,0 S:G$crc_crc8onewire_msb$0$0({2}DF,SC:U),C,0,0 S:G$crc8_ccitt_byte$0$0({2}DF,SC:U),C,0,0 S:G$crc8_ccitt$0$0({2}DF,SC:U),C,0,0 S:G$crc8_onewire_byte$0$0({2}DF,SC:U),C,0,0 S:G$crc8_onewire$0$0({2}DF,SC:U),C,0,0 S:G$pn9_advance$0$0({2}DF,SI:U),C,0,0 S:G$pn9_advance_bit$0$0({2}DF,SI:U),C,0,0 S:G$pn9_advance_bits$0$0({2}DF,SI:U),C,0,0 S:G$pn9_advance_byte$0$0({2}DF,SI:U),C,0,0 S:G$pn9_buffer$0$0({2}DF,SI:U),C,0,0 S:G$pn15_advance$0$0({2}DF,SI:U),C,0,0 S:G$pn15_output$0$0({2}DF,SC:U),C,0,0 S:G$axradio_byteconv$0$0({2}DF,SC:U),C,0,0 S:G$axradio_byteconv_buffer$0$0({2}DF,SV:S),C,0,0 S:G$crc_ccitt_table$0$0({512}DA256d,SI:U),D,0,0 S:G$crc_ccitt_msbtable$0$0({512}DA256d,SI:U),D,0,0 S:G$crc_crc16_table$0$0({512}DA256d,SI:U),D,0,0 S:G$crc_crc16_msbtable$0$0({512}DA256d,SI:U),D,0,0 S:G$crc_crc16dnp_table$0$0({512}DA256d,SI:U),D,0,0 S:G$crc_crc16dnp_msbtable$0$0({512}DA256d,SI:U),D,0,0 S:G$crc_crc32_table$0$0({1024}DA256d,SL:U),D,0,0 S:G$crc_crc32_msbtable$0$0({1024}DA256d,SL:U),D,0,0 S:G$crc_crc8ccitt_table$0$0({256}DA256d,SC:U),D,0,0 S:G$crc_crc8ccitt_msbtable$0$0({256}DA256d,SC:U),D,0,0 S:G$crc_crc8onewire_table$0$0({256}DA256d,SC:U),D,0,0 S:G$crc_crc8onewire_msbtable$0$0({256}DA256d,SC:U),D,0,0 S:G$pn9_table$0$0({512}DA512d,SC:U),D,0,0 S:G$pn15_adv_table$0$0({512}DA256d,SI:U),D,0,0 S:G$pn15_out_table$0$0({256}DA256d,SC:U),D,0,0 S:G$axradio_phy_innerfreqloop$0$0({1}SC:U),D,0,0 S:G$axradio_phy_pn9$0$0({1}SC:U),D,0,0 S:G$axradio_phy_nrchannels$0$0({1}SC:U),D,0,0 S:G$axradio_phy_chanfreq$0$0({4}DA1d,SL:U),D,0,0 S:G$axradio_phy_chanpllrnginit$0$0({2}DA1d,SI:U),D,0,0 S:G$axradio_phy_chanvcoiinit$0$0({1}DA1d,SC:U),D,0,0 S:G$axradio_phy_vcocalib$0$0({1}SC:U),D,0,0 S:G$axradio_phy_maxfreqoffset$0$0({4}SL:S),D,0,0 S:G$axradio_phy_rssioffset$0$0({1}SC:S),D,0,0 S:G$axradio_phy_rssireference$0$0({1}SC:S),D,0,0 S:G$axradio_phy_channelbusy$0$0({1}SC:S),D,0,0 S:G$axradio_phy_cs_period$0$0({2}SI:U),D,0,0 S:G$axradio_phy_cs_enabled$0$0({1}SC:U),D,0,0 S:G$axradio_phy_lbt_retries$0$0({1}SC:U),D,0,0 S:G$axradio_phy_lbt_forcetx$0$0({1}SC:U),D,0,0 S:G$axradio_phy_preamble_wor_longlen$0$0({2}SI:U),D,0,0 S:G$axradio_phy_preamble_wor_len$0$0({2}SI:U),D,0,0 S:G$axradio_phy_preamble_longlen$0$0({2}SI:U),D,0,0 S:G$axradio_phy_preamble_len$0$0({2}SI:U),D,0,0 S:G$axradio_phy_preamble_byte$0$0({1}SC:U),D,0,0 S:G$axradio_phy_preamble_flags$0$0({1}SC:U),D,0,0 S:G$axradio_phy_preamble_appendbits$0$0({1}SC:U),D,0,0 S:G$axradio_phy_preamble_appendpattern$0$0({1}SC:U),D,0,0 S:G$axradio_framing_maclen$0$0({1}SC:U),D,0,0 S:G$axradio_framing_addrlen$0$0({1}SC:U),D,0,0 S:G$axradio_framing_destaddrpos$0$0({1}SC:U),D,0,0 S:G$axradio_framing_sourceaddrpos$0$0({1}SC:U),D,0,0 S:G$axradio_framing_lenpos$0$0({1}SC:U),D,0,0 S:G$axradio_framing_lenoffs$0$0({1}SC:U),D,0,0 S:G$axradio_framing_lenmask$0$0({1}SC:U),D,0,0 S:G$axradio_framing_swcrclen$0$0({1}SC:U),D,0,0 S:G$axradio_framing_synclen$0$0({1}SC:U),D,0,0 S:G$axradio_framing_syncword$0$0({4}DA4d,SC:U),D,0,0 S:G$axradio_framing_syncflags$0$0({1}SC:U),D,0,0 S:G$axradio_framing_enable_sfdcallback$0$0({1}SC:U),D,0,0 S:G$axradio_framing_ack_timeout$0$0({4}SL:U),D,0,0 S:G$axradio_framing_ack_delay$0$0({4}SL:U),D,0,0 S:G$axradio_framing_ack_retransmissions$0$0({1}SC:U),D,0,0 S:G$axradio_framing_ack_seqnrpos$0$0({1}SC:U),D,0,0 S:G$axradio_framing_minpayloadlen$0$0({1}SC:U),D,0,0 S:G$axradio_wor_period$0$0({2}SI:U),D,0,0 S:G$axradio_sync_period$0$0({4}SL:U),D,0,0 S:G$axradio_sync_xoscstartup$0$0({4}SL:U),D,0,0 S:G$axradio_sync_slave_syncwindow$0$0({4}SL:U),D,0,0 S:G$axradio_sync_slave_initialsyncwindow$0$0({4}SL:U),D,0,0 S:G$axradio_sync_slave_syncpause$0$0({4}SL:U),D,0,0 S:G$axradio_sync_slave_maxperiod$0$0({2}SI:S),D,0,0 S:G$axradio_sync_slave_resyncloss$0$0({1}SC:U),D,0,0 S:G$axradio_sync_slave_nrrx$0$0({1}SC:U),D,0,0 S:G$axradio_sync_slave_rxadvance$0$0({12}DA3d,SL:U),D,0,0 S:G$axradio_sync_slave_rxwindow$0$0({12}DA3d,SL:U),D,0,0 S:G$axradio_sync_slave_rxtimeout$0$0({4}SL:U),D,0,0 S:G$axradio_lposckfiltmax$0$0({2}SI:U),D,0,0 S:G$axradio_fxtal$0$0({4}SL:U),D,0,0
AdaCore/training_material
Ada
575
adb
-- Which of the following statement(s) is(are) valid for ``G_P``'s body? procedure Main is --$ begin question generic type T1; A1 : access T1; type T2 is private; A2, B2 : T2; procedure G_P; procedure G_P is begin -- Complete here --$ end question --$ line cut pragma Assert (A1 /= null); --$ line cut pragma Assert (A1.all'Size > 32); --$ line cut pragma Assert (A2 = B2); --$ line cut pragma Assert (A2 - B2 /= 0); --$ line question end G_P; begin null; end Main;
reznikmm/matreshka
Ada
4,790
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Visitors; with ODF.DOM.Db_Data_Source_Setting_Elements; package Matreshka.ODF_Db.Data_Source_Setting_Elements is type Db_Data_Source_Setting_Element_Node is new Matreshka.ODF_Db.Abstract_Db_Element_Node and ODF.DOM.Db_Data_Source_Setting_Elements.ODF_Db_Data_Source_Setting with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters) return Db_Data_Source_Setting_Element_Node; overriding function Get_Local_Name (Self : not null access constant Db_Data_Source_Setting_Element_Node) return League.Strings.Universal_String; overriding procedure Enter_Node (Self : not null access Db_Data_Source_Setting_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); overriding procedure Leave_Node (Self : not null access Db_Data_Source_Setting_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); overriding procedure Visit_Node (Self : not null access Db_Data_Source_Setting_Element_Node; Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); end Matreshka.ODF_Db.Data_Source_Setting_Elements;
zhmu/ananas
Ada
191
ads
generic package Nested_Generic1_Pkg is type Element_Renderer is access procedure; generic procedure Image_Generic (Renderer : in not null Element_Renderer); end Nested_Generic1_Pkg;
optikos/oasis
Ada
4,623
adb
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- package body Program.Nodes.Case_Expression_Paths is function Create (When_Token : not null Program.Lexical_Elements.Lexical_Element_Access; Choices : not null Program.Element_Vectors.Element_Vector_Access; Arrow_Token : not null Program.Lexical_Elements.Lexical_Element_Access; Expression : not null Program.Elements.Expressions.Expression_Access) return Case_Expression_Path is begin return Result : Case_Expression_Path := (When_Token => When_Token, Choices => Choices, Arrow_Token => Arrow_Token, Expression => Expression, Enclosing_Element => null) do Initialize (Result); end return; end Create; function Create (Choices : not null Program.Element_Vectors .Element_Vector_Access; Expression : not null Program.Elements.Expressions .Expression_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Case_Expression_Path is begin return Result : Implicit_Case_Expression_Path := (Choices => Choices, Expression => Expression, Is_Part_Of_Implicit => Is_Part_Of_Implicit, Is_Part_Of_Inherited => Is_Part_Of_Inherited, Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null) do Initialize (Result); end return; end Create; overriding function Choices (Self : Base_Case_Expression_Path) return not null Program.Element_Vectors.Element_Vector_Access is begin return Self.Choices; end Choices; overriding function Expression (Self : Base_Case_Expression_Path) return not null Program.Elements.Expressions.Expression_Access is begin return Self.Expression; end Expression; overriding function When_Token (Self : Case_Expression_Path) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.When_Token; end When_Token; overriding function Arrow_Token (Self : Case_Expression_Path) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Arrow_Token; end Arrow_Token; overriding function Is_Part_Of_Implicit (Self : Implicit_Case_Expression_Path) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; overriding function Is_Part_Of_Inherited (Self : Implicit_Case_Expression_Path) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; overriding function Is_Part_Of_Instance (Self : Implicit_Case_Expression_Path) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; procedure Initialize (Self : aliased in out Base_Case_Expression_Path'Class) is begin for Item in Self.Choices.Each_Element loop Set_Enclosing_Element (Item.Element, Self'Unchecked_Access); end loop; Set_Enclosing_Element (Self.Expression, Self'Unchecked_Access); null; end Initialize; overriding function Is_Case_Expression_Path_Element (Self : Base_Case_Expression_Path) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Case_Expression_Path_Element; overriding function Is_Path_Element (Self : Base_Case_Expression_Path) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Path_Element; overriding procedure Visit (Self : not null access Base_Case_Expression_Path; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin Visitor.Case_Expression_Path (Self); end Visit; overriding function To_Case_Expression_Path_Text (Self : aliased in out Case_Expression_Path) return Program.Elements.Case_Expression_Paths .Case_Expression_Path_Text_Access is begin return Self'Unchecked_Access; end To_Case_Expression_Path_Text; overriding function To_Case_Expression_Path_Text (Self : aliased in out Implicit_Case_Expression_Path) return Program.Elements.Case_Expression_Paths .Case_Expression_Path_Text_Access is pragma Unreferenced (Self); begin return null; end To_Case_Expression_Path_Text; end Program.Nodes.Case_Expression_Paths;
reznikmm/matreshka
Ada
3,794
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Attributes; package ODF.DOM.Number_Transliteration_Language_Attributes is pragma Preelaborate; type ODF_Number_Transliteration_Language_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Number_Transliteration_Language_Attribute_Access is access all ODF_Number_Transliteration_Language_Attribute'Class with Storage_Size => 0; end ODF.DOM.Number_Transliteration_Language_Attributes;
zhmu/ananas
Ada
168
ads
with Packed_Array_Pkg; use Packed_Array_Pkg; package Packed_Array is C : constant Small_Rec2 := (Lo => 1, Hi => Max, A => (1 => (2, 3))); procedure Dummy; end;
optikos/oasis
Ada
227
ads
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- package Meta is pragma Pure; end Meta;
reznikmm/matreshka
Ada
4,137
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Nodes; with XML.DOM.Elements.Internals; package body ODF.DOM.Elements.Text.P.Internals is ------------ -- Create -- ------------ function Create (Node : Matreshka.ODF_Elements.Text.P.Text_P_Access) return ODF.DOM.Elements.Text.P.ODF_Text_P is begin return (XML.DOM.Elements.Internals.Create (Matreshka.DOM_Nodes.Element_Access (Node)) with null record); end Create; ---------- -- Wrap -- ---------- function Wrap (Node : Matreshka.ODF_Elements.Text.P.Text_P_Access) return ODF.DOM.Elements.Text.P.ODF_Text_P is begin return (XML.DOM.Elements.Internals.Wrap (Matreshka.DOM_Nodes.Element_Access (Node)) with null record); end Wrap; end ODF.DOM.Elements.Text.P.Internals;
damaki/libkeccak
Ada
1,851
ads
------------------------------------------------------------------------------- -- Copyright (c) 2016, Daniel King -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * The name of the copyright holder may not be used to endorse or promote -- Products derived from this software without specific prior written -- permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- with AUnit.Test_Suites; use AUnit.Test_Suites; package Ketje_Suite is function Suite return Access_Test_Suite; end Ketje_Suite;
AdaCore/langkit
Ada
25,314
adb
-- -- Copyright (C) 2014-2022, AdaCore -- SPDX-License-Identifier: Apache-2.0 -- package body Langkit_Support.Token_Data_Handlers is function Internal_Get_Trivias (TDH : Token_Data_Handler; Index : Token_Index) return Token_Index_Vectors.Elements_Array; procedure Compute_Lines_Starts (TDH : in out Token_Data_Handler) with Pre => TDH.Source_Buffer /= null; -- Compute the table of lines starting indices, that will allow us to -- go between offsets and line/columns. generic type Key_Type is private; -- Type of the value used to sort vector elements with package Element_Vectors is new Langkit_Support.Vectors (<>); with function Compare (K : Key_Type; E_Index : Positive; E : Element_Vectors.Element_Type) return Relative_Position is <>; -- Tell where K is with respect to E (E_Index is the index of E in the -- vector). function Floor (K : Key_Type; Vector : Element_Vectors.Vector) return Natural; -- Assuming that Vector contains a sorted sequence of elements, return the -- element index for which K is either inside or right after. If K actuals -- points right before the first Vector element, return the index of the -- first element. ----------- -- Floor -- ----------- function Floor (K : Key_Type; Vector : Element_Vectors.Vector) return Natural is Before, After : Natural; begin if Vector.Is_Empty then return 0; end if; Before := Vector.First_Index; After := Vector.Last_Index; while Before < After loop declare Last_Step : constant Boolean := Before + 1 = After; Middle : constant Natural := (After + Before) / 2; begin case Compare (K, Middle, Vector.Get (Middle)) is when Slocs.Before => After := Middle; when Slocs.Inside => return Middle; when Slocs.After => Before := Middle; end case; if Last_Step then case Compare (K, After, Vector.Get (After)) is when Slocs.Before => return Before; when Slocs.Inside | Slocs.After => return After; end case; end if; end; end loop; return Before; end Floor; ----------------- -- Initialized -- ----------------- function Initialized (TDH : Token_Data_Handler) return Boolean is begin return TDH.Symbols /= No_Symbol_Table; end Initialized; ----------------------- -- Has_Source_Buffer -- ----------------------- function Has_Source_Buffer (TDH : Token_Data_Handler) return Boolean is begin return TDH.Source_Buffer /= null; end Has_Source_Buffer; ---------------- -- Initialize -- ---------------- procedure Initialize (TDH : out Token_Data_Handler; Symbols : Symbol_Table; Owner : System.Address; Tab_Stop : Positive := Default_Tab_Stop) is begin TDH := (Version => 0, Source_Buffer => null, Source_First => <>, Source_Last => <>, Filename => <>, Charset => <>, Tokens => <>, Symbols => Symbols, Tokens_To_Trivias => <>, Trivias => <>, Lines_Starts => <>, Tab_Stop => Tab_Stop, Owner => Owner); end Initialize; ----------- -- Reset -- ----------- procedure Reset (TDH : in out Token_Data_Handler; Source_Buffer : Text_Access; Source_First : Positive; Source_Last : Natural) is begin Free (TDH.Source_Buffer); TDH.Source_Buffer := Source_Buffer; TDH.Source_First := Source_First; TDH.Source_Last := Source_Last; TDH.Lines_Starts.Clear; Compute_Lines_Starts (TDH); Clear (TDH.Tokens); Clear (TDH.Trivias); Clear (TDH.Tokens_To_Trivias); end Reset; -------------------------- -- Compute_Lines_Starts -- -------------------------- procedure Compute_Lines_Starts (TDH : in out Token_Data_Handler) is T : Text_Type renames TDH.Source_Buffer (TDH.Source_First .. TDH.Source_Last); Idx : Natural := T'First - 1; -- Index in T of the newline character that ends the currently processed -- line. function Index (Buffer : Text_Type; Char : Wide_Wide_Character; Start_Pos : Positive) return Natural; -- Helper function. Return the index of the first occurrence of ``Char`` -- in ``Buffer (Start_Pos .. End_Pos)``, or ``0`` if not found. ----------- -- Index -- ----------- function Index (Buffer : Text_Type; Char : Wide_Wide_Character; Start_Pos : Positive) return Natural is begin for I in Start_Pos .. T'Last loop if Buffer (I) = Char then return I; end if; end loop; return 0; end Index; begin TDH.Lines_Starts.Append (1); loop -- Search the index of the newline char that follows the current line Idx := Index (T, Chars.LF, Idx + 1); -- Append the index of the first character of line N+1 to -- Self.Line_Starts. This is the character at Idx+1. -- -- For regular cases, this is Idx + 1. If no next newline found, -- emulate the presence of this trailing LF (at T'Last+1) and return. if Idx = 0 then Idx := T'Last + 1; TDH.Lines_Starts.Append (Idx + 1); return; end if; TDH.Lines_Starts.Append (Idx + 1); end loop; end Compute_Lines_Starts; ---------- -- Free -- ---------- procedure Free (TDH : in out Token_Data_Handler) is begin Free (TDH.Source_Buffer); TDH.Tokens.Destroy; TDH.Trivias.Destroy; TDH.Tokens_To_Trivias.Destroy; TDH.Lines_Starts.Destroy; TDH.Symbols := No_Symbol_Table; end Free; ---------- -- Move -- ---------- procedure Move (Destination, Source : in out Token_Data_Handler) is begin Destination := Source; Source := (Version => 0, Source_Buffer => null, Source_First => <>, Source_Last => <>, Filename => <>, Charset => <>, Tokens => <>, Symbols => No_Symbol_Table, Tokens_To_Trivias => <>, Trivias => <>, Lines_Starts => <>, Tab_Stop => <>, Owner => System.Null_Address); end Move; -------------------------- -- Internal_Get_Trivias -- -------------------------- function Internal_Get_Trivias (TDH : Token_Data_Handler; Index : Token_Index) return Token_Index_Vectors.Elements_Array is subtype Index_Type is Trivia_Vectors.Index_Type; First_Trivia_Index : constant Token_Index := (if Length (TDH.Tokens_To_Trivias) = 0 then No_Token_Index else Token_Index (Get (TDH.Tokens_To_Trivias, Index_Type (Index + 1)))); Last_Trivia_Index : Token_Index := First_Trivia_Index; begin if First_Trivia_Index /= No_Token_Index then while Get (TDH.Trivias, Index_Type (Last_Trivia_Index)).Has_Next loop Last_Trivia_Index := Last_Trivia_Index + 1; end loop; declare Trivia_Count : constant Natural := Natural (Last_Trivia_Index) - Natural (First_Trivia_Index) + 1; Result : Token_Index_Vectors.Elements_Array (1 .. Trivia_Count); begin for Index in First_Trivia_Index .. Last_Trivia_Index loop Result (Index_Type (Index - First_Trivia_Index + 1)) := Index; end loop; return Result; end; end if; return Token_Index_Vectors.Empty_Array; end Internal_Get_Trivias; --------------- -- Get_Token -- --------------- function Get_Token (TDH : Token_Data_Handler; Index : Token_Index) return Stored_Token_Data is begin return Token_Vectors.Get (TDH.Tokens, Natural (Index)); end Get_Token; ---------------- -- Last_Token -- ---------------- function Last_Token (TDH : Token_Data_Handler) return Token_Index is begin return Token_Index (Token_Vectors.Last_Index (TDH.Tokens)); end Last_Token; --------------------------- -- First_Token_Or_Trivia -- --------------------------- function First_Token_Or_Trivia (TDH : Token_Data_Handler) return Token_Or_Trivia_Index is begin if TDH.Tokens_To_Trivias.Is_Empty or else TDH.Tokens_To_Trivias.First_Element = Integer (No_Token_Index) then -- There is no leading trivia: return the first token return (if TDH.Tokens.Is_Empty then No_Token_Or_Trivia_Index else (Token_Index (TDH.Tokens.First_Index), No_Token_Index)); else return (No_Token_Index, Token_Index (TDH.Tokens.First_Index)); end if; end First_Token_Or_Trivia; -------------------------- -- Last_Token_Or_Trivia -- -------------------------- function Last_Token_Or_Trivia (TDH : Token_Data_Handler) return Token_Or_Trivia_Index is begin if TDH.Tokens_To_Trivias.Is_Empty or else TDH.Tokens_To_Trivias.Last_Element = Integer (No_Token_Index) then -- There is no trailing trivia: return the last token return (if TDH.Tokens.Is_Empty then No_Token_Or_Trivia_Index else (Token_Index (TDH.Tokens.Last_Index), No_Token_Index)); else return (No_Token_Index, Token_Index (TDH.Trivias.First_Index)); end if; end Last_Token_Or_Trivia; ---------- -- Next -- ---------- function Next (Token : Token_Or_Trivia_Index; TDH : Token_Data_Handler; Exclude_Trivia : Boolean := False) return Token_Or_Trivia_Index is function Next_Token (Current : Token_Or_Trivia_Index) return Token_Or_Trivia_Index is (if Current.Token < Token_Index (TDH.Tokens.Last_Index) then (Current.Token + 1, No_Token_Index) else No_Token_Or_Trivia_Index); -- Return a reference to the next token (not trivia) or no token if -- Token was the last one. function Next_Step (Current : Token_Or_Trivia_Index) return Token_Or_Trivia_Index; -- Compute what Next must return when called with Exclude_Trivia left -- to False. --------------- -- Next_Step -- --------------- function Next_Step (Current : Token_Or_Trivia_Index) return Token_Or_Trivia_Index is begin if Current = No_Token_Or_Trivia_Index then return Current; end if; if Current.Trivia /= No_Token_Index then -- Current is a reference to a trivia: take the next trivia if it -- exists, or escalate to the next token otherwise. declare Tr : constant Trivia_Node := TDH.Trivias.Get (Natural (Current.Trivia)); begin return (if Tr.Has_Next then (Current.Token, Current.Trivia + 1) else Next_Token (Current)); end; else -- Thanks to the guard above, we cannot get to the declare block -- for the No_Token case, so if Token does not refers to a trivia, -- it must be a token. pragma Assert (Current.Token /= No_Token_Index); -- If there is no trivia, just go to the next token if TDH.Tokens_To_Trivias.Is_Empty then return Next_Token (Current); end if; -- If this token has trivia, return a reference to the first one, -- otherwise get the next token. declare Tr_Index : constant Token_Index := Token_Index (TDH.Tokens_To_Trivias.Get (Natural (Current.Token) + 1)); begin return (if Tr_Index = No_Token_Index then Next_Token (Current) else (Current.Token, Tr_Index)); end; end if; end Next_Step; Result : Token_Or_Trivia_Index := Next_Step (Token); begin if not Exclude_Trivia then return Result; end if; while Result /= No_Token_Or_Trivia_Index and then Result.Trivia /= No_Token_Index loop Result := Next_Step (Result); end loop; return Result; end Next; -------------- -- Previous -- -------------- function Previous (Token : Token_Or_Trivia_Index; TDH : Token_Data_Handler; Exclude_Trivia : Boolean := False) return Token_Or_Trivia_Index is function Next_Step (Current : Token_Or_Trivia_Index) return Token_Or_Trivia_Index; -- Compute what Previous must return when called with Exclude_Trivia -- left to False. --------------- -- Next_Step -- --------------- function Next_Step (Current : Token_Or_Trivia_Index) return Token_Or_Trivia_Index is begin if Current = No_Token_Or_Trivia_Index then return Current; end if; if Current.Trivia = No_Token_Index then -- Current is a regular token, so the previous token is either the -- last trivia of the previous regular token, either the previous -- regular token itself. declare Prev_Trivia : Token_Index; begin -- Get the index of the trivia that is right before Current (if -- any). if TDH.Tokens_To_Trivias.Length = 0 then Prev_Trivia := No_Token_Index; else Prev_Trivia := Token_Index (TDH.Tokens_To_Trivias.Get (Natural (Current.Token))); while Prev_Trivia /= No_Token_Index and then TDH.Trivias.Get (Natural (Prev_Trivia)).Has_Next loop Prev_Trivia := Prev_Trivia + 1; end loop; end if; -- If there is no such trivia and Current was the first one, -- then this was the start of the token stream: no previous -- token. if Prev_Trivia = No_Token_Index and then Current.Token <= First_Token_Index then return No_Token_Or_Trivia_Index; else return (Current.Token - 1, Prev_Trivia); end if; end; -- Past this point: Current is known to be a trivia elsif Current.Trivia = First_Token_Index then -- This is the first trivia for some token, so the previous token -- cannot be a trivia. return (if Current.Token = No_Token_Index then No_Token_Or_Trivia_Index else (Current.Token, No_Token_Index)); elsif Current.Token = No_Token_Index then -- This is a leading trivia and not the first one, so the previous -- token has to be a trivia. return (No_Token_Index, Current.Trivia - 1); -- Past this point: Current is known to be a trivia *and* it is not a -- leading trivia. else return (Current.Token, (if TDH.Trivias.Get (Natural (Current.Trivia - 1)).Has_Next then Current.Trivia - 1 else No_Token_Index)); end if; end Next_Step; Result : Token_Or_Trivia_Index := Next_Step (Token); begin if not Exclude_Trivia then return Result; end if; while Result /= No_Token_Or_Trivia_Index and then Result.Trivia /= No_Token_Index loop Result := Next_Step (Result); end loop; return Result; end Previous; -------------------- -- Previous_Token -- -------------------- function Previous_Token (Trivia : Token_Index; TDH : Token_Data_Handler) return Token_Index is function Compare (Key_Trivia : Token_Index; Element_Index : Positive; Element : Integer) return Relative_Position; ------------- -- Compare -- ------------- function Compare (Key_Trivia : Token_Index; Element_Index : Positive; Element : Integer) return Relative_Position is Triv_Index : constant Natural := Natural (Key_Trivia); begin -- Index can be zero if the corresponding token is not followed by -- any trivia. In this case, rely on the sloc to compare them. if Element = 0 then declare Triv_Index : constant Natural := Natural (Key_Trivia); Tok_Index : constant Natural := Element_Index - 1; Key_Start_Sloc : constant Source_Location := Sloc_Start (TDH, TDH.Trivias.Get (Triv_Index).T); begin return Compare (Sloc_Range (TDH, TDH.Tokens.Get (Tok_Index)), Key_Start_Sloc); end; end if; if Element < Triv_Index then return After; elsif Element > Triv_Index then return Before; else return Inside; end if; end Compare; function Token_Floor is new Floor (Key_Type => Token_Index, Element_Vectors => Integer_Vectors); begin -- Perform a binary search over Tokens_To_Trivias to find the index of -- the Token that precedes Trivia. return Token_Index (Token_Floor (Trivia, TDH.Tokens_To_Trivias) - 1); -- Token_Floor deals with indexes for the Tokens_To_Trivia vector, so -- their corresponding to token indexes, but off by one (token index 1 -- corresponding to Tokens_To_Trivia index 2, ...). Hence the X-1 -- operation when returning. end Previous_Token; ------------------ -- Lookup_Token -- ------------------ function Lookup_Token (TDH : Token_Data_Handler; Sloc : Source_Location) return Token_Or_Trivia_Index is function Compare (Sloc : Source_Location; Dummy_Index : Positive; Token : Stored_Token_Data) return Relative_Position is (Compare (Sloc_Range (TDH, Token), Sloc)); function Compare (Sloc : Source_Location; Dummy_Index : Positive; Trivia : Trivia_Node) return Relative_Position is (Compare (Sloc_Range (TDH, Trivia.T), Sloc)); function Token_Floor is new Floor (Key_Type => Source_Location, Element_Vectors => Token_Vectors); function Trivia_Floor is new Floor (Key_Type => Source_Location, Element_Vectors => Trivia_Vectors); -- Look for a candidate token and a candidate trivia, then take the one -- that is the closest to Sloc. Token : constant Natural := Token_Floor (Sloc, TDH.Tokens); Trivia : constant Natural := Trivia_Floor (Sloc, TDH.Trivias); function Result_From_Token return Token_Or_Trivia_Index is ((Token_Index (Token), No_Token_Index)); function Result_From_Trivia return Token_Or_Trivia_Index is ((Previous_Token (Token_Index (Trivia), TDH), Token_Index (Trivia))); begin if Trivia = 0 then return Result_From_Token; elsif Token = 0 then return Result_From_Trivia; end if; declare function SS (Token : Stored_Token_Data) return Source_Location is (Sloc_Start (TDH, Token)); Tok_Sloc : constant Source_Location := SS (TDH.Tokens.Get (Token)); Triv_Sloc : constant Source_Location := SS (TDH.Trivias.Get (Trivia).T); begin if Tok_Sloc < Triv_Sloc then if Sloc < Triv_Sloc then return Result_From_Token; end if; elsif Tok_Sloc < Sloc or else Tok_Sloc = Sloc then return Result_From_Token; end if; return Result_From_Trivia; end; end Lookup_Token; ---------- -- Data -- ---------- function Data (Token : Token_Or_Trivia_Index; TDH : Token_Data_Handler) return Stored_Token_Data is begin return (if Token.Trivia = No_Token_Index then TDH.Tokens.Get (Natural (Token.Token)) else TDH.Trivias.Get (Natural (Token.Trivia)).T); end Data; ----------------- -- Get_Trivias -- ----------------- function Get_Trivias (TDH : Token_Data_Handler; Index : Token_Index) return Token_Index_Vectors.Elements_Array is begin if Index = No_Token_Index then return Token_Index_Vectors.Empty_Array; end if; return Internal_Get_Trivias (TDH, Index); end Get_Trivias; ------------------------- -- Get_Leading_Trivias -- ------------------------- function Get_Leading_Trivias (TDH : Token_Data_Handler) return Token_Index_Vectors.Elements_Array is begin return Internal_Get_Trivias (TDH, No_Token_Index); end Get_Leading_Trivias; -------------- -- Get_Line -- -------------- function Get_Line (TDH : Token_Data_Handler; Line_Number : Positive) return Text_Type is begin -- Return slice from... return TDH.Source_Buffer ( -- The first character in the requested line TDH.Lines_Starts.Get (Line_Number) .. -- The character before the LF that precedes the first character of -- the next line. TDH.Lines_Starts.Get (Line_Number + 1) - 2 ); end Get_Line; -------------- -- Get_Sloc -- -------------- function Get_Sloc (TDH : Token_Data_Handler; Index : Natural) return Source_Location is function Compare (Sought : Positive; Dummy_Index : Positive; Line_Start : Positive) return Relative_Position is (if Sought > Line_Start then After elsif Sought = Line_Start then Inside else Before); function Get_Line_Index is new Floor (Positive, Index_Vectors); -- Return the index of the first character of Line `N` in a given -- `TDH.Line_Starts` vector. begin -- Allow 0 as an offset because it's a common value when the text buffer -- is empty: in that case just return a null source location. if Index = 0 then return No_Source_Location; end if; declare Line_Index : constant Positive := Get_Line_Index (Index, TDH.Lines_Starts); Line_Offset : constant Positive := TDH.Lines_Starts.Get (Line_Index); Line_End : constant Integer := Natural'Min (Index - 1, TDH.Source_Last); Column : Column_Number; begin -- Allow an offset that reference the character that would follow the -- end of the source buffer (i.e. ``'Last + 1``), but no further. if Index > TDH.Source_Buffer'Last + 1 then raise Constraint_Error with "out of bound access"; end if; -- Column number at the start of the current line is 1. We must then -- add the columns for anything between the start of the line and the -- requested offset. Column := 1 + Column_Count (TDH.Source_Buffer (Line_Offset .. Line_End), TDH.Tab_Stop); return Source_Location'(Line_Number (Line_Index), Column); end; end Get_Sloc; ---------------- -- Sloc_Start -- ---------------- function Sloc_Start (TDH : Token_Data_Handler; Token : Stored_Token_Data) return Source_Location is begin return Get_Sloc (TDH, Token.Source_First); end Sloc_Start; -------------- -- Sloc_End -- -------------- function Sloc_End (TDH : Token_Data_Handler; Token : Stored_Token_Data) return Source_Location is begin return Get_Sloc (TDH, Token.Source_Last + 1); end Sloc_End; ---------------- -- Sloc_Range -- ---------------- function Sloc_Range (TDH : Token_Data_Handler; Token : Stored_Token_Data) return Source_Location_Range is begin return Make_Range (Sloc_Start (TDH, Token), Sloc_End (TDH, Token)); end Sloc_Range; end Langkit_Support.Token_Data_Handlers;
peterfrankjohnson/kernel
Ada
1,297
ads
-- with Scheduler.Process; use Scheduler.Process; -- with Scheduler.Queue; use Scheduler.Queue; with Process; use Process; with Queue; use Queue; with Types; use Types; with System; use System; with CPU.ProtectedMode; use CPU.ProtectedMode; with CPU.Interrupts; use CPU.Interrupts; with Console; use Console; package Scheduler is subtype Milliseconds is Integer range 1 .. 1000; -- We need to create a Linked List of all processes in the Run state subtype ProcessQueue is Queue.Object; RunQueue : Queue.Object; -- We also need a list of all processes in the Wait state WaitQueue : ProcessQueue; Quantum : Milliseconds; UserLevelCodeSelector : Word; UserLevelDataSelector : Word; EndOfQueue : Boolean := False; LastPID : Integer := 0; procedure CreateProcess (Name : ProcessName; Level : ProcessLevel; ProgramCounter : System.Address); procedure Initialise (CodeSelector : Word; DataSelector : Word; TSS : TaskStateSegment); procedure Init; procedure TaskA; procedure TaskB; procedure PerformContextSwitch (P : Process_Ptr); procedure MainLoop; procedure ContextSwitch (CodeSelector : Word; DataSelector : Word; Process : System.Address); pragma Import (C, ContextSwitch, "contextswitch"); end Scheduler;
reznikmm/matreshka
Ada
3,689
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Elements; package ODF.DOM.Svg_Font_Face_Name_Elements is pragma Preelaborate; type ODF_Svg_Font_Face_Name is limited interface and XML.DOM.Elements.DOM_Element; type ODF_Svg_Font_Face_Name_Access is access all ODF_Svg_Font_Face_Name'Class with Storage_Size => 0; end ODF.DOM.Svg_Font_Face_Name_Elements;
charlie5/aIDE
Ada
3,380
ads
with AdaM.program_Unit, AdaM.Declaration, AdaM.a_Type, AdaM.Context, AdaM.Declaration.of_exception, Ada.Streams; package AdaM.Declaration.of_package is type Item is new Declaration.item and program_Unit.item with private; -- View -- type View is access all Item'Class; procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Self : in View); procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Self : out View); for View'write use View_write; for View'read use View_read; -- Vector -- package Vectors is new ada.Containers.Vectors (Positive, View); subtype Vector is Vectors.Vector; -- Forge -- function new_Package (Name : in Identifier := "") return Declaration.of_package.view; procedure free (Self : in out Declaration.of_package.view); overriding procedure destruct (Self : in out Item); -- Attributes -- overriding function Id (Self : access Item) return AdaM.Id; function full_Name (Self : in Item) return Identifier; overriding function to_Source (Self : in Item) return text_Vectors.Vector; function to_spec_Source (Self : in Item) return text_Vectors.Vector; function to_body_Source (Self : in Item) return text_Vectors.Vector; function Context (Self : in Item) return Context.view; function all_Types (Self : access Item) return AdaM.a_Type.Vector; function all_Exceptions (Self : access Item) return AdaM.Declaration.of_exception.Vector; function requires_Body (Self : in Item) return Boolean; procedure Parent_is (Self : in out Item; Now : in Declaration.of_package.View); function Parent (Self : in Item) return Declaration.of_package.view; function child_Packages (Self : in Item'Class) return Declaration.of_package.Vector; function child_Package (Self : in Item'Class; Named : in String) return Declaration.of_package.view; procedure add_Child (Self : in out Item; Child : in Declaration.of_package.view); function find (Self : in Item; Named : in Identifier) return AdaM.a_Type.view; function find (Self : in Item; Named : in Identifier) return AdaM.Declaration.of_exception.view; private type Item is new Declaration.item and program_Unit.item with record Parent : Declaration.of_package.view; Progenitors : Declaration.of_package.Vector; child_Packages : Declaration.of_package.Vector; Context : AdaM.Context.view; -- public_Entities : aliased Source.Entities; -- private_Entities : Source.Entities; -- body_Entities : Source.Entities; end record; -- Streams -- procedure Item_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Self : in Item); procedure Item_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Self : out Item); for Item'write use Item_write; for Item'read use Item_read; end AdaM.Declaration.of_package;
afrl-rq/OpenUxAS
Ada
302
ads
-- see OpenUxAS\src\Includes\Constants\UxAS_String.h package UxAS.Common.String_Constant.Content_Type is Json : constant String := "json"; Lmcp : constant String := "lmcp"; Text : constant String := "text"; Xml : constant String := "xml"; end UxAS.Common.String_Constant.Content_Type;
leomlr/sudoku_ada-jewl
Ada
2,368
ads
with JEWL.Windows; with Gnat.String_Split; with Ada.Containers.Indefinite_Vectors; with Ada.Text_Io; with Ada.Strings.Unbounded; Package sudoku_tools_16 Is Type Command_Code is (Quit, Load, Save, Finish, Show); package My_Windows is new JEWL.Windows (Command_Code); use My_Windows; use Gnat.String_Split; use Ada.Containers; package String_Vectors is new Indefinite_Vectors (Positive, String); use String_Vectors; use Ada.Strings.Unbounded; BOXES_SIZE: Integer := 4; LOOP_LENGTH: Integer := 16; BLOCK_WIDTH: Integer := 130; Type Grid_Panel_Type is array (1..BOXES_SIZE, 1..BOXES_SIZE) of Panel_Type; Type Block_Editbox_Type is array (1..BOXES_SIZE, 1..BOXES_SIZE) of Editbox_Type; Type Grid_Block_Type is array (1..BOXES_SIZE, 1..BOXES_SIZE) of Block_Editbox_Type; Type Matrix_Type is array (1..LOOP_LENGTH, 1..LOOP_LENGTH) of Integer; Type List_Type is array (1..LOOP_LENGTH) of Integer; Function getLine (grid: Matrix_Type; index: in Integer) return List_Type; Function getColumn (grid: Matrix_Type; index: in Integer) return List_Type; Function getBlock (grid: in Matrix_Type; index_i: in Integer; index_j: in Integer) return List_Type; Function isValidList (list: in List_Type) return Boolean; Function isValidGrid (grid: in Matrix_Type) return Boolean; Procedure showGrid (grid: in Matrix_Type); Procedure createGrid (window: in Frame_Type; grid_blocks: out Grid_Block_Type); Procedure createBlock (panel: in Panel_Type; block: out Block_Editbox_Type); Procedure setGrid (grid_blocks: in out Grid_Block_Type; grid: in Matrix_Type; base_filename: in out Unbounded_String); Function getGrid (grid_blocks: in Grid_Block_Type; grid: out Matrix_Type; saving: in Boolean) return Boolean; Function readFile (file: in Ada.Text_IO.File_Type) return Vector; Function saveGrid (grid: in Matrix_Type; filename: in String; base_filename: in out Unbounded_String) return Boolean; Function split (line: in String; list: out List_Type) return Boolean; Function fillGrid (lines: in vector; grid: out Matrix_Type; base_filename: in out Unbounded_String) return Boolean; Function isNumeric (value: in String) return Boolean; Function loadBaseMatrix(base_filename: in out Unbounded_String; grid: out Matrix_Type) return Boolean; End sudoku_tools_16;
mfkiwl/ewok-kernel-security-OS
Ada
3,172
ads
-- -- Copyright 2018 The wookey project team <[email protected]> -- - Ryad Benadjila -- - Arnauld Michelizza -- - Mathieu Renard -- - Philippe Thierry -- - Philippe Trebuchet -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- with ada.unchecked_conversion; with soc.interrupts; with ewok.tasks_shared; with ewok.devices_shared; package ewok.interrupts with spark_mode => off is type t_interrupt_handler_access is access procedure (frame_a : in ewok.t_stack_frame_access); type t_interrupt_task_switch_handler_access is access function (frame_a : ewok.t_stack_frame_access) return ewok.t_stack_frame_access; type t_handler_type is (DEFAULT_HANDLER, TASK_SWITCH_HANDLER); type t_interrupt_cell (htype : t_handler_type := DEFAULT_HANDLER) is record task_id : ewok.tasks_shared.t_task_id; device_id : ewok.devices_shared.t_device_id; case htype is when DEFAULT_HANDLER => handler : t_interrupt_handler_access; when TASK_SWITCH_HANDLER => task_switch_handler : t_interrupt_task_switch_handler_access; end case; end record; type t_interrupt_cell_access is access all t_interrupt_cell; interrupt_table : array (soc.interrupts.t_interrupt) of aliased t_interrupt_cell; function to_system_address is new ada.unchecked_conversion (t_interrupt_handler_access, system_address); function to_handler_access is new ada.unchecked_conversion (system_address, t_interrupt_handler_access); procedure init; function is_interrupt_already_used (interrupt : soc.interrupts.t_interrupt) return boolean; procedure set_interrupt_handler (interrupt : in soc.interrupts.t_interrupt; handler : in t_interrupt_handler_access; task_id : in ewok.tasks_shared.t_task_id; device_id : in ewok.devices_shared.t_device_id; success : out boolean); procedure reset_interrupt_handler (interrupt : in soc.interrupts.t_interrupt; task_id : in ewok.tasks_shared.t_task_id; device_id : in ewok.devices_shared.t_device_id); procedure set_task_switching_handler (interrupt : in soc.interrupts.t_interrupt; handler : in t_interrupt_task_switch_handler_access; task_id : in ewok.tasks_shared.t_task_id; device_id : in ewok.devices_shared.t_device_id; success : out boolean); function get_device_from_interrupt (interrupt : soc.interrupts.t_interrupt) return ewok.devices_shared.t_device_id with inline_always; end ewok.interrupts;
optikos/oasis
Ada
1,847
ads
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Elements.Statements; with Program.Lexical_Elements; with Program.Elements.Expressions; package Program.Elements.Requeue_Statements is pragma Pure (Program.Elements.Requeue_Statements); type Requeue_Statement is limited interface and Program.Elements.Statements.Statement; type Requeue_Statement_Access is access all Requeue_Statement'Class with Storage_Size => 0; not overriding function Entry_Name (Self : Requeue_Statement) return not null Program.Elements.Expressions.Expression_Access is abstract; not overriding function Has_With_Abort (Self : Requeue_Statement) return Boolean is abstract; type Requeue_Statement_Text is limited interface; type Requeue_Statement_Text_Access is access all Requeue_Statement_Text'Class with Storage_Size => 0; not overriding function To_Requeue_Statement_Text (Self : aliased in out Requeue_Statement) return Requeue_Statement_Text_Access is abstract; not overriding function Requeue_Token (Self : Requeue_Statement_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function With_Token (Self : Requeue_Statement_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Abort_Token (Self : Requeue_Statement_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Semicolon_Token (Self : Requeue_Statement_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; end Program.Elements.Requeue_Statements;
sungyeon/drake
Ada
6,556
adb
with System.Storage_Barriers; package body System.Reference_Counting is pragma Suppress (All_Checks); use type Storage_Elements.Storage_Offset; function atomic_load ( ptr : not null access constant Counter; memorder : Integer := Storage_Barriers.ATOMIC_ACQUIRE) return Counter with Import, Convention => Intrinsic, External_Name => "__atomic_load_4"; procedure atomic_add_fetch ( ptr : not null access Counter; val : Counter; memorder : Integer := Storage_Barriers.ATOMIC_ACQ_REL) with Import, Convention => Intrinsic, External_Name => "__atomic_add_fetch_4"; function atomic_sub_fetch ( ptr : not null access Counter; val : Counter; memorder : Integer := Storage_Barriers.ATOMIC_ACQ_REL) return Counter with Import, Convention => Intrinsic, External_Name => "__atomic_sub_fetch_4"; pragma Compile_Time_Error ( Storage_Elements.Storage_Offset'Size /= 32 and then Storage_Elements.Storage_Offset'Size /= 64, "Storage_Elements.Storage_Offset'Size is neither 32 nor 64"); -- Use sequentially consistent model because an object's length and -- contents should be synchronized. Order : constant := Storage_Barriers.ATOMIC_SEQ_CST; function atomic_compare_exchange ( ptr : not null access Length_Type; expected : not null access Length_Type; desired : Length_Type; weak : Boolean := False; success_memorder : Integer := Order; failure_memorder : Integer := Order) return Boolean with Import, Convention => Intrinsic, External_Name => (case Storage_Elements.Storage_Offset'Size is when 32 => "__atomic_compare_exchange_4", when others => "__atomic_compare_exchange_8"); -- implementation function Shared (Data : not null Data_Access) return Boolean is begin return atomic_load (Data) > 1; -- static is True end Shared; -- not null because using sentinel (that means empty data block) procedure Adjust ( Target : not null access Container) is Reference_Count : constant not null Data_Access := Target.all; begin if atomic_load (Reference_Count) /= Static then atomic_add_fetch (Reference_Count, 1); end if; end Adjust; procedure Assign ( Target : not null access Container; Source : not null access constant Container; Free : not null access procedure (Object : in out Data_Access)) is begin if Target.all /= Source.all then Clear (Target, Free); Target.all := Source.all; Adjust (Target); end if; end Assign; procedure Clear ( Target : not null access Container; Free : not null access procedure (Object : in out Data_Access)) is Reference_Count : constant not null Data_Access := Target.all; begin if atomic_load (Reference_Count) /= Static and then atomic_sub_fetch (Reference_Count, 1) = 0 then Free (Target.all); end if; end Clear; procedure Move ( Target : not null access Container; Source : not null access Container; Sentinel : not null Data_Access; Free : not null access procedure (Object : in out Data_Access)) is begin if Target.all /= Source.all then Clear (Target, Free); Target.all := Source.all; Source.all := Sentinel; end if; end Move; procedure Unique ( Target : not null access Container; Target_Length : Length_Type; Target_Capacity : Length_Type; New_Length : Length_Type; New_Capacity : Length_Type; Sentinel : not null Data_Access; Reallocate : not null access procedure ( Target : aliased in out not null Data_Access; Length : Length_Type; Max_Length : Length_Type; Capacity : Length_Type); Copy : not null access procedure ( Target : out not null Data_Access; Source : not null Data_Access; Length : Length_Type; Max_Length : Length_Type; Capacity : Length_Type); Free : not null access procedure (Object : in out Data_Access)) is begin if Shared (Target.all) then if New_Capacity /= Target_Capacity or else Target.all /= Sentinel then declare Old : aliased Container := Target.all; begin if New_Capacity = 0 then Target.all := Sentinel; else Copy ( Target.all, Old, Target_Length, New_Length, New_Capacity); end if; Clear (Old'Access, Free => Free); end; end if; else -- not shared if New_Capacity /= Target_Capacity then if New_Capacity = 0 then Free (Target.all); Target.all := Sentinel; else Reallocate ( Target.all, Target_Length, New_Length, New_Capacity); end if; end if; end if; end Unique; procedure In_Place_Set_Length ( Target_Data : not null Data_Access; Target_Length : Length_Type; Target_Max_Length : aliased in out Length_Type; Target_Capacity : Length_Type; New_Length : Length_Type; Failure : out Boolean) is begin if New_Length > Target_Length then -- inscreasing if New_Length > Target_Capacity then -- expanding Failure := True; -- should be reallocated else -- try to use reserved area declare Expected : aliased Length_Type := Target_Length; begin Failure := not atomic_compare_exchange ( Target_Max_Length'Access, Expected'Access, New_Length); end; if Failure and then not Shared (Target_Data) then -- reference count = 1 Target_Max_Length := New_Length; Failure := False; -- success end if; end if; else -- decreasing if not Shared (Target_Data) then Target_Max_Length := New_Length; end if; Failure := False; -- success end if; end In_Place_Set_Length; end System.Reference_Counting;
reznikmm/matreshka
Ada
7,910
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Elements; with AMF.Internals.Helpers; with AMF.Internals.Tables.UML_Attributes; with AMF.UML.Abstractions; with AMF.UML.Value_Specifications; with AMF.Visitors.Standard_Profile_L2_Iterators; with AMF.Visitors.Standard_Profile_L2_Visitors; package body AMF.Internals.Standard_Profile_L2_Derives is -------------------------- -- Get_Base_Abstraction -- -------------------------- overriding function Get_Base_Abstraction (Self : not null access constant Standard_Profile_L2_Derive_Proxy) return AMF.UML.Abstractions.UML_Abstraction_Access is begin return AMF.UML.Abstractions.UML_Abstraction_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Base_Abstraction (Self.Element))); end Get_Base_Abstraction; -------------------------- -- Set_Base_Abstraction -- -------------------------- overriding procedure Set_Base_Abstraction (Self : not null access Standard_Profile_L2_Derive_Proxy; To : AMF.UML.Abstractions.UML_Abstraction_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Base_Abstraction (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Base_Abstraction; --------------------- -- Get_Computation -- --------------------- overriding function Get_Computation (Self : not null access constant Standard_Profile_L2_Derive_Proxy) return AMF.UML.Value_Specifications.UML_Value_Specification_Access is begin return AMF.UML.Value_Specifications.UML_Value_Specification_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Computation (Self.Element))); end Get_Computation; --------------------- -- Set_Computation -- --------------------- overriding procedure Set_Computation (Self : not null access Standard_Profile_L2_Derive_Proxy; To : AMF.UML.Value_Specifications.UML_Value_Specification_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Computation (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Computation; ------------------- -- Enter_Element -- ------------------- overriding procedure Enter_Element (Self : not null access constant Standard_Profile_L2_Derive_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Visitor in AMF.Visitors.Standard_Profile_L2_Visitors.Standard_Profile_L2_Visitor'Class then AMF.Visitors.Standard_Profile_L2_Visitors.Standard_Profile_L2_Visitor'Class (Visitor).Enter_Derive (AMF.Standard_Profile_L2.Derives.Standard_Profile_L2_Derive_Access (Self), Control); end if; end Enter_Element; ------------------- -- Leave_Element -- ------------------- overriding procedure Leave_Element (Self : not null access constant Standard_Profile_L2_Derive_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Visitor in AMF.Visitors.Standard_Profile_L2_Visitors.Standard_Profile_L2_Visitor'Class then AMF.Visitors.Standard_Profile_L2_Visitors.Standard_Profile_L2_Visitor'Class (Visitor).Leave_Derive (AMF.Standard_Profile_L2.Derives.Standard_Profile_L2_Derive_Access (Self), Control); end if; end Leave_Element; ------------------- -- Visit_Element -- ------------------- overriding procedure Visit_Element (Self : not null access constant Standard_Profile_L2_Derive_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Iterator in AMF.Visitors.Standard_Profile_L2_Iterators.Standard_Profile_L2_Iterator'Class then AMF.Visitors.Standard_Profile_L2_Iterators.Standard_Profile_L2_Iterator'Class (Iterator).Visit_Derive (Visitor, AMF.Standard_Profile_L2.Derives.Standard_Profile_L2_Derive_Access (Self), Control); end if; end Visit_Element; end AMF.Internals.Standard_Profile_L2_Derives;
coopht/axmpp
Ada
5,557
adb
------------------------------------------------------------------------------ -- -- -- AXMPP Project -- -- -- -- XMPP Library for Ada -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2018, Alexander Basov <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Alexander Basov, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.SAX.Attributes; package body XMPP.MUCS is -------------- -- Create -- -------------- function Create return XMPP_MUC_Access is begin return new XMPP_MUC; end Create; ---------------- -- Get_Kind -- ---------------- overriding function Get_Kind (Self : XMPP_MUC) return Object_Kind is pragma Unreferenced (Self); begin return XMPP.MUC; end Get_Kind; ----------------- -- Serialize -- ----------------- overriding procedure Serialize (Self : XMPP_MUC; Writer : in out XML.SAX.Pretty_Writers.XML_Pretty_Writer'Class) is Attributes : XML.SAX.Attributes.SAX_Attributes; begin Writer.Start_Prefix_Mapping (Namespace_URI => MUC_URI); Writer.Start_Element (Namespace_URI => MUC_URI, Local_Name => MUC_Element); if Self.History.Max_Chars.Is_Set then declare Image : constant Wide_Wide_String := Integer'Wide_Wide_Image (Self.History.Max_Chars.Value); begin Attributes.Set_Value (League.Strings.To_Universal_String ("maxchars"), League.Strings.To_Universal_String (Image (2 .. Image'Last))); Writer.Start_Element (Namespace_URI => MUC_URI, Local_Name => History_Element, Attributes => Attributes); Writer.End_Element (Namespace_URI => MUC_URI, Local_Name => History_Element); end; end if; Writer.End_Element (Namespace_URI => MUC_URI, Local_Name => MUC_Element); end Serialize; ------------------- -- Set_Content -- ------------------- overriding procedure Set_Content (Self : in out XMPP_MUC; Parameter : League.Strings.Universal_String; Value : League.Strings.Universal_String) is begin null; end Set_Content; ----------------- -- Set_History -- ----------------- procedure Set_History (Self : in out XMPP_MUC; Value : MUC_History) is begin Self.History := Value; end Set_History; ---------------- -- Set_Item -- ---------------- procedure Set_Item (Self : in out XMPP_MUC; Item : MUC_Item) is begin Self.Item := Item; end Set_Item; end XMPP.MUCS;
reznikmm/matreshka
Ada
19,808
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with AMF.Internals.UML_Named_Elements; with AMF.UML.Activities; with AMF.UML.Activity_Edges.Collections; with AMF.UML.Activity_Groups.Collections; with AMF.UML.Activity_Nodes.Collections; with AMF.UML.Activity_Partitions.Collections; with AMF.UML.Behaviors; with AMF.UML.Classifiers.Collections; with AMF.UML.Constraints.Collections; with AMF.UML.Dependencies.Collections; with AMF.UML.Exception_Handlers.Collections; with AMF.UML.Input_Pins.Collections; with AMF.UML.Interruptible_Activity_Regions.Collections; with AMF.UML.Named_Elements; with AMF.UML.Namespaces; with AMF.UML.Output_Pins.Collections; with AMF.UML.Packages.Collections; with AMF.UML.Redefinable_Elements.Collections; with AMF.UML.Reduce_Actions; with AMF.UML.String_Expressions; with AMF.UML.Structured_Activity_Nodes; with AMF.Visitors; package AMF.Internals.UML_Reduce_Actions is type UML_Reduce_Action_Proxy is limited new AMF.Internals.UML_Named_Elements.UML_Named_Element_Proxy and AMF.UML.Reduce_Actions.UML_Reduce_Action with null record; overriding function Get_Collection (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Input_Pins.UML_Input_Pin_Access; -- Getter of ReduceAction::collection. -- -- The collection to be reduced. overriding procedure Set_Collection (Self : not null access UML_Reduce_Action_Proxy; To : AMF.UML.Input_Pins.UML_Input_Pin_Access); -- Setter of ReduceAction::collection. -- -- The collection to be reduced. overriding function Get_Is_Ordered (Self : not null access constant UML_Reduce_Action_Proxy) return Boolean; -- Getter of ReduceAction::isOrdered. -- -- Tells whether the order of the input collection should determine the -- order in which the behavior is applied to its elements. overriding procedure Set_Is_Ordered (Self : not null access UML_Reduce_Action_Proxy; To : Boolean); -- Setter of ReduceAction::isOrdered. -- -- Tells whether the order of the input collection should determine the -- order in which the behavior is applied to its elements. overriding function Get_Reducer (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Behaviors.UML_Behavior_Access; -- Getter of ReduceAction::reducer. -- -- Behavior that is applied to two elements of the input collection to -- produce a value that is the same type as elements of the collection. overriding procedure Set_Reducer (Self : not null access UML_Reduce_Action_Proxy; To : AMF.UML.Behaviors.UML_Behavior_Access); -- Setter of ReduceAction::reducer. -- -- Behavior that is applied to two elements of the input collection to -- produce a value that is the same type as elements of the collection. overriding function Get_Result (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Output_Pins.UML_Output_Pin_Access; -- Getter of ReduceAction::result. -- -- Gives the output pin on which the result is put. overriding procedure Set_Result (Self : not null access UML_Reduce_Action_Proxy; To : AMF.UML.Output_Pins.UML_Output_Pin_Access); -- Setter of ReduceAction::result. -- -- Gives the output pin on which the result is put. overriding function Get_Context (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Classifiers.UML_Classifier_Access; -- Getter of Action::context. -- -- The classifier that owns the behavior of which this action is a part. overriding function Get_Input (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Input_Pins.Collections.Ordered_Set_Of_UML_Input_Pin; -- Getter of Action::input. -- -- The ordered set of input pins connected to the Action. These are among -- the total set of inputs. overriding function Get_Is_Locally_Reentrant (Self : not null access constant UML_Reduce_Action_Proxy) return Boolean; -- Getter of Action::isLocallyReentrant. -- -- If true, the action can begin a new, concurrent execution, even if -- there is already another execution of the action ongoing. If false, the -- action cannot begin a new execution until any previous execution has -- completed. overriding procedure Set_Is_Locally_Reentrant (Self : not null access UML_Reduce_Action_Proxy; To : Boolean); -- Setter of Action::isLocallyReentrant. -- -- If true, the action can begin a new, concurrent execution, even if -- there is already another execution of the action ongoing. If false, the -- action cannot begin a new execution until any previous execution has -- completed. overriding function Get_Local_Postcondition (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint; -- Getter of Action::localPostcondition. -- -- Constraint that must be satisfied when executed is completed. overriding function Get_Local_Precondition (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint; -- Getter of Action::localPrecondition. -- -- Constraint that must be satisfied when execution is started. overriding function Get_Output (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin; -- Getter of Action::output. -- -- The ordered set of output pins connected to the Action. The action -- places its results onto pins in this set. overriding function Get_Handler (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Exception_Handlers.Collections.Set_Of_UML_Exception_Handler; -- Getter of ExecutableNode::handler. -- -- A set of exception handlers that are examined if an uncaught exception -- propagates to the outer level of the executable node. overriding function Get_Activity (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Activities.UML_Activity_Access; -- Getter of ActivityNode::activity. -- -- Activity containing the node. overriding procedure Set_Activity (Self : not null access UML_Reduce_Action_Proxy; To : AMF.UML.Activities.UML_Activity_Access); -- Setter of ActivityNode::activity. -- -- Activity containing the node. overriding function Get_In_Group (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Activity_Groups.Collections.Set_Of_UML_Activity_Group; -- Getter of ActivityNode::inGroup. -- -- Groups containing the node. overriding function Get_In_Interruptible_Region (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Interruptible_Activity_Regions.Collections.Set_Of_UML_Interruptible_Activity_Region; -- Getter of ActivityNode::inInterruptibleRegion. -- -- Interruptible regions containing the node. overriding function Get_In_Partition (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Activity_Partitions.Collections.Set_Of_UML_Activity_Partition; -- Getter of ActivityNode::inPartition. -- -- Partitions containing the node. overriding function Get_In_Structured_Node (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access; -- Getter of ActivityNode::inStructuredNode. -- -- Structured activity node containing the node. overriding procedure Set_In_Structured_Node (Self : not null access UML_Reduce_Action_Proxy; To : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access); -- Setter of ActivityNode::inStructuredNode. -- -- Structured activity node containing the node. overriding function Get_Incoming (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge; -- Getter of ActivityNode::incoming. -- -- Edges that have the node as target. overriding function Get_Outgoing (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge; -- Getter of ActivityNode::outgoing. -- -- Edges that have the node as source. overriding function Get_Redefined_Node (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Activity_Nodes.Collections.Set_Of_UML_Activity_Node; -- Getter of ActivityNode::redefinedNode. -- -- Inherited nodes replaced by this node in a specialization of the -- activity. overriding function Get_Is_Leaf (Self : not null access constant UML_Reduce_Action_Proxy) return Boolean; -- Getter of RedefinableElement::isLeaf. -- -- Indicates whether it is possible to further redefine a -- RedefinableElement. If the value is true, then it is not possible to -- further redefine the RedefinableElement. Note that this property is -- preserved through package merge operations; that is, the capability to -- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in -- the resulting RedefinableElement of a package merge operation where a -- RedefinableElement with isLeaf=false is merged with a matching -- RedefinableElement with isLeaf=true: the resulting RedefinableElement -- will have isLeaf=false. Default value is false. overriding procedure Set_Is_Leaf (Self : not null access UML_Reduce_Action_Proxy; To : Boolean); -- Setter of RedefinableElement::isLeaf. -- -- Indicates whether it is possible to further redefine a -- RedefinableElement. If the value is true, then it is not possible to -- further redefine the RedefinableElement. Note that this property is -- preserved through package merge operations; that is, the capability to -- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in -- the resulting RedefinableElement of a package merge operation where a -- RedefinableElement with isLeaf=false is merged with a matching -- RedefinableElement with isLeaf=true: the resulting RedefinableElement -- will have isLeaf=false. Default value is false. overriding function Get_Redefined_Element (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element; -- Getter of RedefinableElement::redefinedElement. -- -- The redefinable element that is being redefined by this element. overriding function Get_Redefinition_Context (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier; -- Getter of RedefinableElement::redefinitionContext. -- -- References the contexts that this element may be redefined from. overriding function Get_Client_Dependency (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency; -- Getter of NamedElement::clientDependency. -- -- Indicates the dependencies that reference the client. overriding function Get_Name_Expression (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.String_Expressions.UML_String_Expression_Access; -- Getter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding procedure Set_Name_Expression (Self : not null access UML_Reduce_Action_Proxy; To : AMF.UML.String_Expressions.UML_String_Expression_Access); -- Setter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding function Get_Namespace (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Getter of NamedElement::namespace. -- -- Specifies the namespace that owns the NamedElement. overriding function Get_Qualified_Name (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.Optional_String; -- Getter of NamedElement::qualifiedName. -- -- A name which allows the NamedElement to be identified within a -- hierarchy of nested Namespaces. It is constructed from the names of the -- containing namespaces starting at the root of the hierarchy and ending -- with the name of the NamedElement itself. overriding function Context (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Classifiers.UML_Classifier_Access; -- Operation Action::context. -- -- Missing derivation for Action::/context : Classifier overriding function Is_Consistent_With (Self : not null access constant UML_Reduce_Action_Proxy; Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean; -- Operation RedefinableElement::isConsistentWith. -- -- The query isConsistentWith() specifies, for any two RedefinableElements -- in a context in which redefinition is possible, whether redefinition -- would be logically consistent. By default, this is false; this -- operation must be overridden for subclasses of RedefinableElement to -- define the consistency conditions. overriding function Is_Redefinition_Context_Valid (Self : not null access constant UML_Reduce_Action_Proxy; Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean; -- Operation RedefinableElement::isRedefinitionContextValid. -- -- The query isRedefinitionContextValid() specifies whether the -- redefinition contexts of this RedefinableElement are properly related -- to the redefinition contexts of the specified RedefinableElement to -- allow this element to redefine the other. By default at least one of -- the redefinition contexts of this element must be a specialization of -- at least one of the redefinition contexts of the specified element. overriding function All_Owning_Packages (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Packages.Collections.Set_Of_UML_Package; -- Operation NamedElement::allOwningPackages. -- -- The query allOwningPackages() returns all the directly or indirectly -- owning packages. overriding function Is_Distinguishable_From (Self : not null access constant UML_Reduce_Action_Proxy; N : AMF.UML.Named_Elements.UML_Named_Element_Access; Ns : AMF.UML.Namespaces.UML_Namespace_Access) return Boolean; -- Operation NamedElement::isDistinguishableFrom. -- -- The query isDistinguishableFrom() determines whether two NamedElements -- may logically co-exist within a Namespace. By default, two named -- elements are distinguishable if (a) they have unrelated types or (b) -- they have related types but different names. overriding function Namespace (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Operation NamedElement::namespace. -- -- Missing derivation for NamedElement::/namespace : Namespace overriding procedure Enter_Element (Self : not null access constant UML_Reduce_Action_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Leave_Element (Self : not null access constant UML_Reduce_Action_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Visit_Element (Self : not null access constant UML_Reduce_Action_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of iterator interface. end AMF.Internals.UML_Reduce_Actions;
zhmu/ananas
Ada
9,514
ads
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T . S O C K E T S . T H I N -- -- -- -- S p e c -- -- -- -- Copyright (C) 2001-2022, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides a target dependent thin interface to the sockets -- layer for use by the GNAT.Sockets package (g-socket.ads). This package -- should not be directly with'ed by an applications program. -- This is the default version with Interfaces.C; with GNAT.OS_Lib; with GNAT.Sockets.Thin_Common; with System; with System.CRTL; package GNAT.Sockets.Thin is -- This package is intended for hosts implementing BSD sockets with a -- standard interface. It will be used as a default for all the platforms -- that do not have a specific version of this file. use Thin_Common; package C renames Interfaces.C; use type System.CRTL.ssize_t; function Socket_Errno return Integer renames GNAT.OS_Lib.Errno; -- Returns last socket error number function Socket_Error_Message (Errno : Integer) return String; -- Returns the error message string for the error number Errno. If Errno is -- not known, returns "Unknown system error". function Host_Errno return Integer; pragma Import (C, Host_Errno, "__gnat_get_h_errno"); -- Returns last host error number package Host_Error_Messages is function Host_Error_Message (H_Errno : Integer) return String; -- Returns the error message string for the host error number H_Errno. -- If H_Errno is not known, returns "Unknown system error". end Host_Error_Messages; -------------------------------- -- Standard library functions -- -------------------------------- function C_Accept (S : C.int; Addr : System.Address; Addrlen : not null access C.int) return C.int; function C_Bind (S : C.int; Name : System.Address; Namelen : C.int) return C.int; function C_Close (Fd : C.int) return C.int; function C_Connect (S : C.int; Name : System.Address; Namelen : C.int) return C.int; function C_Gethostname (Name : System.Address; Namelen : C.size_t) return C.int; function C_Getpeername (S : C.int; Name : System.Address; Namelen : not null access C.int) return C.int; function C_Getsockname (S : C.int; Name : System.Address; Namelen : not null access C.int) return C.int; function C_Getsockopt (S : C.int; Level : C.int; Optname : C.int; Optval : System.Address; Optlen : not null access C.int) return C.int; function Socket_Ioctl (S : C.int; Req : SOSC.IOCTL_Req_T; Arg : access C.int) return C.int; function C_Listen (S : C.int; Backlog : C.int) return C.int; function C_Recv (S : C.int; Msg : System.Address; Len : C.size_t; Flags : C.int) return C.int; function C_Recvfrom (S : C.int; Msg : System.Address; Len : C.size_t; Flags : C.int; From : System.Address; Fromlen : not null access C.int) return C.int; function C_Recvmsg (S : C.int; Msg : System.Address; Flags : C.int) return System.CRTL.ssize_t; function C_Select (Nfds : C.int; Readfds : access Fd_Set; Writefds : access Fd_Set; Exceptfds : access Fd_Set; Timeout : Timeval_Access) return C.int; function C_Sendmsg (S : C.int; Msg : System.Address; Flags : C.int) return System.CRTL.ssize_t; function C_Sendto (S : C.int; Msg : System.Address; Len : C.size_t; Flags : C.int; To : System.Address; Tolen : C.int) return C.int; function C_Setsockopt (S : C.int; Level : C.int; Optname : C.int; Optval : System.Address; Optlen : C.int) return C.int; function C_Shutdown (S : C.int; How : C.int) return C.int; function C_Socket (Domain : C.int; Typ : C.int; Protocol : C.int) return C.int; function C_System (Command : System.Address) return C.int; Default_Socket_Pair_Family : constant := SOSC.AF_UNIX; -- UNIX has socketpair system call and AF_UNIX family is widely supported function C_Socketpair (Domain : C.int; Typ : C.int; Protocol : C.int; Fds : not null access Fd_Pair) return C.int; -- Creates pair of connected sockets ------------------------------------------------------- -- Signalling file descriptors for selector abortion -- ------------------------------------------------------- package Signalling_Fds is function Create (Fds : not null access Fd_Pair) return C.int; pragma Convention (C, Create); -- Create a pair of connected descriptors suitable for use with C_Select -- (used for signalling in Selector objects). function Read (Rsig : C.int) return C.int; pragma Convention (C, Read); -- Read one byte of data from rsig, the read end of a pair of signalling -- fds created by Create_Signalling_Fds. function Write (Wsig : C.int) return C.int; pragma Convention (C, Write); -- Write one byte of data to wsig, the write end of a pair of signalling -- fds created by Create_Signalling_Fds. procedure Close (Sig : C.int); pragma Convention (C, Close); -- Close one end of a pair of signalling fds (ignoring any error) end Signalling_Fds; ------------------------------------------- -- Nonreentrant network databases access -- ------------------------------------------- -- The following are used only on systems that have nonreentrant -- getXXXbyYYY functions, and do NOT have corresponding getXXXbyYYY_ -- functions. Currently, LynxOS is the only such system. function Nonreentrant_Gethostbyname (Name : C.char_array) return Hostent_Access; function Nonreentrant_Gethostbyaddr (Addr : System.Address; Addr_Len : C.int; Addr_Type : C.int) return Hostent_Access; function Nonreentrant_Getservbyname (Name : C.char_array; Proto : C.char_array) return Servent_Access; function Nonreentrant_Getservbyport (Port : C.int; Proto : C.char_array) return Servent_Access; procedure Initialize; procedure Finalize; private pragma Import (C, C_Bind, "bind"); pragma Import (C, C_Close, "close"); pragma Import (C, C_Gethostname, "gethostname"); pragma Import (C, C_Getpeername, "getpeername"); pragma Import (C, C_Getsockname, "getsockname"); pragma Import (C, C_Getsockopt, "getsockopt"); pragma Import (C, C_Listen, "listen"); pragma Import (C, C_Select, "select"); pragma Import (C, C_Setsockopt, "setsockopt"); pragma Import (C, C_Shutdown, "shutdown"); pragma Import (C, C_Socketpair, "socketpair"); pragma Import (C, C_System, "system"); pragma Import (C, Nonreentrant_Gethostbyname, "gethostbyname"); pragma Import (C, Nonreentrant_Gethostbyaddr, "gethostbyaddr"); pragma Import (C, Nonreentrant_Getservbyname, "getservbyname"); pragma Import (C, Nonreentrant_Getservbyport, "getservbyport"); end GNAT.Sockets.Thin;
AdaCore/gpr
Ada
1,078
adb
with p0_2; use p0_2; with p1_1; use p1_1; package body p0_1 is function p0_1_0 (Item : Integer) return Integer is Result : Long_Long_Integer; begin if Item < 0 then return -Item; end if; Result := Long_Long_Integer (p0_2_0 (Item - 1)) + Long_Long_Integer (p1_1_0 (Item - 2)); return Integer (Result rem Long_Long_Integer (Integer'Last)); end p0_1_0; function p0_1_1 (Item : Integer) return Integer is Result : Long_Long_Integer; begin if Item < 0 then return -Item; end if; Result := Long_Long_Integer (p0_2_1 (Item - 1)) + Long_Long_Integer (p1_1_1 (Item - 2)); return Integer (Result rem Long_Long_Integer (Integer'Last)); end p0_1_1; function p0_1_2 (Item : Integer) return Integer is Result : Long_Long_Integer; begin if Item < 0 then return -Item; end if; Result := Long_Long_Integer (p0_2_2 (Item - 1)) + Long_Long_Integer (p1_1_2 (Item - 2)); return Integer (Result rem Long_Long_Integer (Integer'Last)); end p0_1_2; end p0_1;
twdroeger/ada-awa
Ada
4,229
ads
----------------------------------------------------------------------- -- awa-mail-clients-aws_smtp -- Mail client implementation on top of AWS SMTP client -- Copyright (C) 2012, 2016 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; with Ada.Finalization; with Util.Properties; with AWS.SMTP; with AWS.SMTP.Authentication.Plain; -- The <b>AWA.Mail.Clients.AWS_SMTP</b> package provides an implementation of the -- mail client interfaces on top of AWS SMTP client API. package AWA.Mail.Clients.AWS_SMTP is NAME : constant String := "smtp"; -- ------------------------------ -- Mail Message -- ------------------------------ -- The <b>Mail_Message</b> represents an abstract mail message that can be initialized -- before being sent. type AWS_Mail_Message is new Ada.Finalization.Limited_Controlled and Mail_Message with private; type AWS_Mail_Message_Access is access all AWS_Mail_Message'Class; -- Set the <tt>From</tt> part of the message. overriding procedure Set_From (Message : in out AWS_Mail_Message; Name : in String; Address : in String); -- Add a recipient for the message. overriding procedure Add_Recipient (Message : in out AWS_Mail_Message; Kind : in Recipient_Type; Name : in String; Address : in String); -- Set the subject of the message. overriding procedure Set_Subject (Message : in out AWS_Mail_Message; Subject : in String); -- Set the body of the message. overriding procedure Set_Body (Message : in out AWS_Mail_Message; Content : in String); -- Send the email message. overriding procedure Send (Message : in out AWS_Mail_Message); -- Deletes the mail message. overriding procedure Finalize (Message : in out AWS_Mail_Message); -- ------------------------------ -- Mail Manager -- ------------------------------ -- The <b>Mail_Manager</b> is the entry point to create a new mail message -- and be able to send it. type AWS_Mail_Manager is new Mail_Manager with private; type AWS_Mail_Manager_Access is access all AWS_Mail_Manager'Class; -- Create a SMTP based mail manager and configure it according to the properties. function Create_Manager (Props : in Util.Properties.Manager'Class) return Mail_Manager_Access; -- Create a new mail message. overriding function Create_Message (Manager : in AWS_Mail_Manager) return Mail_Message_Access; private type Recipients_Access is access all AWS.SMTP.Recipients; type AWS_Mail_Message is new Ada.Finalization.Limited_Controlled and Mail_Message with record Manager : AWS_Mail_Manager_Access; From : AWS.SMTP.E_Mail_Data; Subject : Ada.Strings.Unbounded.Unbounded_String; Content : Ada.Strings.Unbounded.Unbounded_String; To : Recipients_Access := null; end record; type AWS_Mail_Manager is new Mail_Manager with record Self : AWS_Mail_Manager_Access; Server : AWS.SMTP.Receiver; Creds : aliased AWS.SMTP.Authentication.Plain.Credential; Port : Positive := 25; Enable : Boolean := True; Secure : Boolean := False; Auth : Boolean := False; end record; procedure Initialize (Client : in out AWS_Mail_Manager'Class; Props : in Util.Properties.Manager'Class); end AWA.Mail.Clients.AWS_SMTP;
hbarrientosg/cs-mp
Ada
2,279
adb
Package body Numeros_racionales is function "/"(A,B:integer)return Racional is R1:Racional; D:integer; Begin if B/=0 then R1.Num := A/Max(abs(a),abs(B)); R1.Dem:= B/Max(abs(a),abs(B)); else raise Denominador_cero; end if; Return r1; End "/"; Function "+"(X,Y:Racional)return Racional is Aux:Racional; Begin Aux.Num:=(X.num*Y.Dem)+(Y.Num*X.Dem); Aux.dem:=X.dem*Y.dem; aux.dem:=aux.Dem/Max(abs(aux.num),abs(aux.dem)); aux.num:=aux.num/Max(abs(aux.num),abs(aux.dem)); Return Aux; End "+"; function "-"(X,Y:Racional)return Racional is Aux:Racional; begin Aux.num:=(X.num*Y.Dem)-(Y.num*X.dem); aux.Dem:=Y.dem*X.dem; aux.num:=aux.num/Max(abs(aux.num),abs(aux.dem)); aux.dem:=aux.Dem/Max(abs(aux.num),abs(aux.dem)); return Aux; end "-"; function "*"(X,Y:racional)return Racional is Aux:racional; Begin Aux.Num:=X.num*Y.Num; Aux.Dem:=X.dem*Y.dem; aux.num:=aux.num/Max(abs(aux.num),abs(aux.dem)); aux.dem:=aux.Dem/Max(abs(aux.num),abs(aux.dem)); return Aux; End "*"; Function "/"(X,Y:Racional)return Racional is Aux:Racional; begin Aux.Num:=X.num*Y.dem; Aux.dem:=X.dem*Y.dem; aux.num:=aux.num/Max(abs(aux.num),abs(aux.dem)); aux.dem:=aux.Dem/Max(abs(aux.num),abs(aux.dem)); return Aux; End "/"; Function "="(X,Y:Racional)return Boolean Is Begin return (X.dem=Y.dem) and (X.num=Y.Num); end "="; function Absoluto(X:Racional)return Racional is A,B:integer; begin If X.Dem/=-X.dem then A:=x.Num; B:=X.Dem; End if; Return X; end Absoluto; function Numerador(X:Racional)return Integer is begin return X.num; end Numerador; Function Denominador(X:Racional)return Integer is begin return X.dem; end Denominador; function Max(X,Y:integer)return Integer is aux,aux2,aux3:Integer; begin if X = 0 Then return Y; else if x>=y then Aux:=x-y; aux3:=y; while aux/=0 loop if aux>=aux3 then Aux2:=aux; else aux2:=aux3; aux3:=aux; end if; aux:=aux2-aux3; end loop; return aux3; else Aux:=y-x; aux3:=x; while aux/=0 loop if aux>=aux3 then Aux2:=aux; else aux2:=aux3; aux3:=aux; end if; aux:=aux2-aux3; end loop; return aux3; end if; end if; end max; end Numeros_Racionales;
sparre/Ada-2012-Examples
Ada
363
ads
package Array_Subtypes is subtype Digit_Character is Character range '0' .. '9'; subtype Digit_String is String with Dynamic_Predicate => (for all C of Digit_String => C in Digit_Character -- or else raise Constraint_Error -- Bug box in GNAT GPL 2014 and GNAT-4.9 ); end Array_Subtypes;
reznikmm/matreshka
Ada
4,618
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Visitors; with ODF.DOM.Draw_A_Elements; package Matreshka.ODF_Draw.A_Elements is type Draw_A_Element_Node is new Matreshka.ODF_Draw.Abstract_Draw_Element_Node and ODF.DOM.Draw_A_Elements.ODF_Draw_A with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters) return Draw_A_Element_Node; overriding function Get_Local_Name (Self : not null access constant Draw_A_Element_Node) return League.Strings.Universal_String; overriding procedure Enter_Node (Self : not null access Draw_A_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); overriding procedure Leave_Node (Self : not null access Draw_A_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); overriding procedure Visit_Node (Self : not null access Draw_A_Element_Node; Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); end Matreshka.ODF_Draw.A_Elements;
strenkml/EE368
Ada
6,209
adb
with Ada.Command_Line; use Ada.Command_Line; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_IO; use Ada.Text_IO; with Memory; use Memory; with Parser; with Device; with Benchmark; use Benchmark; with Benchmark_Runner; use Benchmark_Runner; with Benchmark.Heap; with Benchmark.Trace; with Benchmark.Stride; with Benchmark.Hash; with Benchmark.Matrix.MM; with Benchmark.Matrix.Cholesky; with Benchmark.Matrix.LU; with Benchmark.QSort; with Benchmark.Tree; with Test; with Util; use Util; procedure MemSim is mem : Memory_Pointer := null; runner : Runner_Type; arg : Positive := 1; type Benchmark_Constructor_Type is access function return Benchmark.Benchmark_Pointer; type Benchmark_Info_Type is record name : Unbounded_String; usage : Unbounded_String; constructor : Benchmark_Constructor_Type; end record; type Benchmark_Info_Array is array(Natural range <>) of Benchmark_Info_Type; function BM_Entry(name : String; usage : String; constructor : Benchmark_Constructor_Type) return Benchmark_Info_Type is begin return Benchmark_Info_Type'(To_Unbounded_String(name), To_Unbounded_String(usage), constructor); end BM_Entry; benchmark_map : constant Benchmark_Info_Array := ( BM_Entry("cholesky", "[size=256][iterations=1][spacing=0]", Benchmark.Matrix.Cholesky.Create_Cholesky'Access), BM_Entry("hash", "[size=1024][iterations=1000][spacing=0][seed=15]", Benchmark.Hash.Create_Hash'Access), BM_Entry("heap", "[size=1024][spacing=0][seed=15]", Benchmark.Heap.Create_Heap'Access), BM_Entry("lu", "[size=256][iterations=1][spacing=0]", Benchmark.Matrix.LU.Create_LU'Access), BM_Entry("mm", "[size=256][iterations=1][spacing=0][seed=15]", Benchmark.Matrix.MM.Create_MM'Access), BM_Entry("qsort", "[size=1024][iterations=1][spacing=0][seed=15]", Benchmark.QSort.Create_QSort'Access), BM_Entry("stride", "[size=1024][iterations=1000][stride=1][spacing=0]", Benchmark.Stride.Create_Stride'Access), BM_Entry("trace", "[file=trace.txt][spacing=0]", Benchmark.Trace.Create_Trace'Access), BM_Entry("tree", "[size=1024][iterations=10000][spacing=0]", Benchmark.Tree.Create_Tree'Access) ); procedure Show_Usage is begin Put_Line("usage: " & Command_Name & " [options] " & "<memory> {<benchmark> [<options>]}"); Put_Line("options:"); Put_Line(" -addr_bits <n> Number of address bits"); Put_Line(" -device <d> Device type (asic, virtex6, ...)"); Put_Line("benchmarks:"); for i in benchmark_map'First .. benchmark_map'Last loop Put_Line(" " & To_String(benchmark_map(i).name & " " & To_String(benchmark_map(i).usage))); end loop; Put_Line(" show"); end Show_Usage; begin -- Run the tests if requested. if Argument_Count = 1 and then Argument(1) = "test" then Test.Run_Tests; return; end if; -- Parse options. Parse_Options: while arg < Argument_Count loop begin if Argument(arg) = "-addr_bits" then Device.Set_Address_Bits(Positive'Value(Argument(arg + 1))); arg := arg + 2; elsif Argument(arg) = "-device" then Device.Set_Device(Argument(arg + 1)); arg := arg + 2; else exit Parse_Options; end if; exception when others => Put_Line("error: invalid option value"); return; end; end loop Parse_Options; -- Check if we are to show the memory. if arg + 1 = Argument_Count and then Argument(arg + 1) = "show" then mem := Parser.Parse(Argument(arg)); if mem = null then Put_Line("error: could not open memory: " & Argument(arg)); return; end if; Put_Line("Max Path:" & Natural'Image(Get_Max_Length(mem))); Put_Line("Cost:" & Cost_Type'Image(Get_Cost(mem.all))); Destroy(mem); return; end if; -- Make sure we have enough arguments to specify a memory and benchmark. if arg >= Argument_Count then Show_Usage; return; end if; -- Parse the memory file. Parse_Memory: declare memory_file : constant String := Argument(arg); begin mem := Parser.Parse(memory_file); if mem = null then Put_Line("error: could not open memory: " & memory_file); return; end if; end Parse_Memory; arg := arg + 1; -- Parse benchmarks. Parse_Benchmarks: declare bp : Benchmark_Pointer := null; begin for i in arg .. Argument_Count loop -- If this is a benchmark name, create a new benchmark. for b in benchmark_map'First .. benchmark_map'Last loop if benchmark_map(b).name = Argument(i) then bp := benchmark_map(b).constructor.all; Register_Benchmark(runner, bp); goto Parsed_Argument; end if; end loop; -- If we get here, this argument is not a benchmark. -- First we need to make sure we actually have a benchmark. if bp = null then Put_Line("error: invalid benchmark: " & Argument(i)); return; end if; -- If we get here, this is an argument to the current benchmark. begin Benchmark.Set_Argument(bp.all, Argument(i)); exception when Benchmark.Invalid_Argument => Put_Line("error: invalid argument: " & Argument(i)); return; end; <<Parsed_Argument>> null; end loop; end Parse_Benchmarks; Run(runner, mem); Destroy(mem); end MemSim;
reznikmm/matreshka
Ada
14,163
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2010-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ package body AMF is use type League.Strings.Universal_String; --------- -- "<" -- --------- function "<" (Left : Optional_String; Right : Optional_String) return Boolean is begin if Left.Is_Empty xor Right.Is_Empty then return Left.Is_Empty; elsif Left.Is_Empty or Right.Is_Empty then return False; else return Left.Value < Right.Value; end if; end "<"; --------- -- "<" -- --------- function "<" (Left : Optional_String; Right : League.Strings.Universal_String) return Boolean is begin if Left.Is_Empty then return True; else return Left.Value < Right; end if; end "<"; --------- -- "<" -- --------- function "<" (Left : League.Strings.Universal_String; Right : Optional_String) return Boolean is begin if Right.Is_Empty then return False; else return Left < Right.Value; end if; end "<"; --------- -- "<" -- --------- function "<" (Left : Unlimited_Natural; Right : Unlimited_Natural) return Boolean is begin if Left.Unlimited xor Right.Unlimited then return Left.Unlimited < Right.Unlimited; elsif Left.Unlimited or Right.Unlimited then return False; else return Left.Value < Right.Value; end if; end "<"; --------- -- "<" -- --------- function "<" (Left : Unlimited_Natural; Right : Integer) return Boolean is begin if Left.Unlimited then return False; else return Left.Value < Right; end if; end "<"; --------- -- "<" -- --------- function "<" (Left : Integer; Right : Unlimited_Natural) return Boolean is begin if Right.Unlimited then return True; else return Left < Right.Value; end if; end "<"; ---------- -- "<=" -- ---------- function "<=" (Left : Optional_String; Right : Optional_String) return Boolean is begin if Left.Is_Empty xor Right.Is_Empty then return Left.Is_Empty; elsif Left.Is_Empty or Right.Is_Empty then return True; else return Left.Value <= Right.Value; end if; end "<="; ---------- -- "<=" -- ---------- function "<=" (Left : Optional_String; Right : League.Strings.Universal_String) return Boolean is begin if Left.Is_Empty then return True; else return Left.Value <= Right; end if; end "<="; ---------- -- "<=" -- ---------- function "<=" (Left : League.Strings.Universal_String; Right : Optional_String) return Boolean is begin if Right.Is_Empty then return False; else return Left <= Right.Value; end if; end "<="; ---------- -- "<=" -- ---------- function "<=" (Left : Unlimited_Natural; Right : Unlimited_Natural) return Boolean is begin if Left.Unlimited xor Right.Unlimited then return Left.Unlimited < Right.Unlimited; elsif Left.Unlimited or Right.Unlimited then return True; else return Left.Value <= Right.Value; end if; end "<="; ---------- -- "<=" -- ---------- function "<=" (Left : Unlimited_Natural; Right : Integer) return Boolean is begin if Left.Unlimited then return False; else return Left.Value <= Right; end if; end "<="; ---------- -- "<=" -- ---------- function "<=" (Left : Integer; Right : Unlimited_Natural) return Boolean is begin if Right.Unlimited then return True; else return Left <= Right.Value; end if; end "<="; --------- -- "=" -- --------- function "=" (Left : Optional_String; Right : Optional_String) return Boolean is begin if Left.Is_Empty xor Right.Is_Empty then return False; elsif Left.Is_Empty then return True; else return Left.Value = Right.Value; end if; end "="; --------- -- "=" -- --------- function "=" (Left : Optional_String; Right : League.Strings.Universal_String) return Boolean is begin if Left.Is_Empty then return False; else return Left.Value = Right; end if; end "="; --------- -- "=" -- --------- function "=" (Left : League.Strings.Universal_String; Right : Optional_String) return Boolean is begin if Right.Is_Empty then return False; else return Left = Right.Value; end if; end "="; --------- -- "=" -- --------- function "=" (Left : Integer; Right : Unlimited_Natural) return Boolean is begin return not Right.Unlimited and then Left = Right.Value; end "="; --------- -- "=" -- --------- function "=" (Left : Unlimited_Natural; Right : Integer) return Boolean is begin return not Left.Unlimited and then Left.Value = Right; end "="; --------- -- "=" -- --------- function "=" (Left : Optional_Integer; Right : Integer) return Boolean is begin return not Left.Is_Empty and then Left.Value = Right; end "="; --------- -- "=" -- --------- function "=" (Left : Integer; Right : Optional_Integer) return Boolean is begin return not Right.Is_Empty and then Left = Right.Value; end "="; --------- -- "=" -- --------- function "=" (Left : Optional_Unlimited_Natural; Right : Unlimited_Natural) return Boolean is begin return not Left.Is_Empty and then Left.Value = Right; end "="; --------- -- "=" -- --------- function "=" (Left : Unlimited_Natural; Right : Optional_Unlimited_Natural) return Boolean is begin return not Right.Is_Empty and then Left = Right.Value; end "="; --------- -- "=" -- --------- function "=" (Left : Optional_Unlimited_Natural; Right : Optional_Integer) return Boolean is begin return (Left.Is_Empty and Right.Is_Empty) or (not Left.Is_Empty and then not Right.Is_Empty and then Left.Value = Right.Value); end "="; --------- -- "=" -- --------- function "=" (Left : Optional_Integer; Right : Optional_Unlimited_Natural) return Boolean is begin return (Left.Is_Empty and Right.Is_Empty) or (not Left.Is_Empty and then not Right.Is_Empty and then Left.Value = Right.Value); end "="; --------- -- "=" -- --------- function "=" (Left : Optional_Unlimited_Natural; Right : Integer) return Boolean is begin return not Left.Is_Empty and then Left.Value = Right; end "="; --------- -- "=" -- --------- function "=" (Left : Integer; Right : Optional_Unlimited_Natural) return Boolean is begin return not Right.Is_Empty and then Left = Right.Value; end "="; --------- -- ">" -- --------- function ">" (Left : Optional_String; Right : Optional_String) return Boolean is begin if Left.Is_Empty xor Right.Is_Empty then return Right.Is_Empty; elsif Left.Is_Empty or Right.Is_Empty then return False; else return Left.Value > Right.Value; end if; end ">"; --------- -- ">" -- --------- function ">" (Left : Optional_String; Right : League.Strings.Universal_String) return Boolean is begin if Left.Is_Empty then return False; else return Left.Value > Right; end if; end ">"; --------- -- ">" -- --------- function ">" (Left : League.Strings.Universal_String; Right : Optional_String) return Boolean is begin if Right.Is_Empty then return True; else return Left > Right.Value; end if; end ">"; --------- -- ">" -- --------- function ">" (Left : Unlimited_Natural; Right : Unlimited_Natural) return Boolean is begin if Left.Unlimited xor Right.Unlimited then return Left.Unlimited > Right.Unlimited; elsif Left.Unlimited or Right.Unlimited then return False; else return Left.Value > Right.Value; end if; end ">"; --------- -- ">" -- --------- function ">" (Left : Unlimited_Natural; Right : Integer) return Boolean is begin if Left.Unlimited then return True; else return Left.Value > Right; end if; end ">"; --------- -- ">" -- --------- function ">" (Left : Integer; Right : Unlimited_Natural) return Boolean is begin if Right.Unlimited then return False; else return Left > Right.Value; end if; end ">"; ---------- -- ">=" -- ---------- function ">=" (Left : Optional_String; Right : Optional_String) return Boolean is begin if Left.Is_Empty xor Right.Is_Empty then return Right.Is_Empty; elsif Left.Is_Empty or Right.Is_Empty then return True; else return Left.Value >= Right.Value; end if; end ">="; ---------- -- ">=" -- ---------- function ">=" (Left : Optional_String; Right : League.Strings.Universal_String) return Boolean is begin if Left.Is_Empty then return False; else return Left.Value >= Right; end if; end ">="; ---------- -- ">=" -- ---------- function ">=" (Left : League.Strings.Universal_String; Right : Optional_String) return Boolean is begin if Right.Is_Empty then return True; else return Left >= Right.Value; end if; end ">="; ---------- -- ">=" -- ---------- function ">=" (Left : Unlimited_Natural; Right : Unlimited_Natural) return Boolean is begin if Left.Unlimited xor Right.Unlimited then return Left.Unlimited > Right.Unlimited; elsif Left.Unlimited or Right.Unlimited then return True; else return Left.Value >= Right.Value; end if; end ">="; ---------- -- ">=" -- ---------- function ">=" (Left : Unlimited_Natural; Right : Integer) return Boolean is begin if Left.Unlimited then return True; else return Left.Value >= Right; end if; end ">="; ---------- -- ">=" -- ---------- function ">=" (Left : Integer; Right : Unlimited_Natural) return Boolean is begin if Right.Unlimited then return False; else return Left >= Right.Value; end if; end ">="; end AMF;
reznikmm/matreshka
Ada
3,694
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Elements; package ODF.DOM.Table_Error_Message_Elements is pragma Preelaborate; type ODF_Table_Error_Message is limited interface and XML.DOM.Elements.DOM_Element; type ODF_Table_Error_Message_Access is access all ODF_Table_Error_Message'Class with Storage_Size => 0; end ODF.DOM.Table_Error_Message_Elements;
reznikmm/matreshka
Ada
7,347
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; package body League.Objects.Impl is -------------- -- Children -- -------------- overriding function Children (Self : not null access constant Object_Impl) return League.Objects.Object_Access_Array is Result : League.Objects.Object_Access_Array (1 .. Self.Children_Count); Last : Natural := 0; Current : Object_Impl_Access := Self.First_Child; begin while Current /= null loop Last := Last + 1; Result (Last) := League.Objects.Object_Access (Current); Current := Current.Next_Sibling; end loop; return Result; end Children; ------------------ -- Constructors -- ------------------ package body Constructors is ---------------- -- Initialize -- ---------------- procedure Initialize (Self : not null access Object_Impl'Class; Parent : access League.Objects.Object'Class := null) is begin -- Set object's parent. Self.Set_Parent (Parent); end Initialize; end Constructors; --------------- -- Destroyed -- --------------- overriding function Destroyed (Self : not null access Object_Impl) return League.Signals.Signal is begin return Self.Destroyed.Signal; end Destroyed; -------------- -- Finalize -- -------------- overriding procedure Finalize (Self : in out Object_Impl) is procedure Free is new Ada.Unchecked_Deallocation (Object_Impl'Class, Object_Impl_Access); Child : Object_Impl_Access; begin -- Notify about object destruction. Self.Destroyed.Emit; -- Disconnect signal-slot connections. Matreshka.Internals.Signals.Disconnect (Self.Connections); -- Destroy all children. Note, child removes itself from the parent's -- list of children byself. while Self.First_Child /= null loop Child := Self.First_Child; Free (Child); end loop; -- Remove object from parent's list of children. if Self.Parent /= null then if Self.Previous_Sibling /= null then Self.Previous_Sibling.Next_Sibling := Self.Next_Sibling; else Self.Parent.First_Child := Self.Next_Sibling; end if; if Self.Next_Sibling /= null then Self.Next_Sibling.Previous_Sibling := Self.Previous_Sibling; else Self.Parent.Last_Child := Self.Previous_Sibling; end if; Self.Next_Sibling := null; Self.Previous_Sibling := null; end if; -- Call user defined Finalize procedure. Finalize (Object_Impl'Class (Self)'Access); end Finalize; ------------ -- Parent -- ------------ overriding function Parent (Self : not null access Object_Impl) return League.Objects.Object_Access is begin return League.Objects.Object_Access (Self.Parent); end Parent; ---------------- -- Set_Parent -- ---------------- overriding procedure Set_Parent (Self : not null access Object_Impl; Parent : access League.Objects.Object'Class) is P_Self : constant not null Object_Impl_Access := Object_Impl_Access (Self); P_Parent : constant Object_Impl_Access := Object_Impl_Access (Parent); begin if Self.Parent /= null then raise Program_Error; end if; if Parent /= null then Self.Parent := P_Parent; if P_Parent.First_Child = null then P_Parent.First_Child := P_Self; P_Parent.Last_Child := P_Self; P_Parent.Children_Count := 1; else P_Self.Previous_Sibling := P_Parent.Last_Child; P_Self.Previous_Sibling.Next_Sibling := P_Self; P_Parent.Last_Child := P_Self; P_Parent.Children_Count := P_Parent.Children_Count + 1; end if; end if; end Set_Parent; end League.Objects.Impl;
ekoeppen/STM32_Generic_Ada_Drivers
Ada
998
ads
with STM32_SVD; use STM32_SVD; with STM32GD.Clock; with STM32GD.Clock.Tree; generic USART : STM32GD.USART.USART_Instance; Speed : UInt32; with package Clock_Tree is new STM32GD.Clock.Tree (<>); Clock : STM32GD.Clock.Clock_Type; RX_DMA_Buffer_Size : in Natural := 0; package STM32GD.USART.Peripheral is pragma Preelaborate; RX_DMA_Buffer: array (1 .. RX_DMA_Buffer_Size) of Byte; procedure Init; procedure Enable; procedure Disable; procedure Transmit (Data : in Byte); function Receive return Byte; function Data_Available return Boolean; procedure DMA_Transmit (Data : in USART_Data; Count : in Natural); procedure DMA_Receive (Data : out USART_Data; Count : out Natural); function DMA_Receive (Delimiter : in Byte; Data : out USART_Data; Data_Index : in out Natural) return Boolean; procedure DMA_Receive (Delimiter : Byte; Data : out USART_Data; Count : out Natural); function DMA_Receive return Byte; end STM32GD.USART.Peripheral;
zhmu/ananas
Ada
170
ads
generic type Component_T is private; package Generic_Inst13_Pkg is type T is private; private type T is array (Boolean) of Component_T; end Generic_Inst13_Pkg;
rogermc2/GA_Ada
Ada
2,278
ads
with Ada.Containers.Vectors; with GL.Objects.Programs; with GL.Types; with GA_Maths; with Multivectors; package Geosphere is -- some very ancient code to compute a triangulated sphere use Multivectors; type Geosphere is private; type Indices is array (1 .. 3) of integer; Geosphere_Exception : Exception; procedure Add_To_Sphere_List (Sphere : Geosphere); procedure Draw_Sphere_List (Render_Program : GL.Objects.Programs.Program; Normal : GL.Types.Single := 0.0); procedure GS_Compute (Sphere : in out Geosphere; Depth : integer); procedure GS_Draw (Render_Program : GL.Objects.Programs.Program; Sphere : Geosphere; Normal : GL.Types.Single := 0.0); procedure New_Sphere_List (Sphere : Geosphere); private subtype Int3_Range is Integer range 1 .. 3; subtype Int4_Range is Integer range 1 .. 4; subtype Contour_Intersect_Array is GA_Maths.Integer_Array (Int3_Range); subtype Contour_Visited_Array is GA_Maths.Integer_Array (Int3_Range); subtype Neighbour_Array is GA_Maths.Integer_Array (Int3_Range); subtype Indices_Vector is GA_Maths.Integer_Array (Int3_Range); type Child_Array is array (Int4_Range) of Integer; type Geosphere_Face is record Indices : Indices_Vector := (-1, -1, -1); -- Three indices into Vertices vector Child : Child_Array := (-1, -1, -1, -1); Plane : Multivectors.Bivector; D : float := 0.0; Depth : integer := 0; Neighbour : Neighbour_Array := (-1, -1, -1); Contour_Intersect : Contour_Intersect_Array := (-1, -1, -1); Contour_Visited : Contour_Visited_Array := (-1, -1, -1); end record; package Vertex_Vectors is new Ada.Containers.Vectors (Element_Type => Multivectors.M_Vector, Index_Type => Natural); type MV_Vector is new Vertex_Vectors.Vector with null record; package Face_Vectors is new Ada.Containers.Vectors (Element_Type => Geosphere_Face, Index_Type => Positive); type F_Vector is new Face_Vectors.Vector with null record; type Geosphere is record Depth : integer := 0; Vertices : MV_Vector; Faces : F_Vector; end record; end Geosphere;
sungyeon/drake
Ada
2,899
ads
pragma License (Unrestricted); -- implementation unit with System.Storage_Elements; package System.Storage_Barriers is pragma Pure; -- synchronization modes ATOMIC_RELAXED : constant := 0; ATOMIC_CONSUME : constant := 1; ATOMIC_ACQUIRE : constant := 2; ATOMIC_RELEASE : constant := 3; ATOMIC_ACQ_REL : constant := 4; ATOMIC_SEQ_CST : constant := 5; -- ATOMIC_HLE_ACQUIRE : constant := 65536; -- ATOMIC_HLE_RELEASE : constant := 131072; -- atomic 1-bit value type Flag is mod 2; for Flag'Size use 8; pragma Atomic (Flag); function atomic_load ( ptr : not null access constant Flag; memorder : Integer := ATOMIC_ACQUIRE) return Flag with Import, Convention => Intrinsic, External_Name => "__atomic_load_1"; procedure atomic_store ( ptr : not null access Flag; val : Flag; memorder : Integer := ATOMIC_RELEASE) with Import, Convention => Intrinsic, External_Name => "__atomic_store_1"; function atomic_exchange ( ptr : not null access Flag; val : Flag; memorder : Integer := ATOMIC_ACQ_REL) return Flag with Import, Convention => Intrinsic, External_Name => "__atomic_exchange_1"; function atomic_compare_exchange ( ptr : not null access Flag; expected : not null access Flag; desired : Flag; weak : Boolean := False; success_memorder : Integer := ATOMIC_ACQ_REL; failure_memorder : Integer := ATOMIC_ACQUIRE) return Boolean with Import, Convention => Intrinsic, External_Name => "__atomic_compare_exchange_1"; function atomic_test_and_set ( ptr : not null access Flag; memorder : Integer := ATOMIC_ACQ_REL) return Boolean with Import, Convention => Intrinsic, External_Name => "__atomic_test_and_set"; procedure atomic_clear ( ptr : not null access Flag; memorder : Integer := ATOMIC_RELEASE) with Import, Convention => Intrinsic, External_Name => "__atomic_clear"; -- fences procedure atomic_thread_fence ( memorder : Integer := ATOMIC_SEQ_CST) with Import, Convention => Intrinsic, External_Name => "__atomic_thread_fence"; procedure atomic_signal_fence ( memorder : Integer := ATOMIC_SEQ_CST) with Import, Convention => Intrinsic, External_Name => "__atomic_signal_fence"; -- queries function atomic_always_lock_free ( size : Storage_Elements.Storage_Count; ptr : Address) return Boolean with Import, Convention => Intrinsic, External_Name => "__atomic_always_lock_free"; function atomic_is_lock_free ( size : Storage_Elements.Storage_Count; ptr : Address) return Boolean with Import, Convention => Intrinsic, External_Name => "__atomic_is_lock_free"; end System.Storage_Barriers;
reznikmm/matreshka
Ada
4,724
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2009-2011, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This generic package allows to store value of arbitrary integer type in -- the Value. ------------------------------------------------------------------------------ generic type Num is range <>; package League.Holders.Generic_Integers is pragma Preelaborate; Value_Tag : constant Tag; function Element (Self : Holder) return Num; -- Returns internal value. procedure Replace_Element (Self : in out Holder; To : Num); -- Set value. Tag of the value must be set before this call. function To_Holder (Item : Num) return Holder; -- Creates new Value from specified value. private type Integer_Container is new Abstract_Integer_Container with record Value : Num; end record; overriding function Constructor (Is_Empty : not null access Boolean) return Integer_Container; overriding function Get (Self : not null access constant Integer_Container) return Universal_Integer; overriding procedure Set (Self : not null access Integer_Container; To : Universal_Integer); overriding function First (Self : not null access constant Integer_Container) return Universal_Integer; overriding function Last (Self : not null access constant Integer_Container) return Universal_Integer; Value_Tag : constant Tag := Tag (Integer_Container'Tag); end League.Holders.Generic_Integers;
reznikmm/matreshka
Ada
13,605
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with AMF.Internals.UML_Packageable_Elements; with AMF.UML.Dependencies.Collections; with AMF.UML.Expressions; with AMF.UML.Named_Elements; with AMF.UML.Namespaces; with AMF.UML.Packages.Collections; with AMF.UML.Parameterable_Elements; with AMF.UML.String_Expressions; with AMF.UML.Template_Parameters; with AMF.UML.Types; with AMF.UML.Value_Specifications.Collections; with AMF.Visitors; package AMF.Internals.UML_Expressions is type UML_Expression_Proxy is limited new AMF.Internals.UML_Packageable_Elements.UML_Packageable_Element_Proxy and AMF.UML.Expressions.UML_Expression with null record; overriding function Get_Operand (Self : not null access constant UML_Expression_Proxy) return AMF.UML.Value_Specifications.Collections.Ordered_Set_Of_UML_Value_Specification; -- Getter of Expression::operand. -- -- Specifies a sequence of operands. overriding function Get_Symbol (Self : not null access constant UML_Expression_Proxy) return AMF.Optional_String; -- Getter of Expression::symbol. -- -- The symbol associated with the node in the expression tree. overriding procedure Set_Symbol (Self : not null access UML_Expression_Proxy; To : AMF.Optional_String); -- Setter of Expression::symbol. -- -- The symbol associated with the node in the expression tree. overriding function Get_Type (Self : not null access constant UML_Expression_Proxy) return AMF.UML.Types.UML_Type_Access; -- Getter of TypedElement::type. -- -- The type of the TypedElement. -- This information is derived from the return result for this Operation. overriding procedure Set_Type (Self : not null access UML_Expression_Proxy; To : AMF.UML.Types.UML_Type_Access); -- Setter of TypedElement::type. -- -- The type of the TypedElement. -- This information is derived from the return result for this Operation. overriding function Get_Client_Dependency (Self : not null access constant UML_Expression_Proxy) return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency; -- Getter of NamedElement::clientDependency. -- -- Indicates the dependencies that reference the client. overriding function Get_Name_Expression (Self : not null access constant UML_Expression_Proxy) return AMF.UML.String_Expressions.UML_String_Expression_Access; -- Getter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding procedure Set_Name_Expression (Self : not null access UML_Expression_Proxy; To : AMF.UML.String_Expressions.UML_String_Expression_Access); -- Setter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding function Get_Namespace (Self : not null access constant UML_Expression_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Getter of NamedElement::namespace. -- -- Specifies the namespace that owns the NamedElement. overriding function Get_Qualified_Name (Self : not null access constant UML_Expression_Proxy) return AMF.Optional_String; -- Getter of NamedElement::qualifiedName. -- -- A name which allows the NamedElement to be identified within a -- hierarchy of nested Namespaces. It is constructed from the names of the -- containing namespaces starting at the root of the hierarchy and ending -- with the name of the NamedElement itself. overriding function Get_Owning_Template_Parameter (Self : not null access constant UML_Expression_Proxy) return AMF.UML.Template_Parameters.UML_Template_Parameter_Access; -- Getter of ParameterableElement::owningTemplateParameter. -- -- The formal template parameter that owns this element. overriding procedure Set_Owning_Template_Parameter (Self : not null access UML_Expression_Proxy; To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access); -- Setter of ParameterableElement::owningTemplateParameter. -- -- The formal template parameter that owns this element. overriding function Get_Template_Parameter (Self : not null access constant UML_Expression_Proxy) return AMF.UML.Template_Parameters.UML_Template_Parameter_Access; -- Getter of ParameterableElement::templateParameter. -- -- The template parameter that exposes this element as a formal parameter. overriding procedure Set_Template_Parameter (Self : not null access UML_Expression_Proxy; To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access); -- Setter of ParameterableElement::templateParameter. -- -- The template parameter that exposes this element as a formal parameter. overriding function Boolean_Value (Self : not null access constant UML_Expression_Proxy) return AMF.Optional_Boolean; -- Operation ValueSpecification::booleanValue. -- -- The query booleanValue() gives a single Boolean value when one can be -- computed. overriding function Integer_Value (Self : not null access constant UML_Expression_Proxy) return AMF.Optional_Integer; -- Operation ValueSpecification::integerValue. -- -- The query integerValue() gives a single Integer value when one can be -- computed. overriding function Is_Compatible_With (Self : not null access constant UML_Expression_Proxy; P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access) return Boolean; -- Operation ValueSpecification::isCompatibleWith. -- -- The query isCompatibleWith() determines if this parameterable element -- is compatible with the specified parameterable element. By default -- parameterable element P is compatible with parameterable element Q if -- the kind of P is the same or a subtype as the kind of Q. In addition, -- for ValueSpecification, the type must be conformant with the type of -- the specified parameterable element. overriding function Is_Computable (Self : not null access constant UML_Expression_Proxy) return Boolean; -- Operation ValueSpecification::isComputable. -- -- The query isComputable() determines whether a value specification can -- be computed in a model. This operation cannot be fully defined in OCL. -- A conforming implementation is expected to deliver true for this -- operation for all value specifications that it can compute, and to -- compute all of those for which the operation is true. A conforming -- implementation is expected to be able to compute the value of all -- literals. overriding function Is_Null (Self : not null access constant UML_Expression_Proxy) return Boolean; -- Operation ValueSpecification::isNull. -- -- The query isNull() returns true when it can be computed that the value -- is null. overriding function Real_Value (Self : not null access constant UML_Expression_Proxy) return AMF.Optional_Real; -- Operation ValueSpecification::realValue. -- -- The query realValue() gives a single Real value when one can be -- computed. overriding function String_Value (Self : not null access constant UML_Expression_Proxy) return AMF.Optional_String; -- Operation ValueSpecification::stringValue. -- -- The query stringValue() gives a single String value when one can be -- computed. overriding function Unlimited_Value (Self : not null access constant UML_Expression_Proxy) return AMF.Optional_Unlimited_Natural; -- Operation ValueSpecification::unlimitedValue. -- -- The query unlimitedValue() gives a single UnlimitedNatural value when -- one can be computed. overriding function All_Owning_Packages (Self : not null access constant UML_Expression_Proxy) return AMF.UML.Packages.Collections.Set_Of_UML_Package; -- Operation NamedElement::allOwningPackages. -- -- The query allOwningPackages() returns all the directly or indirectly -- owning packages. overriding function Is_Distinguishable_From (Self : not null access constant UML_Expression_Proxy; N : AMF.UML.Named_Elements.UML_Named_Element_Access; Ns : AMF.UML.Namespaces.UML_Namespace_Access) return Boolean; -- Operation NamedElement::isDistinguishableFrom. -- -- The query isDistinguishableFrom() determines whether two NamedElements -- may logically co-exist within a Namespace. By default, two named -- elements are distinguishable if (a) they have unrelated types or (b) -- they have related types but different names. overriding function Namespace (Self : not null access constant UML_Expression_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Operation NamedElement::namespace. -- -- Missing derivation for NamedElement::/namespace : Namespace overriding function Is_Template_Parameter (Self : not null access constant UML_Expression_Proxy) return Boolean; -- Operation ParameterableElement::isTemplateParameter. -- -- The query isTemplateParameter() determines if this parameterable -- element is exposed as a formal template parameter. overriding procedure Enter_Element (Self : not null access constant UML_Expression_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Leave_Element (Self : not null access constant UML_Expression_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Visit_Element (Self : not null access constant UML_Expression_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of iterator interface. end AMF.Internals.UML_Expressions;
onox/sdlada
Ada
1,413
adb
-------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2018 Luke A. Guest -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- -- 3. This notice may not be removed or altered from any source -- distribution. -------------------------------------------------------------------------------------------------------------------- -- Mac OS X implementation. -------------------------------------------------------------------------------------------------------------------- separate (SDL.Platform) function Get return Platforms is begin return Mac_OS_X; end Get;
optikos/oasis
Ada
8,062
adb
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- package body Program.Nodes.Block_Statements is function Create (Statement_Identifier : Program.Elements.Defining_Identifiers .Defining_Identifier_Access; Colon_Token : Program.Lexical_Elements .Lexical_Element_Access; Declare_Token : Program.Lexical_Elements .Lexical_Element_Access; Declarations : Program.Element_Vectors.Element_Vector_Access; Begin_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Statements : not null Program.Element_Vectors .Element_Vector_Access; Exception_Token : Program.Lexical_Elements .Lexical_Element_Access; Exception_Handlers : Program.Elements.Exception_Handlers .Exception_Handler_Vector_Access; End_Token : not null Program.Lexical_Elements .Lexical_Element_Access; End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access; Semicolon_Token : not null Program.Lexical_Elements .Lexical_Element_Access) return Block_Statement is begin return Result : Block_Statement := (Statement_Identifier => Statement_Identifier, Colon_Token => Colon_Token, Declare_Token => Declare_Token, Declarations => Declarations, Begin_Token => Begin_Token, Statements => Statements, Exception_Token => Exception_Token, Exception_Handlers => Exception_Handlers, End_Token => End_Token, End_Statement_Identifier => End_Statement_Identifier, Semicolon_Token => Semicolon_Token, Enclosing_Element => null) do Initialize (Result); end return; end Create; function Create (Statement_Identifier : Program.Elements.Defining_Identifiers .Defining_Identifier_Access; Declarations : Program.Element_Vectors.Element_Vector_Access; Statements : not null Program.Element_Vectors .Element_Vector_Access; Exception_Handlers : Program.Elements.Exception_Handlers .Exception_Handler_Vector_Access; End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Block_Statement is begin return Result : Implicit_Block_Statement := (Statement_Identifier => Statement_Identifier, Declarations => Declarations, Statements => Statements, Exception_Handlers => Exception_Handlers, End_Statement_Identifier => End_Statement_Identifier, Is_Part_Of_Implicit => Is_Part_Of_Implicit, Is_Part_Of_Inherited => Is_Part_Of_Inherited, Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null) do Initialize (Result); end return; end Create; overriding function Statement_Identifier (Self : Base_Block_Statement) return Program.Elements.Defining_Identifiers .Defining_Identifier_Access is begin return Self.Statement_Identifier; end Statement_Identifier; overriding function Declarations (Self : Base_Block_Statement) return Program.Element_Vectors.Element_Vector_Access is begin return Self.Declarations; end Declarations; overriding function Statements (Self : Base_Block_Statement) return not null Program.Element_Vectors.Element_Vector_Access is begin return Self.Statements; end Statements; overriding function Exception_Handlers (Self : Base_Block_Statement) return Program.Elements.Exception_Handlers .Exception_Handler_Vector_Access is begin return Self.Exception_Handlers; end Exception_Handlers; overriding function End_Statement_Identifier (Self : Base_Block_Statement) return Program.Elements.Identifiers.Identifier_Access is begin return Self.End_Statement_Identifier; end End_Statement_Identifier; overriding function Colon_Token (Self : Block_Statement) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Colon_Token; end Colon_Token; overriding function Declare_Token (Self : Block_Statement) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Declare_Token; end Declare_Token; overriding function Begin_Token (Self : Block_Statement) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Begin_Token; end Begin_Token; overriding function Exception_Token (Self : Block_Statement) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Exception_Token; end Exception_Token; overriding function End_Token (Self : Block_Statement) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.End_Token; end End_Token; overriding function Semicolon_Token (Self : Block_Statement) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Semicolon_Token; end Semicolon_Token; overriding function Is_Part_Of_Implicit (Self : Implicit_Block_Statement) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; overriding function Is_Part_Of_Inherited (Self : Implicit_Block_Statement) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; overriding function Is_Part_Of_Instance (Self : Implicit_Block_Statement) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; procedure Initialize (Self : aliased in out Base_Block_Statement'Class) is begin if Self.Statement_Identifier.Assigned then Set_Enclosing_Element (Self.Statement_Identifier, Self'Unchecked_Access); end if; for Item in Self.Declarations.Each_Element loop Set_Enclosing_Element (Item.Element, Self'Unchecked_Access); end loop; for Item in Self.Statements.Each_Element loop Set_Enclosing_Element (Item.Element, Self'Unchecked_Access); end loop; for Item in Self.Exception_Handlers.Each_Element loop Set_Enclosing_Element (Item.Element, Self'Unchecked_Access); end loop; if Self.End_Statement_Identifier.Assigned then Set_Enclosing_Element (Self.End_Statement_Identifier, Self'Unchecked_Access); end if; null; end Initialize; overriding function Is_Block_Statement_Element (Self : Base_Block_Statement) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Block_Statement_Element; overriding function Is_Statement_Element (Self : Base_Block_Statement) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Statement_Element; overriding procedure Visit (Self : not null access Base_Block_Statement; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin Visitor.Block_Statement (Self); end Visit; overriding function To_Block_Statement_Text (Self : aliased in out Block_Statement) return Program.Elements.Block_Statements.Block_Statement_Text_Access is begin return Self'Unchecked_Access; end To_Block_Statement_Text; overriding function To_Block_Statement_Text (Self : aliased in out Implicit_Block_Statement) return Program.Elements.Block_Statements.Block_Statement_Text_Access is pragma Unreferenced (Self); begin return null; end To_Block_Statement_Text; end Program.Nodes.Block_Statements;
zyron92/banana_tree_generator
Ada
1,835
ads
with Parseur; use Parseur; package Geometry_Helpers is function Milieu (P1, P2: in Coord_Point) return Coord_Point; --Retourne le milieu de deux points function Longueur_Arrete(Coord_S_D, Coord_S_A: in Coord_Point) return Float; --Retourne la longueur de l'arète (en générale, segment) function A_Droite (P1,P2: Coord_Point) return Boolean; --Retourne Vrai si Point1 se situe à droite du Point2 function En_Haut (P1,P2: Coord_Point) return Boolean; --Retourne Vrai si Point1 se situe au dessus du Point2 (sur le plan svg le visuel est inversé) function Angle_Incident_Arrete(Coord_S_D, Mid: in Coord_Point; Longueur: in Float) return Float; --Retourne L'angle incident de l'arète à l'axe X sur le plan svg function Oppose(Angle1, Angle2, Hypotenus : in Float) return Float; --Retourne l'opposé du triangle-rectangle en donnant l'angle entre l'hypotenuse et l'adjacent, et l'hypotenuse function Adjacent(Angle1, Angle2, Hypotenus : in Float) return Float; --Retourne l'adjacent du triangle-rectangle en donnant l'angle entre l'hypotenuse et l'adjacent, et l'hypotenuse function En_Radian(Deg: in Float) return Float; --Conversion d'un angle de degré vers radian function Vecteur(P1,P2: in Coord_Point) return Coord_Point; --Retourne le vecteur(P1,P2) (autrement dit, de Point1 vers Point2) sous coordonnées x,y function Angle_Intersection_Arrete(V1,V2, P1,P2,P3: in Coord_Point; Sens_Trigo: in Boolean) return Float; --Retourne l'angle d'intersection (en degré) entre Vecteur1(Arète1,P1->P2) et Vecteur2(Arète2,P1->P3) function Meme_Point(P1,P2: in Coord_Point) return Boolean; --Retourne True si P1 et P2 se trouve aux mêmes coordonnées end Geometry_Helpers;
dshadrin/AProxy
Ada
5,927
adb
---------------------------------------- -- Copyright (C) 2019 Dmitriy Shadrin -- -- All rights reserved. -- ---------------------------------------- with Formatted_Output; use Formatted_Output; with Logging_Message; use Logging_Message; with TimeStamp; with Sinks; with Ada.Strings.Unbounded; with Ada.Unchecked_Deallocation; with Formatted_Output; use Formatted_Output; with Formatted_Output.Enumeration_Output; ------------------------------------------------------------------------------------------------------------------------ package body Logging is LOG_OUTPUT_DELAY_MS : constant Integer := 2500; LOG_OUTPUT_TIMER_PERIOD : constant Duration := 1.5; --------------------------------------------------------------------------------------------------------------------- procedure SendLogMessage (msg : LogMessage) is begin if loggerInstance.isWorked then if msg.Get.lchannel /= LOG_UNKNOWN_CHANNEL then loggerInstance.logs.Push (msg); else -- LOG_WARN ("LOG ", "Skip log message with unknown channel"); null; end if; end if; end SendLogMessage; ----------------------------------------------------------------------------- protected body LogRecords is -------------------------------------------------------------------------- entry Push (item : in LogMessage) when true is begin if isWorked then messages.Insert (item); else requeue Discard; end if; end Push; -------------------------------------------------------------------------- entry Pop (items : in Sinks.LogMessages) when true is use type TimeStamp.timespec; tm_stamp : TimeStamp.timespec := TimeStamp.GetTimestamp; lm : LogMessage; begin if isWorked and then not messages.Is_Empty then TimeStamp.TimestampAdjust (tm_stamp, -LOG_OUTPUT_DELAY_MS); lm := messages.First_Element; while lm.Get.tm_stamp < tm_stamp loop items.Get.Append (lm); messages.Delete_First; exit when messages.Is_Empty; lm := messages.First_Element; end loop; end if; end Pop; -------------------------------------------------------------------------- entry WaitEmpty when messages.Is_Empty is begin isWorked := false; end WaitEmpty; -------------------------------------------------------------------------- entry Discard when true is begin null; end Discard; end LogRecords; ----------------------------------------------------------------------------- task body LogMultiplexer is sArray : aliased SinksArray; sArraySize : Pal.uint32_t := 0; isWorked : Pal.bool := true; begin accept Start (cfg : in ConfigTree.NodePtr) do CreateSinks (sArray'Access, sArraySize, cfg.GetChild ("sinks")); end Start; while isWorked loop select accept Stop do isWorked := false; for i in sArray'First .. sArraySize loop Sinks.Close (sArray (i)'Access); end loop; end Stop; else delay LOG_OUTPUT_TIMER_PERIOD; if Pal.Atomic_Load_32 (Sinks.activeSinksCounter'Access) = 0 then declare vec : Sinks.LogMessages := Sinks.LogsSP.Make_Shared (new Sinks.LogsVector.Vector); val : Pal.uint32_t := 0; begin loggerInstance.logs.Pop (vec); if not vec.Get.Is_Empty then for i in sArray'First .. sArraySize loop val := Pal.Atomic_Add_Fetch_32 (Sinks.activeSinksCounter'Access, 1); Sinks.WriteLogs (sArray (i)'Access, vec); end loop; end if; end; end if; end select; end loop; end LogMultiplexer; ----------------------------------------------------------------------------- procedure Init (lg : in out Logger; cfg : in ConfigTree.NodePtr) is begin lg.mp.Start (cfg); end Init; ----------------------------------------------------------------------------- procedure CreateSinks (sArray : access SinksArray; sArraySize : in out Pal.uint32_t; cfg : in ConfigTree.NodePtr) is use Ada.Strings.Unbounded; nd : ConfigTree.NodePtr := cfg.GetFirst; str : Unbounded_String; begin while not ConfigTree.IsNull (nd) loop str := To_Unbounded_String ( nd.GetValue ("name")); sArraySize := sArraySize + 1; Sinks.MakeSink (sArray (sArraySize), To_String (str), nd); nd := nd.GetNext; end loop; end CreateSinks; ----------------------------------------------------------------------------- function StartLogger (cfg : in ConfigTree.NodePtr) return LoggerPtr is begin Sinks.activeSinksCounter := 0; loggerInstance := new Logger; loggerInstance.isWorked := false; loggerInstance.Init (cfg); loggerInstance.isWorked := true; LOG_INFO ("LOG ", "Start logger"); return loggerInstance; end StartLogger; ----------------------------------------------------------------------------- procedure StopLogger is procedure Free is new Ada.Unchecked_Deallocation (Logger, LoggerPtr); begin LOG_INFO ("LOG ", "Stop logger"); loggerInstance.isWorked := false; loggerInstance.logs.WaitEmpty; loggerInstance.mp.Stop; Free (loggerInstance); end StopLogger; end Logging;
persan/A-gst
Ada
18,960
ads
pragma Ada_2005; pragma Style_Checks (Off); pragma Warnings (Off); with Interfaces.C; use Interfaces.C; with glib; with glib.Values; with System; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstelement_h; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstsegment_h; -- limited -- with GStreamer.GST_Low_Level.glib_2_0_glib_gthread_h; with System; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstquery_h; with glib; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h; package GStreamer.GST_Low_Level.gstreamer_0_10_gst_base_gstbasetransform_h is -- unsupported macro: GST_TYPE_BASE_TRANSFORM (gst_base_transform_get_type()) -- arg-macro: function GST_BASE_TRANSFORM (obj) -- return G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASE_TRANSFORM,GstBaseTransform); -- arg-macro: function GST_BASE_TRANSFORM_CLASS (klass) -- return G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BASE_TRANSFORM,GstBaseTransformClass); -- arg-macro: function GST_BASE_TRANSFORM_GET_CLASS (obj) -- return G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_BASE_TRANSFORM,GstBaseTransformClass); -- arg-macro: function GST_IS_BASE_TRANSFORM (obj) -- return G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_TRANSFORM); -- arg-macro: function GST_IS_BASE_TRANSFORM_CLASS (klass) -- return G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_TRANSFORM); -- arg-macro: function GST_BASE_TRANSFORM_CAST (obj) -- return (GstBaseTransform *)(obj); GST_BASE_TRANSFORM_SINK_NAME : aliased constant String := "sink" & ASCII.NUL; -- gst/base/gstbasetransform.h:42 GST_BASE_TRANSFORM_SRC_NAME : aliased constant String := "src" & ASCII.NUL; -- gst/base/gstbasetransform.h:48 -- arg-macro: function GST_BASE_TRANSFORM_SRC_PAD (obj) -- return GST_BASE_TRANSFORM_CAST (obj).srcpad; -- arg-macro: function GST_BASE_TRANSFORM_SINK_PAD (obj) -- return GST_BASE_TRANSFORM_CAST (obj).sinkpad; -- unsupported macro: GST_BASE_TRANSFORM_FLOW_DROPPED GST_FLOW_CUSTOM_SUCCESS -- arg-macro: procedure GST_BASE_TRANSFORM_LOCK (obj) -- g_mutex_lock (GST_BASE_TRANSFORM_CAST (obj).transform_lock) -- arg-macro: procedure GST_BASE_TRANSFORM_UNLOCK (obj) -- g_mutex_unlock (GST_BASE_TRANSFORM_CAST (obj).transform_lock) -- GStreamer -- * Copyright (C) 1999,2000 Erik Walthinsen <[email protected]> -- * 2005 Wim Taymans <[email protected]> -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Library General Public -- * License as published by the Free Software Foundation; either -- * version 2 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Library General Public License for more details. -- * -- * You should have received a copy of the GNU Library General Public -- * License along with this library; if not, write to the -- * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- * Boston, MA 02111-1307, USA. -- -- since 0.10.4 --* -- * GST_BASE_TRANSFORM_SINK_NAME: -- * -- * The name of the templates for the sink pad. -- --* -- * GST_BASE_TRANSFORM_SRC_NAME: -- * -- * The name of the templates for the source pad. -- --* -- * GST_BASE_TRANSFORM_SRC_PAD: -- * @obj: base transform instance -- * -- * Gives the pointer to the source #GstPad object of the element. -- * -- * Since: 0.10.4 -- --* -- * GST_BASE_TRANSFORM_SINK_PAD: -- * @obj: base transform instance -- * -- * Gives the pointer to the sink #GstPad object of the element. -- * -- * Since: 0.10.4 -- --* -- * GST_BASE_TRANSFORM_FLOW_DROPPED: -- * -- * A #GstFlowReturn that can be returned from transform and transform_ip to -- * indicate that no output buffer was generated. -- * -- * Since: 0.10.13 -- --* -- * GST_BASE_TRANSFORM_LOCK: -- * @obj: base transform instance -- * -- * Obtain a lock to protect the transform function from concurrent access. -- * -- * Since: 0.10.13 -- --* -- * GST_BASE_TRANSFORM_UNLOCK: -- * @obj: base transform instance -- * -- * Release the lock that protects the transform function from concurrent access. -- * -- * Since: 0.10.13 -- type GstBaseTransform; type u_GstBaseTransform_u_gst_reserved_array is array (0 .. 18) of System.Address; --subtype GstBaseTransform is u_GstBaseTransform; -- gst/base/gstbasetransform.h:100 type GstBaseTransformClass; type u_GstBaseTransformClass_u_gst_reserved_array is array (0 .. 15) of System.Address; --subtype GstBaseTransformClass is u_GstBaseTransformClass; -- gst/base/gstbasetransform.h:101 -- skipped empty struct u_GstBaseTransformPrivate -- skipped empty struct GstBaseTransformPrivate --* -- * GstBaseTransform: -- * -- * The opaque #GstBaseTransform data structure. -- type GstBaseTransform is record element : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstelement_h.GstElement; -- gst/base/gstbasetransform.h:110 sinkpad : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPad; -- gst/base/gstbasetransform.h:114 srcpad : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPad; -- gst/base/gstbasetransform.h:115 passthrough : aliased GLIB.gboolean; -- gst/base/gstbasetransform.h:118 always_in_place : aliased GLIB.gboolean; -- gst/base/gstbasetransform.h:119 cache_caps1 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; -- gst/base/gstbasetransform.h:121 cache_caps1_size : aliased GLIB.guint; -- gst/base/gstbasetransform.h:122 cache_caps2 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; -- gst/base/gstbasetransform.h:123 cache_caps2_size : aliased GLIB.guint; -- gst/base/gstbasetransform.h:124 have_same_caps : aliased GLIB.gboolean; -- gst/base/gstbasetransform.h:125 delay_configure : aliased GLIB.gboolean; -- gst/base/gstbasetransform.h:127 pending_configure : aliased GLIB.gboolean; -- gst/base/gstbasetransform.h:128 negotiated : aliased GLIB.gboolean; -- gst/base/gstbasetransform.h:129 have_newsegment : aliased GLIB.gboolean; -- gst/base/gstbasetransform.h:131 segment : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstsegment_h.GstSegment; -- gst/base/gstbasetransform.h:134 transform_lock : access GStreamer.GST_Low_Level.glib_2_0_glib_gthread_h.GMutex; -- gst/base/gstbasetransform.h:136 priv : System.Address; -- gst/base/gstbasetransform.h:139 u_gst_reserved : u_GstBaseTransform_u_gst_reserved_array; -- gst/base/gstbasetransform.h:141 end record; pragma Convention (C_Pass_By_Copy, GstBaseTransform); -- gst/base/gstbasetransform.h:109 --< protected > -- source and sink pads -- Set by sub-class -- MT-protected (with STREAM_LOCK) --< private > --* -- * GstBaseTransformClass: -- * @parent_class: Element parent class -- * @transform_caps: Optional. Given the pad in this direction and the given -- * caps, what caps are allowed on the other pad in this -- * element ? -- * @fixate_caps: Optional. Given the pad in this direction and the given -- * caps, fixate the caps on the other pad. -- * @transform_size: Optional. Given the size of a buffer in the given direction -- * with the given caps, calculate the size in bytes of a buffer -- * on the other pad with the given other caps. -- * The default implementation uses get_unit_size and keeps -- * the number of units the same. -- * @get_unit_size: Required if the transform is not in-place. -- * get the size in bytes of one unit for the given caps. -- * @set_caps: allows the subclass to be notified of the actual caps set. -- * @start: Optional. -- * Called when the element starts processing. -- * Allows opening external resources. -- * @stop: Optional. -- * Called when the element stops processing. -- * Allows closing external resources. -- * @transform: Required if the element does not operate in-place. -- * Transforms one incoming buffer to one outgoing buffer. -- * The function is allowed to change size/timestamp/duration -- * of the outgoing buffer. -- * @transform_ip: Required if the element operates in-place. -- * Transform the incoming buffer in-place. -- * @event: Optional. -- * Event handler on the sink pad. This function should return -- * TRUE if the base class should forward the event. -- * @src_event: Optional. -- * Event handler on the source pad. -- * @passthrough_on_same_caps: If set to TRUE, passthrough mode will be -- * automatically enabled if the caps are the same. -- * @prepare_output_buffer: Optional. -- * Subclasses can override this to do their own -- * allocation of output buffers. Elements that only do -- * analysis can return a subbuffer or even just -- * increment the reference to the input buffer (if in -- * passthrough mode) -- * @before_transform: Optional. Since 0.10.22 -- * This method is called right before the base class will -- * start processing. Dynamic properties or other delayed -- * configuration could be performed in this method. -- * @accept_caps: Optional. Since 0.10.30 -- * Subclasses can override this method to check if @caps can be -- * handled by the element. The default implementation might not be -- * the most optimal way to check this in all cases. -- * @query: Optional Since 0.10.36 -- * Handle a requested query. Subclasses that implement this -- * should must chain up to the parent if they didn't handle the -- * query -- * -- * Subclasses can override any of the available virtual methods or not, as -- * needed. At minimum either @transform or @transform_ip need to be overridden. -- * If the element can overwrite the input data with the results (data is of the -- * same type and quantity) it should provide @transform_ip. -- type GstBaseTransformClass is record parent_class : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstelement_h.GstElementClass; -- gst/base/gstbasetransform.h:204 transform_caps : access function (arg1 : access GstBaseTransform; arg2 : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPadDirection; arg3 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; -- gst/base/gstbasetransform.h:211 fixate_caps : access procedure (arg1 : access GstBaseTransform; arg2 : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPadDirection; arg3 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; arg4 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps); -- gst/base/gstbasetransform.h:215 transform_size : access function (arg1 : access GstBaseTransform; arg2 : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPadDirection; arg3 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; arg4 : GLIB.guint; arg5 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; arg6 : access GLIB.guint) return GLIB.gboolean; -- gst/base/gstbasetransform.h:220 get_unit_size : access function (arg1 : access GstBaseTransform; arg2 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; arg3 : access GLIB.guint) return GLIB.gboolean; -- gst/base/gstbasetransform.h:223 set_caps : access function (arg1 : access GstBaseTransform; arg2 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; arg3 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps) return GLIB.gboolean; -- gst/base/gstbasetransform.h:226 start : access function (arg1 : access GstBaseTransform) return GLIB.gboolean; -- gst/base/gstbasetransform.h:228 stop : access function (arg1 : access GstBaseTransform) return GLIB.gboolean; -- gst/base/gstbasetransform.h:229 event : access function (arg1 : access GstBaseTransform; arg2 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h.GstEvent) return GLIB.gboolean; -- gst/base/gstbasetransform.h:231 transform : access function (arg1 : access GstBaseTransform; arg2 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; arg3 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstFlowReturn; -- gst/base/gstbasetransform.h:234 transform_ip : access function (arg1 : access GstBaseTransform; arg2 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstFlowReturn; -- gst/base/gstbasetransform.h:235 passthrough_on_same_caps : aliased GLIB.gboolean; -- gst/base/gstbasetransform.h:238 prepare_output_buffer : access function (arg1 : access GstBaseTransform; arg2 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; arg3 : GLIB.gint; arg4 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; arg5 : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstFlowReturn; -- gst/base/gstbasetransform.h:241 src_event : access function (arg1 : access GstBaseTransform; arg2 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h.GstEvent) return GLIB.gboolean; -- gst/base/gstbasetransform.h:244 before_transform : access procedure (arg1 : access GstBaseTransform; arg2 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer); -- gst/base/gstbasetransform.h:246 accept_caps : access function (arg1 : access GstBaseTransform; arg2 : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPadDirection; arg3 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps) return GLIB.gboolean; -- gst/base/gstbasetransform.h:249 query : access function (arg1 : access GstBaseTransform; arg2 : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPadDirection; arg3 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstquery_h.GstQuery) return GLIB.gboolean; -- gst/base/gstbasetransform.h:251 u_gst_reserved : u_GstBaseTransformClass_u_gst_reserved_array; -- gst/base/gstbasetransform.h:254 end record; pragma Convention (C_Pass_By_Copy, GstBaseTransformClass); -- gst/base/gstbasetransform.h:203 --< public > -- virtual methods for subclasses -- FIXME: When adjusting the padding, move these to nicer places in the class -- src event --< private > function gst_base_transform_get_type return GLIB.GType; -- gst/base/gstbasetransform.h:257 pragma Import (C, gst_base_transform_get_type, "gst_base_transform_get_type"); procedure gst_base_transform_set_passthrough (trans : access GstBaseTransform; passthrough : GLIB.gboolean); -- gst/base/gstbasetransform.h:259 pragma Import (C, gst_base_transform_set_passthrough, "gst_base_transform_set_passthrough"); function gst_base_transform_is_passthrough (trans : access GstBaseTransform) return GLIB.gboolean; -- gst/base/gstbasetransform.h:261 pragma Import (C, gst_base_transform_is_passthrough, "gst_base_transform_is_passthrough"); procedure gst_base_transform_set_in_place (trans : access GstBaseTransform; in_place : GLIB.gboolean); -- gst/base/gstbasetransform.h:263 pragma Import (C, gst_base_transform_set_in_place, "gst_base_transform_set_in_place"); function gst_base_transform_is_in_place (trans : access GstBaseTransform) return GLIB.gboolean; -- gst/base/gstbasetransform.h:265 pragma Import (C, gst_base_transform_is_in_place, "gst_base_transform_is_in_place"); procedure gst_base_transform_update_qos (trans : access GstBaseTransform; proportion : GLIB.gdouble; diff : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTimeDiff; timestamp : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime); -- gst/base/gstbasetransform.h:267 pragma Import (C, gst_base_transform_update_qos, "gst_base_transform_update_qos"); procedure gst_base_transform_set_qos_enabled (trans : access GstBaseTransform; enabled : GLIB.gboolean); -- gst/base/gstbasetransform.h:271 pragma Import (C, gst_base_transform_set_qos_enabled, "gst_base_transform_set_qos_enabled"); function gst_base_transform_is_qos_enabled (trans : access GstBaseTransform) return GLIB.gboolean; -- gst/base/gstbasetransform.h:273 pragma Import (C, gst_base_transform_is_qos_enabled, "gst_base_transform_is_qos_enabled"); procedure gst_base_transform_set_gap_aware (trans : access GstBaseTransform; gap_aware : GLIB.gboolean); -- gst/base/gstbasetransform.h:275 pragma Import (C, gst_base_transform_set_gap_aware, "gst_base_transform_set_gap_aware"); procedure gst_base_transform_suggest (trans : access GstBaseTransform; caps : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; size : GLIB.guint); -- gst/base/gstbasetransform.h:278 pragma Import (C, gst_base_transform_suggest, "gst_base_transform_suggest"); procedure gst_base_transform_reconfigure (trans : access GstBaseTransform); -- gst/base/gstbasetransform.h:280 pragma Import (C, gst_base_transform_reconfigure, "gst_base_transform_reconfigure"); end GStreamer.GST_Low_Level.gstreamer_0_10_gst_base_gstbasetransform_h;
reznikmm/matreshka
Ada
3,937
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.DOM.Draw_Id_Attributes; package Matreshka.ODF_Draw.Id_Attributes is type Draw_Id_Attribute_Node is new Matreshka.ODF_Draw.Abstract_Draw_Attribute_Node and ODF.DOM.Draw_Id_Attributes.ODF_Draw_Id_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Draw_Id_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Draw_Id_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Draw.Id_Attributes;
cborao/Ada-P4-chat
Ada
4,006
adb
-- Práctica 4: César Borao Moratinos (Hash_Maps_G_Chaining.adb) with Ada.Text_IO; with Ada.Strings.Unbounded; with Ada.Unchecked_Deallocation; package body Hash_Maps_G is package ASU renames Ada.Strings.Unbounded; procedure Put (M: in out Map; Key: Key_Type; Value: Value_Type) is P_Aux: Cell_A; Success: Boolean; begin Success := False; if M.P_Array = null then M.P_Array := new Cell_Array; M.P_Array(Hash(Key)) := new Cell'(Key,Value,null); M.Length := 1; M.Counter := 1; else if M.P_Array(Hash(Key)) = null then if M.Length = Max then raise Full_Map; end if; M.P_Array(Hash(Key)) := new Cell'(Key, Value, null); M.Length := M.Length + 1; M.Counter := M.Counter + 1; else P_Aux := M.P_Array(Hash(Key)); while P_Aux.Next /= null and not Success loop if P_Aux.Key = Key then P_Aux.Value := Value; Success := True; end if; P_Aux := P_Aux.Next; end loop; if P_Aux.Next = null and not Success then if P_Aux.Key = Key then P_Aux.Value := Value; Success := True; end if; end if; if not Success then if M.Counter = Max then raise Full_Map; end if; P_Aux.Next := new Cell'(Key,Value,null); M.Counter := M.Counter + 1; end if; end if; end if; end Put; procedure Get (M: Map;Key: in Key_Type; Value: out Value_Type; Success: out Boolean) is P_Aux: Cell_A; begin Success := False; if M.P_Array /= null then P_Aux := M.P_Array(Hash(Key)); if P_Aux /= null then while P_Aux.Next /= null and not Success loop if P_Aux.Key = Key then Value := P_Aux.Value; Success := True; end if; P_Aux := P_Aux.Next; end loop; if P_Aux.Next = null and not Success then if P_Aux.Key = Key then Value := P_Aux.Value; Success := True; end if; end if; end if; end if; end Get; procedure Delete (M: in out Map; Key: in Key_Type; Success: out Boolean) is P_Current: Cell_A := M.P_Array(Hash(Key)); P_Previous: Cell_A := P_Current; procedure Free is new Ada.Unchecked_Deallocation (Cell, Cell_A); begin Success := False; while P_Current /= null loop if P_Previous.Key = Key then Success := True; M.P_Array(Hash(Key)) := M.P_Array(Hash(Key)).Next; Free(P_Current); M.Counter := M.Counter - 1; if M.P_Array(Hash(Key)) = null then M.Length := M.Length - 1; end if; elsif P_Current.Key = Key then Success := True; P_Previous.Next := P_Current.Next; Free(P_Current); M.Counter := M.Counter - 1; else P_Previous := P_Current; P_Current := P_Current.Next; end if; end loop; end Delete; function Map_Length (M : Map) return Natural is begin return M.Length; end Map_Length; function First (M: Map) return Cursor is C: Cursor; begin C.M := M; C.Position := 0; while C.M.P_Array(C.Position) = null and C.Position < Hash_Range'Last loop C.Position := C.Position + 1; end loop; C.Pointer := C.M.P_Array(C.Position); return C; end First; procedure Next (C: in out Cursor) is begin if C.Pointer.Next = null then C.Position := C.Position + 1; if C.Position = Hash_Range'First then C.Pointer := null; else C.Pointer := C.M.P_Array(C.Position); while C.Pointer = null and C.Position < Hash_Range'Last loop C.Position := C.Position + 1; C.Pointer := C.M.P_Array(C.Position); end loop; end if; else C.Pointer := C.Pointer.Next; end if; end Next; function Has_Element (C: Cursor) return Boolean is begin if C.Pointer /= null then return True; else return False; end if; end Has_Element; function Element (C: Cursor) return Element_Type is Element: Element_Type; begin if Has_Element (C) then Element.Key := C.Pointer.Key; Element.Value := C.Pointer.Value; else raise No_Element; end if; return Element; end Element; end Hash_Maps_G;
charlie5/lace
Ada
10,565
ads
with GL, float_Math.Algebra.linear.d2, float_Math.Algebra.linear.d3, float_Math.Geometry.d2, float_Math.Geometry.d3, ada.Containers; package openGL -- -- Provides a namespace and set of core types. -- is pragma Pure; Error : exception; ------------ -- Profiles -- type profile_Kind is (Safe, Lean, Desk); function Profile return profile_Kind; ---------- -- Models -- Model_too_complex : exception; max_Models : constant := 2**32 - 1; type model_Id is range 0 .. max_Models; null_model_Id : constant model_Id; ----------- -- Indices -- type short_Index_t is range 0 .. 2**8 - 1; type Index_t is range 0 .. 2**16 - 1; type long_Index_t is range 0 .. 2**32 - 1; type short_Indices is array (long_Index_t range <>) of short_Index_t; type Indices is array (long_Index_t range <>) of Index_t; type long_Indices is array (long_Index_t range <>) of long_Index_t; -------- -- Math -- package Math renames float_Math; use Math; package linear_Algebra renames float_Math.Algebra.linear; package linear_Algebra_2d renames float_Math.Algebra.linear.d2; package linear_Algebra_3d renames float_Math.Algebra.linear.d3; package Geometry_2d renames float_Math.Geometry.d2; package Geometry_3d renames float_Math.Geometry.d3; -------- -- Real -- subtype Real is math.Real; package real_Functions renames math.Functions; ------------- -- Safe Real -- protected type safe_Real is procedure Value_is (Now : in Real); function Value return Real; private the_Value : Real; end safe_Real; ----------- -- Extents -- type Extent_2D is record Width : Natural; Height : Natural; end record; ----------- -- Vectors -- subtype Vector is math.Vector; subtype Vector_2 is math.Vector_2; subtype Vector_3 is math.Vector_3; subtype Vector_4 is math.Vector_4; type Vector_2_array is array (Positive range <>) of Vector_2; type Vector_3_array is array ( Index_t range <>) of aliased Vector_3; type Vector_3_large_array is array (long_Index_t range <>) of aliased Vector_3; function Scaled (Self : in Vector_3; By : in Vector_3) return Vector_3; function Scaled (Self : in Vector_3_array; By : in Vector_3) return Vector_3_array; function to_Vector_3_array (Self : in Vector_2_array) return Vector_3_array; ------------ -- Matrices -- subtype Matrix is math.Matrix; subtype Matrix_2x2 is math.Matrix_2x2; subtype Matrix_3x3 is math.Matrix_3x3; subtype Matrix_4x4 is math.Matrix_4x4; --------------- -- Height Maps -- type height_Map is array (Index_t range <>, Index_t range <>) of aliased Real; function Scaled (Self : in height_Map; By : in Real) return height_Map; procedure scale (Self : in out height_Map; By : in Real); function height_Extent (Self : in height_Map) return Vector_2; -- -- Returns the min and max height. type index_Pair is array (1 .. 2) of Index_t; function Region (Self : in height_Map; Rows, Cols : in index_Pair) return height_Map; -- -- Returns the submatrix indicated via Rows & Cols. ------------ -- Geometry -- subtype Site is Vector_3; -- A position in 3d space. subtype Sites is Vector_3_array; subtype many_Sites is Vector_3_large_array; subtype Normal is Vector_3; -- A normal in 3d space. subtype Normals is Vector_3_array; subtype many_Normals is Vector_3_large_array; type Bounds is record Ball : Real; -- Sphere radius. Box : Geometry_3d.bounding_Box; end record; null_Bounds : constant Bounds; function bounding_Box_of (Self : Sites) return Bounds; procedure set_Ball_from_Box (Self : in out Bounds); --------- -- Color -- -- RGB -- subtype grey_Value is gl.GLubyte; subtype color_Value is gl.GLubyte; type rgb_Color is record Red : aliased color_Value; Green : color_Value; Blue : color_Value; end record; type rgba_Color is record Primary : rgb_Color; Alpha : color_Value; end record; -- Primary -- null_Primary : constant := Real'Adjacent (0.0, -1.0); type Primary is new Real range null_Primary .. 1.0; type Color is record Red : Primary; Green : Primary; Blue : Primary; end record; type Colors is array (Index_t range <>) of Color; type Opaqueness is new Real range 0.0 .. 1.0; Opaque : constant Opaqueness; Lucid : constant Opaqueness; type lucid_Color is record Primary : Color; Opacity : Opaqueness; end record; type lucid_Colors is array (Index_t range <>) of lucid_Color; no_Color : constant Color; no_lucid_Color : constant lucid_Color; subtype Shine is Real range 1.0 .. Real'Last; default_Shine : constant := 0.05; function to_Color (From : in rgb_Color) return Color; ---------- -- Images -- type grey_Image is array (Index_t range <>, Index_t range <>) of aliased grey_Value; type Image is array (Index_t range <>, Index_t range <>) of aliased rgb_Color; type lucid_Image is array (Index_t range <>, Index_t range <>) of aliased rgba_Color; function to_Image (From : in lucid_Image) return Image; ----------- -- Texture -- -- Coordinates -- type Coordinate_1D is record S : aliased Real; end record; type Coordinate_2D is record S, T : aliased Real; end record; type Coordinate_3D is record S, T, R : aliased Real; end record; type Coordinate_4D is record S, T, R, Q : aliased Real; end record; type Coordinates_1D is array (Index_t range <>) of aliased Coordinate_1D; type Coordinates_2D is array (Index_t range <>) of aliased Coordinate_2D; type Coordinates_3D is array (Index_t range <>) of aliased Coordinate_3D; type Coordinates_4D is array (Index_t range <>) of aliased Coordinate_4D; type many_Coordinates_1D is array (long_Index_t range <>) of aliased Coordinate_1D; type many_Coordinates_2D is array (long_Index_t range <>) of aliased Coordinate_2D; type many_Coordinates_3D is array (long_Index_t range <>) of aliased Coordinate_3D; type many_Coordinates_4D is array (long_Index_t range <>) of aliased Coordinate_4D; -- Transforms -- type texture_Transform is record Offset : Real; Scale : Real; end record; type texture_Transform_1D is record S : texture_Transform; end record; type texture_Transform_2D is record S : texture_Transform; T : texture_Transform; end record; type texture_Transform_3D is record S : texture_Transform; T : texture_Transform; R : texture_Transform; end record; type texture_Transform_4D is record S : texture_Transform; T : texture_Transform; R : texture_Transform; Q : texture_Transform; end record; ---------- -- Assets -- type asset_Name is new String (1 .. 128); -- -- Name of a file containing textures, images, fonts or other resources. null_Asset : constant asset_Name; function to_Asset (Self : in String) return asset_Name; function to_String (Self : in asset_Name) return String; function Hash (Self : in asset_Name) return ada.Containers.Hash_type; ----------------------------- -- Shader Program Parameters -- type Parameters is tagged limited private; --------------- -- Task Safety -- type safe_Boolean is new Boolean; pragma Atomic (safe_Boolean); private -- NB: Packing these arrays forces compiler to use the correct size for the element type, rather than the most efficient size. -- pragma Pack (short_Indices); pragma Pack ( Indices); pragma Pack ( long_Indices); pragma Assert (GL.GLfloat'Size = Real'Size); null_Asset : constant asset_Name := (others => ' '); null_model_Id : constant model_Id := 0; null_Bounds : constant Bounds := (ball => 0.0, box => (lower => [Real'Last, Real'Last, Real'Last], upper => [Real'First, Real'First, Real'First])); ----------- -- Opacity -- Opaque : constant Opaqueness := 1.0; Lucid : constant Opaqueness := 0.0; opaque_Value : constant color_Value := color_Value'Last; lucid_Value : constant color_Value := color_Value'First; --------- -- Color -- no_Color : constant Color := (Red => null_Primary, Green => null_Primary, Blue => null_Primary); no_lucid_Color : constant lucid_Color := (Primary => (Red => null_Primary, Green => null_Primary, Blue => null_Primary), Opacity => Opaqueness'First); -- RGB -- type rgb_Colors is array (Index_t range <>) of rgb_Color; type rgba_Colors is array (Index_t range <>) of rgba_Color; -- Conversions -- function to_Color (Red, Green, Blue : in Primary) return rgb_Color; function to_color_Value (Self : in Primary) return color_Value; function to_Primary (Self : in color_Value) return Primary; function to_lucid_Color (From : in rgba_Color) return lucid_Color; function to_rgba_Color (From : in lucid_Color) return rgba_Color; function to_rgb_Color (From : in Color) return rgb_Color; function "+" (From : in rgb_Color) return Color renames to_Color; function "+" (From : in lucid_Color) return rgba_Color renames to_rgba_Color; function "+" (From : in Color) return rgb_Color renames to_rgb_Color; ---------------------------- -- Shader Program Parameters -- type Parameters is tagged limited null record; end openGL;
reznikmm/matreshka
Ada
4,625
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Office.Server_Map_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Office_Server_Map_Attribute_Node is begin return Self : Office_Server_Map_Attribute_Node do Matreshka.ODF_Office.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Office_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Office_Server_Map_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Server_Map_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Office_URI, Matreshka.ODF_String_Constants.Server_Map_Attribute, Office_Server_Map_Attribute_Node'Tag); end Matreshka.ODF_Office.Server_Map_Attributes;
redparavoz/ada-wiki
Ada
2,804
adb
----------------------------------------------------------------------- -- wiki-utils -- Wiki utility operations -- Copyright (C) 2015, 2016 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Wiki.Parsers; with Wiki.Render.Text; with Wiki.Render.Html; with Wiki.Filters.Html; with Wiki.Filters.TOC; with Wiki.Streams.Builders; with Wiki.Streams.Html.Builders; with Wiki.Documents; package body Wiki.Utils is -- ------------------------------ -- Render the wiki text according to the wiki syntax in HTML into a string. -- ------------------------------ function To_Html (Text : in Wiki.Strings.WString; Syntax : in Wiki.Wiki_Syntax) return String is Stream : aliased Wiki.Streams.Html.Builders.Html_Output_Builder_Stream; Renderer : aliased Wiki.Render.Html.Html_Renderer; Doc : Wiki.Documents.Document; Filter : aliased Wiki.Filters.Html.Html_Filter_Type; TOC : aliased Wiki.Filters.TOC.TOC_Filter; Engine : Wiki.Parsers.Parser; begin Renderer.Set_Output_Stream (Stream'Unchecked_Access); Renderer.Set_Render_TOC (True); Engine.Add_Filter (TOC'Unchecked_Access); Engine.Add_Filter (Filter'Unchecked_Access); Engine.Set_Syntax (Syntax); Engine.Parse (Text, Doc); Renderer.Render (Doc); return Stream.To_String; end To_Html; -- ------------------------------ -- Render the wiki text according to the wiki syntax in text into a string. -- Wiki formatting and decoration are removed. -- ------------------------------ function To_Text (Text : in Wiki.Strings.WString; Syntax : in Wiki.Wiki_Syntax) return String is Stream : aliased Wiki.Streams.Builders.Output_Builder_Stream; Doc : Wiki.Documents.Document; Renderer : aliased Wiki.Render.Text.Text_Renderer; Engine : Wiki.Parsers.Parser; begin Renderer.Set_Output_Stream (Stream'Unchecked_Access); Engine.Set_Syntax (Syntax); Engine.Parse (Text, Doc); Renderer.Render (Doc); return Stream.To_String; end To_Text; end Wiki.Utils;
Gabriel-Degret/adalib
Ada
546
ads
-- Standard Ada library specification -- Copyright (c) 2004-2016 AXE Consultants -- Copyright (c) 2004, 2005, 2006 Ada-Europe -- Copyright (c) 2000 The MITRE Corporation, Inc. -- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc. -- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual --------------------------------------------------------------------------- function Ada.Strings.Equal_Case_Insensitive (Left, Right : String) return Boolean; pragma Pure(Ada.Strings.Equal_Case_Insensitive);
charlie5/lace
Ada
8,228
adb
with GID.Buffering; use GID.Buffering; with GID.Color_tables; package body GID.Decoding_TGA is ---------- -- Load -- ---------- procedure Load (image: in out Image_descriptor) is procedure Row_start(y: Natural) is begin if image.flag_1 then -- top first Set_X_Y(0, image.height-1-y); else Set_X_Y(0, y); end if; end Row_Start; -- Run Length Encoding -- RLE_pixels_remaining: Natural:= 0; is_run_packet: Boolean; type Pixel is record color: RGB_Color; alpha: U8; end record; pix, pix_mem: Pixel; generic bpp: Positive; pal: Boolean; procedure Get_pixel; pragma Inline(Get_Pixel); -- procedure Get_pixel is idx: Natural; p1, p2, c, d: U8; begin if pal then if image.palette'Length <= 256 then Get_Byte(image.buffer, p1); idx:= Natural(p1); else Get_Byte(image.buffer, p1); Get_Byte(image.buffer, p2); idx:= Natural(p1) + Natural(p2) * 256; end if; idx:= idx + image.palette'First; pix.color:= image.palette(idx); else case bpp is when 32 => -- BGRA Get_Byte(image.buffer, pix.color.blue); Get_Byte(image.buffer, pix.color.green); Get_Byte(image.buffer, pix.color.red); Get_Byte(image.buffer, pix.alpha); when 24 => -- BGR Get_Byte(image.buffer, pix.color.blue); Get_Byte(image.buffer, pix.color.green); Get_Byte(image.buffer, pix.color.red); when 16 | 15 => -- 5 bit per channel Get_Byte(image.buffer, c); Get_Byte(image.buffer, d); Color_tables.Convert(c, d, pix.color); if bpp=16 then pix.alpha:= U8((U16(c and 128) * 255)/128); end if; when 8 => -- Gray Get_Byte(image.buffer, pix.color.green); pix.color.red:= pix.color.green; pix.color.blue:= pix.color.green; when others => null; end case; end if; end Get_pixel; generic bpp: Positive; pal: Boolean; procedure RLE_Pixel; pragma Inline(RLE_Pixel); -- procedure RLE_Pixel is tmp: U8; procedure Get_pixel_for_RLE is new Get_pixel(bpp, pal); begin if RLE_pixels_remaining = 0 then -- load RLE code Get_Byte(image.buffer, tmp ); Get_pixel_for_RLE; RLE_pixels_remaining:= U8'Pos(tmp and 16#7F#); is_run_packet:= (tmp and 16#80#) /= 0; if is_run_packet then pix_mem:= pix; end if; else if is_run_packet then pix:= pix_mem; else Get_pixel_for_RLE; end if; RLE_pixels_remaining:= RLE_pixels_remaining - 1; end if; end RLE_Pixel; procedure RLE_pixel_32 is new RLE_pixel(32, False); procedure RLE_pixel_24 is new RLE_pixel(24, False); procedure RLE_pixel_16 is new RLE_pixel(16, False); procedure RLE_pixel_15 is new RLE_pixel(15, False); procedure RLE_pixel_8 is new RLE_pixel(8, False); procedure RLE_pixel_palette is new RLE_pixel(1, True); -- 1: dummy procedure Output_Pixel is pragma Inline(Output_Pixel); begin case Primary_color_range'Modulus is when 256 => Put_Pixel( Primary_color_range(pix.color.red), Primary_color_range(pix.color.green), Primary_color_range(pix.color.blue), Primary_color_range(pix.alpha) ); when 65_536 => Put_Pixel( 16#101# * Primary_color_range(pix.color.red), 16#101# * Primary_color_range(pix.color.green), 16#101# * Primary_color_range(pix.color.blue), 16#101# * Primary_color_range(pix.alpha) -- 16#101# because max intensity FF goes to FFFF ); when others => raise invalid_primary_color_range; end case; end Output_Pixel; procedure Get_RGBA is -- 32 bits procedure Get_pixel_32 is new Get_pixel(32, False); begin for y in 0..image.height-1 loop Row_start(y); for x in 0..image.width-1 loop Get_pixel_32; Output_Pixel; end loop; Feedback(((y+1)*100)/image.height); end loop; end Get_RGBA; procedure Get_RGB is -- 24 bits procedure Get_pixel_24 is new Get_pixel(24, False); begin for y in 0..image.height-1 loop Row_start(y); for x in 0..image.width-1 loop Get_pixel_24; Output_Pixel; end loop; Feedback(((y+1)*100)/image.height); end loop; end Get_RGB; procedure Get_16 is -- 16 bits procedure Get_pixel_16 is new Get_pixel(16, False); begin for y in 0..image.height-1 loop Row_start(y); for x in 0..image.width-1 loop Get_pixel_16; Output_Pixel; end loop; Feedback(((y+1)*100)/image.height); end loop; end Get_16; procedure Get_15 is -- 15 bits procedure Get_pixel_15 is new Get_pixel(15, False); begin for y in 0..image.height-1 loop Row_start(y); for x in 0..image.width-1 loop Get_pixel_15; Output_Pixel; end loop; Feedback(((y+1)*100)/image.height); end loop; end Get_15; procedure Get_Gray is procedure Get_pixel_8 is new Get_pixel(8, False); begin for y in 0..image.height-1 loop Row_start(y); for x in 0..image.width-1 loop Get_pixel_8; Output_Pixel; end loop; Feedback(((y+1)*100)/image.height); end loop; end Get_Gray; procedure Get_with_palette is procedure Get_pixel_palette is new Get_pixel(1, True); -- 1: dummy begin for y in 0..image.height-1 loop Row_start(y); for x in 0..image.width-1 loop Get_pixel_palette; Output_Pixel; end loop; Feedback(((y+1)*100)/image.height); end loop; end Get_with_palette; begin pix.alpha:= 255; -- opaque is default Attach_Stream(image.buffer, image.stream); -- if image.RLE_encoded then -- One format check per row RLE_pixels_remaining:= 0; for y in 0..image.height-1 loop Row_start(y); if image.palette /= null then for x in 0..image.width-1 loop RLE_pixel_palette; Output_Pixel; end loop; else case image.bits_per_pixel is when 32 => for x in 0..image.width-1 loop RLE_Pixel_32; Output_Pixel; end loop; when 24 => for x in 0..image.width-1 loop RLE_Pixel_24; Output_Pixel; end loop; when 16 => for x in 0..image.width-1 loop RLE_Pixel_16; Output_Pixel; end loop; when 15 => for x in 0..image.width-1 loop RLE_Pixel_15; Output_Pixel; end loop; when 8 => for x in 0..image.width-1 loop RLE_Pixel_8; Output_Pixel; end loop; when others => null; end case; end if; Feedback(((y+1)*100)/image.height); end loop; elsif image.palette /= null then Get_with_palette; else case image.bits_per_pixel is when 32 => Get_RGBA; when 24 => Get_RGB; when 16 => Get_16; when 15 => Get_15; when 8 => Get_Gray; when others => null; end case; end if; end Load; end GID.Decoding_TGA;
andreas-kupries/critcl
Ada
13,597
ads
------------------------------------------------------------------------------ -- ZLib for Ada thick binding. -- -- -- -- Copyright (C) 2002-2004 Dmitriy Anisimkov -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or (at -- -- your option) any later version. -- -- -- -- This library is distributed in the hope that it will be useful, but -- -- WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public License -- -- along with this library; if not, write to the Free Software Foundation, -- -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- ------------------------------------------------------------------------------ -- $Id: zlib.ads 66 2005-08-17 18:20:58Z andreas_kupries $ with Ada.Streams; with Interfaces; package ZLib is ZLib_Error : exception; Status_Error : exception; type Compression_Level is new Integer range -1 .. 9; type Flush_Mode is private; type Compression_Method is private; type Window_Bits_Type is new Integer range 8 .. 15; type Memory_Level_Type is new Integer range 1 .. 9; type Unsigned_32 is new Interfaces.Unsigned_32; type Strategy_Type is private; type Header_Type is (None, Auto, Default, GZip); -- Header type usage have a some limitation for inflate. -- See comment for Inflate_Init. subtype Count is Ada.Streams.Stream_Element_Count; Default_Memory_Level : constant Memory_Level_Type := 8; Default_Window_Bits : constant Window_Bits_Type := 15; ---------------------------------- -- Compression method constants -- ---------------------------------- Deflated : constant Compression_Method; -- Only one method allowed in this ZLib version --------------------------------- -- Compression level constants -- --------------------------------- No_Compression : constant Compression_Level := 0; Best_Speed : constant Compression_Level := 1; Best_Compression : constant Compression_Level := 9; Default_Compression : constant Compression_Level := -1; -------------------------- -- Flush mode constants -- -------------------------- No_Flush : constant Flush_Mode; -- Regular way for compression, no flush Partial_Flush : constant Flush_Mode; -- Will be removed, use Z_SYNC_FLUSH instead Sync_Flush : constant Flush_Mode; -- All pending output is flushed to the output buffer and the output -- is aligned on a byte boundary, so that the decompressor can get all -- input data available so far. (In particular avail_in is zero after the -- call if enough output space has been provided before the call.) -- Flushing may degrade compression for some compression algorithms and so -- it should be used only when necessary. Block_Flush : constant Flush_Mode; -- Z_BLOCK requests that inflate() stop -- if and when it get to the next deflate block boundary. When decoding the -- zlib or gzip format, this will cause inflate() to return immediately -- after the header and before the first block. When doing a raw inflate, -- inflate() will go ahead and process the first block, and will return -- when it gets to the end of that block, or when it runs out of data. Full_Flush : constant Flush_Mode; -- All output is flushed as with SYNC_FLUSH, and the compression state -- is reset so that decompression can restart from this point if previous -- compressed data has been damaged or if random access is desired. Using -- Full_Flush too often can seriously degrade the compression. Finish : constant Flush_Mode; -- Just for tell the compressor that input data is complete. ------------------------------------ -- Compression strategy constants -- ------------------------------------ -- RLE stategy could be used only in version 1.2.0 and later. Filtered : constant Strategy_Type; Huffman_Only : constant Strategy_Type; RLE : constant Strategy_Type; Default_Strategy : constant Strategy_Type; Default_Buffer_Size : constant := 4096; type Filter_Type is tagged limited private; -- The filter is for compression and for decompression. -- The usage of the type is depend of its initialization. function Version return String; pragma Inline (Version); -- Return string representation of the ZLib version. procedure Deflate_Init (Filter : in out Filter_Type; Level : in Compression_Level := Default_Compression; Strategy : in Strategy_Type := Default_Strategy; Method : in Compression_Method := Deflated; Window_Bits : in Window_Bits_Type := Default_Window_Bits; Memory_Level : in Memory_Level_Type := Default_Memory_Level; Header : in Header_Type := Default); -- Compressor initialization. -- When Header parameter is Auto or Default, then default zlib header -- would be provided for compressed data. -- When Header is GZip, then gzip header would be set instead of -- default header. -- When Header is None, no header would be set for compressed data. procedure Inflate_Init (Filter : in out Filter_Type; Window_Bits : in Window_Bits_Type := Default_Window_Bits; Header : in Header_Type := Default); -- Decompressor initialization. -- Default header type mean that ZLib default header is expecting in the -- input compressed stream. -- Header type None mean that no header is expecting in the input stream. -- GZip header type mean that GZip header is expecting in the -- input compressed stream. -- Auto header type mean that header type (GZip or Native) would be -- detected automatically in the input stream. -- Note that header types parameter values None, GZip and Auto are -- supported for inflate routine only in ZLib versions 1.2.0.2 and later. -- Deflate_Init is supporting all header types. function Is_Open (Filter : in Filter_Type) return Boolean; pragma Inline (Is_Open); -- Is the filter opened for compression or decompression. procedure Close (Filter : in out Filter_Type; Ignore_Error : in Boolean := False); -- Closing the compression or decompressor. -- If stream is closing before the complete and Ignore_Error is False, -- The exception would be raised. generic with procedure Data_In (Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset); with procedure Data_Out (Item : in Ada.Streams.Stream_Element_Array); procedure Generic_Translate (Filter : in out Filter_Type; In_Buffer_Size : in Integer := Default_Buffer_Size; Out_Buffer_Size : in Integer := Default_Buffer_Size); -- Compress/decompress data fetch from Data_In routine and pass the result -- to the Data_Out routine. User should provide Data_In and Data_Out -- for compression/decompression data flow. -- Compression or decompression depend on Filter initialization. function Total_In (Filter : in Filter_Type) return Count; pragma Inline (Total_In); -- Returns total number of input bytes read so far function Total_Out (Filter : in Filter_Type) return Count; pragma Inline (Total_Out); -- Returns total number of bytes output so far function CRC32 (CRC : in Unsigned_32; Data : in Ada.Streams.Stream_Element_Array) return Unsigned_32; pragma Inline (CRC32); -- Compute CRC32, it could be necessary for make gzip format procedure CRC32 (CRC : in out Unsigned_32; Data : in Ada.Streams.Stream_Element_Array); pragma Inline (CRC32); -- Compute CRC32, it could be necessary for make gzip format ------------------------------------------------- -- Below is more complex low level routines. -- ------------------------------------------------- procedure Translate (Filter : in out Filter_Type; In_Data : in Ada.Streams.Stream_Element_Array; In_Last : out Ada.Streams.Stream_Element_Offset; Out_Data : out Ada.Streams.Stream_Element_Array; Out_Last : out Ada.Streams.Stream_Element_Offset; Flush : in Flush_Mode); -- Compress/decompress the In_Data buffer and place the result into -- Out_Data. In_Last is the index of last element from In_Data accepted by -- the Filter. Out_Last is the last element of the received data from -- Filter. To tell the filter that incoming data are complete put the -- Flush parameter to Finish. function Stream_End (Filter : in Filter_Type) return Boolean; pragma Inline (Stream_End); -- Return the true when the stream is complete. procedure Flush (Filter : in out Filter_Type; Out_Data : out Ada.Streams.Stream_Element_Array; Out_Last : out Ada.Streams.Stream_Element_Offset; Flush : in Flush_Mode); pragma Inline (Flush); -- Flushing the data from the compressor. generic with procedure Write (Item : in Ada.Streams.Stream_Element_Array); -- User should provide this routine for accept -- compressed/decompressed data. Buffer_Size : in Ada.Streams.Stream_Element_Offset := Default_Buffer_Size; -- Buffer size for Write user routine. procedure Write (Filter : in out Filter_Type; Item : in Ada.Streams.Stream_Element_Array; Flush : in Flush_Mode := No_Flush); -- Compress/Decompress data from Item to the generic parameter procedure -- Write. Output buffer size could be set in Buffer_Size generic parameter. generic with procedure Read (Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset); -- User should provide data for compression/decompression -- thru this routine. Buffer : in out Ada.Streams.Stream_Element_Array; -- Buffer for keep remaining data from the previous -- back read. Rest_First, Rest_Last : in out Ada.Streams.Stream_Element_Offset; -- Rest_First have to be initialized to Buffer'Last + 1 -- Rest_Last have to be initialized to Buffer'Last -- before usage. Allow_Read_Some : in Boolean := False; -- Is it allowed to return Last < Item'Last before end of data. procedure Read (Filter : in out Filter_Type; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset; Flush : in Flush_Mode := No_Flush); -- Compress/Decompress data from generic parameter procedure Read to the -- Item. User should provide Buffer and initialized Rest_First, Rest_Last -- indicators. If Allow_Read_Some is True, Read routines could return -- Last < Item'Last only at end of stream. private use Ada.Streams; pragma Assert (Ada.Streams.Stream_Element'Size = 8); pragma Assert (Ada.Streams.Stream_Element'Modulus = 2**8); type Flush_Mode is new Integer range 0 .. 5; type Compression_Method is new Integer range 8 .. 8; type Strategy_Type is new Integer range 0 .. 3; No_Flush : constant Flush_Mode := 0; Partial_Flush : constant Flush_Mode := 1; Sync_Flush : constant Flush_Mode := 2; Full_Flush : constant Flush_Mode := 3; Finish : constant Flush_Mode := 4; Block_Flush : constant Flush_Mode := 5; Filtered : constant Strategy_Type := 1; Huffman_Only : constant Strategy_Type := 2; RLE : constant Strategy_Type := 3; Default_Strategy : constant Strategy_Type := 0; Deflated : constant Compression_Method := 8; type Z_Stream; type Z_Stream_Access is access all Z_Stream; type Filter_Type is tagged limited record Strm : Z_Stream_Access; Compression : Boolean; Stream_End : Boolean; Header : Header_Type; CRC : Unsigned_32; Offset : Stream_Element_Offset; -- Offset for gzip header/footer output. end record; end ZLib;
zhmu/ananas
Ada
5,458
ads
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.CONTAINERS.RED_BLACK_TREES.GENERIC_SET_OPERATIONS -- -- -- -- S p e c -- -- -- -- Copyright (C) 2004-2022, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ -- Tree_Type is used to implement ordered containers. This package declares -- set-based tree operations. with Ada.Containers.Red_Black_Trees.Generic_Operations; generic with package Tree_Operations is new Generic_Operations (<>); use Tree_Operations.Tree_Types, Tree_Operations.Tree_Types.Implementation; with procedure Insert_With_Hint (Dst_Tree : in out Tree_Type; Dst_Hint : Node_Access; Src_Node : Node_Access; Dst_Node : out Node_Access); with function Copy_Tree (Source_Root : Node_Access) return Node_Access; with procedure Delete_Tree (X : in out Node_Access); with function Is_Less (Left, Right : Node_Access) return Boolean; with procedure Free (X : in out Node_Access); package Ada.Containers.Red_Black_Trees.Generic_Set_Operations is pragma Pure; procedure Union (Target : in out Tree_Type; Source : Tree_Type); -- Attempts to insert each element of Source in Target. If Target is -- busy then Program_Error is raised. We say "attempts" here because -- if these are unique-element sets, then the insertion should fail -- (not insert a new item) when the insertion item from Source is -- equivalent to an item already in Target. If these are multisets -- then of course the attempt should always succeed. function Union (Left, Right : Tree_Type) return Tree_Type; -- Makes a copy of Left, and attempts to insert each element of -- Right into the copy, then returns the copy. procedure Intersection (Target : in out Tree_Type; Source : Tree_Type); -- Removes elements from Target that are not equivalent to items in -- Source. If Target is busy then Program_Error is raised. function Intersection (Left, Right : Tree_Type) return Tree_Type; -- Returns a set comprising all the items in Left equivalent to items in -- Right. procedure Difference (Target : in out Tree_Type; Source : Tree_Type); -- Removes elements from Target that are equivalent to items in Source. If -- Target is busy then Program_Error is raised. function Difference (Left, Right : Tree_Type) return Tree_Type; -- Returns a set comprising all the items in Left not equivalent to items -- in Right. procedure Symmetric_Difference (Target : in out Tree_Type; Source : Tree_Type); -- Removes from Target elements that are equivalent to items in Source, and -- inserts into Target items from Source not equivalent elements in -- Target. If Target is busy then Program_Error is raised. function Symmetric_Difference (Left, Right : Tree_Type) return Tree_Type; -- Returns a set comprising the union of the elements in Left not -- equivalent to items in Right, and the elements in Right not equivalent -- to items in Left. function Is_Subset (Subset : Tree_Type; Of_Set : Tree_Type) return Boolean; -- Returns False if Subset contains at least one element not equivalent to -- any item in Of_Set; returns True otherwise. function Overlap (Left, Right : Tree_Type) return Boolean; -- Returns True if at least one element of Left is equivalent to an item in -- Right; returns False otherwise. end Ada.Containers.Red_Black_Trees.Generic_Set_Operations;
skill-lang/adaCommon
Ada
13,322
adb
-- ___ _ ___ _ _ -- -- / __| |/ (_) | | Common SKilL implementation -- -- \__ \ ' <| | | |__ implementation of builtin field types -- -- |___/_|\_\_|_|____| by: Timm Felden -- -- -- pragma Ada_2012; with Ada.Containers; with Ada.Containers.Doubly_Linked_Lists; with Ada.Containers.Hashed_Maps; with Ada.Containers.Hashed_Sets; with Ada.Containers.Vectors; with Skill.Types; with Skill.Hashes; use Skill.Hashes; with Skill.Types.Pools; with Skill.Containers.Arrays; with Skill.Containers.Sets; with Skill.Containers.Maps; package body Skill.Field_Types.Builtin is use type Skill.Types.v64; use type Skill.Types.Uv64; use type Skill.Containers.Boxed_Array; use type Skill.Types.Boxed_List; use type Skill.Containers.Boxed_Set; use type Skill.Types.Boxed_Map; function Offset_Single_V64 (Input : Types.v64) return Types.v64 is function Cast is new Ada.Unchecked_Conversion (Skill.Types.v64, Skill.Types.Uv64); V : constant Skill.Types.Uv64 := Cast (Input); begin if 0 = (V and 16#FFFFFFFFFFFFFF80#) then return 1; elsif 0 = (V and 16#FFFFFFFFFFFFC000#) then return 2; elsif 0 = (V and 16#FFFFFFFFFFE00000#) then return 3; elsif 0 = (V and 16#FFFFFFFFF0000000#) then return 4; elsif 0 = (V and 16#FFFFFFF800000000#) then return 5; elsif 0 = (V and 16#FFFFFC0000000000#) then return 6; elsif 0 = (V and 16#FFFE000000000000#) then return 7; elsif 0 = (V and 16#FF00000000000000#) then return 8; else return 9; end if; end Offset_Single_V64; procedure Insert (This : in out Skill.Containers.Boxed_Array; E : in Types.Box) is begin This.Append (E); end Insert; package body Annotation_Type_P is use type Types.Annotation; procedure Fix_Types (This : access Field_Type_T) is procedure Add (P : Types.Pools.Pool) is begin This.Types_By_Name.Include (P.Skill_Name, P); end Add; begin This.Types.Foreach (Add'Access); end Fix_Types; overriding function Read_Box (This : access Field_Type_T; Input : Streams.Reader.Stream) return Types.Box is T : Types.v64 := Input.V64; Idx : Types.v64 := Input.V64; begin if 0 = T then return Boxed (null); else declare Data : Types.Annotation_Array := This.Types.Element (Integer (T - 1)).Base.Data; begin return Boxed (Data (Integer (Idx))); end; end if; end Read_Box; overriding function Offset_Box (This : access Field_Type_T; Target : Types.Box) return Types.v64 is type T is access all String; function Cast is new Ada.Unchecked_Conversion (T, Types.String_Access); Ref : Types.Annotation := Unboxed (Target); begin if null = Ref then return 2; else return Offset_Single_V64 (Types.v64 (1 + This.Types_By_Name.Element (Ref.Dynamic.Skill_Name).Pool_Offset)) + Offset_Single_V64 (Types.v64 (Ref.Skill_ID)); end if; end Offset_Box; overriding procedure Write_Box (This : access Field_Type_T; Output : Streams.Writer.Sub_Stream; Target : Types.Box) is type T is access all String; function Cast is new Ada.Unchecked_Conversion (T, Types.String_Access); Ref : Types.Annotation := Unboxed (Target); begin if null = Ref then Output.I16 (0); else Output.V64 (Types.v64 (1 + This.Types_By_Name.Element (Ref.Dynamic.Skill_Name).Pool_Offset)); Output.V64 (Types.v64 (Ref.Skill_ID)); end if; end Write_Box; end Annotation_Type_P; package Arrays_P is new Skill.Containers.Arrays (Types.Box); package body Const_Arrays_P is pragma Warnings (Off); function Boxed (This : access Containers.Boxed_Array_T'Class) return Types.Box is type X is access all Containers.Boxed_Array_T'Class; function Cast is new Ada.Unchecked_Conversion (X, Types.Box); begin return Cast (X (This)); end Boxed; function Read_Box (This : access Field_Type_T; Input : Streams.Reader.Stream) return Types.Box is Count : Types.v64 := This.Length; Result : Containers.Boxed_Array := Containers.Boxed_Array (Arrays_P.Make); begin for I in 1 .. Count loop Insert (Result, This.Base.Read_Box (Input)); end loop; return Boxed (Result); end Read_Box; function Offset_Box (This : access Field_Type_T; Target : Types.Box) return Types.v64 is Result : Types.v64 := 0; Count : Natural := Natural (This.Length); begin for I in 1 .. Count loop Result := Result + This.Base.Offset_Box (Unboxed (Target).Get (I - 1)); end loop; return Result; end Offset_Box; procedure Write_Box (This : access Field_Type_T; Output : Streams.Writer.Sub_Stream; Target : Types.Box) is Length : Natural := Natural (This.Length); begin for I in 1 .. Length loop This.Base.Write_Box (Output, Unboxed (Target).Get (I - 1)); end loop; end Write_Box; end Const_Arrays_P; package body Var_Arrays_P is function Read_Box (This : access Field_Type_T; Input : Streams.Reader.Stream) return Types.Box is Count : Types.v64 := Input.V64; Result : Containers.Boxed_Array := Containers.Boxed_Array (Arrays_P.Make); begin for I in 1 .. Count loop Insert (Result, This.Base.Read_Box (Input)); end loop; return Boxed (Result); end Read_Box; function Offset_Box (This : access Field_Type_T; Target : Types.Box) return Types.v64 is Result : Types.v64; Arr : Containers.Boxed_Array := Unboxed (Target); Count : Natural := Natural (Arr.Length); begin if null = Arr then return 1; end if; Result := Offset_Single_V64 (Types.v64 (Count)); for I in 1 .. Count loop Result := Result + This.Base.Offset_Box (Arr.Get (I - 1)); end loop; return Result; end Offset_Box; procedure Write_Box (This : access Field_Type_T; Output : Streams.Writer.Sub_Stream; Target : Types.Box) is Arr : Containers.Boxed_Array := Unboxed (Target); Length : Natural := Natural (Arr.Length); begin if null = Arr then Output.I8 (0); return; end if; Output.V64 (Types.v64 (Length)); for I in 1 .. Length loop This.Base.Write_Box (Output, Arr.Get (I - 1)); end loop; end Write_Box; end Var_Arrays_P; package body List_Type_P is function Read_Box (This : access Field_Type_T; Input : Streams.Reader.Stream) return Types.Box is Count : Types.v64 := Input.V64; Result : Containers.Boxed_Array := Containers.Boxed_Array (Arrays_P.Make); begin for I in 1 .. Count loop Insert (Result, This.Base.Read_Box (Input)); end loop; return Boxed (Result); end Read_Box; function Offset_Box (This : access Field_Type_T; Target : Types.Box) return Types.v64 is Result : Types.v64; Arr : Containers.Boxed_Array := Unboxed (Target); Count : Natural := Natural (Arr.Length); begin if null = Arr then return 1; end if; Result := Offset_Single_V64 (Types.v64 (Count)); for I in 1 .. Count loop Result := Result + This.Base.Offset_Box (Arr.Get (I - 1)); end loop; return Result; end Offset_Box; procedure Write_Box (This : access Field_Type_T; Output : Streams.Writer.Sub_Stream; Target : Types.Box) is Arr : Containers.Boxed_Array := Unboxed (Target); Length : Natural := Natural (Arr.Length); begin if null = Arr then Output.I8 (0); return; end if; Output.V64 (Types.v64 (Length)); for I in 1 .. Length loop This.Base.Write_Box (Output, Arr.Get (I - 1)); end loop; end Write_Box; end List_Type_P; package Sets_P is new Skill.Containers.Sets (Types.Box, Types.Hash, "="); package body Set_Type_P is function Read_Box (This : access Field_Type_T; Input : Streams.Reader.Stream) return Types.Box is Count : Types.v64 := Input.V64; Result : Containers.Boxed_Set := Containers.Boxed_Set (Sets_P.Make); begin for I in 1 .. Count loop Result.Add (This.Base.Read_Box (Input)); end loop; return Boxed (Result); end Read_Box; function Offset_Box (This : access Field_Type_T; Target : Types.Box) return Types.v64 is Result : Types.v64; Set : Containers.Boxed_Set := Unboxed (Target); Count : Natural := Natural (Set.Length); Iter : Containers.Set_Iterator; begin if null = Set then return 1; end if; Result := Offset_Single_V64 (Types.v64 (Count)); Iter := Set.Iterator; while Iter.Has_Next loop Result := Result + This.Base.Offset_Box (Iter.Next); end loop; Iter.Free; return Result; end Offset_Box; procedure Write_Box (This : access Field_Type_T; Output : Streams.Writer.Sub_Stream; Target : Types.Box) is Set : Containers.Boxed_Set := Unboxed (Target); Length : Natural := Natural (Set.Length); Iter : Containers.Set_Iterator; begin if null = Set then Output.I8 (0); return; end if; Output.V64 (Types.v64 (Length)); Iter := Set.Iterator; while Iter.Has_Next loop This.Base.Write_Box (Output, Iter.Next); end loop; Iter.Free; end Write_Box; end Set_Type_P; package Maps_P is new Skill.Containers.Maps(Types.Box, Types.Box, Types.Hash, "=", "="); package body Map_Type_P is function Read_Box (This : access Field_Type_T; Input : Streams.Reader.Stream) return Types.Box is Count : Types.v64 := Input.V64; Result : Types.Boxed_Map := Types.Boxed_Map (Maps_P.Make); K, V : Types.Box; begin for I in 1 .. Count loop K := This.Key.Read_Box (Input); V := This.Value.Read_Box (Input); Result.Update (K, V); end loop; return Boxed (Result); end Read_Box; function Offset_Box (This : access Field_Type_T; Target : Types.Box) return Types.v64 is Map : Containers.Boxed_Map := Unboxed (Target); Iter : Containers.Map_Iterator; Result : Types.v64; Count : Natural := Natural (Map.Length); begin if null = Map or 0 = Count then return 1; end if; Result := Offset_Single_V64 (Types.v64 (Count)); Iter := Map.Iterator; while Iter.Has_Next loop Result := Result + This.Key.Offset_Box (Iter.Key) + This.Value.Offset_Box (Iter.Value); Iter.Advance; end loop; Iter.Free; return Result; end Offset_Box; procedure Write_Box (This : access Field_Type_T; Output : Streams.Writer.Sub_Stream; Target : Types.Box) is Map : Types.Boxed_Map := Unboxed (Target); Iter : Containers.Map_Iterator; Length : Natural := Natural (Map.Length); begin if null = Map or 0 = Length then Output.I8 (0); return; end if; Output.V64 (Types.v64 (Length)); Iter := Map.Iterator; while Iter.Has_Next loop This.Key.Write_Box (Output, Iter.Key); This.Value.Write_Box (Output, Iter.Value); Iter.Advance; end loop; Iter.Free; end Write_Box; end Map_Type_P; end Skill.Field_Types.Builtin;
reznikmm/matreshka
Ada
3,699
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Attributes; package ODF.DOM.Draw_Display_Attributes is pragma Preelaborate; type ODF_Draw_Display_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Draw_Display_Attribute_Access is access all ODF_Draw_Display_Attribute'Class with Storage_Size => 0; end ODF.DOM.Draw_Display_Attributes;
zhmu/ananas
Ada
250
adb
with Inline8_Pkg2; package body Inline8_Pkg1 is procedure Test (I : Integer) is function F is new Inline8_Pkg2.Calc (I); pragma Inline (F); begin if I /= F (I) then raise Program_Error; end if; end; end Inline8_Pkg1;
reznikmm/matreshka
Ada
4,115
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.DOM.Table_Use_Banding_Rows_Styles_Attributes; package Matreshka.ODF_Table.Use_Banding_Rows_Styles_Attributes is type Table_Use_Banding_Rows_Styles_Attribute_Node is new Matreshka.ODF_Table.Abstract_Table_Attribute_Node and ODF.DOM.Table_Use_Banding_Rows_Styles_Attributes.ODF_Table_Use_Banding_Rows_Styles_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Table_Use_Banding_Rows_Styles_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Table_Use_Banding_Rows_Styles_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Table.Use_Banding_Rows_Styles_Attributes;
zhmu/ananas
Ada
86
ads
package Anon3 is X : access Integer := new Integer; procedure Dummy; end Anon3;
nerilex/ada-util
Ada
7,560
ads
----------------------------------------------------------------------- -- util-serialize-io-csv -- CSV Serialization Driver -- Copyright (C) 2011, 2016 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Strings.Vectors; with Util.Streams.Texts; -- The <b>Util.Serialize.IO.CSV</b> package allows to read and write CSV files. -- -- See RFC 4180 - Common Format and MIME Type for Comma-Separated Values (CSV) Files package Util.Serialize.IO.CSV is type Row_Type is new Natural; type Column_Type is new Positive; -- ------------------------------ -- CSV Output Stream -- ------------------------------ -- The <b>Output_Stream</b> provides methods for creating a CSV output stream. -- The stream object takes care of the CSV escape rules. type Output_Stream is new Util.Streams.Texts.Print_Stream and Util.Serialize.IO.Output_Stream with private; -- Write the value as a CSV cell. Special characters are escaped using the CSV -- escape rules. procedure Write_Cell (Stream : in out Output_Stream; Value : in String); procedure Write_Cell (Stream : in out Output_Stream; Value : in Integer); procedure Write_Cell (Stream : in out Output_Stream; Value : in Boolean); procedure Write_Cell (Stream : in out Output_Stream; Value : in Util.Beans.Objects.Object); -- Start a new row. procedure New_Row (Stream : in out Output_Stream); -- Write the attribute name/value pair. overriding procedure Write_Attribute (Stream : in out Output_Stream; Name : in String; Value : in String); overriding procedure Write_Wide_Attribute (Stream : in out Output_Stream; Name : in String; Value : in Wide_Wide_String); overriding procedure Write_Attribute (Stream : in out Output_Stream; Name : in String; Value : in Integer); overriding procedure Write_Attribute (Stream : in out Output_Stream; Name : in String; Value : in Boolean); overriding procedure Write_Attribute (Stream : in out Output_Stream; Name : in String; Value : in Util.Beans.Objects.Object); -- Write the entity value. overriding procedure Write_Entity (Stream : in out Output_Stream; Name : in String; Value : in String); overriding procedure Write_Wide_Entity (Stream : in out Output_Stream; Name : in String; Value : in Wide_Wide_String); overriding procedure Write_Entity (Stream : in out Output_Stream; Name : in String; Value : in Boolean); overriding procedure Write_Entity (Stream : in out Output_Stream; Name : in String; Value : in Integer); overriding procedure Write_Entity (Stream : in out Output_Stream; Name : in String; Value : in Ada.Calendar.Time); overriding procedure Write_Long_Entity (Stream : in out Output_Stream; Name : in String; Value : in Long_Long_Integer); overriding procedure Write_Enum_Entity (Stream : in out Output_Stream; Name : in String; Value : in String); overriding procedure Write_Entity (Stream : in out Output_Stream; Name : in String; Value : in Util.Beans.Objects.Object); -- ------------------------------ -- CSV Parser -- ------------------------------ -- The <b>Parser</b> type is a CSV parser which allows to map CVS rows directly -- in Ada records. type Parser is new Serialize.IO.Parser with private; -- Get the header name for the given column. -- If there was no header line, build a default header for the column. function Get_Header_Name (Handler : in Parser; Column : in Column_Type) return String; -- Set the cell value at the given row and column. -- The default implementation finds the column header name and -- invokes <b>Write_Entity</b> with the header name and the value. procedure Set_Cell (Handler : in out Parser; Value : in String; Row : in Row_Type; Column : in Column_Type); -- Set the field separator. The default field separator is the comma (','). procedure Set_Field_Separator (Handler : in out Parser; Separator : in Character); -- Get the field separator. function Get_Field_Separator (Handler : in Parser) return Character; -- Set the comment separator. When a comment separator is defined, a line which starts -- with the comment separator will be ignored. The row number will not be incremented. procedure Set_Comment_Separator (Handler : in out Parser; Separator : in Character); -- Get the comment separator. Returns ASCII.NUL if comments are not supported. function Get_Comment_Separator (Handler : in Parser) return Character; -- Setup the CSV parser and mapper to use the default column header names. -- When activated, the first row is assumed to contain the first item to de-serialize. procedure Set_Default_Headers (Handler : in out Parser; Mode : in Boolean := True); -- Parse the stream using the CSV parser. overriding procedure Parse (Handler : in out Parser; Stream : in out Util.Streams.Buffered.Buffered_Stream'Class); -- Get the current location (file and line) to report an error message. overriding function Get_Location (Handler : in Parser) return String; private type Output_Stream is new Util.Streams.Texts.Print_Stream and Util.Serialize.IO.Output_Stream with record Max_Columns : Column_Type := 1; Column : Column_Type := 1; Row : Row_Type := 0; end record; type Parser is new Util.Serialize.IO.Parser with record Has_Header : Boolean := True; Line_Number : Natural := 1; Row : Row_Type := 0; Headers : Util.Strings.Vectors.Vector; Separator : Character := ','; Comment : Character := ASCII.NUL; Use_Default_Headers : Boolean := False; end record; end Util.Serialize.IO.CSV;
AdaCore/Ada_Drivers_Library
Ada
4,978
ads
-- This spec has been automatically generated from cm7.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; -- Cache maintenance operations package Cortex_M_SVD.Cache is pragma Preelaborate; --------------- -- Registers -- --------------- subtype DCISW_Set_Field is HAL.UInt9; subtype DCISW_Way_Field is HAL.UInt2; -- Data cache invalidate by set/way type DCISW_Register is record -- unspecified Reserved_0_4 : HAL.UInt5 := 16#0#; -- Write-only. Set/index that operation applies to. The number of -- indices in a cache depends on the configured cache size. When this is -- less than the maximum, use the LSB of this field. Set : DCISW_Set_Field := 16#0#; -- unspecified Reserved_14_29 : HAL.UInt16 := 16#0#; -- Write-only. Way that operation applies to. For the data cache, values -- 0, 1, 2 and 3 are supported.. Way : DCISW_Way_Field := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DCISW_Register use record Reserved_0_4 at 0 range 0 .. 4; Set at 0 range 5 .. 13; Reserved_14_29 at 0 range 14 .. 29; Way at 0 range 30 .. 31; end record; subtype DCCSW_Set_Field is HAL.UInt9; subtype DCCSW_Way_Field is HAL.UInt2; -- Data cache clean by set/way type DCCSW_Register is record -- unspecified Reserved_0_4 : HAL.UInt5 := 16#0#; -- Write-only. Set/index that operation applies to. The number of -- indices in a cache depends on the configured cache size. When this is -- less than the maximum, use the LSB of this field. Set : DCCSW_Set_Field := 16#0#; -- unspecified Reserved_14_29 : HAL.UInt16 := 16#0#; -- Write-only. Way that operation applies to. For the data cache, values -- 0, 1, 2 and 3 are supported.. Way : DCCSW_Way_Field := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DCCSW_Register use record Reserved_0_4 at 0 range 0 .. 4; Set at 0 range 5 .. 13; Reserved_14_29 at 0 range 14 .. 29; Way at 0 range 30 .. 31; end record; subtype DCCISW_Set_Field is HAL.UInt9; subtype DCCISW_Way_Field is HAL.UInt2; -- Data cache clean and invalidate by set/way type DCCISW_Register is record -- unspecified Reserved_0_4 : HAL.UInt5 := 16#0#; -- Write-only. Set/index that operation applies to. The number of -- indices in a cache depends on the configured cache size. When this is -- less than the maximum, use the LSB of this field. Set : DCCISW_Set_Field := 16#0#; -- unspecified Reserved_14_29 : HAL.UInt16 := 16#0#; -- Write-only. Way that operation applies to. For the data cache, values -- 0, 1, 2 and 3 are supported.. Way : DCCISW_Way_Field := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DCCISW_Register use record Reserved_0_4 at 0 range 0 .. 4; Set at 0 range 5 .. 13; Reserved_14_29 at 0 range 14 .. 29; Way at 0 range 30 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Cache maintenance operations type Cache_Peripheral is record -- Instruction cache invalidate all to the PoU ICIALLU : aliased HAL.UInt32; -- Instruction cache invalidate by address to the PoU ICIMVAU : aliased HAL.UInt32; -- Data cache invalidate by address to the PoC DCIMVAC : aliased HAL.UInt32; -- Data cache invalidate by set/way DCISW : aliased DCISW_Register; -- Data cache clean by address to the PoU DCCMVAU : aliased HAL.UInt32; -- Data cache clean by address to the PoC DCCMVAC : aliased HAL.UInt32; -- Data cache clean by set/way DCCSW : aliased DCCSW_Register; -- Data cache clean and invalidate by address to the PoC DCCIMVAC : aliased HAL.UInt32; -- Data cache clean and invalidate by set/way DCCISW : aliased DCCISW_Register; end record with Volatile; for Cache_Peripheral use record ICIALLU at 16#0# range 0 .. 31; ICIMVAU at 16#8# range 0 .. 31; DCIMVAC at 16#C# range 0 .. 31; DCISW at 16#10# range 0 .. 31; DCCMVAU at 16#14# range 0 .. 31; DCCMVAC at 16#18# range 0 .. 31; DCCSW at 16#1C# range 0 .. 31; DCCIMVAC at 16#20# range 0 .. 31; DCCISW at 16#24# range 0 .. 31; end record; -- Cache maintenance operations Cache_Periph : aliased Cache_Peripheral with Import, Address => Cache_Base; end Cortex_M_SVD.Cache;
ecalderini/bingada
Ada
538
adb
with Ada.Numerics.Discrete_Random; package body Q_GEN_SHUFFLE is procedure P_Shuffle (List : in out Array_Type) is package Discrete_Random is new Ada.Numerics.DISCRETE_RANDOM (Result_Subtype => POSITIVE); use Discrete_Random; K : POSITIVE; G : Generator; T : Element_Type; begin Reset (G); for I in reverse List'Range loop K := (Random(G) mod I) + 1; T := List(I); List(I) := List(K); List(K) := T; end loop; end P_Shuffle; end Q_GEN_SHUFFLE;
reznikmm/matreshka
Ada
4,609
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Number.Grouping_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Number_Grouping_Attribute_Node is begin return Self : Number_Grouping_Attribute_Node do Matreshka.ODF_Number.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Number_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Number_Grouping_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Grouping_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Number_URI, Matreshka.ODF_String_Constants.Grouping_Attribute, Number_Grouping_Attribute_Node'Tag); end Matreshka.ODF_Number.Grouping_Attributes;
AdaCore/training_material
Ada
4,211
adb
----------------------------------------------------------------------- -- Ada Labs -- -- -- -- Copyright (C) 2008-2009, AdaCore -- -- -- -- Labs is free software; you can redistribute it and/or modify it -- -- under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or -- -- (at your option) any later version. -- -- -- -- This program is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. You should have received -- -- a copy of the GNU General Public License along with this program; -- -- if not, write to the Free Software Foundation, Inc., 59 Temple -- -- Place - Suite 330, Boston, MA 02111-1307, USA. -- ----------------------------------------------------------------------- with Ada.Real_Time; use Ada.Real_Time; with Solar_System; use Solar_System; with Display; use Display; with Display.Basic; use Display.Basic; with Solar_System.Graphics; use Solar_System.Graphics; --with Last_Chance_Handler; procedure Main is -- declare a variable Now of type Time to record current time Now : Time; -- declare a constant Period of 40 milliseconds of type Time_Span defining the loop period Period : constant Time_Span := Milliseconds (40); -- reference to the application window Window : Window_ID; begin -- Create the main window Window := Create_Window(Width => 240, Height => 320, Name => "Solar System"); Graphic_Context.Set_Window(Window); -- initialize Bodies using Init_Body procedure Init_Body (B => Sun, Radius => 20.0, Color => Yellow, Distance => 0.0, Speed => 0.0, Turns_Around => Sun); Init_Body (B => Earth, Radius => 5.0, Color => Blue, Distance => 50.0, Speed => 0.02, Turns_Around => Sun); Init_Body (B => Moon, Radius => 2.0, Color => Gray, Distance => 15.0, Speed => 0.04, Turns_Around => Earth); Init_Body (B => Satellite, Radius => 1.0, Color => Red, Distance => 8.0, Speed => 0.1, Turns_Around => Earth); Init_Body (B => Comet, Radius => 1.0, Color => Yellow, Distance => 80.0, Speed => 0.05, Tail => True, Turns_Around => Sun); Init_Body (B => Black_Hole, Radius => 0.0, Color => Blue, Distance => 75.0, Speed => -0.02, Turns_Around => Sun, Visible => False); Init_Body (B => Asteroid_1, Radius => 2.0, Color => Green, Distance => 5.0, Speed => 0.1, Turns_Around => Black_Hole); Init_Body (B => Asteroid_2, Radius => 2.0, Color => Blue, Distance => 5.0, Speed => 0.1, Angle => 1.57, Turns_Around => Black_Hole); -- create an infinite loop -- update the Now time with current clock -- wait until Now + Period time elapsed before the next loop Now := Clock; delay until Now + Period; end loop; end Main;
reznikmm/matreshka
Ada
6,523
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013-2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ private with Ada.Finalization; with Ada.Streams; with League.JSON.Arrays; with League.JSON.Objects; with League.Stream_Element_Vectors; with League.Strings; private with Matreshka.JSON_Documents; package League.JSON.Documents is pragma Preelaborate; type JSON_Encoding is (UTF8, UTF16, UTF16LE, UTF16BE, UTF32, UTF32LE, UTF32BE); type JSON_Document is tagged private; Empty_JSON_Document : constant JSON_Document; function From_JSON (Data : League.Stream_Element_Vectors.Stream_Element_Vector) return JSON_Document; function From_JSON (Data : Ada.Streams.Stream_Element_Array) return JSON_Document; -- Parses an encoded JSON document and creates a JSON_Document from it. -- Data can be encoded using UTF-8, UTF-16 and UTF-32 encoding. Encoding -- is detected automatically accroding to RFC-4627. function From_JSON (Data : League.Strings.Universal_String) return JSON_Document; -- Parses an encoded JSON document and creates a JSON_Document from it. function To_JSON (Self : JSON_Document'Class; Encoding : JSON_Encoding := UTF8) return League.Stream_Element_Vectors.Stream_Element_Vector; -- Converts the JSON_Document to an encoded JSON document. Encoding can be -- selected by Encoding parameter. function To_JSON (Self : JSON_Document'Class) return League.Strings.Universal_String; -- Converts the JSON_Document to an encoded JSON document. function Is_Array (Self : JSON_Document'Class) return Boolean; -- Returns true if the document contains an array. function Is_Empty (Self : JSON_Document'Class) return Boolean; -- Returns true if the document doesn't contain any data. function Is_Object (Self : JSON_Document'Class) return Boolean; -- Returns true if the document contains an object. procedure Set_Array (Self : in out JSON_Document'Class; Value : League.JSON.Arrays.JSON_Array); -- Sets array as the main object of this document. procedure Set_Object (Self : in out JSON_Document'Class; Value : League.JSON.Objects.JSON_Object); -- Sets object as the main object of this document. function To_JSON_Array (Self : JSON_Document'Class) return League.JSON.Arrays.JSON_Array; -- Returns the JSON_Array contained in the document. -- -- Returns an empty array if the document contains an object. function To_JSON_Object (Self : JSON_Document'Class) return League.JSON.Objects.JSON_Object; -- Returns the JSON_Object contained in the document. -- -- Returns an empty object if the document contains an array. private type JSON_Document is new Ada.Finalization.Controlled with record Data : Matreshka.JSON_Documents.Shared_JSON_Document_Access := Matreshka.JSON_Documents.Empty_Shared_JSON_Document'Access; end record; overriding procedure Adjust (Self : in out JSON_Document); overriding procedure Finalize (Self : in out JSON_Document); Empty_JSON_Document : constant JSON_Document := (Ada.Finalization.Controlled with Data => Matreshka.JSON_Documents.Empty_Shared_JSON_Document'Access); end League.JSON.Documents;
reznikmm/matreshka
Ada
3,609
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Elements.Generic_Hash; function AMF.UML.Interactions.Hash is new AMF.Elements.Generic_Hash (UML_Interaction, UML_Interaction_Access);
stcarrez/ada-ado
Ada
9,769
ads
----------------------------------------------------------------------- -- Regtests.Comments -- Regtests.Comments ----------------------------------------------------------------------- -- File generated by Dynamo DO NOT MODIFY -- Template used: templates/model/package-spec.xhtml -- Ada Generator: https://github.com/stcarrez/dynamo Version 1.4.0 ----------------------------------------------------------------------- -- Copyright (C) 2022 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- pragma Warnings (Off); with ADO.Sessions; with ADO.Objects; with ADO.Statements; with ADO.SQL; with ADO.Schemas; with Ada.Calendar; with Ada.Containers.Vectors; with Ada.Strings.Unbounded; with Util.Beans.Objects; with Util.Beans.Basic.Lists; with Regtests.Simple.Model; pragma Warnings (On); package Regtests.Comments is pragma Style_Checks ("-mrIu"); type Comment_Ref is new ADO.Objects.Object_Ref with null record; -- -------------------- -- The Comment table records a user comment associated with a database entity. -- The comment can be associated with any other database record. -- -------------------- -- Create an object key for Comment. function Comment_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key; -- Create an object key for Comment from a string. -- Raises Constraint_Error if the string cannot be converted into the object key. function Comment_Key (Id : in String) return ADO.Objects.Object_Key; Null_Comment : constant Comment_Ref; function "=" (Left, Right : Comment_Ref'Class) return Boolean; -- Set the comment identifier procedure Set_Id (Object : in out Comment_Ref; Value : in ADO.Identifier); -- Get the comment identifier function Get_Id (Object : in Comment_Ref) return ADO.Identifier; -- Get the comment version. function Get_Version (Object : in Comment_Ref) return Integer; -- Set the comment publication date. procedure Set_Date (Object : in out Comment_Ref; Value : in Ada.Calendar.Time); -- Get the comment publication date. function Get_Date (Object : in Comment_Ref) return Ada.Calendar.Time; -- Set the comment message. procedure Set_Message (Object : in out Comment_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String); procedure Set_Message (Object : in out Comment_Ref; Value : in String); -- Get the comment message. function Get_Message (Object : in Comment_Ref) return Ada.Strings.Unbounded.Unbounded_String; function Get_Message (Object : in Comment_Ref) return String; -- Set the entity identifier to which this comment is associated. procedure Set_Entity_Id (Object : in out Comment_Ref; Value : in Integer); -- Get the entity identifier to which this comment is associated. function Get_Entity_Id (Object : in Comment_Ref) return Integer; -- Set the user who posted this comment procedure Set_User (Object : in out Comment_Ref; Value : in Regtests.Simple.Model.User_Ref'Class); -- Get the user who posted this comment function Get_User (Object : in Comment_Ref) return Regtests.Simple.Model.User_Ref'Class; -- Set the entity type that correspond to the entity associated with this comment. procedure Set_Entity_Type (Object : in out Comment_Ref; Value : in ADO.Entity_Type); -- Get the entity type that correspond to the entity associated with this comment. function Get_Entity_Type (Object : in Comment_Ref) return ADO.Entity_Type; -- Load the entity identified by 'Id'. -- Raises the NOT_FOUND exception if it does not exist. procedure Load (Object : in out Comment_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier); -- Load the entity identified by 'Id'. -- Returns True in <b>Found</b> if the object was found and False if it does not exist. procedure Load (Object : in out Comment_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier; Found : out Boolean); -- Reload from the database the same object if it was modified. -- Returns True in `Updated` if the object was reloaded. -- Raises the NOT_FOUND exception if it does not exist. procedure Reload (Object : in out Comment_Ref; Session : in out ADO.Sessions.Session'Class; Updated : out Boolean); -- Find and load the entity. overriding procedure Find (Object : in out Comment_Ref; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean); -- Save the entity. If the entity does not have an identifier, an identifier is allocated -- and it is inserted in the table. Otherwise, only data fields which have been changed -- are updated. overriding procedure Save (Object : in out Comment_Ref; Session : in out ADO.Sessions.Master_Session'Class); -- Delete the entity. overriding procedure Delete (Object : in out Comment_Ref; Session : in out ADO.Sessions.Master_Session'Class); overriding function Get_Value (From : in Comment_Ref; Name : in String) return Util.Beans.Objects.Object; -- Table definition COMMENT_TABLE : constant ADO.Schemas.Class_Mapping_Access; -- Internal method to allocate the Object_Record instance overriding procedure Allocate (Object : in out Comment_Ref); -- Copy of the object. procedure Copy (Object : in Comment_Ref; Into : in out Comment_Ref); package Comment_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Comment_Ref, "=" => "="); subtype Comment_Vector is Comment_Vectors.Vector; procedure List (Object : in out Comment_Vector; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class); private COMMENT_NAME : aliased constant String := "TEST_COMMENTS"; COL_0_1_NAME : aliased constant String := "id"; COL_1_1_NAME : aliased constant String := "version"; COL_2_1_NAME : aliased constant String := "date"; COL_3_1_NAME : aliased constant String := "message"; COL_4_1_NAME : aliased constant String := "entity_id"; COL_5_1_NAME : aliased constant String := "user_fk"; COL_6_1_NAME : aliased constant String := "entity__type_fk"; COMMENT_DEF : aliased constant ADO.Schemas.Class_Mapping := (Count => 7, Table => COMMENT_NAME'Access, Members => ( 1 => COL_0_1_NAME'Access, 2 => COL_1_1_NAME'Access, 3 => COL_2_1_NAME'Access, 4 => COL_3_1_NAME'Access, 5 => COL_4_1_NAME'Access, 6 => COL_5_1_NAME'Access, 7 => COL_6_1_NAME'Access) ); COMMENT_TABLE : constant ADO.Schemas.Class_Mapping_Access := COMMENT_DEF'Access; Null_Comment : constant Comment_Ref := Comment_Ref'(ADO.Objects.Object_Ref with null record); type Comment_Impl is new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER, Of_Class => COMMENT_DEF'Access) with record Version : Integer; Date : Ada.Calendar.Time; Message : Ada.Strings.Unbounded.Unbounded_String; Entity_Id : Integer; User : Regtests.Simple.Model.User_Ref; Entity_Type : ADO.Entity_Type; end record; type Comment_Access is access all Comment_Impl; overriding procedure Destroy (Object : access Comment_Impl); overriding procedure Find (Object : in out Comment_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean); overriding procedure Load (Object : in out Comment_Impl; Session : in out ADO.Sessions.Session'Class); procedure Load (Object : in out Comment_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class); overriding procedure Save (Object : in out Comment_Impl; Session : in out ADO.Sessions.Master_Session'Class); overriding procedure Create (Object : in out Comment_Impl; Session : in out ADO.Sessions.Master_Session'Class); overriding procedure Delete (Object : in out Comment_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Set_Field (Object : in out Comment_Ref'Class; Impl : out Comment_Access); end Regtests.Comments;
zhmu/ananas
Ada
4,509
adb
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- G N A T . B Y T E _ S W A P P I N G -- -- -- -- B o d y -- -- -- -- Copyright (C) 2006-2022, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This is a general implementation that uses GCC intrinsics to take -- advantage of any machine-specific instructions. with Ada.Unchecked_Conversion; use Ada; with System.Byte_Swapping; use System.Byte_Swapping; package body GNAT.Byte_Swapping is -------------- -- Swapped2 -- -------------- function Swapped2 (Input : Item) return Item is function As_U16 is new Unchecked_Conversion (Item, U16); function As_Item is new Unchecked_Conversion (U16, Item); pragma Compile_Time_Warning (Item'Max_Size_In_Storage_Elements /= 2, "storage size must be 2 bytes"); begin return As_Item (Bswap_16 (As_U16 (Input))); end Swapped2; -------------- -- Swapped4 -- -------------- function Swapped4 (Input : Item) return Item is function As_U32 is new Unchecked_Conversion (Item, U32); function As_Item is new Unchecked_Conversion (U32, Item); pragma Compile_Time_Warning (Item'Max_Size_In_Storage_Elements /= 4, "storage size must be 4 bytes"); begin return As_Item (Bswap_32 (As_U32 (Input))); end Swapped4; -------------- -- Swapped8 -- -------------- function Swapped8 (Input : Item) return Item is function As_U64 is new Unchecked_Conversion (Item, U64); function As_Item is new Unchecked_Conversion (U64, Item); pragma Compile_Time_Warning (Item'Max_Size_In_Storage_Elements /= 8, "storage size must be 8 bytes"); begin return As_Item (Bswap_64 (As_U64 (Input))); end Swapped8; ----------- -- Swap2 -- ----------- procedure Swap2 (Location : System.Address) is X : U16; for X'Address use Location; begin X := Bswap_16 (X); end Swap2; ----------- -- Swap4 -- ----------- procedure Swap4 (Location : System.Address) is X : U32; for X'Address use Location; begin X := Bswap_32 (X); end Swap4; ----------- -- Swap8 -- ----------- procedure Swap8 (Location : System.Address) is X : U64; for X'Address use Location; begin X := Bswap_64 (X); end Swap8; end GNAT.Byte_Swapping;
reznikmm/matreshka
Ada
11,657
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- SQL Database Access -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2013, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This package is low level bindings to SQLite3 library. ------------------------------------------------------------------------------ with Interfaces.C; with Matreshka.Internals.Strings.C; with Matreshka.Internals.Utf16; package Matreshka.Internals.SQL_Drivers.SQLite3 is pragma Preelaborate; ---------------- -- Data types -- ---------------- type sqlite3 is limited private; type sqlite3_Access is access all sqlite3; pragma Convention (C, sqlite3_Access); type sqlite3_stmt is limited private; type sqlite3_stmt_Access is access all sqlite3_stmt; pragma Convention (C, sqlite3_stmt_Access); type Utf16_Code_Unit_Access_Destructor is access procedure (Text : Matreshka.Internals.Strings.C.Utf16_Code_Unit_Access); pragma Convention (C, Utf16_Code_Unit_Access_Destructor); --------------- -- Constants -- --------------- SQLITE_OK : constant := 0; -- Successful result --#define SQLITE_ERROR 1 /* SQL error or missing database */ --#define SQLITE_INTERNAL 2 /* Internal logic error in SQLite */ --#define SQLITE_PERM 3 /* Access permission denied */ --#define SQLITE_ABORT 4 /* Callback routine requested an abort */ --#define SQLITE_BUSY 5 /* The database file is locked */ --#define SQLITE_LOCKED 6 /* A table in the database is locked */ --#define SQLITE_NOMEM 7 /* A malloc() failed */ --#define SQLITE_READONLY 8 /* Attempt to write a readonly database */ --#define SQLITE_INTERRUPT 9 /* Operation terminated by sqlite3_interrupt()*/ --#define SQLITE_IOERR 10 /* Some kind of disk I/O error occurred */ --#define SQLITE_CORRUPT 11 /* The database disk image is malformed */ --#define SQLITE_NOTFOUND 12 /* Unknown opcode in sqlite3_file_control() */ --#define SQLITE_FULL 13 /* Insertion failed because database is full */ --#define SQLITE_CANTOPEN 14 /* Unable to open the database file */ --#define SQLITE_PROTOCOL 15 /* Database lock protocol error */ --#define SQLITE_EMPTY 16 /* Database is empty */ --#define SQLITE_SCHEMA 17 /* The database schema changed */ --#define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */ --#define SQLITE_CONSTRAINT 19 /* Abort due to constraint violation */ --#define SQLITE_MISMATCH 20 /* Data type mismatch */ --#define SQLITE_MISUSE 21 /* Library used incorrectly */ --#define SQLITE_NOLFS 22 /* Uses OS features not supported on host */ --#define SQLITE_AUTH 23 /* Authorization denied */ --#define SQLITE_FORMAT 24 /* Auxiliary database format error */ --#define SQLITE_RANGE 25 /* 2nd parameter to sqlite3_bind out of range */ --#define SQLITE_NOTADB 26 /* File opened that is not a database file */ SQLITE_ROW : constant := 100; -- sqlite3_step() has another row -- ready SQLITE_DONE : constant := 101; -- sqlite3_step() has finished -- executing SQLITE_CONFIG_SINGLETHREAD : constant := 1; -- nil SQLITE_CONFIG_MULTITHREAD : constant := 2; -- nil SQLITE_CONFIG_SERIALIZED : constant := 3; -- nil --#define SQLITE_CONFIG_MALLOC 4 /* sqlite3_mem_methods* */ --#define SQLITE_CONFIG_GETMALLOC 5 /* sqlite3_mem_methods* */ --#define SQLITE_CONFIG_SCRATCH 6 /* void*, int sz, int N */ --#define SQLITE_CONFIG_PAGECACHE 7 /* void*, int sz, int N */ --#define SQLITE_CONFIG_HEAP 8 /* void*, int nByte, int min */ --#define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */ --#define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */ --#define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */ --/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ --#define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ --#define SQLITE_CONFIG_PCACHE 14 /* sqlite3_pcache_methods* */ --#define SQLITE_CONFIG_GETPCACHE 15 /* sqlite3_pcache_methods* */ --#define SQLITE_CONFIG_LOG 16 /* xFunc, void* */ SQLITE_INTEGER : constant := 1; SQLITE_FLOAT : constant := 2; SQLITE_TEXT : constant := 3; SQLITE_BLOB : constant := 4; SQLITE_NULL : constant := 5; --------------- -- Functions -- --------------- function sqlite3_bind_double (Handle : sqlite3_stmt_Access; Index : Interfaces.C.int; Value : Interfaces.C.double) return Interfaces.C.int; pragma Import (C, sqlite3_bind_double); function sqlite3_bind_int64 (Handle : sqlite3_stmt_Access; Index : Interfaces.C.int; Value : Interfaces.Integer_64) return Interfaces.C.int; pragma Import (C, sqlite3_bind_int64); function sqlite3_bind_null (Handle : sqlite3_stmt_Access; Index : Interfaces.C.int) return Interfaces.C.int; pragma Import (C, sqlite3_bind_null); function sqlite3_bind_parameter_count (Handle : sqlite3_stmt_Access) return Interfaces.C.int; pragma Import (C, sqlite3_bind_parameter_count); function sqlite3_bind_parameter_index (Handle : sqlite3_stmt_Access; Name : Interfaces.C.char_array) return Interfaces.C.int; pragma Import (C, sqlite3_bind_parameter_index); function sqlite3_bind_text16 (Handle : sqlite3_stmt_Access; Index : Interfaces.C.int; Text : Matreshka.Internals.Strings.C.Utf16_Code_Unit_Access; nBytes : Interfaces.C.int; Destructor : Utf16_Code_Unit_Access_Destructor) return Interfaces.C.int; pragma Import (C, sqlite3_bind_text16); function sqlite3_close (Handle : sqlite3_Access) return Interfaces.C.int; pragma Import (C, sqlite3_close); function sqlite3_column_bytes16 (Handle : sqlite3_stmt_Access; iCol : Interfaces.C.int) return Interfaces.C.int; pragma Import (C, sqlite3_column_bytes16); function sqlite3_column_double (Handle : sqlite3_stmt_Access; iCol : Interfaces.C.int) return Interfaces.C.double; pragma Import (C, sqlite3_column_double); function sqlite3_column_int64 (Handle : sqlite3_stmt_Access; iCol : Interfaces.C.int) return Interfaces.Integer_64; pragma Import (C, sqlite3_column_int64); function sqlite3_column_text16 (Handle : sqlite3_stmt_Access; iCol : Interfaces.C.int) return Matreshka.Internals.Strings.C.Utf16_Code_Unit_Access; pragma Import (C, sqlite3_column_text16); function sqlite3_column_type (Handle : sqlite3_stmt_Access; iCol : Interfaces.C.int) return Interfaces.C.int; pragma Import (C, sqlite3_column_type); function sqlite3_config (Option : Interfaces.C.int) return Interfaces.C.int; pragma Import (C, sqlite3_config); function sqlite3_errmsg16 (db : sqlite3_Access) return Matreshka.Internals.Strings.C.Utf16_Code_Unit_Access; pragma Import (C, sqlite3_errmsg16); function sqlite3_finalize (Handle : sqlite3_stmt_Access) return Interfaces.C.int; pragma Import (C, sqlite3_finalize); function sqlite3_last_insert_rowid (Handle : sqlite3_Access) return Interfaces.Integer_64; pragma Import (C, sqlite3_last_insert_rowid); function sqlite3_open16 (File_Name : Matreshka.Internals.Utf16.Utf16_String; -- Handle : out sqlite3_Access) return Interfaces.C.int; Handle : not null access sqlite3_Access) return Interfaces.C.int; pragma Import (C, sqlite3_open16); function sqlite3_prepare16_v2 (db : sqlite3_Access; zSql : Matreshka.Internals.Utf16.Utf16_String; nByte : Interfaces.C.int; -- ppStmt : out sqlite3_stmt_Access; -- pzTail : out Utf16_Code_Unit_Access) return Interfaces.C.int; ppStmt : not null access sqlite3_stmt_Access; pzTail : not null access Matreshka.Internals.Strings.C.Utf16_Code_Unit_Access) return Interfaces.C.int; pragma Import (C, sqlite3_prepare16_v2); function sqlite3_reset (pStmt : sqlite3_stmt_Access) return Interfaces.C.int; pragma Import (C, sqlite3_reset); function sqlite3_step (Handle : sqlite3_stmt_Access) return Interfaces.C.int; pragma Import (C, sqlite3_step); private type sqlite3 is limited null record; type sqlite3_stmt is limited null record; end Matreshka.Internals.SQL_Drivers.SQLite3;
stcarrez/ada-lzma
Ada
5,358
ads
pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with Lzma.Base; with Ada.Streams; package Lzma.Check is LZMA_CHECK_ID_MAX : constant := 15; -- /usr/include/lzma/check.h:68 LZMA_CHECK_SIZE_MAX : constant := 64; -- /usr/include/lzma/check.h:102 --* -- * \file lzma/check.h -- * \brief Integrity checks -- -- * Author: Lasse Collin -- * -- * This file has been put into the public domain. -- * You can do whatever you want with this file. -- * -- * See ../lzma.h for information about liblzma as a whole. -- --* -- * \brief Type of the integrity check (Check ID) -- * -- * The .xz format supports multiple types of checks that are calculated -- * from the uncompressed data. They vary in both speed and ability to -- * detect errors. -- --*< -- * No Check is calculated. -- * -- * Size of the Check field: 0 bytes -- --*< -- * CRC32 using the polynomial from the IEEE 802.3 standard -- * -- * Size of the Check field: 4 bytes -- --*< -- * CRC64 using the polynomial from the ECMA-182 standard -- * -- * Size of the Check field: 8 bytes -- --*< -- * SHA-256 -- * -- * Size of the Check field: 32 bytes -- subtype lzma_check is unsigned; LZMA_CHECK_NONE : constant lzma_check := 0; LZMA_CHECK_CRC32 : constant lzma_check := 1; LZMA_CHECK_CRC64 : constant lzma_check := 4; LZMA_CHECK_SHA256 : constant lzma_check := 10; -- /usr/include/lzma/check.h:55 --* -- * \brief Maximum valid Check ID -- * -- * The .xz file format specification specifies 16 Check IDs (0-15). Some -- * of them are only reserved, that is, no actual Check algorithm has been -- * assigned. When decoding, liblzma still accepts unknown Check IDs for -- * future compatibility. If a valid but unsupported Check ID is detected, -- * liblzma can indicate a warning; see the flags LZMA_TELL_NO_CHECK, -- * LZMA_TELL_UNSUPPORTED_CHECK, and LZMA_TELL_ANY_CHECK in container.h. -- --* -- * \brief Test if the given Check ID is supported -- * -- * Return true if the given Check ID is supported by this liblzma build. -- * Otherwise false is returned. It is safe to call this with a value that -- * is not in the range [0, 15]; in that case the return value is always false. -- * -- * You can assume that LZMA_CHECK_NONE and LZMA_CHECK_CRC32 are always -- * supported (even if liblzma is built with limited features). -- function lzma_check_is_supported (check : lzma_check) return Lzma.Base.lzma_bool; -- /usr/include/lzma/check.h:81 pragma Import (C, lzma_check_is_supported, "lzma_check_is_supported"); --* -- * \brief Get the size of the Check field with the given Check ID -- * -- * Although not all Check IDs have a check algorithm associated, the size of -- * every Check is already frozen. This function returns the size (in bytes) of -- * the Check field with the specified Check ID. The values are: -- * { 0, 4, 4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64, 64 } -- * -- * If the argument is not in the range [0, 15], UINT32_MAX is returned. -- function lzma_check_size (check : lzma_check) return Interfaces.C.unsigned; -- /usr/include/lzma/check.h:95 pragma Import (C, lzma_check_size, "lzma_check_size"); --* -- * \brief Maximum size of a Check field -- --* -- * \brief Calculate CRC32 -- * -- * Calculate CRC32 using the polynomial from the IEEE 802.3 standard. -- * -- * \param buf Pointer to the input buffer -- * \param size Size of the input buffer -- * \param crc Previously returned CRC value. This is used to -- * calculate the CRC of a big buffer in smaller chunks. -- * Set to zero when starting a new calculation. -- * -- * \return Updated CRC value, which can be passed to this function -- * again to continue CRC calculation. -- function lzma_crc32 (buf : access Ada.Streams.Stream_Element; size : Interfaces.C.size_t; crc : Interfaces.C.unsigned) return Interfaces.C.unsigned; -- /usr/include/lzma/check.h:119 pragma Import (C, lzma_crc32, "lzma_crc32"); --* -- * \brief Calculate CRC64 -- * -- * Calculate CRC64 using the polynomial from the ECMA-182 standard. -- * -- * This function is used similarly to lzma_crc32(). See its documentation. -- function lzma_crc64 (buf : access Ada.Streams.Stream_Element; size : Interfaces.C.size_t; crc : Long_Long_Integer) return Long_Long_Integer; -- /usr/include/lzma/check.h:131 pragma Import (C, lzma_crc64, "lzma_crc64"); -- * SHA-256 functions are currently not exported to public API. -- * Contact Lasse Collin if you think it should be. -- --* -- * \brief Get the type of the integrity check -- * -- * This function can be called only immediately after lzma_code() has -- * returned LZMA_NO_CHECK, LZMA_UNSUPPORTED_CHECK, or LZMA_GET_CHECK. -- * Calling this function in any other situation has undefined behavior. -- function lzma_get_check (strm : access constant Lzma.Base.lzma_stream) return lzma_check; -- /usr/include/lzma/check.h:149 pragma Import (C, lzma_get_check, "lzma_get_check"); end Lzma.Check;
OneWingedShark/EVIL
Ada
3,130
ads
Pragma Ada_2012; Pragma Assertion_Policy( Check ); With Ada.Finalization, Ada.Streams; Generic Type Character is (<>); Type String is array(Positive Range <>) of Character; Empty_String : String := (2..1 => <>); Type File_Type is limited private; Type File_Mode is (<>); Type Stream_Access is access all Ada.Streams.Root_Stream_Type'Class; with function Stream (File : File_Type) return Stream_Access is <>; with procedure Create (File : in out File_Type; Mode : File_Mode; Name : String := Empty_String; Form : String := Empty_String) is <>; with procedure Open (File : in out File_Type; Mode : File_Mode; Name : String; Form : String := Empty_String) is <>; with procedure Close (File : In Out File_Type) is <>; with procedure Delete (File : In Out File_Type) is <>; with procedure Reset (File : In Out File_Type; Mode : File_Mode) is <>; with procedure Reset (File : In Out File_Type) is <>; with function Mode (File : In File_Type) return File_Mode is <>; with function Name (File : In File_Type) return String is <>; with function Form (File : In File_Type) return String is <>; with function Is_Open (File : In File_Type) return Boolean is <>; Package EVIL.Util.Files with Pure, SPARK_Mode => On is Type File is tagged limited private; Function Create (Name : In String; Mode : In File_Mode) Return File with Global => Null, Depends => (Create'Result => (Name, Mode)); Function Open (Name : In String; Mode : In File_Mode) Return File with Global => Null, Depends => (Open'Result => (Name, Mode)); Function Mode (Object : In File) Return File_Mode with Global => Null, Depends => (Mode'Result => Object); Function Name (Object : In File) Return String with Global => Null, Depends => (Name'Result => Object); Function Form (Object : In File) Return String with Global => Null, Depends => (Form'Result => Object); Function Open (Object : In File) Return Boolean with Global => Null, Depends => (Open'Result => Object); Function Stream (Object : In File) Return Stream_Access with Global => Null, Depends => (Stream'Result => Object); Procedure Close (Object : In Out File) with Global => Null, Depends => (Object =>+ Null); Procedure Delete (Object : In Out File) with Global => Null, Depends => (Object =>+ Null); Procedure Reset (Object : In Out File) with Global => Null, Depends => (Object =>+ Null); Procedure Reset (Object : In Out File; Mode : In File_Mode) with Global => Null, Depends => (Object =>+ Mode); Private Type File is new Ada.Finalization.Limited_Controlled with Record Data : Aliased File_Type; FSA : Stream_Access; end record; Overriding Procedure Finalize (Object : In Out File) with Global => Null, Depends => (Object => Null); Function Stream (Object : File) return Stream_Access is (Object.FSA); End EVIL.Util.Files;
damaki/SPARKNaCl
Ada
689
adb
with SPARKNaCl; use SPARKNaCl; with SPARKNaCl.Cryptobox; use SPARKNaCl.Cryptobox; with SPARKNaCl.Stream; with Ada.Text_IO; use Ada.Text_IO; procedure BadBox is AliceSK, BobSK : Secret_Key; AlicePK, BobPK : Public_Key; N : Stream.HSalsa20_Nonce; S, S2 : Boolean; subtype Text is Byte_Seq (0 .. 100); M, C, M2 : Text := (others => 0); begin Keypair (AlicePK, AliceSK); Keypair (BobPK, BobSK); Random_Bytes (Bytes_24 (N)); Random_Bytes (M (Plaintext_Zero_Bytes .. M'Last)); -- Final 2 params wrong way round Create (C, S, M, N, AliceSK, BobPK); -- Final 2 params wrong way round Open (M2, S2, C, N, BobSK, AlicePK); end BadBox;
charlie5/lace
Ada
960
ads
with openGL.Font, openGL.Geometry; package openGL.Model.sphere.lit_colored -- -- Models a lit, colored sphere. -- is type Item is new Model.sphere.item with private; type View is access all Item'Class; --------- --- Forge -- function new_Sphere (Radius : in Real; lat_Count : in Positive := default_latitude_Count; long_Count : in Positive := default_longitude_Count; Color : in lucid_Color) return View; -------------- --- Attributes -- overriding function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class; Fonts : in Font.font_id_Map_of_font) return Geometry.views; private type Item is new Model.sphere.item with record Color : lucid_Color; end record; end openGL.Model.sphere.lit_colored;
RREE/ada-util
Ada
21,123
adb
----------------------------------------------------------------------- -- util-dates-formats-tests - Test for date formats -- Copyright (C) 2011, 2013, 2014, 2016, 2017, 2018, 2020 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Calendar.Formatting; with Ada.Exceptions; with Util.Test_Caller; with Util.Assertions; with Util.Properties.Bundles; with Util.Log.Loggers; with Util.Dates.RFC7231; with Util.Dates.ISO8601; package body Util.Dates.Formats.Tests is use Ada.Strings.Unbounded; -- The logger Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Util.Dates.Formats.Tests"); package Caller is new Util.Test_Caller (Test, "Dates.Formats"); procedure Check (T : in out Test; Date : in String); procedure Check (T : in out Test'Class; Year : in Ada.Calendar.Year_Number; Month : in Ada.Calendar.Month_Number; Day : in Ada.Calendar.Day_Number; Expect_Day : in Ada.Calendar.Day_Number; Message : in String; Is_End : in Boolean; Operation : access function (D : in Ada.Calendar.Time) return Ada.Calendar.Time); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test Util.Dates.Split", Test_Split'Access); Caller.Add_Test (Suite, "Test Util.Dates.Formats.Format", Test_Format'Access); Caller.Add_Test (Suite, "Test Util.Dates.Formats.Parse", Test_Parse'Access); Caller.Add_Test (Suite, "Test Util.Dates.Formats.Parse (Error)", Test_Parse_Error'Access); Caller.Add_Test (Suite, "Test Util.Dates.Get_Day_Start", Test_Get_Day_Start'Access); Caller.Add_Test (Suite, "Test Util.Dates.Get_Week_Start", Test_Get_Week_Start'Access); Caller.Add_Test (Suite, "Test Util.Dates.Get_Month_Start", Test_Get_Month_Start'Access); Caller.Add_Test (Suite, "Test Util.Dates.Get_Day_End", Test_Get_Day_End'Access); Caller.Add_Test (Suite, "Test Util.Dates.Get_Week_End", Test_Get_Week_End'Access); Caller.Add_Test (Suite, "Test Util.Dates.Get_Month_End", Test_Get_Month_End'Access); Caller.Add_Test (Suite, "Test Util.Dates.RFC7231.Append_Date", Test_Append_Date'Access); Caller.Add_Test (Suite, "Test Util.Dates.ISO8601.Image", Test_ISO8601'Access); end Add_Tests; procedure Test_Format (T : in out Test) is Bundle : Util.Properties.Bundles.Manager; procedure Check (Pattern : in String; Date : in Ada.Calendar.Time; Expect : in String); procedure Check (Pattern : in String; Date : in Ada.Calendar.Time; Expect : in String) is Result : Ada.Strings.Unbounded.Unbounded_String; begin Util.Dates.Formats.Format (Pattern => Pattern, Date => Date, Bundle => Bundle, Into => Result); Util.Tests.Assert_Equals (T, Expect, To_String (Result), "Invalid result for: " & Pattern); end Check; T1 : constant Ada.Calendar.Time := Ada.Calendar.Formatting.Time_Of (1980, 1, 2, 10, 30, 23); T2 : constant Ada.Calendar.Time := Ada.Calendar.Formatting.Time_Of (2011, 11, 19, 0, 0, 0); T3 : constant Ada.Calendar.Time := Ada.Calendar.Formatting.Time_Of (2011, 11, 19, 23, 0, 0); begin Check ("%H", T1, "10"); Check ("%H", T2, "00"); Check ("%I", T3, "11"); Check ("%k", T2, " 0"); Check ("%k", T3, "23"); Check ("%l", T2, " 0"); Check ("%l", T3, "11"); Check ("%r", T3, "11:00:00 PM"); Check ("%r", T2, "00:00:00 AM"); Check ("%R:%S", T3, "23:00:00"); Check ("%y-%Y %m/%d %T", T1, "80-1980 01/02 10:30:23"); Check ("%C %d %D", T1, "19 02 01/02/80"); Check ("%e", T1, " 1"); Check ("%F", T1, "1980-01-02"); Check ("%G", T1, "1980W01"); Check ("%g", T1, "80W01"); Check ("%b", T1, "Jan"); Check ("%b", T2, "Nov"); Check ("%B", T1, "January"); Check ("%B", T2, "November"); Check ("%a", T1, "Tue"); Check ("%a", T2, "Fri"); Check ("%a", T3, "Fri"); Check ("%A", T1, "Tuesday"); Check ("%A", T2, "Friday"); Check ("%A%n%a%t%b %B%n", T2, "Friday" & ASCII.LF & "Fri" & ASCII.HT & "Nov November" & ASCII.LF); Check ("%j", T1, "02"); Check ("%j", T2, "323"); Check ("%j", T3, "324"); Check ("%j%%%p", T1, "02%AM"); Check ("%j%%%p", T2, "323%AM"); Check ("%j%%%M", T3, "324%00"); Check ("%j%%%p", T3, "324%PM"); Check ("Day: %u %w %W", T1, "Day: 02 03 01"); Check ("Day: %u %w %W", T2, "Day: 05 06 46"); Check ("Day: %u %w %W", T3, "Day: 05 06 46"); Check ("%c", T1, "Tue Jan 2 10:30:23 1980"); Check ("T1: %P", T1, "T1: am"); Check ("T2: %P", T2, "T2: am"); Check ("T3: %P", T3, "T3: pm"); Check ("%u %U %V %w %W %x %z %Z %X %Q", T2, "05 46 46 06 46 11/19/11 00:00 UTC 00:00:00 2011 %Q"); end Test_Format; -- ------------------------------ -- Test parsing a date using several formats and different locales. -- ------------------------------ procedure Test_Parse (T : in out Test) is procedure Check (Pattern : in String; Date : in String; Year : Natural; Month : Natural; Day : Natural; Hour : Natural; Minute : Natural; Second : Natural); use Ada.Calendar.Time_Zones; Bundle : Util.Properties.Bundles.Manager; TZ : Time_Offset := 0; procedure Check (Pattern : in String; Date : in String; Year : Natural; Month : Natural; Day : Natural; Hour : Natural; Minute : Natural; Second : Natural) is Result : Date_Record; begin Result := Util.Dates.Formats.Parse (Date => Date, Pattern => Pattern, Bundle => Bundle); Util.Tests.Assert_Equals (T, Year, Natural (Result.Year), "Invalid year with pattern " & Pattern); Util.Tests.Assert_Equals (T, Month, Natural (Result.Month), "Invalid month with pattern " & Pattern); Util.Tests.Assert_Equals (T, Day, Natural (Result.Month_Day), "Invalid day with pattern " & Pattern); Util.Tests.Assert_Equals (T, Hour, Natural (Result.Hour), "Invalid hour with pattern " & Pattern); Util.Tests.Assert_Equals (T, Minute, Natural (Result.Minute), "Invalid minute with pattern " & Pattern); Util.Tests.Assert_Equals (T, Second, Natural (Result.Second), "Invalid second with pattern " & Pattern); Util.Tests.Assert_Equals (T, Integer (TZ), Integer (Result.Time_Zone), "Invalid timezone with pattern " & Pattern); exception when E : Constraint_Error => Util.Tests.Fail (T, "Parsing failed for pattern " & Pattern & ": " & Ada.Exceptions.Exception_Message (E)); end Check; begin Check ("%Y %m/%d %H:%M:%S", "1980 1/2 10:30:23", 1980, 1, 2, 10, 30, 23); Check ("%C%y %m/%d %H:%M:%S", "1980 1/2 10:30:23", 1980, 1, 2, 10, 30, 23); Check ("%B, %d %C%y %R:%S", "January, 2 1980 10:30:23", 1980, 1, 2, 10, 30, 23); Check ("%b, %d %C%y %R:%S", "Jan, 2 1980 10:30:23", 1980, 1, 2, 10, 30, 23); Check ("%b, %d %C%y %T", "Jan, 2 1980 10:30:23", 1980, 1, 2, 10, 30, 23); Check ("%a %b, %d %C%y %R:%S", "Mon Jan, 2 1980 10:30:23", 1980, 1, 2, 10, 30, 23); Check ("%D %H:%M:%S", "1/2/80 10:30:23", 1980, 1, 2, 10, 30, 23); Check ("%F %H:%M:%S", "2018-03-23 10:30:23", 2018, 3, 23, 10, 30, 23); Check ("%Q %F %H:%M:%S %%", "%Q 2018-03-23 10:30:23 %", 2018, 3, 23, 10, 30, 23); Check ("%A|%B| %d %C%y %R:%S %g", "Monday|January| 2 1980 10:30:23 80W01", 1980, 1, 2, 10, 30, 23); Check ("%A|%B| %d %C%y %R:%S %w", "Monday|January| 2 1980 10:30:23 01", 1980, 1, 2, 10, 30, 23); Check ("%F %H:%M:%S %%", "2018-03-23 10:30:23 %", 2018, 3, 23, 10, 30, 23); Check ("%Z %F %H:%M:%S %%", "UTC 2018-03-23 10:30:23 %", 2018, 3, 23, 10, 30, 23); Check ("%F%n%H:%M:%S%t", "2018-03-23" & ASCII.LF & "10:30:23" & ASCII.HT, 2018, 3, 23, 10, 30, 23); Check ("%c", "Tue Jan 2 10:30:23 1980", 1980, 1, 2, 10, 30, 23); Check ("%x %T", "04/10/80 10:30:23", 1980, 4, 10, 10, 30, 23); Check ("%x %I:%M", "04/10/80 10:30", 1980, 4, 10, 10, 30, 0); Check ("%x %r", "04/10/80 10:30:23 AM", 1980, 4, 10, 10, 30, 23); Check ("%x %r", "04/10/80 10:30:23 PM", 1980, 4, 10, 22, 30, 23); Check ("%x %r %u", "04/10/80 10:30:23 PM 6", 1980, 4, 10, 22, 30, 23); TZ := 60 + 30; Check ("%Z %F %H:%M:%S ", "UTC+01:30 2018-03-23 10:30:23 ", 2018, 3, 23, 10, 30, 23); Check ("%z %F %H:%M:%S ", "+01:30 2018-03-23 10:30:23 ", 2018, 3, 23, 10, 30, 23); TZ := -121; Check ("%Z %F %H:%M:%S ", "UTC-02:01 2018-03-23 10:30:23 ", 2018, 3, 23, 10, 30, 23); Check ("%F %H:%M:%S%z", "2018-03-23 10:30:23-02:01", 2018, 3, 23, 10, 30, 23); end Test_Parse; -- Test parsing a date using several formats and having several errors. procedure Test_Parse_Error (T : in out Test) is procedure Check (Pattern : in String; Date : in String); Bundle : Util.Properties.Bundles.Manager; procedure Check (Pattern : in String; Date : in String) is Result : Date_Record; pragma Unreferenced (Result); begin Result := Util.Dates.Formats.Parse (Date => Date, Pattern => Pattern, Bundle => Bundle); T.Fail ("No exception raised for '" & Pattern & "' and date '" & Date & "'"); exception when Constraint_Error => null; end Check; begin Check ("%T", "10:12:456"); Check ("%T", "10:12"); Check ("%T", "10:12:"); Check ("%T", "10:12:w"); Check ("%T", "10:12:65"); Check ("%T", "10:12:60"); Check ("%T", "25:12:30"); Check ("%T", "24:20:30"); Check ("%T", "23:60:30"); Check ("%T", "23:40_30"); Check ("%A", "January"); Check ("%B", "Monday"); Check ("%T %p", "10:12:23 Pm"); Check ("%T %p", "10:12:23 Am"); Check ("%T %P", "10:12:23 Am"); Check ("%T %P", "10:12:23 Pm"); end Test_Parse_Error; procedure Check (T : in out Test'Class; Year : in Ada.Calendar.Year_Number; Month : in Ada.Calendar.Month_Number; Day : in Ada.Calendar.Day_Number; Expect_Day : in Ada.Calendar.Day_Number; Message : in String; Is_End : in Boolean; Operation : access function (D : in Ada.Calendar.Time) return Ada.Calendar.Time) is use type Ada.Calendar.Time; Date : Ada.Calendar.Time := Ada.Calendar.Formatting.Time_Of (Year, Month, Day, 0, 0, 0); begin for I in 1 .. 47 loop declare R : constant Ada.Calendar.Time := Operation (Date); D : Date_Record; begin Split (D, R); Log.Info ("{0} ({1}) => {2}", Ada.Calendar.Formatting.Image (Date), Message, Ada.Calendar.Formatting.Image (R)); Util.Tests.Assert_Equals (T, Natural (Year), Natural (D.Year), "Invalid year " & Message); Util.Tests.Assert_Equals (T, Natural (Month), Natural (D.Month), "Invalid month " & Message); Util.Tests.Assert_Equals (T, Natural (Expect_Day), Natural (D.Month_Day), "Invalid day " & Message); if Is_End then Util.Tests.Assert_Equals (T, 23, Natural (D.Hour), "Invalid hour " & Message); Util.Tests.Assert_Equals (T, 59, Natural (D.Minute), "Invalid minute " & Message); Util.Tests.Assert_Equals (T, 59, Natural (D.Second), "Invalid second " & Message); else Util.Tests.Assert_Equals (T, 0, Natural (D.Hour), "Invalid hour " & Message); Util.Tests.Assert_Equals (T, 0, Natural (D.Minute), "Invalid minute " & Message); Util.Tests.Assert_Equals (T, 0, Natural (D.Second), "Invalid second " & Message); end if; end; Date := Date + 1800.0; end loop; end Check; -- ------------------------------ -- Test the Get_Day_Start operation. -- ------------------------------ procedure Test_Get_Day_Start (T : in out Test) is begin Check (T, 2013, 6, 04, 04, "Get_Day_Start", False, Get_Day_Start'Access); Check (T, 2010, 2, 14, 14, "Get_Day_Start", False, Get_Day_Start'Access); end Test_Get_Day_Start; -- ------------------------------ -- Test the Get_Week_Start operation. -- ------------------------------ procedure Test_Get_Week_Start (T : in out Test) is begin Check (T, 2013, 6, 04, 03, "Get_Week_Start", False, Get_Week_Start'Access); Check (T, 2013, 6, 03, 03, "Get_Week_Start", False, Get_Week_Start'Access); Check (T, 2013, 6, 05, 03, "Get_Week_Start", False, Get_Week_Start'Access); Check (T, 2013, 6, 08, 03, "Get_Week_Start", False, Get_Week_Start'Access); Check (T, 2010, 2, 14, 08, "Get_Week_Start", False, Get_Week_Start'Access); Check (T, 2010, 2, 13, 08, "Get_Week_Start", False, Get_Week_Start'Access); Check (T, 2010, 2, 10, 08, "Get_Week_Start", False, Get_Week_Start'Access); Check (T, 2010, 2, 15, 15, "Get_Week_Start", False, Get_Week_Start'Access); end Test_Get_Week_Start; -- ------------------------------ -- Test the Get_Month_Start operation. -- ------------------------------ procedure Test_Get_Month_Start (T : in out Test) is begin Check (T, 2013, 6, 04, 01, "Get_Month_Start", False, Get_Month_Start'Access); Check (T, 2010, 2, 14, 01, "Get_Month_Start", False, Get_Month_Start'Access); end Test_Get_Month_Start; -- ------------------------------ -- Test the Get_Day_End operation. -- ------------------------------ procedure Test_Get_Day_End (T : in out Test) is begin Check (T, 2013, 6, 04, 04, "Get_Day_Start", True, Get_Day_End'Access); Check (T, 2010, 2, 14, 14, "Get_Day_Start", True, Get_Day_End'Access); end Test_Get_Day_End; -- ------------------------------ -- Test the Get_Week_End operation. -- ------------------------------ procedure Test_Get_Week_End (T : in out Test) is begin Check (T, 2013, 6, 04, 09, "Get_Week_End", True, Get_Week_End'Access); Check (T, 2013, 6, 03, 09, "Get_Week_End", True, Get_Week_End'Access); Check (T, 2013, 6, 05, 09, "Get_Week_End", True, Get_Week_End'Access); Check (T, 2013, 6, 08, 09, "Get_Week_End", True, Get_Week_End'Access); Check (T, 2010, 2, 14, 14, "Get_Week_End", True, Get_Week_End'Access); Check (T, 2010, 2, 13, 14, "Get_Week_End", True, Get_Week_End'Access); Check (T, 2010, 2, 10, 14, "Get_Week_End", True, Get_Week_End'Access); Check (T, 2010, 2, 15, 21, "Get_Week_End", True, Get_Week_End'Access); end Test_Get_Week_End; -- ------------------------------ -- Test the Get_Month_End operation. -- ------------------------------ procedure Test_Get_Month_End (T : in out Test) is begin Check (T, 2013, 6, 04, 30, "Get_Month_End", True, Get_Month_End'Access); Check (T, 2010, 2, 14, 28, "Get_Month_End", True, Get_Month_End'Access); Check (T, 2000, 2, 14, 29, "Get_Month_End", True, Get_Month_End'Access); end Test_Get_Month_End; -- ------------------------------ -- Test the Split operation. -- ------------------------------ procedure Test_Split (T : in out Test) is procedure Assert_Equals is new Util.Assertions.Assert_Equals_T (Ada.Calendar.Formatting.Day_Name); Date : constant Ada.Calendar.Time := Ada.Calendar.Formatting.Time_Of (2014, 11, 12, 23, 30, 0); D : Date_Record; begin Split (D, Date); Util.Tests.Assert_Equals (T, 2014, Natural (D.Year), "Invalid year "); Util.Tests.Assert_Equals (T, 11, Natural (D.Month), "Invalid month "); Util.Tests.Assert_Equals (T, 12, Natural (D.Month_Day), "Invalid day "); Util.Tests.Assert_Equals (T, 23, Natural (D.Hour), "Invalid hour "); Util.Tests.Assert_Equals (T, 30, Natural (D.Minute), "Invalid minute "); Assert_Equals (T, Ada.Calendar.Formatting.Wednesday, D.Day, "Invalid day "); end Test_Split; procedure Check (T : in out Test; Date : in String) is D : constant Ada.Calendar.Time := Util.Dates.RFC7231.Value (Date); F : constant String := Util.Dates.RFC7231.Image (D); begin Util.Tests.Assert_Equals (T, Date, F, "Invalid date conversion"); end Check; -- ------------------------------ -- Test the Append_Date as well as the Image operation -- ------------------------------ procedure Test_Append_Date (T : in out Test) is begin Check (T, "Mon, 26 Mar 2012 19:43:47 GMT"); Check (T, "Tue, 02 Feb 2016 15:18:35 GMT"); Check (T, "Wed, 07 Oct 2015 03:41:11 GMT"); Check (T, "Thu, 17 Sep 2015 10:07:02 GMT"); Check (T, "Sat, 03 Oct 2015 17:09:58 GMT"); Check (T, "Fri, 17 Jul 2015 16:07:54 GMT"); Check (T, "Sun, 04 Oct 2015 15:10:44 GMT"); end Test_Append_Date; -- ------------------------------ -- Test the ISO8601 operations. -- ------------------------------ procedure Test_ISO8601 (T : in out Test) is Date : constant Ada.Calendar.Time := Ada.Calendar.Formatting.Time_Of (2014, 11, 12, 23, 30, 4, 0.123456); D : Date_Record; begin Split (D, Date); Util.Tests.Assert_Equals (T, "2014", ISO8601.Image (D, ISO8601.YEAR)); Util.Tests.Assert_Equals (T, "2014-11", ISO8601.Image (D, ISO8601.MONTH)); Util.Tests.Assert_Equals (T, "2014-11-12", ISO8601.Image (D, ISO8601.DAY)); Util.Tests.Assert_Equals (T, "2014-11-12T23", ISO8601.Image (D, ISO8601.HOUR)); Util.Tests.Assert_Equals (T, "2014-11-12T23:30", ISO8601.Image (D, ISO8601.MINUTE)); Util.Tests.Assert_Equals (T, "2014-11-12T23:30:04", ISO8601.Image (D, ISO8601.SECOND)); Util.Tests.Assert_Equals (T, "2014-11-12T23:30:04.123+00:00", ISO8601.Image (D, ISO8601.SUBSECOND)); end Test_ISO8601; end Util.Dates.Formats.Tests;
zhmu/ananas
Ada
20,353
adb
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.CONTAINERS.RED_BLACK_TREES.GENERIC_SET_OPERATIONS -- -- -- -- B o d y -- -- -- -- Copyright (C) 2004-2022, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ with System; use type System.Address; package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is pragma Warnings (Off, "variable ""Busy*"" is not referenced"); pragma Warnings (Off, "variable ""Lock*"" is not referenced"); -- See comment in Ada.Containers.Helpers ----------------------- -- Local Subprograms -- ----------------------- procedure Clear (Tree : in out Tree_Type); function Copy (Source : Tree_Type) return Tree_Type; ----------- -- Clear -- ----------- procedure Clear (Tree : in out Tree_Type) is use type Helpers.Tamper_Counts; pragma Assert (Tree.TC = (Busy => 0, Lock => 0)); Root : Node_Access := Tree.Root; pragma Warnings (Off, Root); begin Tree.Root := null; Tree.First := null; Tree.Last := null; Tree.Length := 0; Delete_Tree (Root); end Clear; ---------- -- Copy -- ---------- function Copy (Source : Tree_Type) return Tree_Type is Target : Tree_Type; begin if Source.Length = 0 then return Target; end if; Target.Root := Copy_Tree (Source.Root); Target.First := Tree_Operations.Min (Target.Root); Target.Last := Tree_Operations.Max (Target.Root); Target.Length := Source.Length; return Target; end Copy; ---------------- -- Difference -- ---------------- procedure Difference (Target : in out Tree_Type; Source : Tree_Type) is Tgt : Node_Access; Src : Node_Access; Compare : Integer; begin TC_Check (Target.TC); if Target'Address = Source'Address then Clear (Target); return; end if; if Source.Length = 0 then return; end if; Tgt := Target.First; Src := Source.First; loop if Tgt = null then exit; end if; if Src = null then exit; end if; -- Per AI05-0022, the container implementation is required to detect -- element tampering by a generic actual subprogram. declare Lock_Target : With_Lock (Target.TC'Unrestricted_Access); Lock_Source : With_Lock (Source.TC'Unrestricted_Access); begin if Is_Less (Tgt, Src) then Compare := -1; elsif Is_Less (Src, Tgt) then Compare := 1; else Compare := 0; end if; end; if Compare < 0 then Tgt := Tree_Operations.Next (Tgt); elsif Compare > 0 then Src := Tree_Operations.Next (Src); else declare X : Node_Access := Tgt; begin Tgt := Tree_Operations.Next (Tgt); Tree_Operations.Delete_Node_Sans_Free (Target, X); Free (X); end; Src := Tree_Operations.Next (Src); end if; end loop; end Difference; function Difference (Left, Right : Tree_Type) return Tree_Type is begin if Left'Address = Right'Address then return Tree_Type'(others => <>); -- Empty set end if; if Left.Length = 0 then return Tree_Type'(others => <>); -- Empty set end if; if Right.Length = 0 then return Copy (Left); end if; -- Per AI05-0022, the container implementation is required to detect -- element tampering by a generic actual subprogram. declare Lock_Left : With_Lock (Left.TC'Unrestricted_Access); Lock_Right : With_Lock (Right.TC'Unrestricted_Access); Tree : Tree_Type; L_Node : Node_Access; R_Node : Node_Access; Dst_Node : Node_Access; pragma Warnings (Off, Dst_Node); begin L_Node := Left.First; R_Node := Right.First; loop if L_Node = null then exit; end if; if R_Node = null then while L_Node /= null loop Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => null, Src_Node => L_Node, Dst_Node => Dst_Node); L_Node := Tree_Operations.Next (L_Node); end loop; exit; end if; if Is_Less (L_Node, R_Node) then Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => null, Src_Node => L_Node, Dst_Node => Dst_Node); L_Node := Tree_Operations.Next (L_Node); elsif Is_Less (R_Node, L_Node) then R_Node := Tree_Operations.Next (R_Node); else L_Node := Tree_Operations.Next (L_Node); R_Node := Tree_Operations.Next (R_Node); end if; end loop; return Tree; exception when others => Delete_Tree (Tree.Root); raise; end; end Difference; ------------------ -- Intersection -- ------------------ procedure Intersection (Target : in out Tree_Type; Source : Tree_Type) is Tgt : Node_Access; Src : Node_Access; Compare : Integer; begin if Target'Address = Source'Address then return; end if; TC_Check (Target.TC); if Source.Length = 0 then Clear (Target); return; end if; Tgt := Target.First; Src := Source.First; while Tgt /= null and then Src /= null loop -- Per AI05-0022, the container implementation is required to detect -- element tampering by a generic actual subprogram. declare Lock_Target : With_Lock (Target.TC'Unrestricted_Access); Lock_Source : With_Lock (Source.TC'Unrestricted_Access); begin if Is_Less (Tgt, Src) then Compare := -1; elsif Is_Less (Src, Tgt) then Compare := 1; else Compare := 0; end if; end; if Compare < 0 then declare X : Node_Access := Tgt; begin Tgt := Tree_Operations.Next (Tgt); Tree_Operations.Delete_Node_Sans_Free (Target, X); Free (X); end; elsif Compare > 0 then Src := Tree_Operations.Next (Src); else Tgt := Tree_Operations.Next (Tgt); Src := Tree_Operations.Next (Src); end if; end loop; while Tgt /= null loop declare X : Node_Access := Tgt; begin Tgt := Tree_Operations.Next (Tgt); Tree_Operations.Delete_Node_Sans_Free (Target, X); Free (X); end; end loop; end Intersection; function Intersection (Left, Right : Tree_Type) return Tree_Type is begin if Left'Address = Right'Address then return Copy (Left); end if; -- Per AI05-0022, the container implementation is required to detect -- element tampering by a generic actual subprogram. declare Lock_Left : With_Lock (Left.TC'Unrestricted_Access); Lock_Right : With_Lock (Right.TC'Unrestricted_Access); Tree : Tree_Type; L_Node : Node_Access; R_Node : Node_Access; Dst_Node : Node_Access; pragma Warnings (Off, Dst_Node); begin L_Node := Left.First; R_Node := Right.First; loop if L_Node = null then exit; end if; if R_Node = null then exit; end if; if Is_Less (L_Node, R_Node) then L_Node := Tree_Operations.Next (L_Node); elsif Is_Less (R_Node, L_Node) then R_Node := Tree_Operations.Next (R_Node); else Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => null, Src_Node => L_Node, Dst_Node => Dst_Node); L_Node := Tree_Operations.Next (L_Node); R_Node := Tree_Operations.Next (R_Node); end if; end loop; return Tree; exception when others => Delete_Tree (Tree.Root); raise; end; end Intersection; --------------- -- Is_Subset -- --------------- function Is_Subset (Subset : Tree_Type; Of_Set : Tree_Type) return Boolean is begin if Subset'Address = Of_Set'Address then return True; end if; if Subset.Length > Of_Set.Length then return False; end if; -- Per AI05-0022, the container implementation is required to detect -- element tampering by a generic actual subprogram. declare Lock_Subset : With_Lock (Subset.TC'Unrestricted_Access); Lock_Of_Set : With_Lock (Of_Set.TC'Unrestricted_Access); Subset_Node : Node_Access; Set_Node : Node_Access; begin Subset_Node := Subset.First; Set_Node := Of_Set.First; loop if Set_Node = null then return Subset_Node = null; end if; if Subset_Node = null then return True; end if; if Is_Less (Subset_Node, Set_Node) then return False; end if; if Is_Less (Set_Node, Subset_Node) then Set_Node := Tree_Operations.Next (Set_Node); else Set_Node := Tree_Operations.Next (Set_Node); Subset_Node := Tree_Operations.Next (Subset_Node); end if; end loop; end; end Is_Subset; ------------- -- Overlap -- ------------- function Overlap (Left, Right : Tree_Type) return Boolean is begin if Left'Address = Right'Address then return Left.Length /= 0; end if; -- Per AI05-0022, the container implementation is required to detect -- element tampering by a generic actual subprogram. declare Lock_Left : With_Lock (Left.TC'Unrestricted_Access); Lock_Right : With_Lock (Right.TC'Unrestricted_Access); L_Node : Node_Access; R_Node : Node_Access; begin L_Node := Left.First; R_Node := Right.First; loop if L_Node = null or else R_Node = null then return False; end if; if Is_Less (L_Node, R_Node) then L_Node := Tree_Operations.Next (L_Node); elsif Is_Less (R_Node, L_Node) then R_Node := Tree_Operations.Next (R_Node); else return True; end if; end loop; end; end Overlap; -------------------------- -- Symmetric_Difference -- -------------------------- procedure Symmetric_Difference (Target : in out Tree_Type; Source : Tree_Type) is Tgt : Node_Access; Src : Node_Access; New_Tgt_Node : Node_Access; pragma Warnings (Off, New_Tgt_Node); Compare : Integer; begin if Target'Address = Source'Address then Clear (Target); return; end if; Tgt := Target.First; Src := Source.First; loop if Tgt = null then while Src /= null loop Insert_With_Hint (Dst_Tree => Target, Dst_Hint => null, Src_Node => Src, Dst_Node => New_Tgt_Node); Src := Tree_Operations.Next (Src); end loop; return; end if; if Src = null then return; end if; -- Per AI05-0022, the container implementation is required to detect -- element tampering by a generic actual subprogram. declare Lock_Target : With_Lock (Target.TC'Unrestricted_Access); Lock_Source : With_Lock (Source.TC'Unrestricted_Access); begin if Is_Less (Tgt, Src) then Compare := -1; elsif Is_Less (Src, Tgt) then Compare := 1; else Compare := 0; end if; end; if Compare < 0 then Tgt := Tree_Operations.Next (Tgt); elsif Compare > 0 then Insert_With_Hint (Dst_Tree => Target, Dst_Hint => Tgt, Src_Node => Src, Dst_Node => New_Tgt_Node); Src := Tree_Operations.Next (Src); else declare X : Node_Access := Tgt; begin Tgt := Tree_Operations.Next (Tgt); Tree_Operations.Delete_Node_Sans_Free (Target, X); Free (X); end; Src := Tree_Operations.Next (Src); end if; end loop; end Symmetric_Difference; function Symmetric_Difference (Left, Right : Tree_Type) return Tree_Type is begin if Left'Address = Right'Address then return Tree_Type'(others => <>); -- Empty set end if; if Right.Length = 0 then return Copy (Left); end if; if Left.Length = 0 then return Copy (Right); end if; -- Per AI05-0022, the container implementation is required to detect -- element tampering by a generic actual subprogram. declare Lock_Left : With_Lock (Left.TC'Unrestricted_Access); Lock_Right : With_Lock (Right.TC'Unrestricted_Access); Tree : Tree_Type; L_Node : Node_Access; R_Node : Node_Access; Dst_Node : Node_Access; pragma Warnings (Off, Dst_Node); begin L_Node := Left.First; R_Node := Right.First; loop if L_Node = null then while R_Node /= null loop Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => null, Src_Node => R_Node, Dst_Node => Dst_Node); R_Node := Tree_Operations.Next (R_Node); end loop; exit; end if; if R_Node = null then while L_Node /= null loop Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => null, Src_Node => L_Node, Dst_Node => Dst_Node); L_Node := Tree_Operations.Next (L_Node); end loop; exit; end if; if Is_Less (L_Node, R_Node) then Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => null, Src_Node => L_Node, Dst_Node => Dst_Node); L_Node := Tree_Operations.Next (L_Node); elsif Is_Less (R_Node, L_Node) then Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => null, Src_Node => R_Node, Dst_Node => Dst_Node); R_Node := Tree_Operations.Next (R_Node); else L_Node := Tree_Operations.Next (L_Node); R_Node := Tree_Operations.Next (R_Node); end if; end loop; return Tree; exception when others => Delete_Tree (Tree.Root); raise; end; end Symmetric_Difference; ----------- -- Union -- ----------- procedure Union (Target : in out Tree_Type; Source : Tree_Type) is Hint : Node_Access; procedure Process (Node : Node_Access); pragma Inline (Process); procedure Iterate is new Tree_Operations.Generic_Iteration (Process); ------------- -- Process -- ------------- procedure Process (Node : Node_Access) is begin Insert_With_Hint (Dst_Tree => Target, Dst_Hint => Hint, -- use node most recently inserted as hint Src_Node => Node, Dst_Node => Hint); end Process; -- Start of processing for Union begin if Target'Address = Source'Address then return; end if; -- Per AI05-0022, the container implementation is required to detect -- element tampering by a generic actual subprogram. declare Lock_Source : With_Lock (Source.TC'Unrestricted_Access); begin Iterate (Source); end; end Union; function Union (Left, Right : Tree_Type) return Tree_Type is begin if Left'Address = Right'Address then return Copy (Left); end if; if Left.Length = 0 then return Copy (Right); end if; if Right.Length = 0 then return Copy (Left); end if; declare Lock_Left : With_Lock (Left.TC'Unrestricted_Access); Lock_Right : With_Lock (Right.TC'Unrestricted_Access); Tree : Tree_Type := Copy (Left); Hint : Node_Access; procedure Process (Node : Node_Access); pragma Inline (Process); procedure Iterate is new Tree_Operations.Generic_Iteration (Process); ------------- -- Process -- ------------- procedure Process (Node : Node_Access) is begin Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => Hint, -- use node most recently inserted as hint Src_Node => Node, Dst_Node => Hint); end Process; -- Start of processing for Union begin Iterate (Right); return Tree; exception when others => Delete_Tree (Tree.Root); raise; end; end Union; end Ada.Containers.Red_Black_Trees.Generic_Set_Operations;
reznikmm/matreshka
Ada
4,631
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Draw.Line_Distance_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Draw_Line_Distance_Attribute_Node is begin return Self : Draw_Line_Distance_Attribute_Node do Matreshka.ODF_Draw.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Draw_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Draw_Line_Distance_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Line_Distance_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Draw_URI, Matreshka.ODF_String_Constants.Line_Distance_Attribute, Draw_Line_Distance_Attribute_Node'Tag); end Matreshka.ODF_Draw.Line_Distance_Attributes;
reznikmm/matreshka
Ada
4,043
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.DOM.Style_Rotation_Angle_Attributes; package Matreshka.ODF_Style.Rotation_Angle_Attributes is type Style_Rotation_Angle_Attribute_Node is new Matreshka.ODF_Style.Abstract_Style_Attribute_Node and ODF.DOM.Style_Rotation_Angle_Attributes.ODF_Style_Rotation_Angle_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Style_Rotation_Angle_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Style_Rotation_Angle_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Style.Rotation_Angle_Attributes;
msrLi/portingSources
Ada
892
adb
-- Copyright 2011-2014 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with Pck; use Pck; procedure Foo is type Char_Enum_Type is ('A', 'B', 'C', 'D', 'E'); Char : Char_Enum_Type := 'D'; begin Do_Nothing (Char'Address); -- STOP end Foo;
zhmu/ananas
Ada
5,169
adb
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . T R A C E B A C K -- -- -- -- B o d y -- -- -- -- Copyright (C) 1999-2022, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This version uses System.Machine_State_Operations routines with System.Machine_State_Operations; package body System.Traceback is use System.Machine_State_Operations; procedure Call_Chain (Traceback : System.Address; Max_Len : Natural; Len : out Natural; Exclude_Min : System.Address := System.Null_Address; Exclude_Max : System.Address := System.Null_Address; Skip_Frames : Natural := 1); -- Same as the exported version, but takes Traceback as an Address ---------------- -- Call_Chain -- ---------------- procedure Call_Chain (Traceback : System.Address; Max_Len : Natural; Len : out Natural; Exclude_Min : System.Address := System.Null_Address; Exclude_Max : System.Address := System.Null_Address; Skip_Frames : Natural := 1) is type Tracebacks_Array is array (1 .. Max_Len) of Code_Loc; pragma Suppress_Initialization (Tracebacks_Array); M : Machine_State; Code : Code_Loc; Trace : Tracebacks_Array; for Trace'Address use Traceback; N_Skips : Natural := 0; begin M := Allocate_Machine_State; Set_Machine_State (M); -- Skip the requested number of frames loop Code := Get_Code_Loc (M); exit when Code = Null_Address or else N_Skips = Skip_Frames; Pop_Frame (M); N_Skips := N_Skips + 1; end loop; -- Now, record the frames outside the exclusion bounds, updating -- the Len output value along the way. Len := 0; loop Code := Get_Code_Loc (M); exit when Code = Null_Address or else Len = Max_Len; if Code < Exclude_Min or else Code > Exclude_Max then Len := Len + 1; Trace (Len) := Code; end if; Pop_Frame (M); end loop; Free_Machine_State (M); end Call_Chain; procedure Call_Chain (Traceback : in out System.Traceback_Entries.Tracebacks_Array; Max_Len : Natural; Len : out Natural; Exclude_Min : System.Address := System.Null_Address; Exclude_Max : System.Address := System.Null_Address; Skip_Frames : Natural := 1) is begin Call_Chain (Traceback'Address, Max_Len, Len, Exclude_Min, Exclude_Max, -- Skip one extra frame to skip the other Call_Chain entry as well Skip_Frames => Skip_Frames + 1); end Call_Chain; ------------------ -- C_Call_Chain -- ------------------ function C_Call_Chain (Traceback : System.Address; Max_Len : Natural) return Natural is Val : Natural; begin Call_Chain (Traceback, Max_Len, Val); return Val; end C_Call_Chain; end System.Traceback;
micahwelf/FLTK-Ada
Ada
1,608
adb
with Interfaces.C, System; use type System.Address; package body FLTK.Images.RGB.JPEG is function new_fl_jpeg_image (F : in Interfaces.C.char_array) return System.Address; pragma Import (C, new_fl_jpeg_image, "new_fl_jpeg_image"); pragma Inline (new_fl_jpeg_image); procedure free_fl_jpeg_image (P : in System.Address); pragma Import (C, free_fl_jpeg_image, "free_fl_jpeg_image"); pragma Inline (free_fl_jpeg_image); overriding procedure Finalize (This : in out JPEG_Image) is begin if This.Void_Ptr /= System.Null_Address and then This in JPEG_Image'Class then free_fl_jpeg_image (This.Void_Ptr); This.Void_Ptr := System.Null_Address; end if; Finalize (RGB_Image (This)); end Finalize; package body Forge is function Create (Filename : in String) return JPEG_Image is begin return This : JPEG_Image do This.Void_Ptr := new_fl_jpeg_image (Interfaces.C.To_C (Filename)); case fl_image_fail (This.Void_Ptr) is when 1 => raise No_Image_Error; when 2 => raise File_Access_Error; when 3 => raise Format_Error; when others => null; end case; end return; end Create; end Forge; end FLTK.Images.RGB.JPEG;
Vikash-Kothary/swagger-aem
Ada
17,888
ads
-- Adobe Experience Manager (AEM) API -- Swagger AEM is an OpenAPI specification for Adobe Experience Manager (AEM) API -- -- OpenAPI spec version: 3.2.0_pre.0 -- Contact: [email protected] -- -- NOTE: This package is auto generated by the swagger code generator 3.2.1-SNAPSHOT. -- https://openapi-generator.tech -- Do not edit the class manually. with Swagger.Streams; with Ada.Containers.Vectors; package .Models is type InstallStatus_status_Type is record Finished : Swagger.Nullable_Boolean; Item_Count : Swagger.Nullable_Integer; end record; package InstallStatus_status_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => InstallStatus_status_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in InstallStatus_status_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in InstallStatus_status_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out InstallStatus_status_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out InstallStatus_status_Type_Vectors.Vector); type InstallStatus_Type is record Status : .Models.InstallStatus_status_Type; end record; package InstallStatus_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => InstallStatus_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in InstallStatus_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in InstallStatus_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out InstallStatus_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out InstallStatus_Type_Vectors.Vector); type SamlConfigurationPropertyItemsLong_Type is record Name : Swagger.Nullable_UString; Optional : Swagger.Nullable_Boolean; Is_Set : Swagger.Nullable_Boolean; P_Type : Swagger.Nullable_Integer; Value : Swagger.Nullable_Integer; Description : Swagger.Nullable_UString; end record; package SamlConfigurationPropertyItemsLong_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => SamlConfigurationPropertyItemsLong_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SamlConfigurationPropertyItemsLong_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SamlConfigurationPropertyItemsLong_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SamlConfigurationPropertyItemsLong_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SamlConfigurationPropertyItemsLong_Type_Vectors.Vector); type SamlConfigurationPropertyItemsArray_Type is record Name : Swagger.Nullable_UString; Optional : Swagger.Nullable_Boolean; Is_Set : Swagger.Nullable_Boolean; P_Type : Swagger.Nullable_Integer; Values : Swagger.UString_Vectors.Vector; Description : Swagger.Nullable_UString; end record; package SamlConfigurationPropertyItemsArray_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => SamlConfigurationPropertyItemsArray_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SamlConfigurationPropertyItemsArray_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SamlConfigurationPropertyItemsArray_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SamlConfigurationPropertyItemsArray_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SamlConfigurationPropertyItemsArray_Type_Vectors.Vector); type KeystoreChainItems_Type is record Subject : Swagger.Nullable_UString; Issuer : Swagger.Nullable_UString; Not_Before : Swagger.Nullable_UString; Not_After : Swagger.Nullable_UString; Serial_Number : Swagger.Nullable_Integer; end record; package KeystoreChainItems_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => KeystoreChainItems_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in KeystoreChainItems_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in KeystoreChainItems_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out KeystoreChainItems_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out KeystoreChainItems_Type_Vectors.Vector); type KeystoreItems_Type is record Alias : Swagger.Nullable_UString; Entry_Type : Swagger.Nullable_UString; Algorithm : Swagger.Nullable_UString; Format : Swagger.Nullable_UString; Chain : .Models.KeystoreChainItems_Type_Vectors.Vector; end record; package KeystoreItems_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => KeystoreItems_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in KeystoreItems_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in KeystoreItems_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out KeystoreItems_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out KeystoreItems_Type_Vectors.Vector); type KeystoreInfo_Type is record Aliases : .Models.KeystoreItems_Type_Vectors.Vector; Exists : Swagger.Nullable_Boolean; end record; package KeystoreInfo_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => KeystoreInfo_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in KeystoreInfo_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in KeystoreInfo_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out KeystoreInfo_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out KeystoreInfo_Type_Vectors.Vector); type TruststoreItems_Type is record Alias : Swagger.Nullable_UString; Entry_Type : Swagger.Nullable_UString; Subject : Swagger.Nullable_UString; Issuer : Swagger.Nullable_UString; Not_Before : Swagger.Nullable_UString; Not_After : Swagger.Nullable_UString; Serial_Number : Swagger.Nullable_Integer; end record; package TruststoreItems_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => TruststoreItems_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in TruststoreItems_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in TruststoreItems_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out TruststoreItems_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out TruststoreItems_Type_Vectors.Vector); type TruststoreInfo_Type is record Aliases : .Models.TruststoreItems_Type_Vectors.Vector; Exists : Swagger.Nullable_Boolean; end record; package TruststoreInfo_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => TruststoreInfo_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in TruststoreInfo_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in TruststoreInfo_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out TruststoreInfo_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out TruststoreInfo_Type_Vectors.Vector); type SamlConfigurationPropertyItemsBoolean_Type is record Name : Swagger.Nullable_UString; Optional : Swagger.Nullable_Boolean; Is_Set : Swagger.Nullable_Boolean; P_Type : Swagger.Nullable_Integer; Value : Swagger.Nullable_Boolean; Description : Swagger.Nullable_UString; end record; package SamlConfigurationPropertyItemsBoolean_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => SamlConfigurationPropertyItemsBoolean_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SamlConfigurationPropertyItemsBoolean_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SamlConfigurationPropertyItemsBoolean_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SamlConfigurationPropertyItemsBoolean_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SamlConfigurationPropertyItemsBoolean_Type_Vectors.Vector); type SamlConfigurationPropertyItemsString_Type is record Name : Swagger.Nullable_UString; Optional : Swagger.Nullable_Boolean; Is_Set : Swagger.Nullable_Boolean; P_Type : Swagger.Nullable_Integer; Value : Swagger.Nullable_UString; Description : Swagger.Nullable_UString; end record; package SamlConfigurationPropertyItemsString_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => SamlConfigurationPropertyItemsString_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SamlConfigurationPropertyItemsString_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SamlConfigurationPropertyItemsString_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SamlConfigurationPropertyItemsString_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SamlConfigurationPropertyItemsString_Type_Vectors.Vector); type SamlConfigurationProperties_Type is record Path : .Models.SamlConfigurationPropertyItemsArray_Type; Service_Ranking : .Models.SamlConfigurationPropertyItemsLong_Type; Idp_Url : .Models.SamlConfigurationPropertyItemsString_Type; Idp_Cert_Alias : .Models.SamlConfigurationPropertyItemsString_Type; Idp_Http_Redirect : .Models.SamlConfigurationPropertyItemsBoolean_Type; Service_Provider_Entity_Id : .Models.SamlConfigurationPropertyItemsString_Type; Assertion_Consumer_Service_U_R_L : .Models.SamlConfigurationPropertyItemsString_Type; Sp_Private_Key_Alias : .Models.SamlConfigurationPropertyItemsString_Type; Key_Store_Password : .Models.SamlConfigurationPropertyItemsString_Type; Default_Redirect_Url : .Models.SamlConfigurationPropertyItemsString_Type; User_I_D_Attribute : .Models.SamlConfigurationPropertyItemsString_Type; Use_Encryption : .Models.SamlConfigurationPropertyItemsBoolean_Type; Create_User : .Models.SamlConfigurationPropertyItemsBoolean_Type; Add_Group_Memberships : .Models.SamlConfigurationPropertyItemsBoolean_Type; Group_Membership_Attribute : .Models.SamlConfigurationPropertyItemsString_Type; Default_Groups : .Models.SamlConfigurationPropertyItemsArray_Type; Name_Id_Format : .Models.SamlConfigurationPropertyItemsString_Type; Synchronize_Attributes : .Models.SamlConfigurationPropertyItemsArray_Type; Handle_Logout : .Models.SamlConfigurationPropertyItemsBoolean_Type; Logout_Url : .Models.SamlConfigurationPropertyItemsString_Type; Clock_Tolerance : .Models.SamlConfigurationPropertyItemsLong_Type; Digest_Method : .Models.SamlConfigurationPropertyItemsString_Type; Signature_Method : .Models.SamlConfigurationPropertyItemsString_Type; User_Intermediate_Path : .Models.SamlConfigurationPropertyItemsString_Type; end record; package SamlConfigurationProperties_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => SamlConfigurationProperties_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SamlConfigurationProperties_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SamlConfigurationProperties_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SamlConfigurationProperties_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SamlConfigurationProperties_Type_Vectors.Vector); type SamlConfigurationInfo_Type is record Pid : Swagger.Nullable_UString; Title : Swagger.Nullable_UString; Description : Swagger.Nullable_UString; Bundle_Location : Swagger.Nullable_UString; Service_Location : Swagger.Nullable_UString; Properties : .Models.SamlConfigurationProperties_Type; end record; package SamlConfigurationInfo_Type_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => SamlConfigurationInfo_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SamlConfigurationInfo_Type); procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SamlConfigurationInfo_Type_Vectors.Vector); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SamlConfigurationInfo_Type); procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SamlConfigurationInfo_Type_Vectors.Vector); end .Models;
flyx/OpenGLAda
Ada
543
ads
-- part of OpenGLAda, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "COPYING" with GL.Types; with GL.Enums.Getter; generic Min_Representation : Types.Int; Getter_Param : Enums.Getter.Parameter; package GL.Enums.Indexes is pragma Preelaborate; use GL.Types; Max : constant Int := Getter.Get_Max (Getter_Param); subtype Index is Int range 0 .. Max; function Representation (Value : Index) return Int; function Value (Representation : Int) return Index; end GL.Enums.Indexes;
Fabien-Chouteau/lvgl-ada
Ada
4,382
ads
with System; package Lv.Font is type Font is private; No_Font : constant Font; -- Initialize the fonts procedure Init; -- Create a pair from font name and font dsc. get function. After it 'font_get' can be used for this font -- @param child pointer to a font to join to the 'parent' -- @param parent pointer to a font. 'child' will be joined here procedure Add (Child : Font; Parent : Font); -- Tells if font which contains `letter` is monospace or not -- @param font_p point to font -- @param letter an UNICODE character code -- @return true: the letter is monospace; false not monospace function Is_Monospace (F : Font; Letter : Uint32_T) return U_Bool; -- Return with the bitmap of a font. -- @param font_p pointer to a font -- @param letter an UNICODE character code -- @return pointer to the bitmap of the letter function Bitmap (F : Font; Letter : Uint32_T) return access Uint8_T; -- Get the width of a letter in a font. If `monospace` is set then return with it. -- @param font_p pointer to a font -- @param letter an UNICODE character code -- @return the width of a letter function Width (F : Font; Letter : Uint32_T) return Uint8_T; -- Get the width of the letter without overwriting it with the `monospace` attribute -- @param font_p pointer to a font -- @param letter an UNICODE character code -- @return the width of a letter function Real_Width (F : Font; Letter : Uint32_T) return Uint8_T; -- Get the height of a font -- @param font_p pointer to a font -- @return the height of a font function Height (F : Font) return Uint8_T; -- Get the bit-per-pixel of font -- @param font pointer to font -- @param letter a letter from font (font extensions can have different bpp) -- @return bpp of the font (or font extension) function Bpp (F : Font; Letter : Uint32_T) return Uint8_T; -- Generic bitmap get function used in 'font->get_bitmap' when the font contains all characters in the range -- @param font pointer to font -- @param unicode_letter an unicode letter which bitmap should be get -- @return pointer to the bitmap or NULL if not found function Bitmap_Continuous (F : Font; Unicode_Letter : Uint32_T) return access Uint8_T; -- Generic bitmap get function used in 'font->get_bitmap' when the font NOT contains all characters in the range (sparse) -- @param font pointer to font -- @param unicode_letter an unicode letter which bitmap should be get -- @return pointer to the bitmap or NULL if not found function Bitmap_Sparse (F : Font; Unicode_Letter : Uint32_T) return access Uint8_T; -- Generic glyph width get function used in 'font->get_width' when the font contains all characters in the range -- @param font pointer to font -- @param unicode_letter an unicode letter which width should be get -- @return width of the gylph or -1 if not found function Width_Continuous (F : Font; Unicode_Letter : Uint32_T) return Int16_T; -- Generic glyph width get function used in 'font->get_bitmap' when the font NOT contains all characters in the range (sparse) -- @param font pointer to font -- @param unicode_letter an unicode letter which width should be get -- @return width of the glyph or -1 if not found function Width_Sparse (F : Font; Unicode_Letter : Uint32_T) return Int16_T; private type Font is new System.Address; No_Font : constant Font := Font (System.Null_Address); ------------- -- Imports -- ------------- pragma Import (C, Init, "lv_font_init"); pragma Import (C, Add, "lv_font_add"); pragma Import (C, Is_Monospace, "lv_font_is_monospace"); pragma Import (C, Bitmap, "lv_font_get_bitmap"); pragma Import (C, Width, "lv_font_get_width"); pragma Import (C, Real_Width, "lv_font_get_real_width"); pragma Import (C, Height, "lv_font_get_height_inline"); pragma Import (C, Bpp, "lv_font_get_bpp"); pragma Import (C, Bitmap_Continuous, "lv_font_get_bitmap_continuous"); pragma Import (C, Bitmap_Sparse, "lv_font_get_bitmap_sparse"); pragma Import (C, Width_Continuous, "lv_font_get_width_continuous"); pragma Import (C, Width_Sparse, "lv_font_get_width_sparse"); end Lv.Font;
annexi-strayline/AURA
Ada
7,832
ads
------------------------------------------------------------------------------ -- -- -- Ada User Repository Annex (AURA) -- -- ANNEXI-STRAYLINE Reference Implementation -- -- -- -- Command Line Interface -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * Richard Wai (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- This package contains the types and operations related to the configuration -- of an AURA subsystem with Progress; with Unit_Names; with Registrar.Subsystems; package Configuration is ------------------------ -- Configuration_Pass -- ------------------------ procedure Configuration_Pass; procedure Process_Root_Configuration; Configuration_Progress: aliased Progress.Progress_Tracker; -- For all Subsystems in the Regsitry of State Aquired, Configuration_Pass -- attempts to promote the Subsystem to Available, if possible. -- -- ** Any Subsystems checked-out from "System" repositories are promoted to -- "Available" during Checkout, and will not be configured. These -- subsystems were configured at build-time for the repository. -- -- The Configuration_Pass process for each Subsystem is as follows: -- -- 1. If a Registry entry for the expected configuration file (AURA.XYZ) -- exists, its hash is compared with the hash of the same configuration -- from Last_Run (if Last_Run exists). If the hash differs, the process -- progresses immediately to Step 3. -- -- If there is no configuration unit but a manifest exists, the process -- progresses immediately to Step 2. -- -- If the hash does not differ, the pre-loaded configuration information -- is copied from Last_Run, and the process progresses immediately to -- Step 4 -- -- If there is no configuration unit and no manifest, an empty -- configuration unit is generated, and configuration is deemed complete. -- -- -- Root Configuration special case ----------------------------------- -- The AURA subsystem is handled as a special case, particularily there -- may be a configuration file with the unit name "aura.root" The root -- configuration unit never has a manifest. -- ---------------------------------------------------------------------- -- -- If Process_Root_Configuration is invoked, the AURA subsystem is -- entered for configuration. -- -- If the root configuration package exists, and the hash differs, then -- Step 3 is invoked for it, otherwise Step 4 is invoked. -- -- The Root Configuration package shall not have a Codepaths package. -- -- 2. Step 2 installs the default configuration unit from the manifest. -- -- Step 2 is always followed by Step 3 -- -- 3. Step 3 attempts to build, run, and extract the relevent values from -- the configuration unit. -- -- a) The configuration unit is scanned for relevent configuration -- parameters. If no relevent parameters are found, configuration is -- deemed complete. -- -- Currently, relevent configuration parameters must always and only -- be constant String objects. If this is violated, the process is -- aborted. -- -- b) The relevant configuration parameters are then used to auto- -- generate a temporary program to extract the value of those -- parameters. If the program fails to compile, the process is -- aborted. If the program completes abnormally, the process is -- aborted. -- -- If the program completes successfully, the configuration values -- have been loaded, Configuration is complete, and the Subsystem is -- updated in the registry -- -- 4. The subsystem's configuration data has been loaded. If there are any -- codepaths configured, those subdirectories are entered with the -- registrar. Configuration is deemed complete, and the Subsystem becomes -- "Available" -- -- Callers to Configuration_Pass should wait for -- Registrar.Registration.Entry_Progress after Configuration_Progress, -- except for Process_Root_Configuration -- Utility functions function Config_Unit_Name (Target: Registrar.Subsystems.Subsystem) return Unit_Names.Unit_Name; -- Returns the unit name of the configuration unit for a given subsystem function Manifest_Unit_Name (Target: Registrar.Subsystems.Subsystem) return Unit_Names.Unit_Name; -- Returns the unit name of the manifest unit for a given subsystem end Configuration;
iyan22/AprendeAda
Ada
832
adb
with matrices; use matrices; procedure posicion_en_matriz (M: in Matriz_de_enteros; numero: in Integer; posicion_fila, posicion_columna: out Integer) is fila, columna: Integer; encontrado: Boolean:= False; -- Utilizare esta condicion para hacer el algoritmo mas eficiente y que cuando encuentre el número salga -- también me servira para si no lo encontramos definir fila y columna a -1 begin fila:=1; columna:=1; for fila in M'First(1)..M'Last(1) loop for columna in M'First(2)..M'Last(2) loop if numero = M(fila, columna) and encontrado=False then posicion_columna:=columna; posicion_fila:=fila; encontrado:= True; end if; end loop; end loop; if encontrado = False then posicion_columna:=-1; posicion_fila:=-1; end if; end posicion_en_matriz;
damaki/libkeccak
Ada
2,036
ads
------------------------------------------------------------------------------- -- Copyright (c) 2019, Daniel King -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * The name of the copyright holder may not be used to endorse or promote -- Products derived from this software without specific prior written -- permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- with Keccak.Generic_MonkeyWrap; generic with package MonkeyWrap is new Keccak.Generic_MonkeyWrap (<>); package MonkeyWrap_Runner is procedure Run_Tests (File_Name : in String; Num_Passed : out Natural; Num_Failed : out Natural); end MonkeyWrap_Runner;
reznikmm/matreshka
Ada
5,067
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ package body ESAPI.Users.Non_Anonymous is ------------- -- Disable -- ------------- overriding procedure Disable (Self : not null access Non_Anonymous_User) is begin if Self.Enabled then Self.Enabled := False; Self.Store.Update_Enabled (Self); end if; end Disable; ------------ -- Enable -- ------------ overriding procedure Enable (Self : not null access Non_Anonymous_User) is begin if not Self.Enabled then Self.Enabled := True; Self.Store.Update_Enabled (Self); end if; end Enable; ------------------------- -- Get_User_Identifier -- ------------------------- overriding function Get_User_Identifier (Self : not null access constant Non_Anonymous_User) return User_Identifier is begin return Self.Identifier; end Get_User_Identifier; ---------------- -- Initialize -- ---------------- not overriding function Initialize (Store : not null access ESAPI.Users.Stores.User_Store'Class) return Non_Anonymous_User is begin return (Store => Store, Identifier => Store.Get_User_Identifier, Enabled => Store.Get_Enabled); end Initialize; ------------------ -- Is_Anonymous -- ------------------ overriding function Is_Anonymous (Self : not null access constant Non_Anonymous_User) return Boolean is begin return False; end Is_Anonymous; ---------------- -- Is_Enabled -- ---------------- overriding function Is_Enabled (Self : not null access constant Non_Anonymous_User) return Boolean is begin return Self.Enabled; end Is_Enabled; end ESAPI.Users.Non_Anonymous;
mirror/ncurses
Ada
3,727
adb
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Helpers -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright 2020 Thomas E. Dickey -- -- Copyright 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, distribute with modifications, sublicense, and/or sell -- -- copies of the Software, and to permit persons to whom the Software is -- -- furnished to do so, subject to the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- -- -- -- Except as contained in this notice, the name(s) of the above copyright -- -- holders shall not be used in advertising or otherwise to promote the -- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control -- $Revision: 1.15 $ -- $Date: 2020/02/02 23:34:34 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Sample.Explanation; use Sample.Explanation; -- This package contains some convenient helper routines used throughout -- this example. -- package body Sample.Helpers is procedure Window_Title (Win : Window; Title : String) is Height : Line_Count; Width : Column_Count; Pos : Column_Position := 0; begin Get_Size (Win, Height, Width); if Title'Length < Width then Pos := (Width - Title'Length) / 2; end if; Add (Win, 0, Pos, Title); end Window_Title; procedure Not_Implemented is begin Explain ("NOTIMPL"); end Not_Implemented; end Sample.Helpers;
iyan22/AprendeAda
Ada
645
adb
with vectores; use vectores; function esta_en_vector_ordenado (n: in Integer; V: in Vector_De_Enteros) return Boolean is -- pre: V contiene al menos un elemento (V'Last >= 1) -- V esta ordenado ascendentemente: -- V(i) <= V(i+1), 1 <= i < V'last -- post: el resultado es True si N esta en V y False si no -- El algoritmo es eficiente aprovechando que V esta ordenado rdo: Boolean; I: Integer; begin rdo:= False; I:= V'First; while (rdo=False and I<=V'Last) and then n>=V(I) loop if V(I)=n then rdo:= True; end if; I:=I+1; end loop; return rdo; end esta_en_vector_ordenado;
dilawar/ahir
Ada
253
adb
-- RUN: %llvmgcc -c %s procedure Array_Ref is type A is array (Natural range <>, Natural range <>) of Boolean; type A_Access is access A; function Get (X : A_Access) return Boolean is begin return X (0, 0); end; begin null; end;
reznikmm/matreshka
Ada
3,874
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Examples Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2016-2019, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Ada.Text_IO; with League.Holders; with League.Settings; with League.Strings; with Spikedog.HTTP_Session_Managers; with Spikedog.Servlet_Contexts; -- List of used servlets: with Servlets.Hello; pragma Unreferenced (Servlets.Hello); with Servlets.File; pragma Unreferenced (Servlets.File); package body Startup is ---------------- -- On_Startup -- ---------------- overriding procedure On_Startup (Self : in out Servlet_Container_Initializer; Context : in out Servlet.Contexts.Servlet_Context'Class) is pragma Unreferenced (Self); begin Ada.Text_IO.Put_Line ("Open: http://localhost:8080/index.html"); end On_Startup; end Startup;
reznikmm/matreshka
Ada
4,881
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ -- A literal Boolean is a specification of a Boolean value. ------------------------------------------------------------------------------ with AMF.UML.Literal_Specifications; package AMF.UML.Literal_Booleans is pragma Preelaborate; type UML_Literal_Boolean is limited interface and AMF.UML.Literal_Specifications.UML_Literal_Specification; type UML_Literal_Boolean_Access is access all UML_Literal_Boolean'Class; for UML_Literal_Boolean_Access'Storage_Size use 0; not overriding function Get_Value (Self : not null access constant UML_Literal_Boolean) return Boolean is abstract; -- Getter of LiteralBoolean::value. -- -- The specified Boolean value. not overriding procedure Set_Value (Self : not null access UML_Literal_Boolean; To : Boolean) is abstract; -- Setter of LiteralBoolean::value. -- -- The specified Boolean value. not overriding function Boolean_Value (Self : not null access constant UML_Literal_Boolean) return Boolean is abstract; -- Operation LiteralBoolean::booleanValue. -- -- The query booleanValue() gives the value. overriding function Is_Computable (Self : not null access constant UML_Literal_Boolean) return Boolean is abstract; -- Operation LiteralBoolean::isComputable. -- -- The query isComputable() is redefined to be true. end AMF.UML.Literal_Booleans;
stcarrez/ada-security
Ada
2,202
adb
----------------------------------------------------------------------- -- security-controllers-roles -- Simple role base security -- Copyright (C) 2011, 2012, 2018 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package body Security.Controllers.Roles is -- ------------------------------ -- Returns true if the user associated with the security context <b>Context</b> has -- one of the role defined in the <b>Handler</b>. -- ------------------------------ overriding function Has_Permission (Handler : in Role_Controller; Context : in Security.Contexts.Security_Context'Class; Permission : in Security.Permissions.Permission'Class) return Boolean is pragma Unreferenced (Permission); P : constant Security.Principal_Access := Context.Get_User_Principal; Roles : Security.Policies.Roles.Role_Map; begin if P /= null then -- If the principal has some roles, get them. if P.all in Policies.Roles.Role_Principal_Context'Class then Roles := Policies.Roles.Role_Principal_Context'Class (P.all).Get_Roles; else return False; end if; for I in Handler.Roles'Range loop if Roles (Handler.Roles (I)) then return True; end if; end loop; end if; return False; end Has_Permission; end Security.Controllers.Roles;
persan/A-gst
Ada
18,190
ads
pragma Ada_2005; pragma Style_Checks (Off); pragma Warnings (Off); with Interfaces.C; use Interfaces.C; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspurl_h; with System; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h; with glib; with glib.Values; with System; with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspmessage_h; package GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspconnection_h is -- GStreamer -- * Copyright (C) <2005,2009> Wim Taymans <[email protected]> -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Library General Public -- * License as published by the Free Software Foundation; either -- * version 2 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Library General Public License for more details. -- * -- * You should have received a copy of the GNU Library General Public -- * License along with this library; if not, write to the -- * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- * Boston, MA 02111-1307, USA. -- -- * Unless otherwise indicated, Source Code is licensed under MIT license. -- * See further explanation attached in License Statement (distributed in the file -- * LICENSE). -- * -- * Permission is hereby granted, free of charge, to any person obtaining a copy of -- * this software and associated documentation files (the "Software"), to deal in -- * the Software without restriction, including without limitation the rights to -- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -- * of the Software, and to permit persons to whom the Software is furnished to do -- * so, subject to the following conditions: -- * -- * The above copyright notice and this permission notice shall be included in all -- * copies or substantial portions of the Software. -- * -- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -- * SOFTWARE. -- --* -- * GstRTSPConnection: -- * -- * Opaque RTSP connection object. -- -- skipped empty struct u_GstRTSPConnection -- skipped empty struct GstRTSPConnection -- opening/closing a connection function gst_rtsp_connection_create (url : access constant GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspurl_h.GstRTSPUrl; conn : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:63 pragma Import (C, gst_rtsp_connection_create, "gst_rtsp_connection_create"); function gst_rtsp_connection_create_from_fd (fd : GLIB.gint; ip : access GLIB.gchar; port : GLIB.guint16; initial_buffer : access GLIB.gchar; conn : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:64 pragma Import (C, gst_rtsp_connection_create_from_fd, "gst_rtsp_connection_create_from_fd"); function gst_rtsp_connection_accept (sock : GLIB.gint; conn : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:69 pragma Import (C, gst_rtsp_connection_accept, "gst_rtsp_connection_accept"); function gst_rtsp_connection_connect (conn : System.Address; timeout : access GStreamer.GST_Low_Level.glib_2_0_glib_gtypes_h.GTimeVal) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:70 pragma Import (C, gst_rtsp_connection_connect, "gst_rtsp_connection_connect"); function gst_rtsp_connection_close (conn : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:71 pragma Import (C, gst_rtsp_connection_close, "gst_rtsp_connection_close"); function gst_rtsp_connection_free (conn : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:72 pragma Import (C, gst_rtsp_connection_free, "gst_rtsp_connection_free"); -- sending/receiving raw bytes function gst_rtsp_connection_read (conn : System.Address; data : access GLIB.guint8; size : GLIB.guint; timeout : access GStreamer.GST_Low_Level.glib_2_0_glib_gtypes_h.GTimeVal) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:76 pragma Import (C, gst_rtsp_connection_read, "gst_rtsp_connection_read"); function gst_rtsp_connection_write (conn : System.Address; data : access GLIB.guint8; size : GLIB.guint; timeout : access GStreamer.GST_Low_Level.glib_2_0_glib_gtypes_h.GTimeVal) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:78 pragma Import (C, gst_rtsp_connection_write, "gst_rtsp_connection_write"); -- sending/receiving messages function gst_rtsp_connection_send (conn : System.Address; message : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspmessage_h.GstRTSPMessage; timeout : access GStreamer.GST_Low_Level.glib_2_0_glib_gtypes_h.GTimeVal) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:82 pragma Import (C, gst_rtsp_connection_send, "gst_rtsp_connection_send"); function gst_rtsp_connection_receive (conn : System.Address; message : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspmessage_h.GstRTSPMessage; timeout : access GStreamer.GST_Low_Level.glib_2_0_glib_gtypes_h.GTimeVal) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:84 pragma Import (C, gst_rtsp_connection_receive, "gst_rtsp_connection_receive"); -- status management function gst_rtsp_connection_poll (conn : System.Address; events : GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPEvent; revents : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPEvent; timeout : access GStreamer.GST_Low_Level.glib_2_0_glib_gtypes_h.GTimeVal) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:88 pragma Import (C, gst_rtsp_connection_poll, "gst_rtsp_connection_poll"); -- reset the timeout function gst_rtsp_connection_next_timeout (conn : System.Address; timeout : access GStreamer.GST_Low_Level.glib_2_0_glib_gtypes_h.GTimeVal) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:92 pragma Import (C, gst_rtsp_connection_next_timeout, "gst_rtsp_connection_next_timeout"); function gst_rtsp_connection_reset_timeout (conn : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:93 pragma Import (C, gst_rtsp_connection_reset_timeout, "gst_rtsp_connection_reset_timeout"); -- flushing state function gst_rtsp_connection_flush (conn : System.Address; flush : GLIB.gboolean) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:96 pragma Import (C, gst_rtsp_connection_flush, "gst_rtsp_connection_flush"); -- HTTP proxy support function gst_rtsp_connection_set_proxy (conn : System.Address; host : access GLIB.gchar; port : GLIB.guint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:99 pragma Import (C, gst_rtsp_connection_set_proxy, "gst_rtsp_connection_set_proxy"); -- configure authentication data function gst_rtsp_connection_set_auth (conn : System.Address; method : GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPAuthMethod; user : access GLIB.gchar; pass : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:103 pragma Import (C, gst_rtsp_connection_set_auth, "gst_rtsp_connection_set_auth"); procedure gst_rtsp_connection_set_auth_param (conn : System.Address; param : access GLIB.gchar; value : access GLIB.gchar); -- gst/rtsp/gstrtspconnection.h:106 pragma Import (C, gst_rtsp_connection_set_auth_param, "gst_rtsp_connection_set_auth_param"); procedure gst_rtsp_connection_clear_auth_params (conn : System.Address); -- gst/rtsp/gstrtspconnection.h:109 pragma Import (C, gst_rtsp_connection_clear_auth_params, "gst_rtsp_connection_clear_auth_params"); -- configure DSCP function gst_rtsp_connection_set_qos_dscp (conn : System.Address; qos_dscp : GLIB.guint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:112 pragma Import (C, gst_rtsp_connection_set_qos_dscp, "gst_rtsp_connection_set_qos_dscp"); -- accessors function gst_rtsp_connection_get_url (conn : System.Address) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspurl_h.GstRTSPUrl; -- gst/rtsp/gstrtspconnection.h:116 pragma Import (C, gst_rtsp_connection_get_url, "gst_rtsp_connection_get_url"); function gst_rtsp_connection_get_ip (conn : System.Address) return access GLIB.gchar; -- gst/rtsp/gstrtspconnection.h:117 pragma Import (C, gst_rtsp_connection_get_ip, "gst_rtsp_connection_get_ip"); procedure gst_rtsp_connection_set_ip (conn : System.Address; ip : access GLIB.gchar); -- gst/rtsp/gstrtspconnection.h:118 pragma Import (C, gst_rtsp_connection_set_ip, "gst_rtsp_connection_set_ip"); function gst_rtsp_connection_get_readfd (conn : System.Address) return GLIB.gint; -- gst/rtsp/gstrtspconnection.h:120 pragma Import (C, gst_rtsp_connection_get_readfd, "gst_rtsp_connection_get_readfd"); function gst_rtsp_connection_get_writefd (conn : System.Address) return GLIB.gint; -- gst/rtsp/gstrtspconnection.h:121 pragma Import (C, gst_rtsp_connection_get_writefd, "gst_rtsp_connection_get_writefd"); procedure gst_rtsp_connection_set_http_mode (conn : System.Address; enable : GLIB.gboolean); -- gst/rtsp/gstrtspconnection.h:123 pragma Import (C, gst_rtsp_connection_set_http_mode, "gst_rtsp_connection_set_http_mode"); -- tunneling procedure gst_rtsp_connection_set_tunneled (conn : System.Address; tunneled : GLIB.gboolean); -- gst/rtsp/gstrtspconnection.h:127 pragma Import (C, gst_rtsp_connection_set_tunneled, "gst_rtsp_connection_set_tunneled"); function gst_rtsp_connection_is_tunneled (conn : System.Address) return GLIB.gboolean; -- gst/rtsp/gstrtspconnection.h:128 pragma Import (C, gst_rtsp_connection_is_tunneled, "gst_rtsp_connection_is_tunneled"); function gst_rtsp_connection_get_tunnelid (conn : System.Address) return access GLIB.gchar; -- gst/rtsp/gstrtspconnection.h:130 pragma Import (C, gst_rtsp_connection_get_tunnelid, "gst_rtsp_connection_get_tunnelid"); function gst_rtsp_connection_do_tunnel (conn : System.Address; conn2 : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:131 pragma Import (C, gst_rtsp_connection_do_tunnel, "gst_rtsp_connection_do_tunnel"); -- async IO --* -- * GstRTSPWatch: -- * -- * Opaque RTSP watch object that can be used for asynchronous RTSP -- * operations. -- -- skipped empty struct u_GstRTSPWatch -- skipped empty struct GstRTSPWatch --* -- * GstRTSPWatchFuncs: -- * @message_received: callback when a message was received -- * @message_sent: callback when a message was sent -- * @closed: callback when the connection is closed -- * @error: callback when an error occured -- * @tunnel_start: a client started a tunneled connection. The tunnelid of the -- * connection must be saved. -- * @tunnel_complete: a client finished a tunneled connection. In this callback -- * you usually pair the tunnelid of this connection with the saved one using -- * gst_rtsp_connection_do_tunnel(). -- * @error_full: callback when an error occured with more information than -- * the @error callback. Since 0.10.25 -- * @tunnel_lost: callback when the post connection of a tunnel is closed. -- * Since 0.10.29 -- * -- * Callback functions from a #GstRTSPWatch. -- * -- * Since: 0.10.23 -- type GstRTSPWatchFuncs_u_gst_reserved_array is array (0 .. 1) of System.Address; type GstRTSPWatchFuncs is record message_received : access function (arg1 : System.Address; arg2 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspmessage_h.GstRTSPMessage; arg3 : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:165 message_sent : access function (arg1 : System.Address; arg2 : GLIB.guint; arg3 : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:167 closed : access function (arg1 : System.Address; arg2 : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:168 error : access function (arg1 : System.Address; arg2 : GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; arg3 : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:170 tunnel_start : access function (arg1 : System.Address; arg2 : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPStatusCode; -- gst/rtsp/gstrtspconnection.h:171 tunnel_complete : access function (arg1 : System.Address; arg2 : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:172 error_full : access function (arg1 : System.Address; arg2 : GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; arg3 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspmessage_h.GstRTSPMessage; arg4 : GLIB.guint; arg5 : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:175 tunnel_lost : access function (arg1 : System.Address; arg2 : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:176 u_gst_reserved : GstRTSPWatchFuncs_u_gst_reserved_array; -- gst/rtsp/gstrtspconnection.h:179 end record; pragma Convention (C_Pass_By_Copy, GstRTSPWatchFuncs); -- gst/rtsp/gstrtspconnection.h:180 -- skipped anonymous struct anon_414 --< private > function gst_rtsp_watch_new (conn : System.Address; funcs : access GstRTSPWatchFuncs; user_data : System.Address; notify : GStreamer.GST_Low_Level.glib_2_0_glib_gtypes_h.GDestroyNotify) return System.Address; -- gst/rtsp/gstrtspconnection.h:182 pragma Import (C, gst_rtsp_watch_new, "gst_rtsp_watch_new"); procedure gst_rtsp_watch_reset (watch : System.Address); -- gst/rtsp/gstrtspconnection.h:186 pragma Import (C, gst_rtsp_watch_reset, "gst_rtsp_watch_reset"); procedure gst_rtsp_watch_unref (watch : System.Address); -- gst/rtsp/gstrtspconnection.h:187 pragma Import (C, gst_rtsp_watch_unref, "gst_rtsp_watch_unref"); function gst_rtsp_watch_attach (watch : System.Address; context : System.Address) return GLIB.guint; -- gst/rtsp/gstrtspconnection.h:189 pragma Import (C, gst_rtsp_watch_attach, "gst_rtsp_watch_attach"); function gst_rtsp_watch_write_data (watch : System.Address; data : access GLIB.guint8; size : GLIB.guint; id : access GLIB.guint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:192 pragma Import (C, gst_rtsp_watch_write_data, "gst_rtsp_watch_write_data"); function gst_rtsp_watch_send_message (watch : System.Address; message : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspmessage_h.GstRTSPMessage; id : access GLIB.guint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspconnection.h:195 pragma Import (C, gst_rtsp_watch_send_message, "gst_rtsp_watch_send_message"); function gst_rtsp_watch_queue_data (watch : System.Address; data : access GLIB.guint8; size : GLIB.guint) return GLIB.guint; -- gst/rtsp/gstrtspconnection.h:200 pragma Import (C, gst_rtsp_watch_queue_data, "gst_rtsp_watch_queue_data"); function gst_rtsp_watch_queue_message (watch : System.Address; message : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspmessage_h.GstRTSPMessage) return GLIB.guint; -- gst/rtsp/gstrtspconnection.h:203 pragma Import (C, gst_rtsp_watch_queue_message, "gst_rtsp_watch_queue_message"); end GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspconnection_h;
reznikmm/matreshka
Ada
4,041
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.DOM.Draw_Fill_Hatch_Name_Attributes; package Matreshka.ODF_Draw.Fill_Hatch_Name_Attributes is type Draw_Fill_Hatch_Name_Attribute_Node is new Matreshka.ODF_Draw.Abstract_Draw_Attribute_Node and ODF.DOM.Draw_Fill_Hatch_Name_Attributes.ODF_Draw_Fill_Hatch_Name_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Draw_Fill_Hatch_Name_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Draw_Fill_Hatch_Name_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Draw.Fill_Hatch_Name_Attributes;
AdaCore/langkit
Ada
625
adb
with Langkit_Support.Adalog.Main_Support; use Langkit_Support.Adalog.Main_Support; -- Test stateless predicate constructor procedure Main is use T_Solver, Refs, Solver_Ifc; function Is_Odd (X : Integer) return Boolean is (X mod 2 = 1); function Double (X : Integer) return Integer is (X * 2); X : constant Refs.Logic_Var := Create ("x"); Y : constant Refs.Logic_Var := Create ("y"); R : constant Relation := Domain (X, (1, 2, 3, 4, 5, 6)) and Propagate (X, Y, Converter (Double'Access, "double")) and Predicate (X, Predicate (Is_Odd'Access, "is_odd")); begin Solve_All (R); end Main;
reznikmm/markdown
Ada
1,529
adb
-- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT ---------------------------------------------------------------- with League.Regexps; with League.Strings; with Markdown.Visitors; package body Markdown.Thematic_Breaks is Pattern : constant League.Regexps.Regexp_Pattern := League.Regexps.Compile (League.Strings.To_Universal_String ("^\ {0,3}((\-\ *){3,}|(\*\ *){3,}|(_\ *){3,})$")); ------------ -- Create -- ------------ overriding function Create (Line : not null access Markdown.Blocks.Text_Line) return Thematic_Break is Match : constant League.Regexps.Regexp_Match := Pattern.Find_Match (Line.Line); begin pragma Assert (Match.Is_Matched); Line.Line.Clear; return Result : Thematic_Break; end Create; ------------ -- Filter -- ------------ procedure Filter (Line : Markdown.Blocks.Text_Line; Tag : in out Ada.Tags.Tag; CIP : out Can_Interrupt_Paragraph) is Match : constant League.Regexps.Regexp_Match := Pattern.Find_Match (Line.Line); begin if Match.Is_Matched then Tag := Thematic_Break'Tag; CIP := True; end if; end Filter; ----------- -- Visit -- ----------- overriding procedure Visit (Self : in out Thematic_Break; Visitor : in out Markdown.Visitors.Visitor'Class) is begin Visitor.Thematic_Break (Self); end Visit; end Markdown.Thematic_Breaks;
reznikmm/matreshka
Ada
3,648
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Elements.Generic_Hash; function AMF.UML.Consider_Ignore_Fragments.Hash is new AMF.Elements.Generic_Hash (UML_Consider_Ignore_Fragment, UML_Consider_Ignore_Fragment_Access);
sungyeon/drake
Ada
1,044
ads
pragma License (Unrestricted); -- separated and auto-loaded by compiler private generic type Num is delta <> digits <>; package Ada.Wide_Wide_Text_IO.Decimal_IO is Default_Fore : Field := Num'Fore; Default_Aft : Field := Num'Aft; Default_Exp : Field := 0; -- procedure Get ( -- File : File_Type; -- Input_File_Type -- Item : out Num; -- Width : Field := 0); -- procedure Get ( -- Item : out Num; -- Width : Field := 0); -- procedure Put ( -- File : File_Type; -- Output_File_Type -- Item : Num; -- Fore : Field := Default_Fore; -- Aft : Field := Default_Aft; -- Exp : Field := Default_Exp); -- procedure Put ( -- Item : Num; -- Fore : Field := Default_Fore; -- Aft : Field := Default_Aft; -- Exp : Field := Default_Exp); -- procedure Get ( -- From : String; -- Item : out Num; -- Last : out Positive); -- procedure Put ( -- To : out String; -- Item : Num; -- Aft : Field := Default_Aft; -- Exp : Field := Default_Exp); end Ada.Wide_Wide_Text_IO.Decimal_IO;
MinimSecure/unum-sdk
Ada
826
adb
-- Copyright 2010-2016 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with Pck; use Pck; procedure Foo is New_Node : Node_Id; begin New_Node := Pn (1234); -- STOP end Foo;
charlie5/lace
Ada
318
ads
with float_Math.Geometry.D3; package bullet_Physics -- -- Provides an implementation of the physics interface using a binding to the Bullet3D C library. -- is pragma Pure; package Math renames float_Math; package Geometry_3D renames math.Geometry.D3; Error : exception; end bullet_Physics;
bhayward93/Ada-Traffic-Light-Sim
Ada
482
adb
with trafficlightswitcher; with HWIF; use HWIF; with HWIF_Types; use HWIF_Types; procedure EmergencyVehicleOverride (dir : in Direction) is begin for DirectionElement in Direction'Range loop --Itterate through Directions if Traffic_Light(DirectionElement) /= Traffic_Light(dir) and Traffic_Light(DirectionElement) = 4 then --amber guarding needed? TrafficLightSwitcher(dir); end if; end loop; delay 1.0; -- Change this delay end;