max_stars_repo_path
stringlengths
4
261
max_stars_repo_name
stringlengths
6
106
max_stars_count
int64
0
38.8k
id
stringlengths
1
6
text
stringlengths
7
1.05M
4. Lowercase to uppercase.asm
arfin97/Assembly
1
173324
<reponame>arfin97/Assembly<gh_stars>1-10 .model small .stack 100h .data msg1 db 'enter a lowercase letter: $' msg2 db 10,13,'in uppercase it is: ' char db ?,'$' .code main proc ;intialization mov ax, @data mov ds, ax ;display message 1 lea dx, msg1 mov ah, 9 int 21h ;input a character mov ah, 1 int 21h ;convert to uppercase sub al, 32 mov char, al ;display uppcase lea dx, msg2 mov ah, 9 int 21h ;Dos exit mov ah, 4ch int 21h main endp end main
programs/oeis/017/A017787.asm
neoneye/loda
22
245652
<filename>programs/oeis/017/A017787.asm ; A017787: Binomial coefficients C(71,n). ; 1,71,2485,57155,971635,13019909,143218999,1329890705,10639125640,74473879480,461738052776,2560547383576,12802736917880,58104729088840,240719591939480,914734449370024,3201570572795084,10358022441395860,31074067324187580,86680293062207460,225368761961739396,547324136192795676,1243918491347262900,2650087220696342700,5300174441392685400,9964327949818248552,17629195603524593592,29381992672540989320,46171702771135840360,68461490315822108120,95846086442150951368,126764178842844806648,158455223553556008310,187265264199657100730,209296471752557936110,221256270138418389602,221256270138418389602,209296471752557936110,187265264199657100730,158455223553556008310,126764178842844806648,95846086442150951368,68461490315822108120,46171702771135840360,29381992672540989320,17629195603524593592,9964327949818248552,5300174441392685400,2650087220696342700,1243918491347262900,547324136192795676,225368761961739396,86680293062207460,31074067324187580,10358022441395860,3201570572795084,914734449370024,240719591939480,58104729088840,12802736917880,2560547383576,461738052776,74473879480,10639125640,1329890705,143218999,13019909,971635,57155,2485,71,1 mov $1,71 bin $1,$0 mov $0,$1
SelectionSort.asm
benymaxparsa/Assembly-8086
0
10622
; Selection Sort ; <NAME> - 97149081 .MODEL SMALL .STACK 128 .DATA ARRAY DB 1H, 5H, 4H, 8H, 7H, 9H, 2H, 3H, 6H, 0H .CODE MAIN: MOV AX, @DATA MOV DS, AX LEA DI, ARRAY ; POINTER TO THE ARRAY (LAST SORTED INDEX) MOV SI, DI ; MOVING POINTER MOV CL, 10 ; CL KEEPS SIZE OF THE ARRAY XOR CH, CH ; CLEAR CH DEC CL ; 9 REMAINING ELEMENT TO CHECK L1: MOV BX, SI ; KEEP THE SMALLEST INDEX MOV AH, CL ; KEED THE REMAINING ELEMENT SIZE INC AH ; SET THE COUNTER MOV AL, [SI] ; VALUE OF CURRENT ELEMENT INC SI ; POINT TO NEXT ELEMENT DEC AH ; COUNTER - 1 L2: CMP AL, [SI] ; COMPARE NEXT INDEX VALUE TO PREVIOUS JC SKIP ; IF BIGGER OR EQUAL SKIP THE NUMBER MOV AL, [SI] ; UPDATE THE CURRENT INDEX VALUE MOV BX, SI ; UPDATE THE SMALEST INDEX SKIP: INC SI ; GO TO THE NEXT INDEX DEC AH ; COUNTER - 1 JNZ L2 ; AS LONG AS COUNTER IS NOT 0 JUMP TO L2 (GO FORWARD) MOV DL, [BX] ; LOAD MINIMUM NUMBER TO REG XCHG DL, [DI] ; REPLACE MINIMUM NUMBER WITH (LAST SORTED INDEX)+1 XCHG DL, [BX] ; SET THE FIRST UNSORTED INDEX AS MINIMUM NUMBER INC DI ; MOVE THE LAST SORTED POINTER FORWARD MOV SI, DI ; COPY THAT TO THE MOVING POINTER LOOP L1 ; JUMP BACK TO L1 JMP EXIT ; IF ARRAY ENDED FINISH THE PROGRAM EXIT: MOV AX, 4C00H INT 21H END MAIN
programs/oeis/116/A116588.asm
neoneye/loda
22
161731
; A116588: Array read by antidiagonals: T(n,k) = max(2^(n - k), 2^(k - n)). ; 1,2,2,4,1,4,8,2,2,8,16,4,1,4,16,32,8,2,2,8,32,64,16,4,1,4,16,64,128,32,8,2,2,8,32,128,256,64,16,4,1,4,16,64,256,512,128,32,8,2,2,8,32,128,512,1024,256,64,16,4,1,4,16,64,256,1024,2048,512,128 seq $0,114327 ; Table T(n,m) = n - m read by upwards antidiagonals. pow $0,2 seq $0,194 ; n appears 2n times, for n >= 1; also nearest integer to square root of n. mov $1,2 pow $1,$0 mov $0,$1
src/formatter-get-format_number.adb
zenharris/ada-bbs
2
21946
separate(Formatter.Get) procedure Format_Number(Data : in Contents; In_The_String : in out String; Location : in out Natural; Number_Base : in Natural := 10; Width : in Natural := 0; Left_Justify : in Boolean := False; Fill_With_Zeros : in Boolean := False) is -- ++ -- -- FUNCTIONAL DESCRIPTION: -- -- Formats non-real number based on input parameters. -- -- FORMAL PARAMETERS: -- -- Data: -- The input data to format, contained in a variant record. -- -- In_The_String: -- The output string where the formatted number is placed. -- -- Location: -- The position where the formatted number is placed. -- -- Number_Base: -- Which base to convert the number to: 8, 10, or 16. -- -- Width: -- The width of the formatted number. -- -- Left_Justify: -- Logical (Boolean) switch which causes the formatted number to be -- left justified in the output field. -- -- Fill_With_Zeros: -- Logical (Boolean) switch which causes the right-justified, formatted -- number to be padded with leading zeros. -- -- DESIGN: -- -- Determine output field width. -- Convert number to correct number base. -- Strip off number base delimiters. -- Convert number to string. -- Call Format_String to format number string. -- -- EXCEPTIONS: -- -- A constraint error will generate a default field of all asterisks. -- -- -- -- Local variables Temp_String : String(1..255) := (others => ' '); Field_Width : Natural; -- Output field width Based_Width : Natural; -- Width of based number Number_String : Formatter.Contents; -- Local functions function Based_Value_Of(The_String : in String) return String is -- PURPOSE: Returns based value string without base type or delimiters -- Local constant Delimiter : constant Character := ASCII.SHARP; -- '#' -- Character indices First : Positive; -- Position of first digit after '#' delimiter Last : Positive; -- Position of last digit before '#' delimiter begin -- Based_Value_Of -- Find first digit after initial Delimiter First := The_String'First; while The_String(First) /= Delimiter loop if First = The_String'Last then -- Decimal number return The_String; -- No Delimiter found else First := First + 1; -- Check next char end if; end loop; First := First + 1; -- Skip Initial Delimiter -- Find last digit before final Delimiter Last := First; while The_String(Last) /= Delimiter loop Last := Last + 1; end loop; Last := Last - 1; -- Ignore Terminal Delimiter return The_String(First..Last); end Based_Value_Of; begin -- Format_Number -- Determine width of output if Width = 0 then Field_Width := Get.Default_Width; else Field_Width := Width; end if; -- Check for correct data type to format if Data.Class = Integer_type then -- Adjust field width for based value delimiters if Number_Base = 10 then Based_Width := Field_Width; else Based_Width := Field_Width + 4; end if; -- Convert integer value to string in correct Number_Base Io.Put(Item => Data.Integer_value, To => Temp_string(1..Based_width), Base => Number_base); if Left_Justify then Temp_String(1..Based_Width) := Get.Left_Justified(Temp_String(1..Based_Width)); end if; if Number_Base = Base_Ten then if Fill_With_Zeros then -- Generate zero-filled Number_String Number_String := Contents'(Class => String_Type, String_Value => (The_String => new String'(Get.Zero_Fill(Temp_String(1..Based_Width))), The_Length => Based_Width)); else -- Generate Number_String Number_String := Contents'(Class => String_Type, String_Value => (The_String => new String'(Temp_String(1..Based_Width)), The_Length => Based_Width)); end if; else Non_Decimal_Base: declare -- Strip off Based value delimiters Based_Value_String : constant String := Based_Value_Of(Temp_String(1..Based_Width)); begin if Fill_With_Zeros then -- Generate zero-filled Number_String Number_String := Contents'(Class => String_Type, String_Value => (The_String => new String'(Get.Zero_Fill(Based_Value_String)), The_Length => Based_Value_String'length)); else -- Generate Number_String Number_String := Contents'(Class => String_Type, String_Value => (The_String => new String'(Based_Value_String), The_Length => Based_Value_String'length)); end if; end Non_Decimal_Base; end if; -- Insert Number_String into Output String Format_String(Number_String,In_The_String,Location,Field_Width); else -- Incorrect data type -- Fill field with error symbols Format_Error(In_The_String, Location, Field_Width); end if; exception when others => Format_Error(In_The_String, Location, Field_Width); end Format_Number;
src/drivers/zumo_buzzer.adb
yannickmoy/SPARKZumo
6
1410
--pragma SPARK_Mode; with Interfaces.C; use Interfaces.C; with System; package body Zumo_Buzzer is -- BuzzerFinished : Boolean := True; procedure Enable_Timer_ISR (State : Boolean) is TIMSK2 : Unsigned_Char with Address => System'To_Address (16#70#); begin if State then TIMSK2 := 1; else TIMSK2 := 0; end if; end Enable_Timer_ISR; procedure Init is TCCR2A : Unsigned_Char with Address => System'To_Address (16#B0#); TCCR2B : Unsigned_Char with Address => System'To_Address (16#B1#); OCR2A : Unsigned_Char with Address => System'To_Address (16#B3#); OCR2B : Unsigned_Char with Address => System'To_Address (16#B4#); DDRD : Unsigned_Char with Address => System'To_Address (16#0A#); begin Initd := True; Enable_Timer_ISR (State => False); TCCR2A := 16#21#; TCCR2B := 16#0B#; -- OCR2A := (F_CPU / 64) / 1000; OCR2B := 0; DDRD := 4; end Init; procedure PlayFrequency (Freq : Frequency; Dur : Duration; Vol : Volume) is begin null; end PlayFrequency; procedure PlayNote (Note : Integer; Dur : Duration; Vol : Volume) is begin null; end PlayNote; function PlayCheck return Boolean is begin return False; end PlayCheck; function IsPlaying return Boolean is begin return False; end IsPlaying; procedure StopPlaying is begin null; end StopPlaying; end Zumo_Buzzer;
src/pygamer.adb
Fabien-Chouteau/pygamer-simulator
1
24545
with Ada.Exceptions; with GNAT.OS_Lib; with Ada.Text_IO; use Ada.Text_IO; with Sf.Window.VideoMode; use Sf.Window.VideoMode; with Sf.Graphics; use Sf.Graphics; with Sf.Graphics.Sprite; use Sf.Graphics.Sprite; with Sf.Graphics.Texture; use Sf.Graphics.Texture; with Sf.Graphics.RenderTexture; use Sf.Graphics.RenderTexture; with Sf.Graphics.View; use Sf.Graphics.View; with Sf.Graphics.RenderWindow; use Sf.Graphics.RenderWindow; with Sf.Window.Window; use Sf.Window.Window; with Sf.Window.Event; use Sf.Window.Event; with Sf.Window.Keyboard; use Sf.Window.Keyboard; with Sf; use Sf; with Ada.Real_Time; use Ada.Real_Time; with Sf.System.Vector2; use Sf.System.Vector2; with Ada.Unchecked_Conversion; with simulator_assets; package body PyGamer is function Hack_SF_Binding is new Ada.Unchecked_Conversion (sfSprite_Ptr, sfView_Ptr); -------------- -- Set_View -- -------------- procedure Set_View (View : Sf.Graphics.sfView_Ptr; Width, Height : sfUint32) is Win_Ratio : constant Float := Float (Width) / Float (Height); View_Ratio : constant Float := Float (getSize (View).x) / Float (getSize (View).y); Size_X : Float := 1.0; Size_Y : Float := 1.0; Pos_X : Float := 0.0; Pos_Y : Float := 0.0; Horizontal_Spacing : Boolean := True; begin if Win_Ratio < View_Ratio then Size_Y := Win_Ratio / View_Ratio; Pos_Y := (1.0 - Size_Y) / 2.0; else Size_X := View_Ratio / Win_Ratio; Pos_X := (1.0 - Size_X) / 2.0; end if; setViewport (View, (Pos_X, Pos_Y, Size_X, Size_Y)); end Set_View; task Periodic_Update is end Periodic_Update; --------------------- -- Periodic_Update -- --------------------- task body Periodic_Update is BG_Width : constant := 730; BG_Height : constant := 411; Mode : constant Sf.Window.VideoMode.sfVideoMode := (BG_Width, BG_Height, 32); Params : sfContextSettings := sfDefaultContextSettings; Window : Sf.Graphics.sfRenderWindow_Ptr; Framebuffer_Texture : Sf.Graphics.sfTexture_Ptr; Render_Texture : Sf.Graphics.sfRenderTexture_Ptr; PG_Texture : Sf.Graphics.sfTexture_Ptr; PG_Sprite : Sf.Graphics.sfSprite_Ptr; Screen_Sprite : Sf.Graphics.sfSprite_Ptr; Sprite_Left : Sf.Graphics.sfSprite_Ptr; Sprite_Right : Sf.Graphics.sfSprite_Ptr; Letter_Box_View : Sf.Graphics.sfView_Ptr; Event : sfEvent; Period : constant Time_Span := Milliseconds (1000 / 60); Next_Release : Time := Clock + Period; Pressed : Boolean; Screen_Scale : constant := 287.0 / Float (Screen_Width); Screen_Offset : constant sfVector2f := (231.0, 66.0); begin Framebuffer_Texture := Create (Screen_Width, Screen_Height); if Framebuffer_Texture = null then Put_Line ("Failed to create screen texture"); GNAT.OS_Lib.OS_Exit (1); end if; declare Ptr : constant simulator_assets.Content_Access := simulator_assets.Get_Content ("pygamer.png").Content; begin PG_Texture := createFromMemory (Ptr.all'Address, Ptr.all'Length); end; if PG_Texture = null then Put_Line ("Failed to create PyGamer texture"); GNAT.OS_Lib.OS_Exit (1); end if; Render_Texture := create (Screen_Width, Screen_Height, False); if Render_Texture = null then Put_Line ("Could not create render texture"); GNAT.OS_Lib.OS_Exit (1); end if; Screen_Sprite := Create; if Screen_Sprite = null then Put_Line ("Could not create screen sprite"); GNAT.OS_Lib.OS_Exit (1); end if; SetTexture (Screen_Sprite, getTexture (Render_Texture)); scale (Screen_Sprite, (Screen_Scale, Screen_Scale)); setPosition (Screen_Sprite, Screen_Offset); Sprite_Left := Create; if Sprite_Left = null then Put_Line ("Could not create sprite"); GNAT.OS_Lib.OS_Exit (1); end if; SetTexture (Sprite_Left, Framebuffer_Texture); Sprite_Right := Create; if Sprite_Right = null then Put_Line ("Could not create sprite"); GNAT.OS_Lib.OS_Exit (1); end if; SetTexture (Sprite_Right, Framebuffer_Texture); PG_Sprite := Create; if PG_Sprite = null then Put_Line ("Could not create sprite"); GNAT.OS_Lib.OS_Exit (1); end if; SetTexture (PG_Sprite, PG_Texture); Window := Create (Mode, "PyGamer simulator", sfResize or sfClose, Params); if Window = null then Put_Line ("Failed to create window"); GNAT.OS_Lib.OS_Exit (1); end if; SetVerticalSyncEnabled (Window, sfFalse); SetVisible (Window, sfTrue); Letter_Box_View := create; if Letter_Box_View = null then Put_Line ("Failed to create view"); GNAT.OS_Lib.OS_Exit (1); end if; setSize (Letter_Box_View, (Float (BG_Width), Float (BG_Height))); setCenter (Letter_Box_View, (Float (BG_Width) / 2.0, Float (BG_Height) / 2.0)); Set_View (Letter_Box_View, getSize (Window).x, getSize (Window).y); loop delay until Next_Release; Next_Release := Next_Release + Period; while pollEvent (Window, Event) loop if Event.eventType = sfEvtClosed then Close (Window); Put_Line ("Attempting to close"); GNAT.OS_Lib.OS_Exit (0); end if; if Event.eventType = sfEvtResized then Set_View (Letter_Box_View, Event.size.width, Event.size.height); end if; if Event.eventType in sfEvtKeyPressed | sfEvtKeyReleased then Pressed := Event.eventType = sfEvtKeyPressed; case Event.key.code is when sfKeyLeft => SFML_Pressed (Left) := Pressed; when sfKeyRight => SFML_Pressed (Right) := Pressed; when sfKeyDown => SFML_Pressed (Down) := Pressed; when sfKeyUp => SFML_Pressed (Up) := Pressed; when sfKeyZ => SFML_Pressed (B) := Pressed; when sfKeyX => SFML_Pressed (A) := Pressed; when sfKeyReturn => SFML_Pressed (Start) := Pressed; when sfKeyC => SFML_Pressed (Sel) := Pressed; when sfKeyEscape => Close (Window); Put_Line ("Attempting to close"); GNAT.OS_Lib.OS_Exit (0); when others => null; end case; end if; end loop; updateFromPixels (texture => Framebuffer_Texture, pixels => Frame_Buffer (Frame_Buffer'First)'access, width => Screen_Width, height => Screen_Height, x => 0, y => 0); setPosition (Sprite_Right, (Float (Scroll_Val) - Float (Screen_Width), 0.0)); setPosition (Sprite_Left, (Float (Scroll_Val), 0.0)); drawSprite (Render_Texture, Hack_SF_Binding (Sprite_Right)); drawSprite (Render_Texture, Hack_SF_Binding (Sprite_Left)); display (Render_Texture); clear (Window); drawSprite (Window, PG_Sprite); drawSprite (Window, Screen_Sprite); setView (Window, Letter_Box_View); display (Window); end loop; exception when E : others => Put_Line (Ada.Exceptions.Exception_Message (E)); GNAT.OS_Lib.OS_Exit (1); end Periodic_Update; end PyGamer;
oeis/086/A086089.asm
neoneye/loda-programs
11
244217
; A086089: Decimal expansion of 3*sqrt(3)/(2*Pi). ; Submitted by <NAME> ; 8,2,6,9,9,3,3,4,3,1,3,2,6,8,8,0,7,4,2,6,6,9,8,9,7,4,7,4,6,9,4,5,4,1,6,2,0,9,6,0,7,9,7,2,0,5,4,9,9,6,0,9,7,9,1,9,9,0,4,9,0,3,0,4,3,6,5,4,5,4,5,5,2,0,3,9,0,4,6,9,2,2,6,0,5,7,0,0,4,3,2,3,4,7,5,6,3,3,3,8 add $0,1 mov $2,1 mov $3,$0 mul $3,3 lpb $3 mul $1,$3 mul $1,2 mul $2,4 mov $5,$3 mul $5,2 add $5,1 mul $2,$5 add $1,$2 div $1,$0 div $2,$0 sub $3,1 lpe sub $3,1 mul $2,$3 sub $1,$2 add $2,$1 mov $4,10 pow $4,$0 div $2,$4 div $1,$2 mov $0,$1 mod $0,10
tmp1/c55x-sim2/foo/Debug/ezdsp5535_uart.asm
jwestmoreland/eZdsp-DBG-sim
1
5078
;******************************************************************************* ;* TMS320C55x C/C++ Codegen PC v4.4.1 * ;* Date/Time created: Sat Oct 06 06:37:21 2018 * ;******************************************************************************* .compiler_opts --hll_source=on --mem_model:code=flat --mem_model:data=large --object_format=coff --silicon_core_3_3 --symdebug:dwarf .mmregs .cpl_on .arms_on .c54cm_off .asg AR6, FP .asg XAR6, XFP .asg DPH, MDP .model call=c55_std .model mem=large .noremark 5002 ; code respects overwrite rules ;******************************************************************************* ;* GLOBAL FILE PARAMETERS * ;* * ;* Architecture : TMS320C55x * ;* Optimizing for : Speed * ;* Memory : Large Model (23-Bit Data Pointers) * ;* Calls : Normal Library ASM calls * ;* Debug Info : Standard TI Debug Information * ;******************************************************************************* $C$DW$CU .dwtag DW_TAG_compile_unit .dwattr $C$DW$CU, DW_AT_name("../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c") .dwattr $C$DW$CU, DW_AT_producer("TMS320C55x C/C++ Codegen PC v4.4.1 Copyright (c) 1996-2012 Texas Instruments Incorporated") .dwattr $C$DW$CU, DW_AT_TI_version(0x01) .dwattr $C$DW$CU, DW_AT_comp_dir("F:\eZdsp_DBG\tmp1\c55x-sim2\foo\Debug") $C$DW$1 .dwtag DW_TAG_subprogram, DW_AT_name("UART_init") .dwattr $C$DW$1, DW_AT_TI_symbol_name("_UART_init") .dwattr $C$DW$1, DW_AT_type(*$C$DW$T$47) .dwattr $C$DW$1, DW_AT_declaration .dwattr $C$DW$1, DW_AT_external $C$DW$2 .dwtag DW_TAG_formal_parameter .dwattr $C$DW$2, DW_AT_type(*$C$DW$T$44) $C$DW$3 .dwtag DW_TAG_formal_parameter .dwattr $C$DW$3, DW_AT_type(*$C$DW$T$38) $C$DW$4 .dwtag DW_TAG_formal_parameter .dwattr $C$DW$4, DW_AT_type(*$C$DW$T$37) .dwendtag $C$DW$1 $C$DW$5 .dwtag DW_TAG_subprogram, DW_AT_name("UART_config") .dwattr $C$DW$5, DW_AT_TI_symbol_name("_UART_config") .dwattr $C$DW$5, DW_AT_type(*$C$DW$T$47) .dwattr $C$DW$5, DW_AT_declaration .dwattr $C$DW$5, DW_AT_external $C$DW$6 .dwtag DW_TAG_formal_parameter .dwattr $C$DW$6, DW_AT_type(*$C$DW$T$45) $C$DW$7 .dwtag DW_TAG_formal_parameter .dwattr $C$DW$7, DW_AT_type(*$C$DW$T$42) .dwendtag $C$DW$5 $C$DW$8 .dwtag DW_TAG_subprogram, DW_AT_name("UART_reset") .dwattr $C$DW$8, DW_AT_TI_symbol_name("_UART_reset") .dwattr $C$DW$8, DW_AT_type(*$C$DW$T$47) .dwattr $C$DW$8, DW_AT_declaration .dwattr $C$DW$8, DW_AT_external $C$DW$9 .dwtag DW_TAG_formal_parameter .dwattr $C$DW$9, DW_AT_type(*$C$DW$T$45) .dwendtag $C$DW$8 $C$DW$10 .dwtag DW_TAG_subprogram, DW_AT_name("UART_resetOff") .dwattr $C$DW$10, DW_AT_TI_symbol_name("_UART_resetOff") .dwattr $C$DW$10, DW_AT_type(*$C$DW$T$47) .dwattr $C$DW$10, DW_AT_declaration .dwattr $C$DW$10, DW_AT_external $C$DW$11 .dwtag DW_TAG_formal_parameter .dwattr $C$DW$11, DW_AT_type(*$C$DW$T$45) .dwendtag $C$DW$10 $C$DW$12 .dwtag DW_TAG_subprogram, DW_AT_name("UART_fgetc") .dwattr $C$DW$12, DW_AT_TI_symbol_name("_UART_fgetc") .dwattr $C$DW$12, DW_AT_type(*$C$DW$T$47) .dwattr $C$DW$12, DW_AT_declaration .dwattr $C$DW$12, DW_AT_external $C$DW$13 .dwtag DW_TAG_formal_parameter .dwattr $C$DW$13, DW_AT_type(*$C$DW$T$45) $C$DW$14 .dwtag DW_TAG_formal_parameter .dwattr $C$DW$14, DW_AT_type(*$C$DW$T$56) $C$DW$15 .dwtag DW_TAG_formal_parameter .dwattr $C$DW$15, DW_AT_type(*$C$DW$T$38) .dwendtag $C$DW$12 $C$DW$16 .dwtag DW_TAG_subprogram, DW_AT_name("UART_fputc") .dwattr $C$DW$16, DW_AT_TI_symbol_name("_UART_fputc") .dwattr $C$DW$16, DW_AT_type(*$C$DW$T$47) .dwattr $C$DW$16, DW_AT_declaration .dwattr $C$DW$16, DW_AT_external $C$DW$17 .dwtag DW_TAG_formal_parameter .dwattr $C$DW$17, DW_AT_type(*$C$DW$T$45) $C$DW$18 .dwtag DW_TAG_formal_parameter .dwattr $C$DW$18, DW_AT_type(*$C$DW$T$59) $C$DW$19 .dwtag DW_TAG_formal_parameter .dwattr $C$DW$19, DW_AT_type(*$C$DW$T$38) .dwendtag $C$DW$16 .global _uartObj .bss _uartObj,20,0,2 $C$DW$20 .dwtag DW_TAG_variable, DW_AT_name("uartObj") .dwattr $C$DW$20, DW_AT_TI_symbol_name("_uartObj") .dwattr $C$DW$20, DW_AT_location[DW_OP_addr _uartObj] .dwattr $C$DW$20, DW_AT_type(*$C$DW$T$43) .dwattr $C$DW$20, DW_AT_external .global _hUart .bss _hUart,2,0,2 $C$DW$21 .dwtag DW_TAG_variable, DW_AT_name("hUart") .dwattr $C$DW$21, DW_AT_TI_symbol_name("_hUart") .dwattr $C$DW$21, DW_AT_location[DW_OP_addr _hUart] .dwattr $C$DW$21, DW_AT_type(*$C$DW$T$45) .dwattr $C$DW$21, DW_AT_external ; F:\t\cc5p5\ccsv5\tools\compiler\c5500_4.4.1\bin\acp55.exe -@f:\\AppData\\Local\\Temp\\0988013 .sect ".text" .align 4 .global _EZDSP5535_UART_open $C$DW$22 .dwtag DW_TAG_subprogram, DW_AT_name("EZDSP5535_UART_open") .dwattr $C$DW$22, DW_AT_low_pc(_EZDSP5535_UART_open) .dwattr $C$DW$22, DW_AT_high_pc(0x00) .dwattr $C$DW$22, DW_AT_TI_symbol_name("_EZDSP5535_UART_open") .dwattr $C$DW$22, DW_AT_external .dwattr $C$DW$22, DW_AT_type(*$C$DW$T$46) .dwattr $C$DW$22, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c") .dwattr $C$DW$22, DW_AT_TI_begin_line(0x35) .dwattr $C$DW$22, DW_AT_TI_begin_column(0x07) .dwattr $C$DW$22, DW_AT_TI_max_frame_size(0x08) .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 54,column 1,is_stmt,address _EZDSP5535_UART_open .dwfde $C$DW$CIE, _EZDSP5535_UART_open ;******************************************************************************* ;* FUNCTION NAME: EZDSP5535_UART_open * ;* * ;* Function Uses Regs : AC0,AC0,T0,AR0,XAR0,AR1,XAR1,AR3,XAR3,SP,M40,SATA, * ;* SATD,RDM,FRCT,SMUL * ;* Stack Frame : Compact (No Frame Pointer, w/ debug) * ;* Total Frame Size : 8 words * ;* (2 return address/alignment) * ;* (6 local values) * ;* Min System Stack : 1 word * ;******************************************************************************* _EZDSP5535_UART_open: .dwcfi cfa_offset, 1 .dwcfi save_reg_to_mem, 91, -1 AADD #-7, SP .dwcfi cfa_offset, 8 $C$DW$23 .dwtag DW_TAG_variable, DW_AT_name("status") .dwattr $C$DW$23, DW_AT_TI_symbol_name("_status") .dwattr $C$DW$23, DW_AT_type(*$C$DW$T$47) .dwattr $C$DW$23, DW_AT_location[DW_OP_bregx 0x24 0] $C$DW$24 .dwtag DW_TAG_variable, DW_AT_name("Config") .dwattr $C$DW$24, DW_AT_TI_symbol_name("_Config") .dwattr $C$DW$24, DW_AT_type(*$C$DW$T$41) .dwattr $C$DW$24, DW_AT_location[DW_OP_bregx 0x24 1] .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 64,column 5,is_stmt MOV #54, *SP(#1) ; |64| .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 65,column 5,is_stmt MOV #0, *SP(#2) ; |65| .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 67,column 5,is_stmt MOV #0, *SP(#4) ; |67| .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 68,column 5,is_stmt MOV #3, *SP(#3) ; |68| .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 72,column 5,is_stmt MOV #0, *SP(#5) ; |72| .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 76,column 5,is_stmt AMOV #_uartObj, XAR0 ; |76| MOV #0, AC0 ; |76| $C$DW$25 .dwtag DW_TAG_TI_branch .dwattr $C$DW$25, DW_AT_low_pc(0x00) .dwattr $C$DW$25, DW_AT_name("_UART_init") .dwattr $C$DW$25, DW_AT_TI_call CALL #_UART_init ; |76| || MOV #1, T0 ; call occurs [#_UART_init] ; |76| MOV T0, *SP(#0) ; |76| .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 77,column 5,is_stmt AMOV #_uartObj, XAR3 ; |77| MOV XAR3, dbl(*(#_hUart)) .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 78,column 5,is_stmt MOV dbl(*(#_hUart)), XAR0 $C$DW$26 .dwtag DW_TAG_TI_branch .dwattr $C$DW$26, DW_AT_low_pc(0x00) .dwattr $C$DW$26, DW_AT_name("_UART_reset") .dwattr $C$DW$26, DW_AT_TI_call CALL #_UART_reset ; |78| ; call occurs [#_UART_reset] ; |78| OR *SP(#0), T0, AR1 ; |78| MOV AR1, *SP(#0) ; |78| .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 79,column 5,is_stmt MOV dbl(*(#_hUart)), XAR0 AMAR *SP(#1), XAR1 $C$DW$27 .dwtag DW_TAG_TI_branch .dwattr $C$DW$27, DW_AT_low_pc(0x00) .dwattr $C$DW$27, DW_AT_name("_UART_config") .dwattr $C$DW$27, DW_AT_TI_call CALL #_UART_config ; |79| ; call occurs [#_UART_config] ; |79| OR *SP(#0), T0, AR1 ; |79| MOV AR1, *SP(#0) ; |79| .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 80,column 5,is_stmt MOV dbl(*(#_hUart)), XAR0 $C$DW$28 .dwtag DW_TAG_TI_branch .dwattr $C$DW$28, DW_AT_low_pc(0x00) .dwattr $C$DW$28, DW_AT_name("_UART_resetOff") .dwattr $C$DW$28, DW_AT_TI_call CALL #_UART_resetOff ; |80| ; call occurs [#_UART_resetOff] ; |80| OR *SP(#0), T0, AR1 ; |80| MOV AR1, *SP(#0) ; |80| .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 82,column 5,is_stmt AND #0x0fff, *port(#7168) ; |82| .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 83,column 5,is_stmt OR #0x1000, *port(#7168) ; |83| .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 85,column 2,is_stmt MOV AR1, T0 .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 86,column 1,is_stmt AADD #7, SP .dwcfi cfa_offset, 1 $C$DW$29 .dwtag DW_TAG_TI_branch .dwattr $C$DW$29, DW_AT_low_pc(0x00) .dwattr $C$DW$29, DW_AT_TI_return RET ; return occurs .dwattr $C$DW$22, DW_AT_TI_end_file("../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c") .dwattr $C$DW$22, DW_AT_TI_end_line(0x56) .dwattr $C$DW$22, DW_AT_TI_end_column(0x01) .dwendentry .dwendtag $C$DW$22 .sect ".text" .align 4 .global _EVM5515_UART_putChar $C$DW$30 .dwtag DW_TAG_subprogram, DW_AT_name("EVM5515_UART_putChar") .dwattr $C$DW$30, DW_AT_low_pc(_EVM5515_UART_putChar) .dwattr $C$DW$30, DW_AT_high_pc(0x00) .dwattr $C$DW$30, DW_AT_TI_symbol_name("_EVM5515_UART_putChar") .dwattr $C$DW$30, DW_AT_external .dwattr $C$DW$30, DW_AT_type(*$C$DW$T$46) .dwattr $C$DW$30, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c") .dwattr $C$DW$30, DW_AT_TI_begin_line(0x5d) .dwattr $C$DW$30, DW_AT_TI_begin_column(0x07) .dwattr $C$DW$30, DW_AT_TI_max_frame_size(0x02) .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 94,column 1,is_stmt,address _EVM5515_UART_putChar .dwfde $C$DW$CIE, _EVM5515_UART_putChar $C$DW$31 .dwtag DW_TAG_formal_parameter, DW_AT_name("data") .dwattr $C$DW$31, DW_AT_TI_symbol_name("_data") .dwattr $C$DW$31, DW_AT_type(*$C$DW$T$54) .dwattr $C$DW$31, DW_AT_location[DW_OP_reg12] ;******************************************************************************* ;* FUNCTION NAME: EVM5515_UART_putChar * ;* * ;* Function Uses Regs : AC0,AC0,T0,AR0,XAR0,SP,M40,SATA,SATD,RDM,FRCT,SMUL * ;* Stack Frame : Compact (No Frame Pointer, w/ debug) * ;* Total Frame Size : 2 words * ;* (1 return address/alignment) * ;* (1 local values) * ;* Min System Stack : 1 word * ;******************************************************************************* _EVM5515_UART_putChar: .dwcfi cfa_offset, 1 .dwcfi save_reg_to_mem, 91, -1 AADD #-1, SP .dwcfi cfa_offset, 2 $C$DW$32 .dwtag DW_TAG_variable, DW_AT_name("data") .dwattr $C$DW$32, DW_AT_TI_symbol_name("_data") .dwattr $C$DW$32, DW_AT_type(*$C$DW$T$54) .dwattr $C$DW$32, DW_AT_location[DW_OP_bregx 0x24 0] MOV T0, *SP(#0) ; |94| .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 95,column 2,is_stmt MOV dbl(*(#_hUart)), XAR0 $C$DW$33 .dwtag DW_TAG_TI_branch .dwattr $C$DW$33, DW_AT_low_pc(0x00) .dwattr $C$DW$33, DW_AT_name("_UART_fputc") .dwattr $C$DW$33, DW_AT_TI_call CALL #_UART_fputc ; |95| || MOV #0, AC0 ; |95| ; call occurs [#_UART_fputc] ; |95| .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 97,column 5,is_stmt MOV #0, T0 .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 98,column 1,is_stmt AADD #1, SP .dwcfi cfa_offset, 1 $C$DW$34 .dwtag DW_TAG_TI_branch .dwattr $C$DW$34, DW_AT_low_pc(0x00) .dwattr $C$DW$34, DW_AT_TI_return RET ; return occurs .dwattr $C$DW$30, DW_AT_TI_end_file("../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c") .dwattr $C$DW$30, DW_AT_TI_end_line(0x62) .dwattr $C$DW$30, DW_AT_TI_end_column(0x01) .dwendentry .dwendtag $C$DW$30 .sect ".text" .align 4 .global _EVM5515_UART_getChar $C$DW$35 .dwtag DW_TAG_subprogram, DW_AT_name("EVM5515_UART_getChar") .dwattr $C$DW$35, DW_AT_low_pc(_EVM5515_UART_getChar) .dwattr $C$DW$35, DW_AT_high_pc(0x00) .dwattr $C$DW$35, DW_AT_TI_symbol_name("_EVM5515_UART_getChar") .dwattr $C$DW$35, DW_AT_external .dwattr $C$DW$35, DW_AT_type(*$C$DW$T$46) .dwattr $C$DW$35, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c") .dwattr $C$DW$35, DW_AT_TI_begin_line(0x69) .dwattr $C$DW$35, DW_AT_TI_begin_column(0x07) .dwattr $C$DW$35, DW_AT_TI_max_frame_size(0x04) .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 106,column 1,is_stmt,address _EVM5515_UART_getChar .dwfde $C$DW$CIE, _EVM5515_UART_getChar $C$DW$36 .dwtag DW_TAG_formal_parameter, DW_AT_name("data") .dwattr $C$DW$36, DW_AT_TI_symbol_name("_data") .dwattr $C$DW$36, DW_AT_type(*$C$DW$T$64) .dwattr $C$DW$36, DW_AT_location[DW_OP_reg17] ;******************************************************************************* ;* FUNCTION NAME: EVM5515_UART_getChar * ;* * ;* Function Uses Regs : AC0,AC0,T0,AR0,XAR0,AR1,XAR1,SP,M40,SATA,SATD,RDM, * ;* FRCT,SMUL * ;* Stack Frame : Compact (No Frame Pointer, w/ debug) * ;* Total Frame Size : 4 words * ;* (2 return address/alignment) * ;* (2 local values) * ;* Min System Stack : 1 word * ;******************************************************************************* _EVM5515_UART_getChar: .dwcfi cfa_offset, 1 .dwcfi save_reg_to_mem, 91, -1 AADD #-3, SP .dwcfi cfa_offset, 4 $C$DW$37 .dwtag DW_TAG_variable, DW_AT_name("data") .dwattr $C$DW$37, DW_AT_TI_symbol_name("_data") .dwattr $C$DW$37, DW_AT_type(*$C$DW$T$64) .dwattr $C$DW$37, DW_AT_location[DW_OP_bregx 0x24 0] MOV XAR0, dbl(*SP(#0)) .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 107,column 2,is_stmt MOV dbl(*(#_hUart)), XAR0 MOV dbl(*SP(#0)), XAR1 $C$DW$38 .dwtag DW_TAG_TI_branch .dwattr $C$DW$38, DW_AT_low_pc(0x00) .dwattr $C$DW$38, DW_AT_name("_UART_fgetc") .dwattr $C$DW$38, DW_AT_TI_call CALL #_UART_fgetc ; |107| || MOV #0, AC0 ; |107| ; call occurs [#_UART_fgetc] ; |107| .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 109,column 5,is_stmt MOV #0, T0 .dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c",line 110,column 1,is_stmt AADD #3, SP .dwcfi cfa_offset, 1 $C$DW$39 .dwtag DW_TAG_TI_branch .dwattr $C$DW$39, DW_AT_low_pc(0x00) .dwattr $C$DW$39, DW_AT_TI_return RET ; return occurs .dwattr $C$DW$35, DW_AT_TI_end_file("../c5535_bsl_revc/ezdsp5535_v1/lib/bsl/ezdsp5535_uart.c") .dwattr $C$DW$35, DW_AT_TI_end_line(0x6e) .dwattr $C$DW$35, DW_AT_TI_end_column(0x01) .dwendentry .dwendtag $C$DW$35 ;****************************************************************************** ;* UNDEFINED EXTERNAL REFERENCES * ;****************************************************************************** .global _UART_init .global _UART_config .global _UART_reset .global _UART_resetOff .global _UART_fgetc .global _UART_fputc ;******************************************************************************* ;* TYPE INFORMATION * ;******************************************************************************* $C$DW$T$36 .dwtag DW_TAG_enumeration_type .dwattr $C$DW$T$36, DW_AT_byte_size(0x01) $C$DW$40 .dwtag DW_TAG_enumerator, DW_AT_name("UART_POLLED"), DW_AT_const_value(0x00) $C$DW$41 .dwtag DW_TAG_enumerator, DW_AT_name("UART_INTERRUPT"), DW_AT_const_value(0x01) $C$DW$42 .dwtag DW_TAG_enumerator, DW_AT_name("UART_OPMODE_OTHER"), DW_AT_const_value(0x02) .dwendtag $C$DW$T$36 $C$DW$T$37 .dwtag DW_TAG_typedef, DW_AT_name("CSL_UartOpmode") .dwattr $C$DW$T$37, DW_AT_type(*$C$DW$T$36) .dwattr $C$DW$T$37, DW_AT_language(DW_LANG_C) $C$DW$T$23 .dwtag DW_TAG_structure_type .dwattr $C$DW$T$23, DW_AT_byte_size(0x19) $C$DW$43 .dwtag DW_TAG_member .dwattr $C$DW$43, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$43, DW_AT_name("THR") .dwattr $C$DW$43, DW_AT_TI_symbol_name("_THR") .dwattr $C$DW$43, DW_AT_data_member_location[DW_OP_plus_uconst 0x0] .dwattr $C$DW$43, DW_AT_accessibility(DW_ACCESS_public) $C$DW$44 .dwtag DW_TAG_member .dwattr $C$DW$44, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$44, DW_AT_name("RSVD0") .dwattr $C$DW$44, DW_AT_TI_symbol_name("_RSVD0") .dwattr $C$DW$44, DW_AT_data_member_location[DW_OP_plus_uconst 0x1] .dwattr $C$DW$44, DW_AT_accessibility(DW_ACCESS_public) $C$DW$45 .dwtag DW_TAG_member .dwattr $C$DW$45, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$45, DW_AT_name("IER") .dwattr $C$DW$45, DW_AT_TI_symbol_name("_IER") .dwattr $C$DW$45, DW_AT_data_member_location[DW_OP_plus_uconst 0x2] .dwattr $C$DW$45, DW_AT_accessibility(DW_ACCESS_public) $C$DW$46 .dwtag DW_TAG_member .dwattr $C$DW$46, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$46, DW_AT_name("RSVD1") .dwattr $C$DW$46, DW_AT_TI_symbol_name("_RSVD1") .dwattr $C$DW$46, DW_AT_data_member_location[DW_OP_plus_uconst 0x3] .dwattr $C$DW$46, DW_AT_accessibility(DW_ACCESS_public) $C$DW$47 .dwtag DW_TAG_member .dwattr $C$DW$47, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$47, DW_AT_name("FCR") .dwattr $C$DW$47, DW_AT_TI_symbol_name("_FCR") .dwattr $C$DW$47, DW_AT_data_member_location[DW_OP_plus_uconst 0x4] .dwattr $C$DW$47, DW_AT_accessibility(DW_ACCESS_public) $C$DW$48 .dwtag DW_TAG_member .dwattr $C$DW$48, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$48, DW_AT_name("RSVD2") .dwattr $C$DW$48, DW_AT_TI_symbol_name("_RSVD2") .dwattr $C$DW$48, DW_AT_data_member_location[DW_OP_plus_uconst 0x5] .dwattr $C$DW$48, DW_AT_accessibility(DW_ACCESS_public) $C$DW$49 .dwtag DW_TAG_member .dwattr $C$DW$49, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$49, DW_AT_name("LCR") .dwattr $C$DW$49, DW_AT_TI_symbol_name("_LCR") .dwattr $C$DW$49, DW_AT_data_member_location[DW_OP_plus_uconst 0x6] .dwattr $C$DW$49, DW_AT_accessibility(DW_ACCESS_public) $C$DW$50 .dwtag DW_TAG_member .dwattr $C$DW$50, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$50, DW_AT_name("RSVD3") .dwattr $C$DW$50, DW_AT_TI_symbol_name("_RSVD3") .dwattr $C$DW$50, DW_AT_data_member_location[DW_OP_plus_uconst 0x7] .dwattr $C$DW$50, DW_AT_accessibility(DW_ACCESS_public) $C$DW$51 .dwtag DW_TAG_member .dwattr $C$DW$51, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$51, DW_AT_name("MCR") .dwattr $C$DW$51, DW_AT_TI_symbol_name("_MCR") .dwattr $C$DW$51, DW_AT_data_member_location[DW_OP_plus_uconst 0x8] .dwattr $C$DW$51, DW_AT_accessibility(DW_ACCESS_public) $C$DW$52 .dwtag DW_TAG_member .dwattr $C$DW$52, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$52, DW_AT_name("RSVD4") .dwattr $C$DW$52, DW_AT_TI_symbol_name("_RSVD4") .dwattr $C$DW$52, DW_AT_data_member_location[DW_OP_plus_uconst 0x9] .dwattr $C$DW$52, DW_AT_accessibility(DW_ACCESS_public) $C$DW$53 .dwtag DW_TAG_member .dwattr $C$DW$53, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$53, DW_AT_name("LSR") .dwattr $C$DW$53, DW_AT_TI_symbol_name("_LSR") .dwattr $C$DW$53, DW_AT_data_member_location[DW_OP_plus_uconst 0xa] .dwattr $C$DW$53, DW_AT_accessibility(DW_ACCESS_public) $C$DW$54 .dwtag DW_TAG_member .dwattr $C$DW$54, DW_AT_type(*$C$DW$T$21) .dwattr $C$DW$54, DW_AT_name("RSVD5") .dwattr $C$DW$54, DW_AT_TI_symbol_name("_RSVD5") .dwattr $C$DW$54, DW_AT_data_member_location[DW_OP_plus_uconst 0xb] .dwattr $C$DW$54, DW_AT_accessibility(DW_ACCESS_public) $C$DW$55 .dwtag DW_TAG_member .dwattr $C$DW$55, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$55, DW_AT_name("SCR") .dwattr $C$DW$55, DW_AT_TI_symbol_name("_SCR") .dwattr $C$DW$55, DW_AT_data_member_location[DW_OP_plus_uconst 0xe] .dwattr $C$DW$55, DW_AT_accessibility(DW_ACCESS_public) $C$DW$56 .dwtag DW_TAG_member .dwattr $C$DW$56, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$56, DW_AT_name("RSVD6") .dwattr $C$DW$56, DW_AT_TI_symbol_name("_RSVD6") .dwattr $C$DW$56, DW_AT_data_member_location[DW_OP_plus_uconst 0xf] .dwattr $C$DW$56, DW_AT_accessibility(DW_ACCESS_public) $C$DW$57 .dwtag DW_TAG_member .dwattr $C$DW$57, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$57, DW_AT_name("DLL") .dwattr $C$DW$57, DW_AT_TI_symbol_name("_DLL") .dwattr $C$DW$57, DW_AT_data_member_location[DW_OP_plus_uconst 0x10] .dwattr $C$DW$57, DW_AT_accessibility(DW_ACCESS_public) $C$DW$58 .dwtag DW_TAG_member .dwattr $C$DW$58, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$58, DW_AT_name("RSVD7") .dwattr $C$DW$58, DW_AT_TI_symbol_name("_RSVD7") .dwattr $C$DW$58, DW_AT_data_member_location[DW_OP_plus_uconst 0x11] .dwattr $C$DW$58, DW_AT_accessibility(DW_ACCESS_public) $C$DW$59 .dwtag DW_TAG_member .dwattr $C$DW$59, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$59, DW_AT_name("DLH") .dwattr $C$DW$59, DW_AT_TI_symbol_name("_DLH") .dwattr $C$DW$59, DW_AT_data_member_location[DW_OP_plus_uconst 0x12] .dwattr $C$DW$59, DW_AT_accessibility(DW_ACCESS_public) $C$DW$60 .dwtag DW_TAG_member .dwattr $C$DW$60, DW_AT_type(*$C$DW$T$22) .dwattr $C$DW$60, DW_AT_name("RSVD8") .dwattr $C$DW$60, DW_AT_TI_symbol_name("_RSVD8") .dwattr $C$DW$60, DW_AT_data_member_location[DW_OP_plus_uconst 0x13] .dwattr $C$DW$60, DW_AT_accessibility(DW_ACCESS_public) $C$DW$61 .dwtag DW_TAG_member .dwattr $C$DW$61, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$61, DW_AT_name("PWREMU_MGMT") .dwattr $C$DW$61, DW_AT_TI_symbol_name("_PWREMU_MGMT") .dwattr $C$DW$61, DW_AT_data_member_location[DW_OP_plus_uconst 0x18] .dwattr $C$DW$61, DW_AT_accessibility(DW_ACCESS_public) .dwendtag $C$DW$T$23 $C$DW$T$28 .dwtag DW_TAG_typedef, DW_AT_name("CSL_UartRegs") .dwattr $C$DW$T$28, DW_AT_type(*$C$DW$T$23) .dwattr $C$DW$T$28, DW_AT_language(DW_LANG_C) $C$DW$62 .dwtag DW_TAG_TI_far_type .dwattr $C$DW$62, DW_AT_type(*$C$DW$T$28) $C$DW$63 .dwtag DW_TAG_TI_ioport_type .dwattr $C$DW$63, DW_AT_type(*$C$DW$62) $C$DW$T$29 .dwtag DW_TAG_volatile_type .dwattr $C$DW$T$29, DW_AT_type(*$C$DW$63) $C$DW$T$30 .dwtag DW_TAG_pointer_type .dwattr $C$DW$T$30, DW_AT_type(*$C$DW$T$29) .dwattr $C$DW$T$30, DW_AT_address_class(0x10) $C$DW$T$31 .dwtag DW_TAG_typedef, DW_AT_name("CSL_UartRegsOvly") .dwattr $C$DW$T$31, DW_AT_type(*$C$DW$T$30) .dwattr $C$DW$T$31, DW_AT_language(DW_LANG_C) $C$DW$T$26 .dwtag DW_TAG_structure_type .dwattr $C$DW$T$26, DW_AT_byte_size(0x48) $C$DW$64 .dwtag DW_TAG_member .dwattr $C$DW$64, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$64, DW_AT_name("EBSR") .dwattr $C$DW$64, DW_AT_TI_symbol_name("_EBSR") .dwattr $C$DW$64, DW_AT_data_member_location[DW_OP_plus_uconst 0x0] .dwattr $C$DW$64, DW_AT_accessibility(DW_ACCESS_public) $C$DW$65 .dwtag DW_TAG_member .dwattr $C$DW$65, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$65, DW_AT_name("RSVD0") .dwattr $C$DW$65, DW_AT_TI_symbol_name("_RSVD0") .dwattr $C$DW$65, DW_AT_data_member_location[DW_OP_plus_uconst 0x1] .dwattr $C$DW$65, DW_AT_accessibility(DW_ACCESS_public) $C$DW$66 .dwtag DW_TAG_member .dwattr $C$DW$66, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$66, DW_AT_name("PCGCR1") .dwattr $C$DW$66, DW_AT_TI_symbol_name("_PCGCR1") .dwattr $C$DW$66, DW_AT_data_member_location[DW_OP_plus_uconst 0x2] .dwattr $C$DW$66, DW_AT_accessibility(DW_ACCESS_public) $C$DW$67 .dwtag DW_TAG_member .dwattr $C$DW$67, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$67, DW_AT_name("PCGCR2") .dwattr $C$DW$67, DW_AT_TI_symbol_name("_PCGCR2") .dwattr $C$DW$67, DW_AT_data_member_location[DW_OP_plus_uconst 0x3] .dwattr $C$DW$67, DW_AT_accessibility(DW_ACCESS_public) $C$DW$68 .dwtag DW_TAG_member .dwattr $C$DW$68, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$68, DW_AT_name("PSRCR") .dwattr $C$DW$68, DW_AT_TI_symbol_name("_PSRCR") .dwattr $C$DW$68, DW_AT_data_member_location[DW_OP_plus_uconst 0x4] .dwattr $C$DW$68, DW_AT_accessibility(DW_ACCESS_public) $C$DW$69 .dwtag DW_TAG_member .dwattr $C$DW$69, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$69, DW_AT_name("PRCR") .dwattr $C$DW$69, DW_AT_TI_symbol_name("_PRCR") .dwattr $C$DW$69, DW_AT_data_member_location[DW_OP_plus_uconst 0x5] .dwattr $C$DW$69, DW_AT_accessibility(DW_ACCESS_public) $C$DW$70 .dwtag DW_TAG_member .dwattr $C$DW$70, DW_AT_type(*$C$DW$T$24) .dwattr $C$DW$70, DW_AT_name("RSVD1") .dwattr $C$DW$70, DW_AT_TI_symbol_name("_RSVD1") .dwattr $C$DW$70, DW_AT_data_member_location[DW_OP_plus_uconst 0x6] .dwattr $C$DW$70, DW_AT_accessibility(DW_ACCESS_public) $C$DW$71 .dwtag DW_TAG_member .dwattr $C$DW$71, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$71, DW_AT_name("TIAFR") .dwattr $C$DW$71, DW_AT_TI_symbol_name("_TIAFR") .dwattr $C$DW$71, DW_AT_data_member_location[DW_OP_plus_uconst 0x14] .dwattr $C$DW$71, DW_AT_accessibility(DW_ACCESS_public) $C$DW$72 .dwtag DW_TAG_member .dwattr $C$DW$72, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$72, DW_AT_name("RSVD2") .dwattr $C$DW$72, DW_AT_TI_symbol_name("_RSVD2") .dwattr $C$DW$72, DW_AT_data_member_location[DW_OP_plus_uconst 0x15] .dwattr $C$DW$72, DW_AT_accessibility(DW_ACCESS_public) $C$DW$73 .dwtag DW_TAG_member .dwattr $C$DW$73, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$73, DW_AT_name("ODSCR") .dwattr $C$DW$73, DW_AT_TI_symbol_name("_ODSCR") .dwattr $C$DW$73, DW_AT_data_member_location[DW_OP_plus_uconst 0x16] .dwattr $C$DW$73, DW_AT_accessibility(DW_ACCESS_public) $C$DW$74 .dwtag DW_TAG_member .dwattr $C$DW$74, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$74, DW_AT_name("PDINHIBR1") .dwattr $C$DW$74, DW_AT_TI_symbol_name("_PDINHIBR1") .dwattr $C$DW$74, DW_AT_data_member_location[DW_OP_plus_uconst 0x17] .dwattr $C$DW$74, DW_AT_accessibility(DW_ACCESS_public) $C$DW$75 .dwtag DW_TAG_member .dwattr $C$DW$75, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$75, DW_AT_name("PDINHIBR2") .dwattr $C$DW$75, DW_AT_TI_symbol_name("_PDINHIBR2") .dwattr $C$DW$75, DW_AT_data_member_location[DW_OP_plus_uconst 0x18] .dwattr $C$DW$75, DW_AT_accessibility(DW_ACCESS_public) $C$DW$76 .dwtag DW_TAG_member .dwattr $C$DW$76, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$76, DW_AT_name("PDINHIBR3") .dwattr $C$DW$76, DW_AT_TI_symbol_name("_PDINHIBR3") .dwattr $C$DW$76, DW_AT_data_member_location[DW_OP_plus_uconst 0x19] .dwattr $C$DW$76, DW_AT_accessibility(DW_ACCESS_public) $C$DW$77 .dwtag DW_TAG_member .dwattr $C$DW$77, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$77, DW_AT_name("DMA0CESR1") .dwattr $C$DW$77, DW_AT_TI_symbol_name("_DMA0CESR1") .dwattr $C$DW$77, DW_AT_data_member_location[DW_OP_plus_uconst 0x1a] .dwattr $C$DW$77, DW_AT_accessibility(DW_ACCESS_public) $C$DW$78 .dwtag DW_TAG_member .dwattr $C$DW$78, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$78, DW_AT_name("DMA0CESR2") .dwattr $C$DW$78, DW_AT_TI_symbol_name("_DMA0CESR2") .dwattr $C$DW$78, DW_AT_data_member_location[DW_OP_plus_uconst 0x1b] .dwattr $C$DW$78, DW_AT_accessibility(DW_ACCESS_public) $C$DW$79 .dwtag DW_TAG_member .dwattr $C$DW$79, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$79, DW_AT_name("DMA1CESR1") .dwattr $C$DW$79, DW_AT_TI_symbol_name("_DMA1CESR1") .dwattr $C$DW$79, DW_AT_data_member_location[DW_OP_plus_uconst 0x1c] .dwattr $C$DW$79, DW_AT_accessibility(DW_ACCESS_public) $C$DW$80 .dwtag DW_TAG_member .dwattr $C$DW$80, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$80, DW_AT_name("DMA1CESR2") .dwattr $C$DW$80, DW_AT_TI_symbol_name("_DMA1CESR2") .dwattr $C$DW$80, DW_AT_data_member_location[DW_OP_plus_uconst 0x1d] .dwattr $C$DW$80, DW_AT_accessibility(DW_ACCESS_public) $C$DW$81 .dwtag DW_TAG_member .dwattr $C$DW$81, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$81, DW_AT_name("SDRAMCCR") .dwattr $C$DW$81, DW_AT_TI_symbol_name("_SDRAMCCR") .dwattr $C$DW$81, DW_AT_data_member_location[DW_OP_plus_uconst 0x1e] .dwattr $C$DW$81, DW_AT_accessibility(DW_ACCESS_public) $C$DW$82 .dwtag DW_TAG_member .dwattr $C$DW$82, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$82, DW_AT_name("CCR2") .dwattr $C$DW$82, DW_AT_TI_symbol_name("_CCR2") .dwattr $C$DW$82, DW_AT_data_member_location[DW_OP_plus_uconst 0x1f] .dwattr $C$DW$82, DW_AT_accessibility(DW_ACCESS_public) $C$DW$83 .dwtag DW_TAG_member .dwattr $C$DW$83, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$83, DW_AT_name("CGCR1") .dwattr $C$DW$83, DW_AT_TI_symbol_name("_CGCR1") .dwattr $C$DW$83, DW_AT_data_member_location[DW_OP_plus_uconst 0x20] .dwattr $C$DW$83, DW_AT_accessibility(DW_ACCESS_public) $C$DW$84 .dwtag DW_TAG_member .dwattr $C$DW$84, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$84, DW_AT_name("CGICR") .dwattr $C$DW$84, DW_AT_TI_symbol_name("_CGICR") .dwattr $C$DW$84, DW_AT_data_member_location[DW_OP_plus_uconst 0x21] .dwattr $C$DW$84, DW_AT_accessibility(DW_ACCESS_public) $C$DW$85 .dwtag DW_TAG_member .dwattr $C$DW$85, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$85, DW_AT_name("CGCR2") .dwattr $C$DW$85, DW_AT_TI_symbol_name("_CGCR2") .dwattr $C$DW$85, DW_AT_data_member_location[DW_OP_plus_uconst 0x22] .dwattr $C$DW$85, DW_AT_accessibility(DW_ACCESS_public) $C$DW$86 .dwtag DW_TAG_member .dwattr $C$DW$86, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$86, DW_AT_name("CGOCR") .dwattr $C$DW$86, DW_AT_TI_symbol_name("_CGOCR") .dwattr $C$DW$86, DW_AT_data_member_location[DW_OP_plus_uconst 0x23] .dwattr $C$DW$86, DW_AT_accessibility(DW_ACCESS_public) $C$DW$87 .dwtag DW_TAG_member .dwattr $C$DW$87, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$87, DW_AT_name("CCSSR") .dwattr $C$DW$87, DW_AT_TI_symbol_name("_CCSSR") .dwattr $C$DW$87, DW_AT_data_member_location[DW_OP_plus_uconst 0x24] .dwattr $C$DW$87, DW_AT_accessibility(DW_ACCESS_public) $C$DW$88 .dwtag DW_TAG_member .dwattr $C$DW$88, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$88, DW_AT_name("RSVD3") .dwattr $C$DW$88, DW_AT_TI_symbol_name("_RSVD3") .dwattr $C$DW$88, DW_AT_data_member_location[DW_OP_plus_uconst 0x25] .dwattr $C$DW$88, DW_AT_accessibility(DW_ACCESS_public) $C$DW$89 .dwtag DW_TAG_member .dwattr $C$DW$89, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$89, DW_AT_name("ECDR") .dwattr $C$DW$89, DW_AT_TI_symbol_name("_ECDR") .dwattr $C$DW$89, DW_AT_data_member_location[DW_OP_plus_uconst 0x26] .dwattr $C$DW$89, DW_AT_accessibility(DW_ACCESS_public) $C$DW$90 .dwtag DW_TAG_member .dwattr $C$DW$90, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$90, DW_AT_name("RSVD4") .dwattr $C$DW$90, DW_AT_TI_symbol_name("_RSVD4") .dwattr $C$DW$90, DW_AT_data_member_location[DW_OP_plus_uconst 0x27] .dwattr $C$DW$90, DW_AT_accessibility(DW_ACCESS_public) $C$DW$91 .dwtag DW_TAG_member .dwattr $C$DW$91, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$91, DW_AT_name("RAMSLPMDCNTLR1") .dwattr $C$DW$91, DW_AT_TI_symbol_name("_RAMSLPMDCNTLR1") .dwattr $C$DW$91, DW_AT_data_member_location[DW_OP_plus_uconst 0x28] .dwattr $C$DW$91, DW_AT_accessibility(DW_ACCESS_public) $C$DW$92 .dwtag DW_TAG_member .dwattr $C$DW$92, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$92, DW_AT_name("RSVD5") .dwattr $C$DW$92, DW_AT_TI_symbol_name("_RSVD5") .dwattr $C$DW$92, DW_AT_data_member_location[DW_OP_plus_uconst 0x29] .dwattr $C$DW$92, DW_AT_accessibility(DW_ACCESS_public) $C$DW$93 .dwtag DW_TAG_member .dwattr $C$DW$93, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$93, DW_AT_name("RAMSLPMDCNTLR2") .dwattr $C$DW$93, DW_AT_TI_symbol_name("_RAMSLPMDCNTLR2") .dwattr $C$DW$93, DW_AT_data_member_location[DW_OP_plus_uconst 0x2a] .dwattr $C$DW$93, DW_AT_accessibility(DW_ACCESS_public) $C$DW$94 .dwtag DW_TAG_member .dwattr $C$DW$94, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$94, DW_AT_name("RAMSLPMDCNTLR3") .dwattr $C$DW$94, DW_AT_TI_symbol_name("_RAMSLPMDCNTLR3") .dwattr $C$DW$94, DW_AT_data_member_location[DW_OP_plus_uconst 0x2b] .dwattr $C$DW$94, DW_AT_accessibility(DW_ACCESS_public) $C$DW$95 .dwtag DW_TAG_member .dwattr $C$DW$95, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$95, DW_AT_name("RAMSLPMDCNTLR4") .dwattr $C$DW$95, DW_AT_TI_symbol_name("_RAMSLPMDCNTLR4") .dwattr $C$DW$95, DW_AT_data_member_location[DW_OP_plus_uconst 0x2c] .dwattr $C$DW$95, DW_AT_accessibility(DW_ACCESS_public) $C$DW$96 .dwtag DW_TAG_member .dwattr $C$DW$96, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$96, DW_AT_name("RAMSLPMDCNTLR5") .dwattr $C$DW$96, DW_AT_TI_symbol_name("_RAMSLPMDCNTLR5") .dwattr $C$DW$96, DW_AT_data_member_location[DW_OP_plus_uconst 0x2d] .dwattr $C$DW$96, DW_AT_accessibility(DW_ACCESS_public) $C$DW$97 .dwtag DW_TAG_member .dwattr $C$DW$97, DW_AT_type(*$C$DW$T$25) .dwattr $C$DW$97, DW_AT_name("RSVD6") .dwattr $C$DW$97, DW_AT_TI_symbol_name("_RSVD6") .dwattr $C$DW$97, DW_AT_data_member_location[DW_OP_plus_uconst 0x2e] .dwattr $C$DW$97, DW_AT_accessibility(DW_ACCESS_public) $C$DW$98 .dwtag DW_TAG_member .dwattr $C$DW$98, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$98, DW_AT_name("DMAIFR") .dwattr $C$DW$98, DW_AT_TI_symbol_name("_DMAIFR") .dwattr $C$DW$98, DW_AT_data_member_location[DW_OP_plus_uconst 0x30] .dwattr $C$DW$98, DW_AT_accessibility(DW_ACCESS_public) $C$DW$99 .dwtag DW_TAG_member .dwattr $C$DW$99, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$99, DW_AT_name("DMAIER") .dwattr $C$DW$99, DW_AT_TI_symbol_name("_DMAIER") .dwattr $C$DW$99, DW_AT_data_member_location[DW_OP_plus_uconst 0x31] .dwattr $C$DW$99, DW_AT_accessibility(DW_ACCESS_public) $C$DW$100 .dwtag DW_TAG_member .dwattr $C$DW$100, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$100, DW_AT_name("USBSCR") .dwattr $C$DW$100, DW_AT_TI_symbol_name("_USBSCR") .dwattr $C$DW$100, DW_AT_data_member_location[DW_OP_plus_uconst 0x32] .dwattr $C$DW$100, DW_AT_accessibility(DW_ACCESS_public) $C$DW$101 .dwtag DW_TAG_member .dwattr $C$DW$101, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$101, DW_AT_name("ESCR") .dwattr $C$DW$101, DW_AT_TI_symbol_name("_ESCR") .dwattr $C$DW$101, DW_AT_data_member_location[DW_OP_plus_uconst 0x33] .dwattr $C$DW$101, DW_AT_accessibility(DW_ACCESS_public) $C$DW$102 .dwtag DW_TAG_member .dwattr $C$DW$102, DW_AT_type(*$C$DW$T$25) .dwattr $C$DW$102, DW_AT_name("RSVD7") .dwattr $C$DW$102, DW_AT_TI_symbol_name("_RSVD7") .dwattr $C$DW$102, DW_AT_data_member_location[DW_OP_plus_uconst 0x34] .dwattr $C$DW$102, DW_AT_accessibility(DW_ACCESS_public) $C$DW$103 .dwtag DW_TAG_member .dwattr $C$DW$103, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$103, DW_AT_name("DMA2CESR1") .dwattr $C$DW$103, DW_AT_TI_symbol_name("_DMA2CESR1") .dwattr $C$DW$103, DW_AT_data_member_location[DW_OP_plus_uconst 0x36] .dwattr $C$DW$103, DW_AT_accessibility(DW_ACCESS_public) $C$DW$104 .dwtag DW_TAG_member .dwattr $C$DW$104, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$104, DW_AT_name("DMA2CESR2") .dwattr $C$DW$104, DW_AT_TI_symbol_name("_DMA2CESR2") .dwattr $C$DW$104, DW_AT_data_member_location[DW_OP_plus_uconst 0x37] .dwattr $C$DW$104, DW_AT_accessibility(DW_ACCESS_public) $C$DW$105 .dwtag DW_TAG_member .dwattr $C$DW$105, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$105, DW_AT_name("DMA3CESR1") .dwattr $C$DW$105, DW_AT_TI_symbol_name("_DMA3CESR1") .dwattr $C$DW$105, DW_AT_data_member_location[DW_OP_plus_uconst 0x38] .dwattr $C$DW$105, DW_AT_accessibility(DW_ACCESS_public) $C$DW$106 .dwtag DW_TAG_member .dwattr $C$DW$106, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$106, DW_AT_name("DMA3CESR2") .dwattr $C$DW$106, DW_AT_TI_symbol_name("_DMA3CESR2") .dwattr $C$DW$106, DW_AT_data_member_location[DW_OP_plus_uconst 0x39] .dwattr $C$DW$106, DW_AT_accessibility(DW_ACCESS_public) $C$DW$107 .dwtag DW_TAG_member .dwattr $C$DW$107, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$107, DW_AT_name("CLKSTOP") .dwattr $C$DW$107, DW_AT_TI_symbol_name("_CLKSTOP") .dwattr $C$DW$107, DW_AT_data_member_location[DW_OP_plus_uconst 0x3a] .dwattr $C$DW$107, DW_AT_accessibility(DW_ACCESS_public) $C$DW$108 .dwtag DW_TAG_member .dwattr $C$DW$108, DW_AT_type(*$C$DW$T$22) .dwattr $C$DW$108, DW_AT_name("RSVD8") .dwattr $C$DW$108, DW_AT_TI_symbol_name("_RSVD8") .dwattr $C$DW$108, DW_AT_data_member_location[DW_OP_plus_uconst 0x3b] .dwattr $C$DW$108, DW_AT_accessibility(DW_ACCESS_public) $C$DW$109 .dwtag DW_TAG_member .dwattr $C$DW$109, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$109, DW_AT_name("DIEIDR0") .dwattr $C$DW$109, DW_AT_TI_symbol_name("_DIEIDR0") .dwattr $C$DW$109, DW_AT_data_member_location[DW_OP_plus_uconst 0x40] .dwattr $C$DW$109, DW_AT_accessibility(DW_ACCESS_public) $C$DW$110 .dwtag DW_TAG_member .dwattr $C$DW$110, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$110, DW_AT_name("DIEIDR1") .dwattr $C$DW$110, DW_AT_TI_symbol_name("_DIEIDR1") .dwattr $C$DW$110, DW_AT_data_member_location[DW_OP_plus_uconst 0x41] .dwattr $C$DW$110, DW_AT_accessibility(DW_ACCESS_public) $C$DW$111 .dwtag DW_TAG_member .dwattr $C$DW$111, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$111, DW_AT_name("DIEIDR2") .dwattr $C$DW$111, DW_AT_TI_symbol_name("_DIEIDR2") .dwattr $C$DW$111, DW_AT_data_member_location[DW_OP_plus_uconst 0x42] .dwattr $C$DW$111, DW_AT_accessibility(DW_ACCESS_public) $C$DW$112 .dwtag DW_TAG_member .dwattr $C$DW$112, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$112, DW_AT_name("DIEIDR3") .dwattr $C$DW$112, DW_AT_TI_symbol_name("_DIEIDR3") .dwattr $C$DW$112, DW_AT_data_member_location[DW_OP_plus_uconst 0x43] .dwattr $C$DW$112, DW_AT_accessibility(DW_ACCESS_public) $C$DW$113 .dwtag DW_TAG_member .dwattr $C$DW$113, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$113, DW_AT_name("DIEIDR4") .dwattr $C$DW$113, DW_AT_TI_symbol_name("_DIEIDR4") .dwattr $C$DW$113, DW_AT_data_member_location[DW_OP_plus_uconst 0x44] .dwattr $C$DW$113, DW_AT_accessibility(DW_ACCESS_public) $C$DW$114 .dwtag DW_TAG_member .dwattr $C$DW$114, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$114, DW_AT_name("DIEIDR5") .dwattr $C$DW$114, DW_AT_TI_symbol_name("_DIEIDR5") .dwattr $C$DW$114, DW_AT_data_member_location[DW_OP_plus_uconst 0x45] .dwattr $C$DW$114, DW_AT_accessibility(DW_ACCESS_public) $C$DW$115 .dwtag DW_TAG_member .dwattr $C$DW$115, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$115, DW_AT_name("DIEIDR6") .dwattr $C$DW$115, DW_AT_TI_symbol_name("_DIEIDR6") .dwattr $C$DW$115, DW_AT_data_member_location[DW_OP_plus_uconst 0x46] .dwattr $C$DW$115, DW_AT_accessibility(DW_ACCESS_public) $C$DW$116 .dwtag DW_TAG_member .dwattr $C$DW$116, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$116, DW_AT_name("DIEIDR7") .dwattr $C$DW$116, DW_AT_TI_symbol_name("_DIEIDR7") .dwattr $C$DW$116, DW_AT_data_member_location[DW_OP_plus_uconst 0x47] .dwattr $C$DW$116, DW_AT_accessibility(DW_ACCESS_public) .dwendtag $C$DW$T$26 $C$DW$T$32 .dwtag DW_TAG_typedef, DW_AT_name("CSL_SysRegs") .dwattr $C$DW$T$32, DW_AT_type(*$C$DW$T$26) .dwattr $C$DW$T$32, DW_AT_language(DW_LANG_C) $C$DW$117 .dwtag DW_TAG_TI_far_type .dwattr $C$DW$117, DW_AT_type(*$C$DW$T$32) $C$DW$118 .dwtag DW_TAG_TI_ioport_type .dwattr $C$DW$118, DW_AT_type(*$C$DW$117) $C$DW$T$33 .dwtag DW_TAG_volatile_type .dwattr $C$DW$T$33, DW_AT_type(*$C$DW$118) $C$DW$T$34 .dwtag DW_TAG_pointer_type .dwattr $C$DW$T$34, DW_AT_type(*$C$DW$T$33) .dwattr $C$DW$T$34, DW_AT_address_class(0x10) $C$DW$T$35 .dwtag DW_TAG_typedef, DW_AT_name("CSL_SysRegsOvly") .dwattr $C$DW$T$35, DW_AT_type(*$C$DW$T$34) .dwattr $C$DW$T$35, DW_AT_language(DW_LANG_C) $C$DW$T$27 .dwtag DW_TAG_structure_type .dwattr $C$DW$T$27, DW_AT_byte_size(0x05) $C$DW$119 .dwtag DW_TAG_member .dwattr $C$DW$119, DW_AT_type(*$C$DW$T$19) .dwattr $C$DW$119, DW_AT_name("DLL") .dwattr $C$DW$119, DW_AT_TI_symbol_name("_DLL") .dwattr $C$DW$119, DW_AT_data_member_location[DW_OP_plus_uconst 0x0] .dwattr $C$DW$119, DW_AT_accessibility(DW_ACCESS_public) $C$DW$120 .dwtag DW_TAG_member .dwattr $C$DW$120, DW_AT_type(*$C$DW$T$19) .dwattr $C$DW$120, DW_AT_name("DLH") .dwattr $C$DW$120, DW_AT_TI_symbol_name("_DLH") .dwattr $C$DW$120, DW_AT_data_member_location[DW_OP_plus_uconst 0x1] .dwattr $C$DW$120, DW_AT_accessibility(DW_ACCESS_public) $C$DW$121 .dwtag DW_TAG_member .dwattr $C$DW$121, DW_AT_type(*$C$DW$T$19) .dwattr $C$DW$121, DW_AT_name("LCR") .dwattr $C$DW$121, DW_AT_TI_symbol_name("_LCR") .dwattr $C$DW$121, DW_AT_data_member_location[DW_OP_plus_uconst 0x2] .dwattr $C$DW$121, DW_AT_accessibility(DW_ACCESS_public) $C$DW$122 .dwtag DW_TAG_member .dwattr $C$DW$122, DW_AT_type(*$C$DW$T$19) .dwattr $C$DW$122, DW_AT_name("FCR") .dwattr $C$DW$122, DW_AT_TI_symbol_name("_FCR") .dwattr $C$DW$122, DW_AT_data_member_location[DW_OP_plus_uconst 0x3] .dwattr $C$DW$122, DW_AT_accessibility(DW_ACCESS_public) $C$DW$123 .dwtag DW_TAG_member .dwattr $C$DW$123, DW_AT_type(*$C$DW$T$19) .dwattr $C$DW$123, DW_AT_name("MCR") .dwattr $C$DW$123, DW_AT_TI_symbol_name("_MCR") .dwattr $C$DW$123, DW_AT_data_member_location[DW_OP_plus_uconst 0x4] .dwattr $C$DW$123, DW_AT_accessibility(DW_ACCESS_public) .dwendtag $C$DW$T$27 $C$DW$T$41 .dwtag DW_TAG_typedef, DW_AT_name("CSL_UartConfig") .dwattr $C$DW$T$41, DW_AT_type(*$C$DW$T$27) .dwattr $C$DW$T$41, DW_AT_language(DW_LANG_C) $C$DW$T$42 .dwtag DW_TAG_pointer_type .dwattr $C$DW$T$42, DW_AT_type(*$C$DW$T$41) .dwattr $C$DW$T$42, DW_AT_address_class(0x17) $C$DW$T$40 .dwtag DW_TAG_structure_type .dwattr $C$DW$T$40, DW_AT_name("CSL_UartObj") .dwattr $C$DW$T$40, DW_AT_byte_size(0x14) $C$DW$124 .dwtag DW_TAG_member .dwattr $C$DW$124, DW_AT_type(*$C$DW$T$19) .dwattr $C$DW$124, DW_AT_name("insId") .dwattr $C$DW$124, DW_AT_TI_symbol_name("_insId") .dwattr $C$DW$124, DW_AT_data_member_location[DW_OP_plus_uconst 0x0] .dwattr $C$DW$124, DW_AT_accessibility(DW_ACCESS_public) $C$DW$125 .dwtag DW_TAG_member .dwattr $C$DW$125, DW_AT_type(*$C$DW$T$31) .dwattr $C$DW$125, DW_AT_name("uartRegs") .dwattr $C$DW$125, DW_AT_TI_symbol_name("_uartRegs") .dwattr $C$DW$125, DW_AT_data_member_location[DW_OP_plus_uconst 0x1] .dwattr $C$DW$125, DW_AT_accessibility(DW_ACCESS_public) $C$DW$126 .dwtag DW_TAG_member .dwattr $C$DW$126, DW_AT_type(*$C$DW$T$35) .dwattr $C$DW$126, DW_AT_name("sysAddr") .dwattr $C$DW$126, DW_AT_TI_symbol_name("_sysAddr") .dwattr $C$DW$126, DW_AT_data_member_location[DW_OP_plus_uconst 0x2] .dwattr $C$DW$126, DW_AT_accessibility(DW_ACCESS_public) $C$DW$127 .dwtag DW_TAG_member .dwattr $C$DW$127, DW_AT_type(*$C$DW$T$37) .dwattr $C$DW$127, DW_AT_name("opmode") .dwattr $C$DW$127, DW_AT_TI_symbol_name("_opmode") .dwattr $C$DW$127, DW_AT_data_member_location[DW_OP_plus_uconst 0x3] .dwattr $C$DW$127, DW_AT_accessibility(DW_ACCESS_public) $C$DW$128 .dwtag DW_TAG_member .dwattr $C$DW$128, DW_AT_type(*$C$DW$T$19) .dwattr $C$DW$128, DW_AT_name("trigLevel") .dwattr $C$DW$128, DW_AT_TI_symbol_name("_trigLevel") .dwattr $C$DW$128, DW_AT_data_member_location[DW_OP_plus_uconst 0x4] .dwattr $C$DW$128, DW_AT_accessibility(DW_ACCESS_public) $C$DW$129 .dwtag DW_TAG_member .dwattr $C$DW$129, DW_AT_type(*$C$DW$T$39) .dwattr $C$DW$129, DW_AT_name("UART_isrDispatchTable") .dwattr $C$DW$129, DW_AT_TI_symbol_name("_UART_isrDispatchTable") .dwattr $C$DW$129, DW_AT_data_member_location[DW_OP_plus_uconst 0x6] .dwattr $C$DW$129, DW_AT_accessibility(DW_ACCESS_public) .dwendtag $C$DW$T$40 $C$DW$T$43 .dwtag DW_TAG_typedef, DW_AT_name("CSL_UartObj") .dwattr $C$DW$T$43, DW_AT_type(*$C$DW$T$40) .dwattr $C$DW$T$43, DW_AT_language(DW_LANG_C) $C$DW$T$44 .dwtag DW_TAG_pointer_type .dwattr $C$DW$T$44, DW_AT_type(*$C$DW$T$43) .dwattr $C$DW$T$44, DW_AT_address_class(0x17) $C$DW$T$45 .dwtag DW_TAG_typedef, DW_AT_name("CSL_UartHandle") .dwattr $C$DW$T$45, DW_AT_type(*$C$DW$T$44) .dwattr $C$DW$T$45, DW_AT_language(DW_LANG_C) $C$DW$T$4 .dwtag DW_TAG_base_type .dwattr $C$DW$T$4, DW_AT_encoding(DW_ATE_boolean) .dwattr $C$DW$T$4, DW_AT_name("bool") .dwattr $C$DW$T$4, DW_AT_byte_size(0x01) $C$DW$T$5 .dwtag DW_TAG_base_type .dwattr $C$DW$T$5, DW_AT_encoding(DW_ATE_signed_char) .dwattr $C$DW$T$5, DW_AT_name("signed char") .dwattr $C$DW$T$5, DW_AT_byte_size(0x01) $C$DW$T$6 .dwtag DW_TAG_base_type .dwattr $C$DW$T$6, DW_AT_encoding(DW_ATE_unsigned_char) .dwattr $C$DW$T$6, DW_AT_name("unsigned char") .dwattr $C$DW$T$6, DW_AT_byte_size(0x01) $C$DW$T$7 .dwtag DW_TAG_base_type .dwattr $C$DW$T$7, DW_AT_encoding(DW_ATE_signed_char) .dwattr $C$DW$T$7, DW_AT_name("wchar_t") .dwattr $C$DW$T$7, DW_AT_byte_size(0x01) $C$DW$T$8 .dwtag DW_TAG_base_type .dwattr $C$DW$T$8, DW_AT_encoding(DW_ATE_signed) .dwattr $C$DW$T$8, DW_AT_name("short") .dwattr $C$DW$T$8, DW_AT_byte_size(0x01) $C$DW$T$46 .dwtag DW_TAG_typedef, DW_AT_name("Int16") .dwattr $C$DW$T$46, DW_AT_type(*$C$DW$T$8) .dwattr $C$DW$T$46, DW_AT_language(DW_LANG_C) $C$DW$T$47 .dwtag DW_TAG_typedef, DW_AT_name("CSL_Status") .dwattr $C$DW$T$47, DW_AT_type(*$C$DW$T$46) .dwattr $C$DW$T$47, DW_AT_language(DW_LANG_C) $C$DW$T$9 .dwtag DW_TAG_base_type .dwattr $C$DW$T$9, DW_AT_encoding(DW_ATE_unsigned) .dwattr $C$DW$T$9, DW_AT_name("unsigned short") .dwattr $C$DW$T$9, DW_AT_byte_size(0x01) $C$DW$T$19 .dwtag DW_TAG_typedef, DW_AT_name("Uint16") .dwattr $C$DW$T$19, DW_AT_type(*$C$DW$T$9) .dwattr $C$DW$T$19, DW_AT_language(DW_LANG_C) $C$DW$130 .dwtag DW_TAG_TI_far_type .dwattr $C$DW$130, DW_AT_type(*$C$DW$T$19) $C$DW$T$20 .dwtag DW_TAG_volatile_type .dwattr $C$DW$T$20, DW_AT_type(*$C$DW$130) $C$DW$T$21 .dwtag DW_TAG_array_type .dwattr $C$DW$T$21, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$T$21, DW_AT_language(DW_LANG_C) .dwattr $C$DW$T$21, DW_AT_byte_size(0x03) $C$DW$131 .dwtag DW_TAG_subrange_type .dwattr $C$DW$131, DW_AT_upper_bound(0x02) .dwendtag $C$DW$T$21 $C$DW$T$22 .dwtag DW_TAG_array_type .dwattr $C$DW$T$22, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$T$22, DW_AT_language(DW_LANG_C) .dwattr $C$DW$T$22, DW_AT_byte_size(0x05) $C$DW$132 .dwtag DW_TAG_subrange_type .dwattr $C$DW$132, DW_AT_upper_bound(0x04) .dwendtag $C$DW$T$22 $C$DW$T$24 .dwtag DW_TAG_array_type .dwattr $C$DW$T$24, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$T$24, DW_AT_language(DW_LANG_C) .dwattr $C$DW$T$24, DW_AT_byte_size(0x0e) $C$DW$133 .dwtag DW_TAG_subrange_type .dwattr $C$DW$133, DW_AT_upper_bound(0x0d) .dwendtag $C$DW$T$24 $C$DW$T$25 .dwtag DW_TAG_array_type .dwattr $C$DW$T$25, DW_AT_type(*$C$DW$T$20) .dwattr $C$DW$T$25, DW_AT_language(DW_LANG_C) .dwattr $C$DW$T$25, DW_AT_byte_size(0x02) $C$DW$134 .dwtag DW_TAG_subrange_type .dwattr $C$DW$134, DW_AT_upper_bound(0x01) .dwendtag $C$DW$T$25 $C$DW$T$10 .dwtag DW_TAG_base_type .dwattr $C$DW$T$10, DW_AT_encoding(DW_ATE_signed) .dwattr $C$DW$T$10, DW_AT_name("int") .dwattr $C$DW$T$10, DW_AT_byte_size(0x01) $C$DW$T$11 .dwtag DW_TAG_base_type .dwattr $C$DW$T$11, DW_AT_encoding(DW_ATE_unsigned) .dwattr $C$DW$T$11, DW_AT_name("unsigned int") .dwattr $C$DW$T$11, DW_AT_byte_size(0x01) $C$DW$T$12 .dwtag DW_TAG_base_type .dwattr $C$DW$T$12, DW_AT_encoding(DW_ATE_signed) .dwattr $C$DW$T$12, DW_AT_name("long") .dwattr $C$DW$T$12, DW_AT_byte_size(0x02) $C$DW$T$13 .dwtag DW_TAG_base_type .dwattr $C$DW$T$13, DW_AT_encoding(DW_ATE_unsigned) .dwattr $C$DW$T$13, DW_AT_name("unsigned long") .dwattr $C$DW$T$13, DW_AT_byte_size(0x02) $C$DW$T$38 .dwtag DW_TAG_typedef, DW_AT_name("Uint32") .dwattr $C$DW$T$38, DW_AT_type(*$C$DW$T$13) .dwattr $C$DW$T$38, DW_AT_language(DW_LANG_C) $C$DW$T$39 .dwtag DW_TAG_array_type .dwattr $C$DW$T$39, DW_AT_type(*$C$DW$T$38) .dwattr $C$DW$T$39, DW_AT_language(DW_LANG_C) .dwattr $C$DW$T$39, DW_AT_byte_size(0x0e) $C$DW$135 .dwtag DW_TAG_subrange_type .dwattr $C$DW$135, DW_AT_upper_bound(0x06) .dwendtag $C$DW$T$39 $C$DW$T$14 .dwtag DW_TAG_base_type .dwattr $C$DW$T$14, DW_AT_encoding(DW_ATE_signed) .dwattr $C$DW$T$14, DW_AT_name("long long") .dwattr $C$DW$T$14, DW_AT_byte_size(0x04) .dwattr $C$DW$T$14, DW_AT_bit_size(0x28) .dwattr $C$DW$T$14, DW_AT_bit_offset(0x18) $C$DW$T$15 .dwtag DW_TAG_base_type .dwattr $C$DW$T$15, DW_AT_encoding(DW_ATE_unsigned) .dwattr $C$DW$T$15, DW_AT_name("unsigned long long") .dwattr $C$DW$T$15, DW_AT_byte_size(0x04) .dwattr $C$DW$T$15, DW_AT_bit_size(0x28) .dwattr $C$DW$T$15, DW_AT_bit_offset(0x18) $C$DW$T$16 .dwtag DW_TAG_base_type .dwattr $C$DW$T$16, DW_AT_encoding(DW_ATE_float) .dwattr $C$DW$T$16, DW_AT_name("float") .dwattr $C$DW$T$16, DW_AT_byte_size(0x02) $C$DW$T$17 .dwtag DW_TAG_base_type .dwattr $C$DW$T$17, DW_AT_encoding(DW_ATE_float) .dwattr $C$DW$T$17, DW_AT_name("double") .dwattr $C$DW$T$17, DW_AT_byte_size(0x02) $C$DW$T$18 .dwtag DW_TAG_base_type .dwattr $C$DW$T$18, DW_AT_encoding(DW_ATE_float) .dwattr $C$DW$T$18, DW_AT_name("long double") .dwattr $C$DW$T$18, DW_AT_byte_size(0x02) $C$DW$T$54 .dwtag DW_TAG_base_type .dwattr $C$DW$T$54, DW_AT_encoding(DW_ATE_signed_char) .dwattr $C$DW$T$54, DW_AT_name("signed char") .dwattr $C$DW$T$54, DW_AT_byte_size(0x01) $C$DW$T$55 .dwtag DW_TAG_typedef, DW_AT_name("Char") .dwattr $C$DW$T$55, DW_AT_type(*$C$DW$T$54) .dwattr $C$DW$T$55, DW_AT_language(DW_LANG_C) $C$DW$136 .dwtag DW_TAG_TI_far_type .dwattr $C$DW$136, DW_AT_type(*$C$DW$T$55) $C$DW$T$59 .dwtag DW_TAG_const_type .dwattr $C$DW$T$59, DW_AT_type(*$C$DW$136) $C$DW$T$56 .dwtag DW_TAG_pointer_type .dwattr $C$DW$T$56, DW_AT_type(*$C$DW$T$55) .dwattr $C$DW$T$56, DW_AT_address_class(0x17) $C$DW$T$64 .dwtag DW_TAG_pointer_type .dwattr $C$DW$T$64, DW_AT_type(*$C$DW$T$54) .dwattr $C$DW$T$64, DW_AT_address_class(0x17) .dwattr $C$DW$CU, DW_AT_language(DW_LANG_C) ;*************************************************************** ;* DWARF CIE ENTRIES * ;*************************************************************** $C$DW$CIE .dwcie 91 .dwcfi cfa_register, 36 .dwcfi cfa_offset, 0 .dwcfi undefined, 0 .dwcfi undefined, 1 .dwcfi undefined, 2 .dwcfi undefined, 3 .dwcfi undefined, 4 .dwcfi undefined, 5 .dwcfi undefined, 6 .dwcfi undefined, 7 .dwcfi undefined, 8 .dwcfi undefined, 9 .dwcfi undefined, 10 .dwcfi undefined, 11 .dwcfi undefined, 12 .dwcfi undefined, 13 .dwcfi same_value, 14 .dwcfi same_value, 15 .dwcfi undefined, 16 .dwcfi undefined, 17 .dwcfi undefined, 18 .dwcfi undefined, 19 .dwcfi undefined, 20 .dwcfi undefined, 21 .dwcfi undefined, 22 .dwcfi undefined, 23 .dwcfi undefined, 24 .dwcfi undefined, 25 .dwcfi same_value, 26 .dwcfi same_value, 27 .dwcfi same_value, 28 .dwcfi same_value, 29 .dwcfi same_value, 30 .dwcfi same_value, 31 .dwcfi undefined, 32 .dwcfi undefined, 33 .dwcfi undefined, 34 .dwcfi undefined, 35 .dwcfi undefined, 36 .dwcfi undefined, 37 .dwcfi undefined, 38 .dwcfi undefined, 39 .dwcfi undefined, 40 .dwcfi undefined, 41 .dwcfi undefined, 42 .dwcfi undefined, 43 .dwcfi undefined, 44 .dwcfi undefined, 45 .dwcfi undefined, 46 .dwcfi undefined, 47 .dwcfi undefined, 48 .dwcfi undefined, 49 .dwcfi undefined, 50 .dwcfi undefined, 51 .dwcfi undefined, 52 .dwcfi undefined, 53 .dwcfi undefined, 54 .dwcfi undefined, 55 .dwcfi undefined, 56 .dwcfi undefined, 57 .dwcfi undefined, 58 .dwcfi undefined, 59 .dwcfi undefined, 60 .dwcfi undefined, 61 .dwcfi undefined, 62 .dwcfi undefined, 63 .dwcfi undefined, 64 .dwcfi undefined, 65 .dwcfi undefined, 66 .dwcfi undefined, 67 .dwcfi undefined, 68 .dwcfi undefined, 69 .dwcfi undefined, 70 .dwcfi undefined, 71 .dwcfi undefined, 72 .dwcfi undefined, 73 .dwcfi undefined, 74 .dwcfi undefined, 75 .dwcfi undefined, 76 .dwcfi undefined, 77 .dwcfi undefined, 78 .dwcfi undefined, 79 .dwcfi undefined, 80 .dwcfi undefined, 81 .dwcfi undefined, 82 .dwcfi undefined, 83 .dwcfi undefined, 84 .dwcfi undefined, 85 .dwcfi undefined, 86 .dwcfi undefined, 87 .dwcfi undefined, 88 .dwcfi undefined, 89 .dwcfi undefined, 90 .dwcfi undefined, 91 .dwendentry ;*************************************************************** ;* DWARF REGISTER MAP * ;*************************************************************** $C$DW$137 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC0") .dwattr $C$DW$137, DW_AT_location[DW_OP_reg0] $C$DW$138 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC0") .dwattr $C$DW$138, DW_AT_location[DW_OP_reg1] $C$DW$139 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC0_G") .dwattr $C$DW$139, DW_AT_location[DW_OP_reg2] $C$DW$140 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC1") .dwattr $C$DW$140, DW_AT_location[DW_OP_reg3] $C$DW$141 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC1") .dwattr $C$DW$141, DW_AT_location[DW_OP_reg4] $C$DW$142 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC1_G") .dwattr $C$DW$142, DW_AT_location[DW_OP_reg5] $C$DW$143 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC2") .dwattr $C$DW$143, DW_AT_location[DW_OP_reg6] $C$DW$144 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC2") .dwattr $C$DW$144, DW_AT_location[DW_OP_reg7] $C$DW$145 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC2_G") .dwattr $C$DW$145, DW_AT_location[DW_OP_reg8] $C$DW$146 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC3") .dwattr $C$DW$146, DW_AT_location[DW_OP_reg9] $C$DW$147 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC3") .dwattr $C$DW$147, DW_AT_location[DW_OP_reg10] $C$DW$148 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC3_G") .dwattr $C$DW$148, DW_AT_location[DW_OP_reg11] $C$DW$149 .dwtag DW_TAG_TI_assign_register, DW_AT_name("T0") .dwattr $C$DW$149, DW_AT_location[DW_OP_reg12] $C$DW$150 .dwtag DW_TAG_TI_assign_register, DW_AT_name("T1") .dwattr $C$DW$150, DW_AT_location[DW_OP_reg13] $C$DW$151 .dwtag DW_TAG_TI_assign_register, DW_AT_name("T2") .dwattr $C$DW$151, DW_AT_location[DW_OP_reg14] $C$DW$152 .dwtag DW_TAG_TI_assign_register, DW_AT_name("T3") .dwattr $C$DW$152, DW_AT_location[DW_OP_reg15] $C$DW$153 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR0") .dwattr $C$DW$153, DW_AT_location[DW_OP_reg16] $C$DW$154 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR0") .dwattr $C$DW$154, DW_AT_location[DW_OP_reg17] $C$DW$155 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR1") .dwattr $C$DW$155, DW_AT_location[DW_OP_reg18] $C$DW$156 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR1") .dwattr $C$DW$156, DW_AT_location[DW_OP_reg19] $C$DW$157 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR2") .dwattr $C$DW$157, DW_AT_location[DW_OP_reg20] $C$DW$158 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR2") .dwattr $C$DW$158, DW_AT_location[DW_OP_reg21] $C$DW$159 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR3") .dwattr $C$DW$159, DW_AT_location[DW_OP_reg22] $C$DW$160 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR3") .dwattr $C$DW$160, DW_AT_location[DW_OP_reg23] $C$DW$161 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR4") .dwattr $C$DW$161, DW_AT_location[DW_OP_reg24] $C$DW$162 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR4") .dwattr $C$DW$162, DW_AT_location[DW_OP_reg25] $C$DW$163 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR5") .dwattr $C$DW$163, DW_AT_location[DW_OP_reg26] $C$DW$164 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR5") .dwattr $C$DW$164, DW_AT_location[DW_OP_reg27] $C$DW$165 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR6") .dwattr $C$DW$165, DW_AT_location[DW_OP_reg28] $C$DW$166 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR6") .dwattr $C$DW$166, DW_AT_location[DW_OP_reg29] $C$DW$167 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR7") .dwattr $C$DW$167, DW_AT_location[DW_OP_reg30] $C$DW$168 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR7") .dwattr $C$DW$168, DW_AT_location[DW_OP_reg31] $C$DW$169 .dwtag DW_TAG_TI_assign_register, DW_AT_name("FP") .dwattr $C$DW$169, DW_AT_location[DW_OP_regx 0x20] $C$DW$170 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XFP") .dwattr $C$DW$170, DW_AT_location[DW_OP_regx 0x21] $C$DW$171 .dwtag DW_TAG_TI_assign_register, DW_AT_name("PC") .dwattr $C$DW$171, DW_AT_location[DW_OP_regx 0x22] $C$DW$172 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SP") .dwattr $C$DW$172, DW_AT_location[DW_OP_regx 0x23] $C$DW$173 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XSP") .dwattr $C$DW$173, DW_AT_location[DW_OP_regx 0x24] $C$DW$174 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BKC") .dwattr $C$DW$174, DW_AT_location[DW_OP_regx 0x25] $C$DW$175 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BK03") .dwattr $C$DW$175, DW_AT_location[DW_OP_regx 0x26] $C$DW$176 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BK47") .dwattr $C$DW$176, DW_AT_location[DW_OP_regx 0x27] $C$DW$177 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ST0") .dwattr $C$DW$177, DW_AT_location[DW_OP_regx 0x28] $C$DW$178 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ST1") .dwattr $C$DW$178, DW_AT_location[DW_OP_regx 0x29] $C$DW$179 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ST2") .dwattr $C$DW$179, DW_AT_location[DW_OP_regx 0x2a] $C$DW$180 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ST3") .dwattr $C$DW$180, DW_AT_location[DW_OP_regx 0x2b] $C$DW$181 .dwtag DW_TAG_TI_assign_register, DW_AT_name("MDP") .dwattr $C$DW$181, DW_AT_location[DW_OP_regx 0x2c] $C$DW$182 .dwtag DW_TAG_TI_assign_register, DW_AT_name("MDP05") .dwattr $C$DW$182, DW_AT_location[DW_OP_regx 0x2d] $C$DW$183 .dwtag DW_TAG_TI_assign_register, DW_AT_name("MDP67") .dwattr $C$DW$183, DW_AT_location[DW_OP_regx 0x2e] $C$DW$184 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BRC0") .dwattr $C$DW$184, DW_AT_location[DW_OP_regx 0x2f] $C$DW$185 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RSA0") .dwattr $C$DW$185, DW_AT_location[DW_OP_regx 0x30] $C$DW$186 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RSA0_H") .dwattr $C$DW$186, DW_AT_location[DW_OP_regx 0x31] $C$DW$187 .dwtag DW_TAG_TI_assign_register, DW_AT_name("REA0") .dwattr $C$DW$187, DW_AT_location[DW_OP_regx 0x32] $C$DW$188 .dwtag DW_TAG_TI_assign_register, DW_AT_name("REA0_H") .dwattr $C$DW$188, DW_AT_location[DW_OP_regx 0x33] $C$DW$189 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BRS1") .dwattr $C$DW$189, DW_AT_location[DW_OP_regx 0x34] $C$DW$190 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BRC1") .dwattr $C$DW$190, DW_AT_location[DW_OP_regx 0x35] $C$DW$191 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RSA1") .dwattr $C$DW$191, DW_AT_location[DW_OP_regx 0x36] $C$DW$192 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RSA1_H") .dwattr $C$DW$192, DW_AT_location[DW_OP_regx 0x37] $C$DW$193 .dwtag DW_TAG_TI_assign_register, DW_AT_name("REA1") .dwattr $C$DW$193, DW_AT_location[DW_OP_regx 0x38] $C$DW$194 .dwtag DW_TAG_TI_assign_register, DW_AT_name("REA1_H") .dwattr $C$DW$194, DW_AT_location[DW_OP_regx 0x39] $C$DW$195 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CSR") .dwattr $C$DW$195, DW_AT_location[DW_OP_regx 0x3a] $C$DW$196 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RPTC") .dwattr $C$DW$196, DW_AT_location[DW_OP_regx 0x3b] $C$DW$197 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CDP") .dwattr $C$DW$197, DW_AT_location[DW_OP_regx 0x3c] $C$DW$198 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XCDP") .dwattr $C$DW$198, DW_AT_location[DW_OP_regx 0x3d] $C$DW$199 .dwtag DW_TAG_TI_assign_register, DW_AT_name("TRN0") .dwattr $C$DW$199, DW_AT_location[DW_OP_regx 0x3e] $C$DW$200 .dwtag DW_TAG_TI_assign_register, DW_AT_name("TRN1") .dwattr $C$DW$200, DW_AT_location[DW_OP_regx 0x3f] $C$DW$201 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSA01") .dwattr $C$DW$201, DW_AT_location[DW_OP_regx 0x40] $C$DW$202 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSA23") .dwattr $C$DW$202, DW_AT_location[DW_OP_regx 0x41] $C$DW$203 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSA45") .dwattr $C$DW$203, DW_AT_location[DW_OP_regx 0x42] $C$DW$204 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSA67") .dwattr $C$DW$204, DW_AT_location[DW_OP_regx 0x43] $C$DW$205 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSAC") .dwattr $C$DW$205, DW_AT_location[DW_OP_regx 0x44] $C$DW$206 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CARRY") .dwattr $C$DW$206, DW_AT_location[DW_OP_regx 0x45] $C$DW$207 .dwtag DW_TAG_TI_assign_register, DW_AT_name("TC1") .dwattr $C$DW$207, DW_AT_location[DW_OP_regx 0x46] $C$DW$208 .dwtag DW_TAG_TI_assign_register, DW_AT_name("TC2") .dwattr $C$DW$208, DW_AT_location[DW_OP_regx 0x47] $C$DW$209 .dwtag DW_TAG_TI_assign_register, DW_AT_name("M40") .dwattr $C$DW$209, DW_AT_location[DW_OP_regx 0x48] $C$DW$210 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SXMD") .dwattr $C$DW$210, DW_AT_location[DW_OP_regx 0x49] $C$DW$211 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ARMS") .dwattr $C$DW$211, DW_AT_location[DW_OP_regx 0x4a] $C$DW$212 .dwtag DW_TAG_TI_assign_register, DW_AT_name("C54CM") .dwattr $C$DW$212, DW_AT_location[DW_OP_regx 0x4b] $C$DW$213 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SATA") .dwattr $C$DW$213, DW_AT_location[DW_OP_regx 0x4c] $C$DW$214 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SATD") .dwattr $C$DW$214, DW_AT_location[DW_OP_regx 0x4d] $C$DW$215 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RDM") .dwattr $C$DW$215, DW_AT_location[DW_OP_regx 0x4e] $C$DW$216 .dwtag DW_TAG_TI_assign_register, DW_AT_name("FRCT") .dwattr $C$DW$216, DW_AT_location[DW_OP_regx 0x4f] $C$DW$217 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SMUL") .dwattr $C$DW$217, DW_AT_location[DW_OP_regx 0x50] $C$DW$218 .dwtag DW_TAG_TI_assign_register, DW_AT_name("INTM") .dwattr $C$DW$218, DW_AT_location[DW_OP_regx 0x51] $C$DW$219 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR0LC") .dwattr $C$DW$219, DW_AT_location[DW_OP_regx 0x52] $C$DW$220 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR1LC") .dwattr $C$DW$220, DW_AT_location[DW_OP_regx 0x53] $C$DW$221 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR2LC") .dwattr $C$DW$221, DW_AT_location[DW_OP_regx 0x54] $C$DW$222 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR3LC") .dwattr $C$DW$222, DW_AT_location[DW_OP_regx 0x55] $C$DW$223 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR4LC") .dwattr $C$DW$223, DW_AT_location[DW_OP_regx 0x56] $C$DW$224 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR5LC") .dwattr $C$DW$224, DW_AT_location[DW_OP_regx 0x57] $C$DW$225 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR6LC") .dwattr $C$DW$225, DW_AT_location[DW_OP_regx 0x58] $C$DW$226 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR7LC") .dwattr $C$DW$226, DW_AT_location[DW_OP_regx 0x59] $C$DW$227 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CDPLC") .dwattr $C$DW$227, DW_AT_location[DW_OP_regx 0x5a] $C$DW$228 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CIE_RETA") .dwattr $C$DW$228, DW_AT_location[DW_OP_regx 0x5b] .dwendtag $C$DW$CU
run_time/dynamic_call_asm.asm
GParcade/AttachA
0
87780
<reponame>GParcade/AttachA ; Copyright <NAME> 2022 ; ; Distributed under the Boost Software License, Version 1.0. ; (See accompanying file LICENSE or copy at ; http://www.boost.org/LICENSE_1_0.txt) ifdef rsp .code ArgumentsPrepareCallForFastcall PROC FRAME push rbp .pushreg rbp mov rbp,rsp .setframe rbp, 0h .endprolog mov rax ,qword ptr [rbp+38h];argc mov r10 ,qword ptr [rbp+40h];args shl rax,3 prepeart: cmp rax,0 jne not_end jmp end_proc not_end: sub rax, 8 push qword ptr [r10+rax]; jmp prepeart end_proc: xor r10,r10 sub rsp,20h call qword ptr [rbp+30h];func mov rsp,rbp pop rbp ret ArgumentsPrepareCallForFastcall endp ArgumentsPrepareCallFor_V_AMD64 PROC FRAME push rbp .pushreg rbp mov rbp,rsp .setframe rbp, 0h .endprolog mov rax ,qword ptr [rbp+38h];argc mov r10 ,qword ptr [rbp+40h];args shl rax,3 prepeart: cmp rax,0 jne not_end jmp end_proc not_end: sub rax, 8 push qword ptr [r10+rax]; jmp prepeart end_proc: xor r10,r10 sub rsp,148h call qword ptr [rbp+30h];func mov rsp,rbp pop rbp ret ArgumentsPrepareCallFor_V_AMD64 endp justJump proc mov [rsp+8], rcx ret justJump endp endif END
_anim/Bubbles.asm
kodishmediacenter/msu-md-sonic
9
3016
<gh_stars>1-10 ; --------------------------------------------------------------------------- ; Animation script - bubbles (LZ) ; --------------------------------------------------------------------------- Ani_Bub: dc.w @small-Ani_Bub dc.w @medium-Ani_Bub dc.w @large-Ani_Bub dc.w @incroutine-Ani_Bub dc.w @incroutine-Ani_Bub dc.w @burst-Ani_Bub dc.w @bubmaker-Ani_Bub @small: dc.b $E, 0, 1, 2, afRoutine ; small bubble forming even @medium: dc.b $E, 1, 2, 3, 4, afRoutine ; medium bubble forming @large: dc.b $E, 2, 3, 4, 5, 6, afRoutine ; full size bubble forming even @incroutine: dc.b 4, afRoutine ; increment routine counter (no animation) @burst: dc.b 4, 6, 7, 8, afRoutine ; large bubble bursts even @bubmaker: dc.b $F, $13, $14, $15, afEnd ; bubble maker on the floor even
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_11218_1303.asm
ljhsiun2/medusa
9
162730
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r13 push %r8 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_normal_ht+0x10526, %rsi lea addresses_WC_ht+0x12d8a, %rdi clflush (%rdi) nop nop nop nop add $29344, %rax mov $23, %rcx rep movsl nop nop nop nop nop dec %r13 lea addresses_WC_ht+0xf95a, %rsi lea addresses_normal_ht+0x16b44, %rdi clflush (%rsi) nop add %r8, %r8 mov $77, %rcx rep movsl nop nop nop nop nop and $39632, %rdi lea addresses_normal_ht+0x395a, %rcx nop and %r9, %r9 movl $0x61626364, (%rcx) nop nop nop nop sub %r13, %r13 lea addresses_normal_ht+0xe6e4, %rdi and $3896, %rsi mov (%rdi), %r13 cmp $24453, %r13 lea addresses_normal_ht+0x1415a, %rax nop nop inc %rsi mov (%rax), %rcx nop nop nop nop nop xor %r9, %r9 lea addresses_WT_ht+0x271a, %rsi nop nop nop xor %rdi, %rdi mov $0x6162636465666768, %r13 movq %r13, (%rsi) nop nop nop nop nop and $52671, %r8 pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r8 pop %r13 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r15 push %r9 push %rcx push %rdi push %rdx push %rsi // REPMOV lea addresses_PSE+0x615a, %rsi lea addresses_normal+0x239a, %rdi nop nop nop xor %r13, %r13 mov $43, %rcx rep movsq nop nop cmp $37787, %rcx // REPMOV lea addresses_D+0x1ba9a, %rsi lea addresses_UC+0x11dc, %rdi clflush (%rsi) nop nop nop dec %r9 mov $75, %rcx rep movsl nop nop nop nop nop and %rcx, %rcx // REPMOV lea addresses_D+0x1b55a, %rsi lea addresses_PSE+0xc35a, %rdi clflush (%rsi) nop nop nop nop xor $36063, %r9 mov $110, %rcx rep movsl and %r13, %r13 // REPMOV lea addresses_PSE+0x17faf, %rsi lea addresses_UC+0x1898a, %rdi nop nop nop nop nop sub %rdx, %rdx mov $52, %rcx rep movsw nop nop nop sub $33873, %r13 // Load lea addresses_US+0x164ba, %rcx nop nop nop cmp %r15, %r15 mov (%rcx), %r11 nop nop xor $24222, %r15 // Load lea addresses_PSE+0x115a, %r13 nop nop nop nop nop cmp $20432, %rsi mov (%r13), %di nop nop nop nop add %rdx, %rdx // Store lea addresses_A+0x595a, %r13 nop sub $19346, %rdx movl $0x51525354, (%r13) nop nop nop and %r15, %r15 // Faulty Load lea addresses_PSE+0x615a, %r13 dec %r11 movb (%r13), %dl lea oracles, %rdi and $0xff, %rdx shlq $12, %rdx mov (%rdi,%rdx,1), %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r15 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_PSE', 'congruent': 0}} {'dst': {'same': False, 'congruent': 5, 'type': 'addresses_normal'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 0, 'type': 'addresses_PSE'}} {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_UC'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_D'}} {'dst': {'same': False, 'congruent': 9, 'type': 'addresses_PSE'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_D'}} {'dst': {'same': False, 'congruent': 4, 'type': 'addresses_UC'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_PSE'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_US', 'congruent': 3}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_PSE', 'congruent': 11}} {'dst': {'same': False, 'NT': True, 'AVXalign': True, 'size': 4, 'type': 'addresses_A', 'congruent': 9}, 'OP': 'STOR'} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_PSE', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}} {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal_ht', 'congruent': 11}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal_ht', 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal_ht', 'congruent': 11}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT_ht', 'congruent': 5}, 'OP': 'STOR'} {'33': 11218} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
oeis/036/A036091.asm
neoneye/loda-programs
11
96230
<gh_stars>10-100 ; A036091: Centered cube numbers: (n+1)^13+n^13. ; Submitted by <NAME> ; 1,8193,1602515,68703187,1287811989,14281397141,109949704423,646644824295,3091621642217,12541865828329,44522712143931,141515917523003,409868311971325,1096589879846397,2739909841613519,6449794695729871,14408177660276433,30727542898577105,62875948327928227,123972983462257059,236392377739119461,437282435622202213,786846419819550135,1380524700401825207,2366604457850123449,3971268992588502201,6533708026222712843,10554666575516923915,16762740135456549837,26203858712958602189,40360776297445042591 add $0,1 lpb $0 mov $3,$2 mov $2,$1 cmp $3,0 mul $3,$0 sub $0,1 pow $3,13 add $1,$3 lpe mov $0,$1
Pruebas/prueba3.adb
Arles96/PCompiladores
0
26764
procedure hola is I, X : Integer; begin I := 1; X := 4; while I <= 6 AND X = 4 loop put(I); I := I + 1; end loop; X := 4 + 4; put("Fin del programa \n"); end hola;
software/profi/net-tools/src/pqdos/browser/gopher/render/row.asm
andykarpov/karabas-pro
26
655
; A - row number ; HL - pointer to row renderRow: add CURSOR_OFFSET ld d, a, e, 0 : call TextMode.gotoXY ld a, (hl) push hl call getIcon call TextMode.putC pop hl inc hl jp print70Goph ; A - gopher id char getIcon: cp 'i' : jr z, .info cp '9' : jr z, .down cp '1' : jr z, .page cp '0' : jr z, .text cp '7' : jr z, .input ld a, ' ' ret .info ld a, 32 : ret .down ld de, hl ld bc, #ff, a, 9 : cpir ld a, b : or c : jr z, .downExit push de .nameLoop ld a, (hl) : and a : jr z, .check cp 9 : jr z, .check cp 13 : jr z, .check push hl call CompareBuff.push pop hl inc hl jr .nameLoop .check ; ld hl, scrExt1 : call CompareBuff.search : and a : jr nz, .image ; ld hl, scrExt2 : call CompareBuff.search : and a : jr nz, .image ld a, 3 : ld (VTPL.SETUP), a ; 0 bit - looping, 1 bit - pt2 file ld hl, pt2Ext1 : call CompareBuff.search : and a : jr nz, .music ld hl, pt2Ext2 : call CompareBuff.search : and a : jr nz, .music ld a, 1 : ld (VTPL.SETUP), a ld hl, pt3Ext1 : call CompareBuff.search : and a : jr nz, .music ld hl, pt3Ext2 : call CompareBuff.search : and a : jr nz, .music .checkExit pop hl .downExit ld a, MIME_DOWNLOAD : ret .page ld a, MIME_LINK : ret .text ld a, MIME_TEXT : ret .input ld a, MIME_INPUT : ret ;.image ; pop hl : ld a, MIME_IMAGE : ret .music pop hl : ld a, MIME_MUSIC : ret ;scrExt1 db ".scr", 0 ;scrExt2 db ".SCR", 0 pt3Ext1 db ".pt3", 0 pt3Ext2 db ".PT3", 0 pt2Ext1 db ".pt2", 0 pt2Ext2 db ".PT2", 0
src/Categories/Diagram/End/Properties.agda
bblfish/agda-categories
5
16611
{-# OPTIONS --without-K --safe #-} module Categories.Diagram.End.Properties where open import Level open import Data.Product using (Σ; _,_) open import Function using (_$_) open import Categories.Category open import Categories.Category.Product open import Categories.Category.Construction.Functors open import Categories.Functor open import Categories.Functor.Bifunctor open import Categories.NaturalTransformation open import Categories.NaturalTransformation.Dinatural open import Categories.Diagram.End as ∫ import Categories.Morphism.Reasoning as MR private variable o ℓ e : Level C D E : Category o ℓ e module _ {C : Category o ℓ e} (F : Functor E (Functors (Product (Category.op C) C) D)) where private module C = Category C module D = Category D module E = Category E module NT = NaturalTransformation open D open HomReasoning open MR D open Functor F open End hiding (E) open NT using (η) EndF : (∀ X → End (F₀ X)) → Functor E D EndF end = record { F₀ = λ X → End.E (end X) ; F₁ = F₁′ ; identity = λ {A} → unique (end A) (id-comm ○ ∘-resp-≈ˡ (⟺ identity)) ; homomorphism = λ {A B C} {f g} → unique (end C) $ λ {Z} → begin dinatural.α (end C) Z ∘ F₁′ g ∘ F₁′ f ≈⟨ pullˡ (universal (end C)) ⟩ (η (F₁ g) (Z , Z) ∘ dinatural.α (end B) Z) ∘ F₁′ f ≈⟨ pullʳ (universal (end B)) ⟩ η (F₁ g) (Z , Z) ∘ η (F₁ f) (Z , Z) ∘ dinatural.α (end A) Z ≈˘⟨ pushˡ homomorphism ⟩ η (F₁ (g E.∘ f)) (Z , Z) ∘ dinatural.α (end A) Z ∎ ; F-resp-≈ = λ {A B f g} eq → unique (end B) $ λ {Z} → begin dinatural.α (end B) Z ∘ F₁′ g ≈⟨ universal (end B) ⟩ η (F₁ g) (Z , Z) ∘ dinatural.α (end A) Z ≈˘⟨ F-resp-≈ eq ⟩∘⟨refl ⟩ η (F₁ f) (Z , Z) ∘ dinatural.α (end A) Z ∎ } where F₁′ : ∀ {X Y} → X E.⇒ Y → End.E (end X) ⇒ End.E (end Y) F₁′ {X} {Y} f = factor (end Y) $ record { E = End.E (end X) ; dinatural = F₁ f <∘ dinatural (end X) }
programs/oeis/288/A288534.asm
neoneye/loda
22
93227
<filename>programs/oeis/288/A288534.asm ; A288534: a(n) = n*(2*n^2 + 3), n >= 1; a(0)=1. ; 1,5,22,63,140,265,450,707,1048,1485,2030,2695,3492,4433,5530,6795,8240,9877,11718,13775,16060,18585,21362,24403,27720,31325,35230,39447,43988,48865,54090,59675,65632,71973,78710,85855,93420,101417,109858,118755,128120,137965,148302,159143,170500,182385,194810,207787,221328,235445,250150,265455,281372,297913,315090,332915,351400,370557,390398,410935,432180,454145,476842,500283,524480,549445,575190,601727,629068,657225,686210,716035,746712,778253,810670,843975,878180,913297,949338,986315,1024240,1063125,1102982,1143823,1185660,1228505,1272370,1317267,1363208,1410205,1458270,1507415,1557652,1608993,1661450,1715035,1769760,1825637,1882678,1940895 mov $1,3 mul $1,$0 pow $0,3 mul $0,2 add $0,$1 cmp $1,0 max $1,$0 mov $0,$1
test/asset/agda-stdlib-1.0/Data/Vec/Relation/Unary/All/Properties.agda
omega12345/agda-mode
0
4647
------------------------------------------------------------------------ -- The Agda standard library -- -- Properties related to All ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Vec.Relation.Unary.All.Properties where open import Data.List using ([]; _∷_) open import Data.List.Relation.Unary.All as List using ([]; _∷_) open import Data.Product as Prod using (_×_; _,_; uncurry; uncurry′) open import Data.Vec as Vec open import Data.Vec.Relation.Unary.All as All using (All; []; _∷_) open import Function using (_∘_; id) open import Function.Inverse using (_↔_; inverse) open import Relation.Unary using (Pred) renaming (_⊆_ to _⋐_) open import Relation.Binary.PropositionalEquality using (_≡_; refl; cong; cong₂; →-to-⟶) ------------------------------------------------------------------------ -- map module _ {a b p} {A : Set a} {B : Set b} {P : Pred B p} {f : A → B} where map⁺ : ∀ {n} {xs : Vec A n} → All (P ∘ f) xs → All P (map f xs) map⁺ [] = [] map⁺ (px ∷ pxs) = px ∷ map⁺ pxs map⁻ : ∀ {n} {xs : Vec A n} → All P (map f xs) → All (P ∘ f) xs map⁻ {xs = []} [] = [] map⁻ {xs = _ ∷ _} (px ∷ pxs) = px ∷ map⁻ pxs -- A variant of All.map module _ {a b p q} {A : Set a} {B : Set b} {f : A → B} {P : Pred A p} {Q : Pred B q} where gmap : ∀ {n} → P ⋐ Q ∘ f → All P {n} ⋐ All Q {n} ∘ map f gmap g = map⁺ ∘ All.map g ------------------------------------------------------------------------ -- _++_ module _ {a n p} {A : Set a} {P : Pred A p} where ++⁺ : ∀ {m} {xs : Vec A m} {ys : Vec A n} → All P xs → All P ys → All P (xs ++ ys) ++⁺ [] pys = pys ++⁺ (px ∷ pxs) pys = px ∷ ++⁺ pxs pys ++ˡ⁻ : ∀ {m} (xs : Vec A m) {ys : Vec A n} → All P (xs ++ ys) → All P xs ++ˡ⁻ [] _ = [] ++ˡ⁻ (x ∷ xs) (px ∷ pxs) = px ∷ ++ˡ⁻ xs pxs ++ʳ⁻ : ∀ {m} (xs : Vec A m) {ys : Vec A n} → All P (xs ++ ys) → All P ys ++ʳ⁻ [] pys = pys ++ʳ⁻ (x ∷ xs) (px ∷ pxs) = ++ʳ⁻ xs pxs ++⁻ : ∀ {m} (xs : Vec A m) {ys : Vec A n} → All P (xs ++ ys) → All P xs × All P ys ++⁻ [] p = [] , p ++⁻ (x ∷ xs) (px ∷ pxs) = Prod.map₁ (px ∷_) (++⁻ _ pxs) ++⁺∘++⁻ : ∀ {m} (xs : Vec A m) {ys : Vec A n} → (p : All P (xs ++ ys)) → uncurry′ ++⁺ (++⁻ xs p) ≡ p ++⁺∘++⁻ [] p = refl ++⁺∘++⁻ (x ∷ xs) (px ∷ pxs) = cong (px ∷_) (++⁺∘++⁻ xs pxs) ++⁻∘++⁺ : ∀ {m} {xs : Vec A m} {ys : Vec A n} → (p : All P xs × All P ys) → ++⁻ xs (uncurry ++⁺ p) ≡ p ++⁻∘++⁺ ([] , pys) = refl ++⁻∘++⁺ (px ∷ pxs , pys) rewrite ++⁻∘++⁺ (pxs , pys) = refl ++↔ : ∀ {m} {xs : Vec A m} {ys : Vec A n} → (All P xs × All P ys) ↔ All P (xs ++ ys) ++↔ {xs = xs} = inverse (uncurry ++⁺) (++⁻ xs) ++⁻∘++⁺ (++⁺∘++⁻ xs) ------------------------------------------------------------------------ -- concat module _ {a m p} {A : Set a} {P : Pred A p} where concat⁺ : ∀ {n} {xss : Vec (Vec A m) n} → All (All P) xss → All P (concat xss) concat⁺ [] = [] concat⁺ (pxs ∷ pxss) = ++⁺ pxs (concat⁺ pxss) concat⁻ : ∀ {n} (xss : Vec (Vec A m) n) → All P (concat xss) → All (All P) xss concat⁻ [] [] = [] concat⁻ (xs ∷ xss) pxss = ++ˡ⁻ xs pxss ∷ concat⁻ xss (++ʳ⁻ xs pxss) ------------------------------------------------------------------------ -- toList module _ {a p} {A : Set a} {P : A → Set p} where toList⁺ : ∀ {n} {xs : Vec A n} → All P xs → List.All P (toList xs) toList⁺ [] = [] toList⁺ (px ∷ pxs) = px ∷ toList⁺ pxs toList⁻ : ∀ {n} {xs : Vec A n} → List.All P (toList xs) → All P xs toList⁻ {xs = []} [] = [] toList⁻ {xs = x ∷ xs} (px ∷ pxs) = px ∷ toList⁻ pxs ------------------------------------------------------------------------ -- fromList module _ {a p} {A : Set a} {P : A → Set p} where fromList⁺ : ∀ {xs} → List.All P xs → All P (fromList xs) fromList⁺ [] = [] fromList⁺ (px ∷ pxs) = px ∷ fromList⁺ pxs fromList⁻ : ∀ {xs} → All P (fromList xs) → List.All P xs fromList⁻ {[]} [] = [] fromList⁻ {x ∷ xs} (px ∷ pxs) = px ∷ (fromList⁻ pxs) ------------------------------------------------------------------------ -- DEPRECATED NAMES ------------------------------------------------------------------------ -- Please use the new names as continuing support for the old names is -- not guaranteed. -- Version 0.16 All-map = map⁺ {-# WARNING_ON_USAGE All-map "Warning: All-map was deprecated in v0.16. Please use map⁺ instead." #-} map-All = map⁻ {-# WARNING_ON_USAGE map-All "Warning: map-All was deprecated in v0.16. Please use map⁻ instead." #-} All-++⁺ = ++⁺ {-# WARNING_ON_USAGE All-++⁺ "Warning: All-++⁺ was deprecated in v0.16. Please use ++⁺ instead." #-} All-++ˡ⁻ = ++ˡ⁻ {-# WARNING_ON_USAGE All-++ˡ⁻ "Warning: All-++ˡ⁻ was deprecated in v0.16. Please use ++ˡ⁻ instead." #-} All-++ʳ⁻ = ++ʳ⁻ {-# WARNING_ON_USAGE All-++ʳ⁻ "Warning: All-++ʳ⁻ was deprecated in v0.16. Please use ++ʳ⁻ instead." #-} All-++⁻ = ++⁻ {-# WARNING_ON_USAGE All-++⁻ "Warning: All-++⁻ was deprecated in v0.16. Please use ++⁻ instead." #-} All-++⁺∘++⁻ = ++⁺∘++⁻ {-# WARNING_ON_USAGE All-++⁺∘++⁻ "Warning: All-++⁺∘++⁻ was deprecated in v0.16. Please use ++⁺∘++⁻ instead." #-} All-++⁻∘++⁺ = ++⁻∘++⁺ {-# WARNING_ON_USAGE All-++⁻∘++⁺ "Warning: All-++⁻∘++⁺ was deprecated in v0.16. Please use ++⁻∘++⁺ instead." #-} All-concat⁺ = concat⁺ {-# WARNING_ON_USAGE All-concat⁺ "Warning: All-concat⁺ was deprecated in v0.16. Please use concat⁺ instead." #-} All-concat⁻ = concat⁻ {-# WARNING_ON_USAGE All-concat⁻ "Warning: All-concat⁻ was deprecated in v0.16. Please use concat⁻ instead." #-}
src/u1/p4.asm
luishendrix92/lenguajezinterfaz
0
28696
<gh_stars>0 ; 4 - Programa que despliega nombre en cruz con borde ; <NAME> ; 15211312 ; 17 de Septiembre del 2018 .Model small .stack 64 .Data .Code ; limpiar pantalla mov ax,03h ; servicio de página int 10h ; interrupción de pantalla ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,11 ; fila mov dl,30 ; columna int 10h ; interrupción de pantalla ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Horizontal ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; mov dx,70 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,69 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,76 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,73 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,80 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,69 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,33 mov ah,02h int 21h ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Vertical ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,9 ; fila mov dl,36 ; columna int 10h ; interrupción de pantalla mov dx,76 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,7 ; fila mov dl,36 ; columna int 10h ; interrupción de pantalla mov dx,69 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,5 ; fila mov dl,36 ; columna int 10h ; interrupción de pantalla mov dx,70 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,13 ; fila mov dl,36 ; columna int 10h ; interrupción de pantalla mov dx,80 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,15 ; fila mov dl,36 ; columna int 10h ; interrupción de pantalla mov dx,69 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,17 ; fila mov dl,36 ; columna int 10h ; interrupción de pantalla mov dx,33 mov ah,02h int 21h ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; TOP LINE ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,0 ; fila mov dl,0 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; BOTTOM LINE ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,22 ; fila mov dl,0 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h mov dx,42 mov ah,02h int 21h mov dx,32 ; Espacio mov ah,02h int 21h ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; LEFT LINE ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,2 ; fila mov dl,0 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,4 ; fila mov dl,0 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,6 ; fila mov dl,0 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,8 ; fila mov dl,0 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,10 ; fila mov dl,0 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,12 ; fila mov dl,0 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,14 ; fila mov dl,0 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,16 ; fila mov dl,0 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,18 ; fila mov dl,0 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,20 ; fila mov dl,0 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; RIGHT LINE ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,2 ; fila mov dl,78 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,4 ; fila mov dl,78 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,6 ; fila mov dl,78 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,8 ; fila mov dl,78 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,10 ; fila mov dl,78 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,12 ; fila mov dl,78 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,14 ; fila mov dl,78 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,16 ; fila mov dl,78 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,18 ; fila mov dl,78 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h ; posicionar cursor mov ah,02h ; servicio de cursor mov dh,20 ; fila mov dl,78 ; columna int 10h ; interrupción de pantalla mov dx,42 mov ah,02h int 21h .Exit end
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_872.asm
ljhsiun2/medusa
9
96524
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r13 push %r14 push %r15 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0xd13, %rcx nop cmp $52140, %r14 mov (%rcx), %r13d nop nop nop nop cmp $58993, %r15 lea addresses_WC_ht+0x1cb13, %rdi nop nop nop nop nop add $48678, %r15 mov (%rdi), %edx nop nop nop xor $61142, %r14 lea addresses_WT_ht+0x817c, %rsi lea addresses_UC_ht+0x1b313, %rdi nop cmp $5421, %rax mov $36, %rcx rep movsb nop nop and $8924, %rdx lea addresses_A_ht+0x1bf13, %rsi lea addresses_UC_ht+0x1d053, %rdi nop nop nop and %r13, %r13 mov $7, %rcx rep movsl nop cmp $59126, %rax lea addresses_normal_ht+0x913, %rsi lea addresses_D_ht+0x3713, %rdi clflush (%rdi) nop nop nop xor %r13, %r13 mov $94, %rcx rep movsl add %rsi, %rsi lea addresses_WT_ht+0x3efe, %r14 xor $50391, %rdx mov $0x6162636465666768, %rcx movq %rcx, %xmm7 movups %xmm7, (%r14) nop and %r15, %r15 lea addresses_WT_ht+0x194d3, %rdi nop and $24340, %rsi mov (%rdi), %r14d nop nop and %r15, %r15 lea addresses_D_ht+0x1e8f3, %rsi lea addresses_D_ht+0x1dd3b, %rdi nop nop cmp $6711, %r14 mov $9, %rcx rep movsl add $55552, %r13 pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r15 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r14 push %r15 push %rbp push %rcx // Store lea addresses_RW+0x160ab, %rcx nop nop nop nop xor $60750, %r15 movb $0x51, (%rcx) nop nop nop nop nop cmp $38797, %r12 // Load lea addresses_US+0x17fc5, %rcx nop nop add $40127, %r11 movb (%rcx), %r13b nop nop nop add $36088, %r11 // Load mov $0xf17, %r12 nop nop nop cmp %rbp, %rbp vmovups (%r12), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $1, %xmm2, %r15 nop cmp %r11, %r11 // Store lea addresses_PSE+0x13653, %r11 nop xor %r12, %r12 mov $0x5152535455565758, %r13 movq %r13, %xmm3 movups %xmm3, (%r11) nop nop nop sub %rbp, %rbp // Faulty Load lea addresses_PSE+0x1b713, %r14 nop nop nop nop and $50002, %rcx movups (%r14), %xmm0 vpextrq $1, %xmm0, %r11 lea oracles, %rcx and $0xff, %r11 shlq $12, %r11 mov (%rcx,%r11,1), %r11 pop %rcx pop %rbp pop %r15 pop %r14 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} {'dst': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 2, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 1, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 1, 'same': False, 'type': 'addresses_P'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 6, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'} {'src': {'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'} {'src': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6, 'same': True, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
oeis/121/A121858.asm
neoneye/loda-programs
11
162043
; A121858: Smallest odd number having p(n) divisors, where p(n) is the n-th prime=A000040(n). ; 3,9,81,729,59049,531441,43046721,387420489,31381059609,22876792454961,205891132094649,150094635296999121,12157665459056928801,109418989131512359209,8862938119652501095929,6461081889226673298932241 seq $0,6005 ; The odd prime numbers together with 1. trn $0,2 mov $2,3 pow $2,$0 mov $0,$2 mul $0,3
util/insert_timestamp.applescript
Kleopatros/Academy
0
3712
<filename>util/insert_timestamp.applescript # Sends keystrokes to type the current date and time, dependent on system formats. # # Create a new Quick Action workflow in Automator with one Run AppleScript action. # Then assign a Keyboard Shortcut to the action (found under the Services category). on run {input, parameters} set now to (current date) set dateString to short date string of now set timeString to characters 1 thru 5 of (time string of now as string) tell application "System Events" keystroke dateString & " " & timeString end tell end run
programs/oeis/120/A120168.asm
neoneye/loda
22
25701
<reponame>neoneye/loda<gh_stars>10-100 ; A120168: a(1)=11; a(n)=floor((44+sum(a(1) to a(n-1)))/4). ; 11,13,17,21,26,33,41,51,64,80,100,125,156,195,244,305,381,476,595,744,930,1163,1453,1817,2271,2839,3548,4435,5544,6930,8663,10828,13535,16919,21149,26436,33045,41306,51633,64541 add $0,1 mov $1,4 mov $2,8 lpb $0 sub $0,1 add $2,$1 mov $1,8 add $1,$2 div $1,4 add $2,6 lpe add $1,6 mov $0,$1
apple-scripts/keyboard-cfg.applescript
lloydde/mac-preferences
0
250
<reponame>lloydde/mac-preferences<filename>apple-scripts/keyboard-cfg.applescript -- Swap Control & Command keys, and set Caps Lock to Esc -- macOS Keyboard Preference AppleScript # # (C) Copyright 2016 <NAME> # License: MIT <https://spdx.org/licenses/MIT.html> # # Pre-condition: keyboard is the default keyboard # # Developed by trial and error on macOS Sierra 10.12.2 (16c67) # Mac OS X El Capitan 10.11 does not have an option to change the # Caps Lock key press. # Restart system preferences to make GUI state more predictable if application "System Preferences" is running then tell application "System Preferences" to quit delay 1 end if # Open system preferences to the Keyboard Pane tell application "System Preferences" activate set the current pane to pane id "com.apple.preference.keyboard" end tell tell application "System Events" tell process "System Preferences" repeat until exists tab group 1 of window "Keyboard" end repeat click button "Modifier Keys…" of tab group 1 of window "Keyboard" -- Set Caps Lock key to Escape press # Caps Lock Key (button 2 found by trial and error) tell pop up button 2 of sheet 1 of window "Keyboard" click tell menu 1 click menu item "⎋ Escape" end tell end tell -- Switch Control and Command keys # Select Control Key (button 3 found by trial and error) tell pop up button 3 of sheet 1 of window "Keyboard" click tell menu 1 click menu item "⌘ Command" end tell end tell # Select Command Key (button 1 found by trial and error) tell pop up button 1 of sheet 1 of window "Keyboard" click tell menu 1 click menu item "⌃ Control" end tell end tell click button "OK" of sheet 1 of window "Keyboard" end tell end tell tell application "System Preferences" to quit # Thank you to # https://www.macosxautomation.com/applescript/features/system-prefs.html # # "wait for it" # http://apple.stackexchange.com/questions/209352/applescript-cant-get-tab-group-1-of-window-el-capitan/209434#209434
Linux/mkdir.asm
EgeBalci/Shellcode
2
100580
<gh_stars>1-10 Linux/x86 - mkdir HACK & chmod 777 and exit(0) - 29 Bytes #Greetz : Bomberman(Leader) #Author : B3mB4m #Auxiliary tools (50% time gain !) #https://github.com/b3mb4m/Shellcode/blob/master/Auxiliary/convertstack.py #https://github.com/b3mb4m/Shellcode/blob/master/Auxiliary/ASMtoShellcode.py Disassembly of section .text: 08048060 <.text>: 8048060: 31 c0 xor %eax,%eax 8048062: 50 push %eax 8048063: 68 48 41 43 4b push $0x4b434148 #You can change it ! 8048068: b0 27 mov $0x27,%al 804806a: 89 e3 mov %esp,%ebx 804806c: 66 41 inc %cx 804806e: cd 80 int $0x80 8048070: b0 0f mov $0xf,%al 8048072: 66 b9 ff 01 mov $0x1ff,%cx 8048076: cd 80 int $0x80 8048078: 31 c0 xor %eax,%eax 804807a: 40 inc %eax 804807b: cd 80 int $0x80 #include <stdio.h> #include <string.h> char *shellcode = "\x31\xc0\x50\x68\x48\x41\x43\x4b\xb0\x27\x89\xe3\x66\x41\xcd\x80\xb0\x0f\x66\xb9\xff\x01\xcd\x80\x31\xc0\x40\xcd\x80"; //First push always start with byte 68.Also mov b0. //Than just push your string between byte 68 - b0 ! :) //Here it is -> \x68 "\x48\x41\x43\x4b\" xb0 GOODLUCK ! int main(void){ fprintf(stdout,"Length: %d\n",strlen(shellcode)); (*(void(*)()) shellcode)();}
src/chars.asm
Iambian/Falldown2-CE
2
247097
<gh_stars>1-10 .assume adl=0 ; ; Characters and strings. Relies on the defines in game.asm. Is not portable. ; ;Depends on: ; Existence of page-aligned 8->16 bit expansion lookup tables ; Text color defines ; Screen buffer at address $8000 ; ;Defines the following inline memory areas: ; textcoords (LSB+X, MSB=Y) ; textcolor (two choices, each pointing to start of expansion LUTs) ; ;Defines the following functions: ; putchar [in:A=char, dstr: AF DE HL] ; putstr_centerpartial [in:HL=str A=x_offset, out:HL=next_str, dstr: AF DE] ; putstr_macro [For use in macro. see routine. Also destroys IX] ; putstr [in:HL=str, dstr: AF DE] ; putscore [in:HL=adr_of_BE_BCD_num, dstr: AF BC DE HL] ; getstrlen [in:HL=str, out:A,B=strlen HL=str, dstr: N/A] ; getstrfromidx [in:HL=strarr B=idx, out:HL=str A,B=0] ;in: A=char; out: character written to display ;rem: lazy will only do x in multiples of 4 px ;destroys: AF DE HL putchar: textcoords .equ $+1 textpos .equ $+1 ; convenience equates textx .equ $+1 ; texty .equ $+2 ; ld hl,0 ;SMC'd: H=Y, L=X ld e,L ld d,0 ;DE=X offset ld L,80 mlt hl add hl,de ;HL=offset into buffer set 7,h ;buffer starts at $8000 push hl pop ix ld e,a ld hl,graphx_textdata ex de,hl add hl,hl add hl,hl add hl,hl ;x8 add hl,de ;HL = address to character ld a,8 putchar_loop: ld e,(hl) ;Character data into LSB of pagealigned LUT textcolor .EQU $+1 ld d,TEXT_BLACK ;MSB of LUT address div 2 into MSB DE. ex de,hl add hl,hl ;Shift left to complete the address. ld hl,(hl) ;Get 2bpp data from LUT ld (ix+0),hl ;and write it to the buffer ex de,hl inc hl ;point to next byte of character lea ix,ix+80 ;point to next row in buffer dec a jr nz,putchar_loop ld hl,textcoords inc (hl) inc (hl) ret ;ok. can't get it to work with screen quartering as it is so we'll do the calc ;separately. ;inputs and outputs the same as putstr_centerpartial putstr_centerquarter: ld b,-40+1 jr putstr_centercontinue ;in: HL=strlen ;out: HL=adr_after_string ;Destroys: AF DE B putstr_centerpartial: ld b,-80+1 putstr_centercontinue: push hl call getstrlen add a,a add a,b cpl srl a sbc a,0 ;round down if a bit got shifted out ld hl,(textcoords) ld L,a ld a,h add a,12 ld h,a ld (textcoords),hl pop hl jr putstr ;also destroys IX. BC is safe. ;call putstr_macro / .db XPOS,YPOS / .dw str_adr putstr_macro: pop ix ld hl,(ix+0+COMPILER_BUG_OFFSET) ld (textcoords),hl ld hl,(ix+2+COMPILER_BUG_OFFSET) pea ix+4+COMPILER_BUG_OFFSET ;in: HL=zero_terminated_string ;out: HL=address_after_zero_terminator ;destroys: AF DE putstr: ld a,(hl) inc hl or a ret z push hl call putchar pop hl jr putstr ;in: HL=4_byte_BCD_bigendian ;destroys: All but IY putscore: xor a ld b,8 putscore_loop: push hl rld ld c,a add a,'0' call putchar ld a,c pop hl bit 0,b jr z,$+5 rld ;To return (HL) to way it was before. Else corrupted scores inc hl djnz putscore_loop ret ;in: HL=address_of_z-term_string ;out: HL is preserved, A= numchars string, zero flag set getstrlen: ld a,-1 push hl getstrlen_loop: inc a inc (hl) dec (hl) ;frees up reg A for compare inc hl jr nz,getstrlen_loop pop hl ret ;in: HL=start_of_string_array, B=index_to_get ;out: HL=start_of_indexed_string ;destroys: A and B always zero. ;NOTE: This routine was used only once, so inlining it @ gametitle_printbottom ; getstrfromidx: ; xor a ; cp b ; ret z ; getstrfromidx_loop: ; cp (hl) ; inc hl ; jr nz,getstrfromidx_loop ; djnz getstrfromidx_loop ; ret ;zeroing out characters that aren't used to improve compression results graphx_textdata .EQU $-(8*' ') ;points to what would be start of ASCII .db $00,$00,$00,$00,$00,$00,$00,$00 ; .db $00,$00,$00,$00,$00,$00,$00,$00 ; ! .db $00,$00,$00,$00,$00,$00,$00,$00 ; " .db $00,$00,$00,$00,$00,$00,$00,$00 ; # .db $00,$00,$00,$00,$00,$00,$00,$00 ; $ .db $00,$00,$00,$00,$00,$00,$00,$00 ; % .db $00,$00,$00,$00,$00,$00,$00,$00 ; & .db $30,$30,$60,$00,$00,$00,$00,$00 ; ' .db $30,$60,$C0,$C0,$C0,$60,$30,$00 ; ( .db $C0,$60,$30,$30,$30,$60,$C0,$00 ; ) .db $00,$00,$00,$00,$00,$00,$00,$00 ; * .db $00,$00,$00,$00,$00,$00,$00,$00 ; + .db $00,$00,$00,$00,$00,$60,$60,$C0 ; , .db $00,$00,$00,$00,$00,$00,$00,$00 ; - .db $00,$00,$00,$00,$00,$18,$18,$00 ; . .db $06,$0C,$18,$30,$60,$C0,$80,$00 ; / .db $7C,$CE,$DE,$F6,$E6,$C6,$7C,$00 ; 0 .db $30,$70,$30,$30,$30,$30,$FC,$00 ; 1 .db $7C,$C6,$06,$7C,$C0,$C0,$FE,$00 ; 2 .db $FC,$06,$06,$3C,$06,$06,$FC,$00 ; 3 .db $0C,$CC,$CC,$CC,$FE,$0C,$0C,$00 ; 4 .db $FE,$C0,$FC,$06,$06,$C6,$7C,$00 ; 5 .db $7C,$C0,$C0,$FC,$C6,$C6,$7C,$00 ; 6 .db $FE,$06,$06,$0C,$18,$30,$30,$00 ; 7 .db $7C,$C6,$C6,$7C,$C6,$C6,$7C,$00 ; 8 .db $7C,$C6,$C6,$7E,$06,$06,$7C,$00 ; 9 .db $00,$C0,$C0,$00,$00,$C0,$C0,$00 ; : .db $00,$00,$00,$00,$00,$00,$00,$00 ; ; .db $00,$00,$00,$00,$00,$00,$00,$00 ; < .db $00,$00,$00,$00,$00,$00,$00,$00 ; = .db $00,$00,$00,$00,$00,$00,$00,$00 ; > .db $00,$00,$00,$00,$00,$00,$00,$00 ; ? .db $00,$00,$00,$00,$00,$00,$00,$00 ; @ .db $38,$6C,$C6,$C6,$FE,$C6,$C6,$00 ; A .db $FC,$C6,$C6,$FC,$C6,$C6,$FC,$00 ; B .db $7C,$C6,$C0,$C0,$C0,$C6,$7C,$00 ; C .db $F8,$CC,$C6,$C6,$C6,$CC,$F8,$00 ; D .db $FE,$C0,$C0,$F8,$C0,$C0,$FE,$00 ; E .db $FE,$C0,$C0,$F8,$C0,$C0,$C0,$00 ; F .db $7C,$C6,$C0,$C0,$CE,$C6,$7C,$00 ; G .db $C6,$C6,$C6,$FE,$C6,$C6,$C6,$00 ; H .db $7E,$18,$18,$18,$18,$18,$7E,$00 ; I .db $06,$06,$06,$06,$06,$C6,$7C,$00 ; J .db $C6,$CC,$D8,$F0,$D8,$CC,$C6,$00 ; K .db $C0,$C0,$C0,$C0,$C0,$C0,$FE,$00 ; L .db $C6,$EE,$FE,$FE,$D6,$C6,$C6,$00 ; M .db $C6,$E6,$F6,$DE,$CE,$C6,$C6,$00 ; N .db $7C,$C6,$C6,$C6,$C6,$C6,$7C,$00 ; O .db $FC,$C6,$C6,$FC,$C0,$C0,$C0,$00 ; P .db $7C,$C6,$C6,$C6,$D6,$DE,$7C,$06 ; Q .db $FC,$C6,$C6,$FC,$D8,$CC,$C6,$00 ; R .db $7C,$C6,$C0,$7C,$06,$C6,$7C,$00 ; S .db $FF,$18,$18,$18,$18,$18,$18,$00 ; T .db $C6,$C6,$C6,$C6,$C6,$C6,$FE,$00 ; U .db $C6,$C6,$C6,$C6,$C6,$7C,$38,$00 ; V .db $C6,$C6,$C6,$C6,$D6,$FE,$6C,$00 ; W .db $C6,$C6,$6C,$38,$6C,$C6,$C6,$00 ; X .db $C6,$C6,$C6,$7C,$18,$30,$E0,$00 ; Y .db $FE,$06,$0C,$18,$30,$60,$FE,$00 ; Z .db $00,$00,$00,$00,$00,$00,$00,$00 ; [ .db $00,$00,$00,$00,$00,$00,$00,$00 ; \ .db $00,$00,$00,$00,$00,$00,$00,$00 ; ] .db $00,$00,$00,$00,$00,$00,$00,$00 ; ^ .db $00,$00,$00,$00,$00,$00,$00,$00 ; _ .db $00,$00,$00,$00,$00,$00,$00,$00 ; ` .db $00,$00,$7C,$06,$7E,$C6,$7E,$00 ; a .db $C0,$C0,$C0,$FC,$C6,$C6,$FC,$00 ; b .db $00,$00,$7C,$C6,$C0,$C6,$7C,$00 ; c .db $06,$06,$06,$7E,$C6,$C6,$7E,$00 ; d .db $00,$00,$7C,$C6,$FE,$C0,$7C,$00 ; e .db $1C,$36,$30,$78,$30,$30,$78,$00 ; f .db $00,$00,$7E,$C6,$C6,$7E,$06,$FC ; g .db $C0,$C0,$FC,$C6,$C6,$C6,$C6,$00 ; h .db $18,$00,$38,$18,$18,$18,$3C,$00 ; i .db $06,$00,$06,$06,$06,$06,$C6,$7C ; j .db $C0,$C0,$CC,$D8,$F8,$CC,$C6,$00 ; k .db $38,$18,$18,$18,$18,$18,$3C,$00 ; l .db $00,$00,$CC,$FE,$FE,$D6,$D6,$00 ; m .db $00,$00,$FC,$C6,$C6,$C6,$C6,$00 ; n .db $00,$00,$7C,$C6,$C6,$C6,$7C,$00 ; o .db $00,$00,$FC,$C6,$C6,$FC,$C0,$C0 ; p .db $00,$00,$7E,$C6,$C6,$7E,$06,$06 ; q .db $00,$00,$FC,$C6,$C0,$C0,$C0,$00 ; r .db $00,$00,$7E,$C0,$7C,$06,$FC,$00 ; s .db $30,$30,$FC,$30,$30,$30,$1C,$00 ; t .db $00,$00,$C6,$C6,$C6,$C6,$7E,$00 ; u .db $00,$00,$C6,$C6,$C6,$7C,$38,$00 ; v .db $00,$00,$C6,$C6,$D6,$FE,$6C,$00 ; w .db $00,$00,$C6,$6C,$38,$6C,$C6,$00 ; x .db $00,$00,$C6,$C6,$C6,$7E,$06,$FC ; y .db $00,$00,$FE,$0C,$38,$60,$FE,$00 ; z
oeis/130/A130624.asm
neoneye/loda-programs
11
243524
; A130624: Binomial transform of A101000. ; Submitted by <NAME>(s4) ; 0,1,5,12,23,43,84,169,341,684,1367,2731,5460,10921,21845,43692,87383,174763,349524,699049,1398101,2796204,5592407,11184811,22369620,44739241,89478485,178956972,357913943,715827883,1431655764,2863311529,5726623061,11453246124,22906492247,45812984491,91625968980,183251937961,366503875925,733007751852,1466015503703,2932031007403,5864062014804,11728124029609,23456248059221,46912496118444,93824992236887,187649984473771,375299968947540,750599937895081,1501199875790165,3002399751580332 lpb $0 sub $0,1 add $2,2 add $3,$2 sub $3,1 add $4,1 mul $4,2 add $2,$4 sub $2,$3 lpe mov $0,$3
src/Prelude/IO.agda
L-TChen/agda-prelude
111
6985
module Prelude.IO where open import Prelude.Function open import Prelude.Functor open import Prelude.Applicative open import Prelude.Monad open import Prelude.List open import Prelude.String open import Prelude.Char open import Prelude.Unit open import Prelude.Show open import Prelude.Nat open import Agda.Builtin.IO public postulate ioReturn : ∀ {a} {A : Set a} → A → IO A ioBind : ∀ {a b} {A : Set a} {B : Set b} → IO A → (A → IO B) → IO B {-# COMPILE GHC ioReturn = (\ _ _ -> return) #-} {-# COMPILE GHC ioBind = (\ _ _ _ _ -> (>>=)) #-} {-# COMPILE UHC ioReturn = (\ _ _ x -> UHC.Agda.Builtins.primReturn x) #-} {-# COMPILE UHC ioBind = (\ _ _ _ _ x y -> UHC.Agda.Builtins.primBind x y) #-} ioMap : ∀ {a b} {A : Set a} {B : Set b} → (A → B) → IO A → IO B ioMap f m = ioBind m λ x → ioReturn (f x) instance FunctorIO : ∀ {a} → Functor {a} IO fmap {{FunctorIO}} = ioMap ApplicativeIO : ∀ {a} → Applicative {a} IO pure {{ApplicativeIO}} = ioReturn _<*>_ {{ApplicativeIO}} = monadAp ioBind MonadIO : ∀ {a} → Monad {a} IO _>>=_ {{MonadIO}} = ioBind FunctorIO′ : ∀ {a b} → Functor′ {a} {b} IO fmap′ {{FunctorIO′}} = ioMap ApplicativeIO′ : ∀ {a b} → Applicative′ {a} {b} IO _<*>′_ {{ApplicativeIO′}} = monadAp′ ioBind MonadIO′ : ∀ {a b} → Monad′ {a} {b} IO _>>=′_ {{MonadIO′}} = ioBind --- Terminal IO --- postulate getChar : IO Char putChar : Char → IO Unit putStr : String → IO Unit putStrLn : String → IO Unit {-# FOREIGN GHC import qualified Data.Text as Text #-} {-# FOREIGN GHC import qualified Data.Text.IO as Text #-} {-# COMPILE GHC getChar = getChar #-} {-# COMPILE GHC putChar = putChar #-} {-# COMPILE GHC putStr = Text.putStr #-} {-# COMPILE GHC putStrLn = Text.putStrLn #-} {-# COMPILE UHC putStr = (UHC.Agda.Builtins.primPutStr) #-} {-# COMPILE UHC putStrLn = (UHC.Agda.Builtins.primPutStrLn) #-} print : ∀ {a} {A : Set a} {{ShowA : Show A}} → A → IO Unit print = putStrLn ∘ show --- Command line arguments --- {-# FOREIGN GHC import System.Environment (getArgs, getProgName) #-} postulate getArgs : IO (List String) getProgName : IO String {-# COMPILE GHC getArgs = fmap (map Text.pack) getArgs #-} {-# COMPILE GHC getProgName = fmap Text.pack getProgName #-} --- Misc --- {-# FOREIGN GHC import System.Exit #-} data ExitCode : Set where Success : ExitCode -- TODO we probably should also enforce an upper limit? Failure : (n : Nat) → {p : NonZero n} → ExitCode private {-# FOREIGN GHC exitWith' x = exitWith (if x == 0 then ExitSuccess else ExitFailure $ fromInteger x) #-} postulate exitWith' : ∀ {a} {A : Set a} → Nat → IO A {-# COMPILE GHC exitWith' = \ _ _ -> exitWith' #-} exitWith : ∀ {a} {A : Set a} → ExitCode → IO A exitWith Success = exitWith' 0 exitWith (Failure i) = exitWith' i
oeis/275/A275636.asm
neoneye/loda-programs
11
17979
<reponame>neoneye/loda-programs ; A275636: a(n) = (3^n-1)*(3^n+3)/3!. ; 0,2,16,130,1120,9922,88816,797890,7176640,64576642,581150416,5230235650,47071766560,423644836162,3812800336816,34315193465410,308836712490880,2779530326324482,25015772678640016,225141953332919170,2026277577671749600,18236498192072177602,164128483707728892016,1477156353306797908930,13294407179572894822720,119649664615591194331522,1076846981538626171764816,9691622833842551814226690,87224605504567715133070240,785021449541063682612722242,7065193045869435882759770416,63586737412824511162573744450 mov $1,3 pow $1,$0 add $1,1 pow $1,2 div $1,6 mov $0,$1
Practica 1/ej5.asm
YanniMartinez/Microcomputadoras
1
172479
<reponame>YanniMartinez/Microcomputadoras PROCESSOR 16f877 ;version del procesador INCLUDE <P16f877.inc> ;libreria del procesador K equ H'26' ;registro donde se guardara K L equ H'27' ;registro donde se guardara L ORG 0 ;vector reset (lugar de origen) GOTO INICIO ;inicio del programa ORG 5 ;posicion donde se iniciara el programa INICIO: MOVLW 0X01 ;se guarda en w el valor 0x01 ADDWF K,W ;sumamos el valor de w a k MOVWF K ;copia el valor de w a f BTFSS K,3 ;verifica el bit 3 de k GOTO INICIO ;retorna a inicio si el bit3 es 1 GOTO SIG ;va a SIG SIG: BTFSS K,0 ;verifica el bit 0 de k GOTO INICIO ;En caso que el bit 0 de k sea 1 regresa a inicio GOTO SIG1 ;Continua a SIG1 SIG1: BTFSC K,4 ;verifica el valor del bit 4 de k es 0 GOTO SIG2 ;En caso que el bit 4 de k sea 0 continua a sig2 MOVLW 0X10 ;Movemos a w el valor de 0x10 MOVWF K ;movemos k a f GOTO INICIO ;regresamos a INICIO SIG2: MOVLW 0X20 ;se mueve a w 0x20 MOVWF K ;movemos k a f GOTO SIG3 ;continuamos a sig3 SIG3: MOVLW 0X00 ;movemos a w 0x00 MOVWF K ;movemos k a f GOTO INICIO ;vamos a inicio GOTO INICIO ;redirige al inicio del programa END
programs/oeis/078/A078788.asm
karttu/loda
0
20620
; A078788: Smallest m such that (n-1)*m+1 mod n = 0, or 0 if no such number exists. ; 0,0,3,0,5,3,7,0,3,5,11,3,13,7,3,0,17,3,19,5,3,11,23,3,5,13,3,7,29,3,31,0,3,17,5,3,37,19,3,5,41,3,43,11,3,23,47,3,7,5,3,13,53,3,5,7,3,29,59,3,61,31,3,0,5,3,67,17,3,5,71,3,73,37,3,19,7,3,79,5,3,41,83,3,5,43,3,11 cal $0,78701 ; Least odd prime factor of n, or 1 if no such factor exists. lpb $0,1 sub $0,1 mul $0,3 lpe mov $1,$0
examples/AIM6/Path/Fin.agda
shlevy/agda
1,989
12247
<reponame>shlevy/agda<filename>examples/AIM6/Path/Fin.agda module Fin where open import Prelude open import Star open import Modal open import Nat Fin : Nat -> Set Fin = Any (\_ -> True) fzero : {n : Nat} -> Fin (suc n) fzero = done _ • ε fsuc : {n : Nat} -> Fin n -> Fin (suc n) fsuc i = step • i
libsrc/video/mc6845/asm_set_cursor_state.asm
jpoikela/z88dk
0
22694
<gh_stars>0 SECTION code_clib PUBLIC asm_set_cursor_state INCLUDE "mc6845.inc" ; Set the state of the hardware cursor ; ; Entry: l = cursor state: ; 0x00 = always on ; 0x20 = off ; 0x40 = fast blink ; 0x60 = slow blink ; ; Uses: af, l asm_set_cursor_state: ld a,0x0a out (address_w),a ld a,l out (register_w),a ret
awa/src/awa-wikis-parsers.ads
Letractively/ada-awa
0
14207
----------------------------------------------------------------------- -- awa-wikis-parsers -- Wiki parser -- Copyright (C) 2011, 2015 <NAME> -- Written by <NAME> (<EMAIL>) -- -- 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.Wide_Wide_Unbounded; with AWA.Wikis.Documents; -- The <b>AWA.Wikis.Parsers</b> package implements a parser for several well known wiki formats. -- The parser works with the <b>Document_Reader</b> interface type which defines several -- procedures that are called by the parser when the wiki text is scanned. package AWA.Wikis.Parsers is pragma Preelaborate; -- Defines the possible wiki syntax supported by the parser. type Wiki_Syntax_Type is ( -- Google wiki syntax http://code.google.com/p/support/wiki/WikiSyntax SYNTAX_GOOGLE, -- Creole wiki syntax http://www.wikicreole.org/wiki/Creole1.0 SYNTAX_CREOLE, -- Dotclear syntax http://dotclear.org/documentation/2.0/usage/syntaxes SYNTAX_DOTCLEAR, -- PhpBB syntax http://wiki.phpbb.com/Help:Formatting SYNTAX_PHPBB, -- MediaWiki syntax http://www.mediawiki.org/wiki/Help:Formatting SYNTAX_MEDIA_WIKI, -- A mix of the above SYNTAX_MIX); -- Parse the wiki text contained in <b>Text</b> according to the wiki syntax -- specified in <b>Syntax</b> and invoke the document reader procedures defined -- by <b>into</b>. procedure Parse (Into : in AWA.Wikis.Documents.Document_Reader_Access; Text : in Wide_Wide_String; Syntax : in Wiki_Syntax_Type := SYNTAX_MIX); private HT : constant Wide_Wide_Character := Wide_Wide_Character'Val (16#09#); LF : constant Wide_Wide_Character := Wide_Wide_Character'Val (16#0A#); CR : constant Wide_Wide_Character := Wide_Wide_Character'Val (16#0D#); type Input is interface; type Input_Access is access all Input'Class; procedure Read_Char (From : in out Input; Token : out Wide_Wide_Character; Eof : out Boolean) is abstract; type Parser is limited record Pending : Wide_Wide_Character; Has_Pending : Boolean; Document : AWA.Wikis.Documents.Document_Reader_Access; Format : AWA.Wikis.Documents.Format_Map; Text : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String; Empty_Line : Boolean := True; Is_Eof : Boolean := False; In_Paragraph : Boolean := False; Need_Paragraph : Boolean := True; Link_Double_Bracket : Boolean := False; Is_Dotclear : Boolean := False; Header_Offset : Integer := 0; Quote_Level : Natural := 0; Escape_Char : Wide_Wide_Character; List_Level : Natural := 0; Reader : Input_Access := null; end record; type Parser_Handler is access procedure (P : in out Parser; Token : in Wide_Wide_Character); type Parser_Table is array (0 .. 127) of Parser_Handler; type Parser_Table_Access is access Parser_Table; end AWA.Wikis.Parsers;
mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/xor32.asm
gb-archive/really-old-stuff
10
86751
; FASTCALL boolean xor 8 version. ; result in Accumulator (0 False, not 0 True) ; __FASTCALL__ version (operands: A, H) ; Performs 32bit xor 32bit and returns the boolean #include once <xor8.asm> __XOR32: ld a, h or l or d or e ld c, a pop hl ; RET address pop de ex (sp), hl ld a, h or l or d or e ld h, c jp __XOR8
programs/oeis/001/A001535.asm
karttu/loda
1
14277
<filename>programs/oeis/001/A001535.asm ; A001535: (10n+1)(10n+9). ; 9,209,609,1209,2009,3009,4209,5609,7209,9009,11009,13209,15609,18209,21009,24009,27209,30609,34209,38009,42009,46209,50609,55209,60009,65009,70209,75609,81209,87009,93009,99209,105609,112209,119009,126009,133209,140609,148209,156009,164009,172209,180609,189209,198009,207009,216209,225609,235209,245009,255009,265209,275609,286209,297009,308009,319209,330609,342209,354009,366009,378209,390609,403209,416009,429009,442209,455609,469209,483009,497009,511209,525609,540209,555009,570009,585209,600609,616209,632009,648009,664209,680609,697209,714009,731009,748209,765609,783209,801009,819009,837209,855609,874209,893009,912009,931209,950609,970209,990009,1010009,1030209,1050609,1071209,1092009,1113009,1134209,1155609,1177209,1199009,1221009,1243209,1265609,1288209,1311009,1334009,1357209,1380609,1404209,1428009,1452009,1476209,1500609,1525209,1550009,1575009,1600209,1625609,1651209,1677009,1703009,1729209,1755609,1782209,1809009,1836009,1863209,1890609,1918209,1946009,1974009,2002209,2030609,2059209,2088009,2117009,2146209,2175609,2205209,2235009,2265009,2295209,2325609,2356209,2387009,2418009,2449209,2480609,2512209,2544009,2576009,2608209,2640609,2673209,2706009,2739009,2772209,2805609,2839209,2873009,2907009,2941209,2975609,3010209,3045009,3080009,3115209,3150609,3186209,3222009,3258009,3294209,3330609,3367209,3404009,3441009,3478209,3515609,3553209,3591009,3629009,3667209,3705609,3744209,3783009,3822009,3861209,3900609,3940209,3980009,4020009,4060209,4100609,4141209,4182009,4223009,4264209,4305609,4347209,4389009,4431009,4473209,4515609,4558209,4601009,4644009,4687209,4730609,4774209,4818009,4862009,4906209,4950609,4995209,5040009,5085009,5130209,5175609,5221209,5267009,5313009,5359209,5405609,5452209,5499009,5546009,5593209,5640609,5688209,5736009,5784009,5832209,5880609,5929209,5978009,6027009,6076209,6125609,6175209,6225009 sub $1,$0 bin $1,2 mul $1,200 add $1,9
data/maps/objects/VermilionPokecenter.asm
opiter09/ASM-Machina
1
245496
VermilionPokecenter_Object: db $0 ; border block def_warps warp 3, 7, 0, LAST_MAP warp 4, 7, 0, LAST_MAP def_signs def_objects object SPRITE_NURSE, 3, 1, STAY, DOWN, 1 ; person object SPRITE_FISHING_GURU, 10, 5, STAY, NONE, 2 ; person object SPRITE_SAILOR, 5, 4, STAY, NONE, 3 ; person object SPRITE_LINK_RECEPTIONIST, 11, 2, STAY, DOWN, 4 ; person def_warps_to VERMILION_POKECENTER
programs/oeis/292/A292410.asm
karttu/loda
0
22909
; A292410: Difference between (2n+1)^2 and highest power of 2 less than or equal to (2n+1)^2. ; 0,1,9,17,17,57,41,97,33,105,185,17,113,217,329,449,65,201,345,497,657,825,1001,161,353,553,761,977,1201,1433,1673,1921,129,393,665,945,1233,1529,1833,2145,2465,2793,3129,3473,3825,89,457,833,1217,1609,2009,2417,2833,3257,3689,4129,4577,5033,5497,5969,6449,6937,7433,7937,257,777,1305,1841,2385,2937,3497,4065,4641,5225,5817,6417,7025,7641,8265,8897,9537,10185,10841,11505,12177,12857,13545,14241,14945,15657,16377,721,1457,2201,2953,3713,4481,5257,6041,6833,7633,8441,9257,10081,10913,11753,12601,13457,14321,15193,16073,16961,17857,18761,19673,20593,21521,22457,23401,24353,25313,26281,27257,28241,29233,30233,31241,32257,513,1545,2585,3633,4689,5753,6825,7905,8993,10089,11193,12305,13425,14553,15689,16833,17985,19145,20313,21489,22673,23865,25065,26273,27489,28713,29945,31185,32433,33689,34953,36225,37505,38793,40089,41393,42705,44025,45353,46689,48033,49385,50745,52113,53489,54873,56265,57665,59073,60489,61913,63345,64785,697,2153,3617,5089,6569,8057,9553,11057,12569,14089,15617,17153,18697,20249,21809,23377,24953,26537,28129,29729,31337,32953,34577,36209,37849,39497,41153,42817,44489,46169,47857,49553,51257,52969,54689,56417,58153,59897,61649,63409,65177,66953,68737,70529,72329,74137,75953,77777,79609,81449,83297,85153,87017,88889,90769,92657,94553,96457,98369,100289,102217,104153,106097,108049,110009,111977,113953,115937,117929 mov $3,$0 mul $0,0 mul $3,4 add $3,2 pow $3,2 add $0,$3 mov $1,$3 lpb $0,1 mov $4,$0 mul $0,2 sub $0,$1 trn $0,1 mov $2,$4 add $4,259 lpe add $0,$2 add $0,$4 mov $1,$0 sub $1,261 div $1,8
oeis/088/A088560.asm
neoneye/loda-programs
11
104588
<reponame>neoneye/loda-programs<filename>oeis/088/A088560.asm ; A088560: Sum of odd entries in row n of Pascal's triangle. ; Submitted by <NAME> ; 1,2,2,8,2,12,32,128,2,20,92,464,992,4032,8192,32768,2,36,308,2320,9692,52712,164320,781312,1470944,6249152,13748672,56768768,67100672,268419072,536870912,2147483648,2,68,1124,14352,117812,1003960,5670400,38622976,153809372,891783704,3178948040,16756565856,42536101984,205738635840,566269951872,2621071988736,4509697827296,19694758782400,45954437161152,196611937842944,272715645333952,1134989624389248,2439841680237056,10073431279673344,8793364151263232,35298718213652480,71025106500042752 mov $4,$0 lpb $0 sub $0,1 mov $3,$4 bin $3,$1 add $1,1 mov $2,$3 mod $3,2 mul $3,$2 add $5,$3 lpe mov $0,$5 add $0,1
libsrc/_DEVELOPMENT/compress/zx1/c/sdcc/dzx1_standard_callee.asm
ahjelm/z88dk
640
26068
<filename>libsrc/_DEVELOPMENT/compress/zx1/c/sdcc/dzx1_standard_callee.asm ; void dzx1_standard_callee(void *src, void *dst) SECTION code_clib SECTION code_compress_zx1 PUBLIC _dzx1_standard_callee EXTERN asm_dzx1_standard _dzx1_standard_callee: pop af pop hl pop de push af jp asm_dzx1_standard
test/Succeed/Issue296.agda
redfish64/autonomic-agda
1
7406
module Issue296 where postulate Unit : Set IO : Set → Set foo : ((A B : Set) → Unit) → IO Unit bar : (A B : Set) → Unit {-# BUILTIN IO IO #-} {-# COMPILED_TYPE IO IO #-} {-# COMPILED_TYPE Unit () #-} {-# COMPILED bar undefined #-} main : IO Unit main = foo bar
test/Fail/Issue1194i.agda
shlevy/agda
1,989
9649
<filename>test/Fail/Issue1194i.agda module _ where module A where infix 0 c syntax c x = + x data D₁ : Set where b : D₁ c : D₁ → D₁ module B where infix 1 c syntax c x = + x data D₂ : Set where c : A.D₁ → D₂ open A open B test₁ : D₂ test₁ = + + + b test₂ : D₂ → D₁ test₂ (+ + x) = x test₂ (+ b) = + + + b
ggsound_asm6/demo.asm
bunder2015/ggsound
38
161192
include "ppu.inc" include "controller.inc" include "sprite.inc" include "ggsound.inc" ;**************************************************************** ;iNES header ;**************************************************************** .byte "NES",$1a .byte $01 ; 1 PRG-ROM block .byte $01 ; 1 CHR-ROM block ; ROM control bytes: Horizontal mirroring, no SRAM ; or trainer, Mapper #0 .byte $01 ; .byte $00 ; .byte 0,0,0,0,0,0,0,0 ; pad header to 16 bytes ;**************************************************************** ;ZP variables ;**************************************************************** .base $0000 .enum $0000 include "demo_zp.inc" include "ggsound_zp.inc" .ende ;**************************************************************** ;RAM variables ;**************************************************************** .base $0200 .enum $0200 include "demo_ram.inc" include "ggsound_ram.inc" .ende ;**************************************************************** ;Engine code, music data, and helper modules ;**************************************************************** .base $C000 include "get_tv_system.asm" include "sprite.asm" include "ppu.asm" include "controller.asm" include "ggsound.asm" include "track_data.inc" .align 64 include "track_dpcm.inc" ;**************************************************************** ;Data used for demo ;**************************************************************** palette: .db $0e,$08,$18,$20,$0e,$0e,$12,$20,$0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e .db $0e,$0e,$09,$1a,$0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e tv_system_to_sound_region: .db SOUND_REGION_NTSC, SOUND_REGION_PAL, SOUND_REGION_DENDY, SOUND_REGION_NTSC ;**************************************************************** ;Demo entry point ;**************************************************************** reset: ;Set interrupt disable flag. sei ;Clear binary encoded decimal flag. cld ;Disable APU frame IRQ. lda #$40 sta $4017 ;Initialize stack. ldx #$FF txs ;Turn off all graphics, and clear PPU registers. lda #$00 sta ppu_2000 sta ppu_2001 upload_ppu_2000 upload_ppu_2001 ;Disable DMC IRQs. lda #$00 sta $4010 ;Clear the vblank flag, so we know that we are waiting for the ;start of a vertical blank and not powering on with the ;vblank flag spuriously set. bit $2002 ;Wait for PPU to be ready. wait_vblank wait_vblank ;Install nmi routine for just counting nmis (detecting system) lda #<(vblank_get_tv_system) sta vblank_routine lda #>(vblank_get_tv_system) sta vblank_routine+1 ;Initialize ppu registers with settings we're never going to change. set_ppu_2000_bit PPU0_EXECUTE_NMI set_ppu_2001_bit PPU1_SPRITE_CLIPPING set_ppu_2001_bit PPU1_BACKGROUND_CLIPPING clear_ppu_2000_bit PPU0_BACKGROUND_PATTERN_TABLE_ADDRESS set_ppu_2000_bit PPU0_SPRITE_PATTERN_TABLE_ADDRESS upload_ppu_2000 upload_ppu_2001 ;Load palette. lda #<(palette) sta palette_address lda #>(palette) sta palette_address+1 jsr ppu_load_palette ;Load nametable. lda #$20 sta ppu_2006 lda #$00 sta ppu_2006+1 upload_ppu_2006 lda #<(name_table) sta w0 lda #>(name_table) sta w0+1 jsr ppu_load_nametable lda #0 sta next_sprite_address ;Draw sprite overlay. lda #<(sprite_overlay) sta w0 lda #>(sprite_overlay) sta w0+1 jsr sprite_draw_overlay ;Get the sprites on the screen. lda #>(sprite) sta $4014 lda #$20 sta ppu_2006+1 lda #0 sta ppu_2006 sta ppu_2005 lda #-8 sta ppu_2005+1 upload_ppu_2006 upload_ppu_2005 ;Turn on graphics and sprites. set_ppu_2001_bit PPU1_SPRITE_VISIBILITY set_ppu_2001_bit PPU1_BACKGROUND_VISIBILITY upload_ppu_2001 lda #0 sta current_song sta pause_flag wait_vblank ;initialize modules lda #0 sta nmis jsr get_tv_system tax lda tv_system_to_sound_region,x sta sound_param_byte_0 lda #<(song_list) sta sound_param_word_0 lda #>(song_list) sta sound_param_word_0+1 lda #<(sfx_list) sta sound_param_word_1 lda #>(sfx_list) sta sound_param_word_1+1 lda #<(instrument_list) sta sound_param_word_2 lda #>(instrument_list) sta sound_param_word_2+1 lda #<dpcm_list sta sound_param_word_3 lda #>dpcm_list sta sound_param_word_3+1 jsr sound_initialize ;load a song lda current_song sta sound_param_byte_0 jsr play_song lda #<(vblank_demo) sta vblank_routine lda #>(vblank_demo) sta vblank_routine+1 main_loop: clear_vblank_done wait_vblank_done jsr controller_read lda controller_buffer+buttons_a and #%00000011 cmp #%00000001 bne skipa lda #sfx_index_sfx_collide sta sound_param_byte_0 lda #soundeffect_one sta sound_param_byte_1 jsr play_sfx skipa: lda controller_buffer+buttons_b and #%00000011 cmp #%00000001 bne skipb lda #sfx_index_sfx_dpcm sta sound_param_byte_0 lda #soundeffect_two sta sound_param_byte_1 jsr play_sfx skipb: lda controller_buffer+buttons_up and #%00000011 cmp #%00000001 bne skipup inc current_song lda current_song cmp #7 bne + lda #6 sta current_song + lda current_song sta sound_param_byte_0 jsr play_song skipup: lda controller_buffer+buttons_down and #%00000011 cmp #%00000001 bne skipdown dec current_song lda current_song cmp #$ff bne + lda #0 sta current_song + lda current_song sta sound_param_byte_0 jsr play_song skipdown: lda controller_buffer+buttons_start and #%00000011 cmp #%00000001 bne skipstart lda pause_flag eor #1 sta pause_flag lda pause_flag bne paused unpaused: jsr resume_song jmp done paused: jsr pause_song done: skipstart: jmp main_loop vblank_get_tv_system: inc nmis rts vblank_demo: ;Just use up vblank cycles to push monochrome bit ;CPU usage display of sound engine onto the screen. ldy #130 lda sound_region cmp #SOUND_REGION_PAL bne + ldy #255 + -- ldx #7 - dex bne - dey bne -- ;turn on monochrome color while the sound engine runs set_ppu_2001_bit PPU1_DISPLAY_TYPE upload_ppu_2001 ;update the sound engine. This should always be done at the ;end of vblank, this way it is always running at the same speed ;even if your game s<s down. soundengine_update ;turn off monochrome color now that the sound engine is ;done. You should see a nice gray bar that shows how much ;cpu time the sound engine is using. clear_ppu_2001_bit PPU1_DISPLAY_TYPE upload_ppu_2001 rts vblank: pha txa pha tya pha php jsr vblank_indirect lda #1 sta vblank_done_flag plp pla tay pla tax pla irq: rti vblank_indirect: jmp (vblank_routine) name_table: include "name_table.inc" sprite_overlay: include "sprite_overlay.inc" ;**************************************************************** ;Vectors ;**************************************************************** .org $FFFA ;first of the three vectors starts here .dw vblank ;when an NMI happens (once per frame if enabled) the ;processor will jump to the label NMI: .dw reset ;when the processor first turns on or is reset, it will jump ;to the label RESET: .dw irq ;external interrupt IRQ is not used in this tutorial ;**************************************************************** ;CHR-ROM data ;**************************************************************** .base $0000 .include "bg_chr.inc" .org $1000 .include "spr_chr.inc" .pad $2000
oeis/102/A102753.asm
neoneye/loda-programs
11
29472
<reponame>neoneye/loda-programs<gh_stars>10-100 ; A102753: Decimal expansion of (Pi^2)/2. ; Submitted by <NAME> ; 4,9,3,4,8,0,2,2,0,0,5,4,4,6,7,9,3,0,9,4,1,7,2,4,5,4,9,9,9,3,8,0,7,5,5,6,7,6,5,6,8,4,9,7,0,3,6,2,0,3,9,5,3,1,3,2,0,6,6,7,4,6,8,8,1,1,0,0,2,2,4,1,1,2,0,9,6,0,2,6,2,1,5,0,0,8,8,6,7,0,1,8,5,9,2,7,6,1,1,5 add $0,1 mov $2,1 mov $3,$0 mul $3,5 sub $3,1 lpb $3 mul $1,$3 mov $5,$3 mul $5,2 add $5,1 mul $2,$5 add $1,$2 div $1,$0 div $2,$0 sub $3,1 lpe pow $1,2 mul $1,2 pow $2,2 mul $2,10 mov $4,10 pow $4,$0 div $2,$4 div $1,$2 mov $0,$1 mod $0,10
include/sf-window-context.ads
danva994/ASFML-1.6
1
4220
<gh_stars>1-10 -- //////////////////////////////////////////////////////////// -- // -- // SFML - Simple and Fast Multimedia Library -- // Copyright (C) 2007-2009 <NAME> (<EMAIL>) -- // -- // 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. -- // -- //////////////////////////////////////////////////////////// -- //////////////////////////////////////////////////////////// -- // Headers -- //////////////////////////////////////////////////////////// with Sf.Config; with Sf.Window.Types; package Sf.Window.Context is use Sf.Config; use Sf.Window.Types; -- //////////////////////////////////////////////////////////// -- /// Construct a new context -- /// -- /// \return New context -- /// -- //////////////////////////////////////////////////////////// function sfContext_Create return sfContext_Ptr; -- //////////////////////////////////////////////////////////// -- /// Destroy an existing context -- /// -- /// \param Context : Context to destroy -- /// -- //////////////////////////////////////////////////////////// procedure sfContext_Destroy (Context : sfContext_Ptr); -- //////////////////////////////////////////////////////////// -- /// Activate or deactivate a context -- /// -- /// \param Context : Context to activate or deactivate -- /// \param Active : sfTrue to activate, sfFalse to deactivate -- /// -- //////////////////////////////////////////////////////////// procedure sfContext_SetActive (Context : sfContext_Ptr; Active : sfBool); private pragma Import (C, sfContext_Create, "sfContext_Create"); pragma Import (C, sfContext_Destroy, "sfContext_Destroy"); pragma Import (C, sfContext_SetActive, "sfContext_SetActive"); end Sf.Window.Context;
Snippeturi/find_substring_KMP.asm
DanBrezeanu/IOCLA
2
81925
<gh_stars>1-10 %include "io.inc" section .data source_text: db "ABCABCBABCBABCBBBABABBCBABCBAAACCCB", 0 substring: db "BABC", 0 substr_length: dd 4 print_format: db "Substring found at index: ", 0 section .bss source_length: resd 1 pref_array: resd 10 section .text global CMAIN CMAIN: mov ebp, esp; for correct debugging push ebp mov ebp, esp ; TODO: Fill source_length with the length of the source_text string. ; Find the length of the string using scasb. mov al, 0 ; \0 mov edi, source_text repne scasb sub edi, source_text + 1 mov [source_length], edi mov byte [pref_array], 0 mov eax, 1 xor ebx, ebx xor dl, dl build_pref_array: cmp eax, [substr_length] je make_KMP back_pref_array: mov dl, byte [substring + eax] cmp dl, byte [substring + ebx] je compare_positions cmp ebx, 0 je compare_positions mov ebx, [pref_array + (ebx - 1) * 4] jmp back_pref_array compare_positions: cmp dl, byte [substring + ebx] jne end_build inc ebx end_build: mov [pref_array + eax * 4], ebx inc eax jmp build_pref_array make_KMP: xor eax, eax xor ebx, ebx xor edx, edx KMP_search: cmp eax, [source_length] jge return back_on_array: mov dl, byte [source_text + eax] cmp dl, byte [substring + ebx] je compare_positions_search cmp ebx, 0 je compare_positions_search mov ebx, [pref_array + (ebx - 1) * 4] jmp back_on_array compare_positions_search: cmp dl, byte [substring + ebx] jne end_search inc ebx end_search: cmp ebx, [substr_length] jne back_to_start mov ecx, eax sub ecx, [substr_length] inc ecx PRINT_STRING print_format PRINT_UDEC 4, ecx NEWLINE mov ebx, [pref_array + (ebx - 1) * 4] back_to_start: inc eax jmp KMP_search return: xor eax, eax leave ret
Chime Channel Chooser.scpt
ericbjones/alfredchimeflows
5
2629
<reponame>ericbjones/alfredchimeflows<filename>Chime Channel Chooser.scpt global fzfMatch on convertListToString(theList, theDelimiter) set AppleScript's text item delimiters to theDelimiter set theString to theList as string set AppleScript's text item delimiters to "" return theString end convertListToString on alfred_script(q) clickChannel(q) end alfred_script on clickChannel(q) --CONFIG:Set path for dependancy cliclick (https://www.bluem.net/en/mac/cliclick/) set cliclickpath to "/usr/local/bin/cliclick" --<--replace null with path of cliclick i.e. "/usr/local/bin/cliclick" if cliclickpath is null then return "ERROR: cliclickpath varriable is not set" end if set channelLocation to getChannel(q) tell application "System Events" tell application "Amazon Chime" to activate tell application process "Amazon Chime" -- From http://macscripter.net/viewtopic.php?pid=170532#p170532 perform action "AXRaise" of (first window whose name contains "Amazon Chime") try tell UI element 1 of row channelLocation of table 1 of scroll area 1 of splitter group 1 of window "Amazon Chime" set {xPosition, yPosition} to position set {xSize, ySize} to size end tell -- modify offsets if hot spot is not centered: --click at {xPosition + (xSize div 10), yPosition + (ySize div 2)} do shell script cliclickpath & " c:" & (xPosition + (xSize div 10)) & "," & (yPosition + (ySize div 2)) end try end tell end tell return fzfMatch end clickChannel on getChannel(q) tell application "System Events" tell application process "Amazon Chime" set allRowNames to get name of first UI element of every row of table 1 of scroll area 1 of splitter group 1 of window "Amazon Chime" set channels to my convertListToString(allRowNames, " ") set fzfMatch to do shell script "echo " & quoted form of channels & "| /usr/local/bin/fzf -f " & quoted form of q & "|head -1" set iterate to 1 repeat with eachRowName in allRowNames log iterate & eachRowName if text of eachRowName is fzfMatch then return iterate end if set iterate to iterate + 1 end repeat end tell end tell end getChannel
grammar/Command.g4
PhoenixIra/count-endtime
0
5773
grammar Command; command : server #CommandServer | moment output #CommandMoment | message #CommandMessage | help #CommandHelp ; help : 'help' ; server : 'locale ' STRING #ServerLocale | 'timezone ' STRING #ServerTimezone | 'format ' QUOTESTRING #ServerFormat | 'delete ' STRING #ServerDeleteMoment ; message : 'message ' QUOTESTRING #MessagePrint | 'title ' QUOTESTRING #MessageTitle ; moment : 'now' #MomentNow | 'load ' STRING #MomentLoad | 'input ' QUOTESTRING (' in ' STRING)? (' as ' QUOTESTRING)? #MomentInput | 'input ' STRING (' in ' STRING)? (' as ' QUOTESTRING)? #MomentInputWoQ ; output : ' to ' STRING output? #OutputTo | ' save ' STRING output? #OutputSave | ' print' (' 'QUOTESTRING)? output? #OutputPrint | ' print in Title' (' 'QUOTESTRING)? output? #OutputPrintTitle ; QUOTESTRING: '"'~('"')*'"'; STRING: [A-Za-z0-9/:.-]+;
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_endt3.asm
prismotizm/gigaleak
0
97955
<filename>other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_endt3.asm Name: zel_endt3.asm Type: file Size: 130398 Last-Modified: '2016-05-13T04:25:37Z' SHA-1: A25954CE556BA457A34708B9172D7A2DE8D45E4E Description: null
unittests/ASM/OpSize/66_F4.asm
cobalt2727/FEX
628
89931
<filename>unittests/ASM/OpSize/66_F4.asm %ifdef CONFIG { "RegData": { "XMM0": ["0x000000000003FFFC", "0x000000000000FFFE"], "XMM1": ["0x000000000003FFFC", "0x000000000000FFFE"] }, "MemoryRegions": { "0x100000000": "4096" } } %endif mov rdx, 0xe0000000 mov rax, 0x414243440000FFFF mov [rdx + 8 * 0], rax mov rax, 0x5152535400007FFF mov [rdx + 8 * 1], rax mov rax, 0x6162636400000004 mov [rdx + 8 * 2], rax mov rax, 0x7172737400000002 mov [rdx + 8 * 3], rax movapd xmm0, [rdx] pmuludq xmm0, [rdx + 8 * 2] movapd xmm1, [rdx] movapd xmm2, [rdx + 8 * 2] pmuludq xmm1, xmm2 hlt
source/image/required/s-widenu.adb
ytomino/drake
33
15845
<filename>source/image/required/s-widenu.adb package body System.Wid_Enum is function Width_Enumeration_8 ( Names : String; Indexes : Address; Lo, Hi : Natural) return Natural is pragma Unreferenced (Names); type Index_Type is mod 2 ** 8; type Index_Array_Type is array (0 .. Hi + 1) of Index_Type; Indexes_All : Index_Array_Type; for Indexes_All'Address use Indexes; Result : Natural := 0; begin for I in Lo .. Hi loop Result := Natural'Max ( Natural (Indexes_All (I + 1) - Indexes_All (I)), Result); end loop; return Result; end Width_Enumeration_8; function Width_Enumeration_16 ( Names : String; Indexes : Address; Lo, Hi : Natural) return Natural is pragma Unreferenced (Names); type Index_Type is mod 2 ** 16; type Index_Array_Type is array (0 .. Hi + 1) of Index_Type; Indexes_All : Index_Array_Type; for Indexes_All'Address use Indexes; Result : Natural := 0; begin for I in Lo .. Hi loop Result := Natural'Max ( Natural (Indexes_All (I + 1) - Indexes_All (I)), Result); end loop; return Result; end Width_Enumeration_16; function Width_Enumeration_32 ( Names : String; Indexes : Address; Lo, Hi : Natural) return Natural is pragma Unreferenced (Names); type Index_Type is mod 2 ** 32; type Index_Array_Type is array (0 .. Hi + 1) of Index_Type; Indexes_All : Index_Array_Type; for Indexes_All'Address use Indexes; Result : Natural := 0; begin for I in Lo .. Hi loop Result := Natural'Max ( Natural (Indexes_All (I + 1) - Indexes_All (I)), Result); end loop; return Result; end Width_Enumeration_32; end System.Wid_Enum;
src/asf-security-servlets.ads
Letractively/ada-asf
0
4562
----------------------------------------------------------------------- -- security-openid-servlets - Servlets for OpenID 2.0 Authentication -- Copyright (C) 2010, 2011, 2012, 2013 <NAME> -- Written by <NAME> (<EMAIL>) -- -- 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 ASF.Servlets; with ASF.Requests; with ASF.Responses; with ASF.Principals; with Security.Auth; use Security; -- The <b>Security.Openid.Servlets</b> package defines two servlets that can be used -- to implement an OpenID 2.0 authentication with an OpenID provider such as Google, -- Yahoo!, Verisign, Orange, ... -- -- The process to use these servlets is the following: -- <ul> -- <li>Declare and register a <b>Request_Auth_Servlet</b> servlet.</li> -- <li>Map that servlet to an authenticate URL. To authenticate, a user will have -- to click on a link mapped to that servlet. To identify the OpenID provider, -- the URL must contain the name of the provider. Example: -- -- http://localhost:8080/app/openid/auth/google -- -- <li>Declare and register a <b>Verify_Auth_Servlet</b> servlet. -- <li>Map that servlet to the verification URL. This is the URL that the user -- will return to when authentication is done by the OpenID provider. Example: -- -- http://localhost:8080/app/openid/verify -- -- <li>Declare in the application properties a set of configurations: -- <ul> -- <li>The <b>openid.realm</b> must indicate the URL that identifies the -- application the end user will trust. Example: -- -- openid.realm=http://localhost:8080/app -- -- <li>The <b>openid.callback_url</b> must indicate the callback URL to -- which the OpenID provider will redirect the user when authentication -- is finished (successfully or not). The callback URL must match -- the realm. -- -- openid.callback_url=http://localhost:8080/app/openid/verify -- -- <li>For each OpenID provider, a URL to the Yadis entry point of the -- OpenID provider is necessary. This URL is used to get the XRDS -- stream giving endoint of the OpenID provider. Example: -- -- openid.provider.google=https://www.google.com/accounts/o8/id -- </ul> -- -- </ul> -- package ASF.Security.Servlets is -- ------------------------------ -- OpenID Servlet -- ------------------------------ -- The <b>Openid_Servlet</b> is the OpenID root servlet for OpenID 2.0 authentication. -- It is defined to provide a common basis for the authentication and verification servlets. type Openid_Servlet is abstract new ASF.Servlets.Servlet and Auth.Parameters with private; -- Called by the servlet container to indicate to a servlet that the servlet -- is being placed into service. overriding procedure Initialize (Server : in out Openid_Servlet; Context : in ASF.Servlets.Servlet_Registry'Class); -- Get a configuration parameter from the servlet context for the security Auth provider. overriding function Get_Parameter (Server : in Openid_Servlet; Name : in String) return String; -- ------------------------------ -- OpenID Request Servlet -- ------------------------------ -- The <b>Request_Auth_Servlet</b> servlet implements the first steps of an OpenID -- authentication. type Request_Auth_Servlet is new Openid_Servlet with private; -- Proceed to the OpenID authentication with an OpenID provider. -- Find the OpenID provider URL and starts the discovery, association phases -- during which a private key is obtained from the OpenID provider. -- After OpenID discovery and association, the user will be redirected to -- the OpenID provider. overriding procedure Do_Get (Server : in Request_Auth_Servlet; Request : in out ASF.Requests.Request'Class; Response : in out ASF.Responses.Response'Class); -- ------------------------------ -- OpenID Verification Servlet -- ------------------------------ -- The <b>Verify_Auth_Servlet</b> verifies the authentication result and -- extract authentication from the callback URL. type Verify_Auth_Servlet is new Openid_Servlet with private; -- Verify the authentication result that was returned by the OpenID provider. -- If the authentication succeeded and the signature was correct, sets a -- user principals on the session. overriding procedure Do_Get (Server : in Verify_Auth_Servlet; Request : in out ASF.Requests.Request'Class; Response : in out ASF.Responses.Response'Class); -- Create a principal object that correspond to the authenticated user identified -- by the <b>Credential</b> information. The principal will be attached to the session -- and will be destroyed when the session is closed. procedure Create_Principal (Server : in Verify_Auth_Servlet; Credential : in Auth.Authentication; Result : out ASF.Principals.Principal_Access); private function Get_Provider_URL (Server : in Request_Auth_Servlet; Request : in ASF.Requests.Request'Class) return String; procedure Initialize (Server : in Openid_Servlet; Provider : in String; Manager : in out Auth.Manager); type Openid_Servlet is new ASF.Servlets.Servlet and Auth.Parameters with null record; type Request_Auth_Servlet is new Openid_Servlet with null record; type Verify_Auth_Servlet is new Openid_Servlet with null record; end ASF.Security.Servlets;
firmware/coreboot/3rdparty/libhwbase/debug/hw-debug.adb
fabiojna02/OpenCellular
1
24734
-- -- Copyright (C) 2015 secunet Security Networks AG -- -- 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 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. -- with HW; with HW.Time; with HW.Debug_Sink; use type HW.Word64; use type HW.Int64; package body HW.Debug with SPARK_Mode => Off is Start_Of_Line : Boolean := True; Register_Write_Delay_Nanoseconds : Word64 := 0; type Base_Range is new Positive range 2 .. 16; type Width_Range is new Natural range 0 .. 64; procedure Put_By_Base (Item : Word64; Min_Width : Width_Range; Base : Base_Range); procedure Do_Put_Int64 (Item : Int64); ---------------------------------------------------------------------------- procedure Put_Time is Now_US : Int64; begin if Start_Of_Line then Start_Of_Line := False; Now_US := Time.Now_US; Debug_Sink.Put_Char ('['); Do_Put_Int64 ((Now_US / 1_000_000) mod 1_000_000); Debug_Sink.Put_Char ('.'); Put_By_Base (Word64 (Now_US mod 1_000_000), 6, 10); Debug_Sink.Put ("] "); end if; end Put_Time; ---------------------------------------------------------------------------- procedure Put (Item : String) is begin Put_Time; HW.Debug_Sink.Put (Item); end Put; procedure Put_Line (Item : String) is begin Put (Item); New_Line; end Put_Line; procedure New_Line is begin HW.Debug_Sink.New_Line; Start_Of_Line := True; end New_Line; ---------------------------------------------------------------------------- procedure Put_By_Base (Item : Word64; Min_Width : Width_Range; Base : Base_Range) is Temp : Word64 := Item; subtype Chars_Range is Width_Range range 0 .. 63; Index : Width_Range := 0; type Chars_Array is array (Chars_Range) of Character; Chars : Chars_Array := (others => '0'); Digit : Natural; begin while Temp > 0 loop Digit := Natural (Temp rem Word64 (Base)); if Digit < 10 then Chars (Index) := Character'Val (Character'Pos ('0') + Digit); else Chars (Index) := Character'Val (Character'Pos ('a') + Digit - 10); end if; Temp := Temp / Word64 (Base); Index := Index + 1; end loop; if Index < Min_Width then Index := Min_Width; end if; for I in reverse Width_Range range 0 .. Index - 1 loop HW.Debug_Sink.Put_Char (Chars (I)); end loop; end Put_By_Base; ---------------------------------------------------------------------------- procedure Put_Word (Item : Word64; Min_Width : Width_Range; Print_Ox : Boolean := True) is begin Put_Time; if Print_Ox then Put ("0x"); end if; Put_By_Base (Item, Min_Width, 16); end Put_Word; procedure Put_Word8 (Item : Word8) is begin Put_Word (Word64 (Item), 2); end Put_Word8; procedure Put_Word16 (Item : Word16) is begin Put_Word (Word64 (Item), 4); end Put_Word16; procedure Put_Word32 (Item : Word32) is begin Put_Word (Word64 (Item), 8); end Put_Word32; procedure Put_Word64 (Item : Word64) is begin Put_Word (Item, 16); end Put_Word64; ---------------------------------------------------------------------------- procedure Do_Put_Int64 (Item : Int64) is Temp : Word64; begin if Item < 0 then Debug_Sink.Put_Char ('-'); Temp := Word64 (-Item); else Temp := Word64 (Item); end if; Put_By_Base (Temp, 1, 10); end Do_Put_Int64; procedure Put_Int64 (Item : Int64) is begin Put_Time; Do_Put_Int64 (Item); end Put_Int64; procedure Put_Int8 (Item : Int8) is begin Put_Int64 (Int64 (Item)); end Put_Int8; procedure Put_Int16 (Item : Int16) is begin Put_Int64 (Int64 (Item)); end Put_Int16; procedure Put_Int32 (Item : Int32) is begin Put_Int64 (Int64 (Item)); end Put_Int32; ---------------------------------------------------------------------------- procedure Put_Reg8 (Name : String; Item : Word8) is begin Put (Name); Put (": "); Put_Word8 (Item); New_Line; end Put_Reg8; procedure Put_Reg16 (Name : String; Item : Word16) is begin Put (Name); Put (": "); Put_Word16 (Item); New_Line; end Put_Reg16; procedure Put_Reg32 (Name : String; Item : Word32) is begin Put (Name); Put (": "); Put_Word32 (Item); New_Line; end Put_Reg32; procedure Put_Reg64 (Name : String; Item : Word64) is begin Put (Name); Put (": "); Put_Word64 (Item); New_Line; end Put_Reg64; ---------------------------------------------------------------------------- procedure Put_Buffer (Name : String; Buf : Buffer; Len : Buffer_Range) is Line_Start, Left : Natural; begin if Len = 0 then if Name'Length > 0 then Put (Name); Put_Line ("+0x00:"); end if; else Line_Start := 0; Left := Len - 1; for I in Natural range 1 .. ((Len + 15) / 16) loop if Name'Length > 0 then Put (Name); Debug_Sink.Put_Char ('+'); Put_Word16 (Word16 (Line_Start)); Put (": "); end if; for J in Natural range 0 .. Natural'Min (7, Left) loop Put_Word (Word64 (Buf (Line_Start + J)), 2, False); Debug_Sink.Put_Char (' '); end loop; Debug_Sink.Put_Char (' '); for J in Natural range 8 .. Natural'Min (15, Left) loop Put_Word (Word64(Buf (Line_Start + J)), 2, False); Debug_Sink.Put_Char (' '); end loop; New_Line; Line_Start := Line_Start + 16; Left := Left - Natural'Min (Left, 16); end loop; end if; end Put_Buffer; ---------------------------------------------------------------------------- procedure Set_Register_Write_Delay (Value : Word64) is begin Register_Write_Delay_Nanoseconds := Value; end Set_Register_Write_Delay; ---------------------------------------------------------------------------- Procedure Register_Write_Wait is begin if Register_Write_Delay_Nanoseconds > 0 then Time.U_Delay (Natural ((Register_Write_Delay_Nanoseconds + 999) / 1000)); end if; end Register_Write_Wait; end HW.Debug; -- vim: set ts=8 sts=3 sw=3 et:
audio/sfx/cry1b_2.asm
AmateurPanda92/pokemon-rby-dx
9
103151
SFX_Cry1B_2_Ch4: dutycycle 240 squarenote 6, 15, 7, 1728 squarenote 15, 14, 7, 1792 squarenote 4, 15, 4, 1776 squarenote 4, 14, 4, 1760 squarenote 8, 13, 1, 1744 endchannel SFX_Cry1B_2_Ch5: dutycycle 10 squarenote 7, 14, 6, 1665 squarenote 14, 13, 5, 1729 squarenote 4, 12, 4, 1713 squarenote 4, 13, 4, 1697 squarenote 8, 12, 1, 1681 endchannel SFX_Cry1B_2_Ch7: noisenote 10, 10, 6, 60 noisenote 14, 9, 4, 44 noisenote 5, 10, 3, 60 noisenote 8, 9, 1, 44 endchannel
assembly/08/lcm.asm
mahzoun/programs
0
85276
section .data num1 dw 75 num2 dw 5 section .text global _start _start: mov ax, [num1] mov bx, [num2] gcd: cmp bx, 0 je exit xor dx, dx div bx cmp dx, 0 je lcm mov ax, bx mov bx, dx jmp gcd lcm: mov r8, rbx mov ax, [num1] mov bx, [num2] mul bx xor dx, dx div r8w jmp exit exit: mov ebx, 0 mov eax, 1 int 80h
libsrc/_DEVELOPMENT/stdlib/c/sdcc_iy/quick_exit_fastcall.asm
meesokim/z88dk
0
241649
<filename>libsrc/_DEVELOPMENT/stdlib/c/sdcc_iy/quick_exit_fastcall.asm ; _Noreturn void quick_exit_fastcall(int status) SECTION code_stdlib PUBLIC _quick_exit_fastcall EXTERN asm_quick_exit defc _quick_exit_fastcall = asm_quick_exit
Src/Q11.asm
OferMon/MIPS-Assembly-Exercises
0
3878
.data 0x10020000 array: .space 80 # 20 words .text li $a0, 0x10020000 jal init_array li $a0, 0x10020000 jal find_amount_bigger_than_zero_word_in_array add $a0, $v0, $zero # amount of words bigger than 0 in array li $v0, 1 # print integer syscall b end #------------------------# init_array: add $t2, $a0, $zero li $t3, 0 _init_array_loop_start: li $v0, 42 li $a0, 0 li $a1, 101 syscall subi $a0, $a0, 50 sw $a0, ($t2) addi $t2, $t2, 4 addi $t3, $t3, 1 bne $t3, 20, _init_array_loop_start subi $t2, $t2, 80 jr $ra #------------------------# find_amount_bigger_than_zero_word_in_array: add $t0, $a0, $zero # address of array li $t1, 0 # start from index 0 li $t4, 0 _find_amount_bigger_than_zero_word_in_array_loop_start: lw $t3, ($t0) blt $t3, 0, _skip_if_bigger_than_zero add $t4, $t4, 1 _skip_if_bigger_than_zero: addi $t0, $t0, 4 addi $t1, $t1, 1 bne $t1, 20, _find_amount_bigger_than_zero_word_in_array_loop_start add $v0, $t4, $zero jr $ra #------------------------# end:
tools-src/gnu/gcc/gcc/ada/s-tasren.adb
enfoTek/tomato.linksys.e2000.nvram-mod
80
15693
<filename>tools-src/gnu/gcc/gcc/ada/s-tasren.adb<gh_stars>10-100 ------------------------------------------------------------------------------ -- -- -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . T A S K I N G . R E N D E Z V O U S -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1991-2001, Florida State University -- -- -- -- GNARL 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 2, or (at your option) any later ver- -- -- sion. GNARL 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. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNARL; see file COPYING. If not, write -- -- to the Free Software Foundation, 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. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. It is -- -- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- -- State University (http://www.gnat.com). -- -- -- ------------------------------------------------------------------------------ with Ada.Exceptions; -- Used for Exception_ID -- Null_Id -- Save_Occurrence -- Raise_Exception with System.Task_Primitives.Operations; -- used for Get_Priority -- Set_Priority -- Write_Lock -- Unlock -- Sleep -- Wakeup -- Timed_Sleep with System.Tasking.Entry_Calls; -- Used for Wait_For_Completion -- Wait_For_Completion_With_Timeout -- Wait_Until_Abortable with System.Tasking.Initialization; -- used for Defer_Abort -- Undefer_Abort -- Poll_Base_Priority_Change with System.Tasking.Queuing; -- used for Enqueue -- Dequeue_Head -- Select_Task_Entry_Call -- Count_Waiting with System.Tasking.Utilities; -- used for Check_Exception -- Make_Passive -- Wakeup_Entry_Caller with System.Tasking.Protected_Objects.Operations; -- used for PO_Do_Or_Queue -- PO_Service_Entries -- Lock_Entries -- Unlock_Entries with System.Tasking.Debug; -- used for Trace package body System.Tasking.Rendezvous is package STPO renames System.Task_Primitives.Operations; package POO renames System.Tasking.Protected_Objects.Operations; package POE renames System.Tasking.Protected_Objects.Entries; use System.Task_Primitives; use System.Task_Primitives.Operations; type Select_Treatment is ( Accept_Alternative_Selected, -- alternative with non-null body Accept_Alternative_Completed, -- alternative with null body Else_Selected, Terminate_Selected, Accept_Alternative_Open, No_Alternative_Open); Default_Treatment : constant array (Select_Modes) of Select_Treatment := (Simple_Mode => No_Alternative_Open, Else_Mode => Else_Selected, Terminate_Mode => Terminate_Selected, Delay_Mode => No_Alternative_Open); New_State : constant array (Boolean, Entry_Call_State) of Entry_Call_State := (True => (Never_Abortable => Never_Abortable, Not_Yet_Abortable => Now_Abortable, Was_Abortable => Now_Abortable, Now_Abortable => Now_Abortable, Done => Done, Cancelled => Cancelled), False => (Never_Abortable => Never_Abortable, Not_Yet_Abortable => Not_Yet_Abortable, Was_Abortable => Was_Abortable, Now_Abortable => Now_Abortable, Done => Done, Cancelled => Cancelled) ); ----------------------- -- Local Subprograms -- ----------------------- procedure Local_Defer_Abort (Self_Id : Task_ID) renames System.Tasking.Initialization.Defer_Abort_Nestable; procedure Local_Undefer_Abort (Self_Id : Task_ID) renames System.Tasking.Initialization.Undefer_Abort_Nestable; -- Florist defers abort around critical sections that -- make entry calls to the Interrupt_Manager task, which -- violates the general rule about top-level runtime system -- calls from abort-deferred regions. It is not that this is -- unsafe, but when it occurs in "normal" programs it usually -- means either the user is trying to do a potentially blocking -- operation from within a protected object, or there is a -- runtime system/compiler error that has failed to undefer -- an earlier abort deferral. Thus, for debugging it may be -- wise to modify the above renamings to the non-nestable forms. procedure Boost_Priority (Call : Entry_Call_Link; Acceptor : Task_ID); pragma Inline (Boost_Priority); -- Call this only with abort deferred and holding lock of Acceptor. procedure Call_Synchronous (Acceptor : Task_ID; E : Task_Entry_Index; Uninterpreted_Data : System.Address; Mode : Call_Modes; Rendezvous_Successful : out Boolean); pragma Inline (Call_Synchronous); -- This call is used to make a simple or conditional entry call. procedure Setup_For_Rendezvous_With_Body (Entry_Call : Entry_Call_Link; Acceptor : Task_ID); pragma Inline (Setup_For_Rendezvous_With_Body); -- Call this only with abort deferred and holding lock of Acceptor. -- When a rendezvous selected (ready for rendezvous) we need to save -- privious caller and adjust the priority. Also we need to make -- this call not Abortable (Cancellable) since the rendezvous has -- already been started. function Is_Entry_Open (T : Task_ID; E : Task_Entry_Index) return Boolean; pragma Inline (Is_Entry_Open); -- Call this only with abort deferred and holding lock of T. procedure Wait_For_Call (Self_Id : Task_ID); pragma Inline (Wait_For_Call); -- Call this only with abort deferred and holding lock of Self_Id. -- An accepting task goes into Sleep by calling this routine -- waiting for a call from the caller or waiting for an abortion. -- Make sure Self_Id is locked before calling this routine. ----------------- -- Accept_Call -- ----------------- -- Compiler interface only. Do not call from within the RTS. -- source: -- accept E do ...A... end E; -- expansion: -- A27b : address; -- L26b : label -- begin -- accept_call (1, A27b); -- ...A... -- complete_rendezvous; -- <<L26b>> -- exception -- when all others => -- exceptional_complete_rendezvous (get_gnat_exception); -- end; -- The handler for Abort_Signal (*all* others) is to handle the case when -- the acceptor is aborted between Accept_Call and the corresponding -- Complete_Rendezvous call. We need to wake up the caller in this case. -- See also Selective_Wait procedure Accept_Call (E : Task_Entry_Index; Uninterpreted_Data : out System.Address) is Self_Id : constant Task_ID := STPO.Self; Caller : Task_ID := null; Open_Accepts : aliased Accept_List (1 .. 1); Entry_Call : Entry_Call_Link; begin Initialization.Defer_Abort (Self_Id); STPO.Write_Lock (Self_Id); if not Self_Id.Callable then pragma Assert (Self_Id.Pending_ATC_Level = 0); pragma Assert (Self_Id.Pending_Action); STPO.Unlock (Self_Id); Initialization.Undefer_Abort (Self_Id); -- Should never get here ??? pragma Assert (False); raise Standard'Abort_Signal; end if; -- If someone completed this task, this task should not try to -- access its pending entry calls or queues in this case, as they -- are being emptied. Wait for abortion to kill us. -- ????? -- Recheck the correctness of the above, now that we have made -- changes. The logic above seems to be based on the assumption -- that one task can safely clean up another's in-service accepts. -- ????? -- Why do we need to block here in this case? -- Why not just return and let Undefer_Abort do its work? Queuing.Dequeue_Head (Self_Id.Entry_Queues (E), Entry_Call); if Entry_Call /= null then Caller := Entry_Call.Self; Setup_For_Rendezvous_With_Body (Entry_Call, Self_Id); Uninterpreted_Data := Entry_Call.Uninterpreted_Data; else -- Wait for a caller Open_Accepts (1).Null_Body := False; Open_Accepts (1).S := E; Self_Id.Open_Accepts := Open_Accepts'Unrestricted_Access; -- Wait for normal call pragma Debug (Debug.Trace (Self_Id, "Accept_Call: wait", 'R')); Wait_For_Call (Self_Id); pragma Assert (Self_Id.Open_Accepts = null); if Self_Id.Pending_ATC_Level >= Self_Id.ATC_Nesting_Level then Caller := Self_Id.Common.Call.Self; Uninterpreted_Data := Caller.Entry_Calls (Caller.ATC_Nesting_Level).Uninterpreted_Data; end if; -- If this task has been aborted, skip the Uninterpreted_Data load -- (Caller will not be reliable) and fall through to -- Undefer_Abort which will allow the task to be killed. -- ????? -- Perhaps we could do the code anyway, if it has no harm, in order -- to get better performance for the normal case. end if; -- Self_Id.Common.Call should already be updated by the Caller -- On return, we will start the rendezvous. STPO.Unlock (Self_Id); Initialization.Undefer_Abort (Self_Id); end Accept_Call; -------------------- -- Accept_Trivial -- -------------------- -- Compiler interface only. Do not call from within the RTS. -- This should only be called when there is no accept body, -- or the except body is empty. -- source: -- accept E; -- expansion: -- accept_trivial (1); -- The compiler is also able to recognize the following and -- translate it the same way. -- accept E do null; end E; procedure Accept_Trivial (E : Task_Entry_Index) is Self_Id : constant Task_ID := STPO.Self; Caller : Task_ID := null; Open_Accepts : aliased Accept_List (1 .. 1); Entry_Call : Entry_Call_Link; begin Initialization.Defer_Abort_Nestable (Self_Id); STPO.Write_Lock (Self_Id); if not Self_Id.Callable then pragma Assert (Self_Id.Pending_ATC_Level = 0); pragma Assert (Self_Id.Pending_Action); STPO.Unlock (Self_Id); Initialization.Undefer_Abort_Nestable (Self_Id); -- Should never get here ??? pragma Assert (False); raise Standard'Abort_Signal; end if; -- If someone completed this task, this task should not try to -- access its pending entry calls or queues in this case, as they -- are being emptied. Wait for abortion to kill us. -- ????? -- Recheck the correctness of the above, now that we have made -- changes. Queuing.Dequeue_Head (Self_Id.Entry_Queues (E), Entry_Call); if Entry_Call = null then -- Need to wait for entry call Open_Accepts (1).Null_Body := True; Open_Accepts (1).S := E; Self_Id.Open_Accepts := Open_Accepts'Unrestricted_Access; pragma Debug (Debug.Trace (Self_Id, "Accept_Trivial: wait", 'R')); Wait_For_Call (Self_Id); pragma Assert (Self_Id.Open_Accepts = null); -- No need to do anything special here for pending abort. -- Abort_Signal will be raised by Undefer on exit. STPO.Unlock (Self_Id); else -- found caller already waiting pragma Assert (Entry_Call.State < Done); STPO.Unlock (Self_Id); Caller := Entry_Call.Self; STPO.Write_Lock (Caller); Initialization.Wakeup_Entry_Caller (Self_Id, Entry_Call, Done); STPO.Unlock (Caller); end if; Initialization.Undefer_Abort_Nestable (Self_Id); end Accept_Trivial; -------------------- -- Boost_Priority -- -------------------- -- Call this only with abort deferred and holding lock of Acceptor. procedure Boost_Priority (Call : Entry_Call_Link; Acceptor : Task_ID) is Caller : Task_ID := Call.Self; Caller_Prio : System.Any_Priority := Get_Priority (Caller); Acceptor_Prio : System.Any_Priority := Get_Priority (Acceptor); begin if Caller_Prio > Acceptor_Prio then Call.Acceptor_Prev_Priority := Acceptor_Prio; Set_Priority (Acceptor, Caller_Prio); else Call.Acceptor_Prev_Priority := Priority_Not_Boosted; end if; end Boost_Priority; ----------------- -- Call_Simple -- ----------------- -- Compiler interface only. Do not call from within the RTS. procedure Call_Simple (Acceptor : Task_ID; E : Task_Entry_Index; Uninterpreted_Data : System.Address) is Rendezvous_Successful : Boolean; begin Call_Synchronous (Acceptor, E, Uninterpreted_Data, Simple_Call, Rendezvous_Successful); end Call_Simple; ---------------------- -- Call_Synchronous -- ---------------------- -- Compiler interface. -- Also called from inside Call_Simple and Task_Entry_Call. procedure Call_Synchronous (Acceptor : Task_ID; E : Task_Entry_Index; Uninterpreted_Data : System.Address; Mode : Call_Modes; Rendezvous_Successful : out Boolean) is Self_Id : constant Task_ID := STPO.Self; Level : ATC_Level; Entry_Call : Entry_Call_Link; begin pragma Assert (Mode /= Asynchronous_Call); Local_Defer_Abort (Self_Id); Self_Id.ATC_Nesting_Level := Self_Id.ATC_Nesting_Level + 1; pragma Debug (Debug.Trace (Self_Id, "CS: entered ATC level: " & ATC_Level'Image (Self_Id.ATC_Nesting_Level), 'A')); Level := Self_Id.ATC_Nesting_Level; Entry_Call := Self_Id.Entry_Calls (Level)'Access; Entry_Call.Next := null; Entry_Call.Mode := Mode; Entry_Call.Cancellation_Attempted := False; -- If this is a call made inside of an abort deferred region, -- the call should be never abortable. if Self_Id.Deferral_Level > 1 then Entry_Call.State := Never_Abortable; else Entry_Call.State := Now_Abortable; end if; Entry_Call.E := Entry_Index (E); Entry_Call.Prio := Get_Priority (Self_Id); Entry_Call.Uninterpreted_Data := Uninterpreted_Data; Entry_Call.Called_Task := Acceptor; Entry_Call.Exception_To_Raise := Ada.Exceptions.Null_Id; -- Note: the caller will undefer abortion on return (see WARNING above) if not Task_Do_Or_Queue (Self_Id, Entry_Call, With_Abort => True) then Self_Id.ATC_Nesting_Level := Self_Id.ATC_Nesting_Level - 1; Initialization.Undefer_Abort (Self_Id); pragma Debug (Debug.Trace (Self_Id, "CS: exited to ATC level: " & ATC_Level'Image (Self_Id.ATC_Nesting_Level), 'A')); raise Tasking_Error; end if; STPO.Write_Lock (Self_Id); pragma Debug (Debug.Trace (Self_Id, "Call_Synchronous: wait", 'R')); Entry_Calls.Wait_For_Completion (Self_Id, Entry_Call); pragma Debug (Debug.Trace (Self_Id, "Call_Synchronous: done waiting", 'R')); Rendezvous_Successful := Entry_Call.State = Done; STPO.Unlock (Self_Id); Local_Undefer_Abort (Self_Id); Entry_Calls.Check_Exception (Self_Id, Entry_Call); end Call_Synchronous; -------------- -- Callable -- -------------- -- Compiler interface. -- Do not call from within the RTS, -- except for body of Ada.Task_Identification. function Callable (T : Task_ID) return Boolean is Result : Boolean; Self_Id : constant Task_ID := STPO.Self; begin Initialization.Defer_Abort (Self_Id); STPO.Write_Lock (T); Result := T.Callable; STPO.Unlock (T); Initialization.Undefer_Abort (Self_Id); return Result; end Callable; ---------------------------- -- Cancel_Task_Entry_Call -- ---------------------------- -- Compiler interface only. Do not call from within the RTS. -- Call only with abort deferred. procedure Cancel_Task_Entry_Call (Cancelled : out Boolean) is begin Entry_Calls.Try_To_Cancel_Entry_Call (Cancelled); end Cancel_Task_Entry_Call; ------------------------- -- Complete_Rendezvous -- ------------------------- -- See comments for Exceptional_Complete_Rendezvous. procedure Complete_Rendezvous is begin Exceptional_Complete_Rendezvous (Ada.Exceptions.Null_Id); end Complete_Rendezvous; ------------------------------------- -- Exceptional_Complete_Rendezvous -- ------------------------------------- -- Compiler interface. -- Also called from Complete_Rendezvous. -- ????? -- Consider phasing out Complete_Rendezvous in favor -- of direct call to this with Ada.Exceptions.Null_ID. -- See code expansion examples for Accept_Call and Selective_Wait. -- ????? -- If we don't change the interface, consider instead -- putting an explicit re-raise after this call, in -- the generated code. That way we could eliminate the -- code here that reraises the exception. -- The deferral level is critical here, -- since we want to raise an exception or allow abort to take -- place, if there is an exception or abort pending. procedure Exceptional_Complete_Rendezvous (Ex : Ada.Exceptions.Exception_Id) is Self_Id : constant Task_ID := STPO.Self; Entry_Call : Entry_Call_Link := Self_Id.Common.Call; Caller : Task_ID; Called_PO : STPE.Protection_Entries_Access; Exception_To_Raise : Ada.Exceptions.Exception_Id := Ex; Ceiling_Violation : Boolean; use type Ada.Exceptions.Exception_Id; procedure Internal_Reraise; pragma Import (C, Internal_Reraise, "__gnat_reraise"); use type STPE.Protection_Entries_Access; begin pragma Debug (Debug.Trace (Self_Id, "Exceptional_Complete_Rendezvous", 'R')); if Ex = Ada.Exceptions.Null_Id then -- The call came from normal end-of-rendezvous, -- so abort is not yet deferred. Initialization.Defer_Abort_Nestable (Self_Id); end if; -- We need to clean up any accepts which Self may have -- been serving when it was aborted. if Ex = Standard'Abort_Signal'Identity then while Entry_Call /= null loop Entry_Call.Exception_To_Raise := Tasking_Error'Identity; -- All forms of accept make sure that the acceptor is not -- completed, before accepting further calls, so that we -- can be sure that no further calls are made after the -- current calls are purged. Caller := Entry_Call.Self; -- Take write lock. This follows the lock precedence rule that -- Caller may be locked while holding lock of Acceptor. -- Complete the call abnormally, with exception. STPO.Write_Lock (Caller); Initialization.Wakeup_Entry_Caller (Self_Id, Entry_Call, Done); STPO.Unlock (Caller); Entry_Call := Entry_Call.Acceptor_Prev_Call; end loop; else Caller := Entry_Call.Self; if Entry_Call.Needs_Requeue then -- We dare not lock Self_Id at the same time as Caller, -- for fear of deadlock. Entry_Call.Needs_Requeue := False; Self_Id.Common.Call := Entry_Call.Acceptor_Prev_Call; if Entry_Call.Called_Task /= null then -- Requeue to another task entry if not Task_Do_Or_Queue (Self_Id, Entry_Call, Entry_Call.Requeue_With_Abort) then Initialization.Undefer_Abort (Self_Id); raise Tasking_Error; end if; else -- Requeue to a protected entry Called_PO := POE.To_Protection (Entry_Call.Called_PO); STPE.Lock_Entries (Called_PO, Ceiling_Violation); if Ceiling_Violation then pragma Assert (Ex = Ada.Exceptions.Null_Id); Exception_To_Raise := Program_Error'Identity; Entry_Call.Exception_To_Raise := Exception_To_Raise; STPO.Write_Lock (Caller); Initialization.Wakeup_Entry_Caller (Self_Id, Entry_Call, Done); STPO.Unlock (Caller); else POO.PO_Do_Or_Queue (Self_Id, Called_PO, Entry_Call, Entry_Call.Requeue_With_Abort); POO.PO_Service_Entries (Self_Id, Called_PO); STPE.Unlock_Entries (Called_PO); end if; end if; Entry_Calls.Reset_Priority (Entry_Call.Acceptor_Prev_Priority, Self_Id); else -- The call does not need to be requeued. Self_Id.Common.Call := Entry_Call.Acceptor_Prev_Call; Entry_Call.Exception_To_Raise := Ex; STPO.Write_Lock (Caller); -- Done with Caller locked to make sure that Wakeup is not lost. if Ex /= Ada.Exceptions.Null_Id then Ada.Exceptions.Save_Occurrence (Caller.Common.Compiler_Data.Current_Excep, Self_Id.Common.Compiler_Data.Current_Excep); end if; Initialization.Wakeup_Entry_Caller (Self_Id, Entry_Call, Done); STPO.Unlock (Caller); Entry_Calls.Reset_Priority (Entry_Call.Acceptor_Prev_Priority, Self_Id); end if; end if; Initialization.Undefer_Abort (Self_Id); if Exception_To_Raise /= Ada.Exceptions.Null_Id then Internal_Reraise; end if; -- ????? -- Do we need to -- give precedence to Program_Error that might be raised -- due to failure of finalization, over Tasking_Error from -- failure of requeue? end Exceptional_Complete_Rendezvous; ------------------- -- Is_Entry_Open -- ------------------- -- Call this only with abort deferred and holding lock of T. function Is_Entry_Open (T : Task_ID; E : Task_Entry_Index) return Boolean is begin pragma Assert (T.Open_Accepts /= null); if T.Open_Accepts /= null then for J in T.Open_Accepts'Range loop pragma Assert (J > 0); if E = T.Open_Accepts (J).S then return True; end if; end loop; end if; return False; end Is_Entry_Open; ------------------------------------- -- Requeue_Protected_To_Task_Entry -- ------------------------------------- -- Compiler interface only. Do not call from within the RTS. -- entry e2 when b is -- begin -- b := false; -- ...A... -- requeue t.e2; -- end e2; -- procedure rPT__E14b (O : address; P : address; E : -- protected_entry_index) is -- type rTVP is access rTV; -- freeze rTVP [] -- _object : rTVP := rTVP!(O); -- begin -- declare -- rR : protection renames _object._object; -- vP : integer renames _object.v; -- bP : boolean renames _object.b; -- begin -- b := false; -- ...A... -- requeue_protected_to_task_entry (rR'unchecked_access, tTV!(t). -- _task_id, 2, false); -- return; -- end; -- complete_entry_body (_object._object'unchecked_access, objectF => -- 0); -- return; -- exception -- when others => -- abort_undefer.all; -- exceptional_complete_entry_body (_object._object' -- unchecked_access, current_exception, objectF => 0); -- return; -- end rPT__E14b; procedure Requeue_Protected_To_Task_Entry (Object : STPE.Protection_Entries_Access; Acceptor : Task_ID; E : Task_Entry_Index; With_Abort : Boolean) is Entry_Call : constant Entry_Call_Link := Object.Call_In_Progress; begin pragma Assert (STPO.Self.Deferral_Level > 0); Entry_Call.E := Entry_Index (E); Entry_Call.Called_Task := Acceptor; Entry_Call.Called_PO := Null_Address; Entry_Call.Requeue_With_Abort := With_Abort; Object.Call_In_Progress := null; end Requeue_Protected_To_Task_Entry; ------------------------ -- Requeue_Task_Entry -- ------------------------ -- Compiler interface only. Do not call from within the RTS. -- The code generation for task entry requeues is different from that -- for protected entry requeues. There is a "goto" that skips around -- the call to Complete_Rendezous, so that Requeue_Task_Entry must also -- do the work of Complete_Rendezvous. The difference is that it does -- not report that the call's State = Done. -- accept e1 do -- ...A... -- requeue e2; -- ...B... -- end e1; -- A62b : address; -- L61b : label -- begin -- accept_call (1, A62b); -- ...A... -- requeue_task_entry (tTV!(t)._task_id, 2, false); -- goto L61b; -- ...B... -- complete_rendezvous; -- <<L61b>> -- exception -- when others => -- exceptional_complete_rendezvous (current_exception); -- end; procedure Requeue_Task_Entry (Acceptor : Task_ID; E : Task_Entry_Index; With_Abort : Boolean) is Self_Id : constant Task_ID := STPO.Self; Entry_Call : constant Entry_Call_Link := Self_Id.Common.Call; begin Initialization.Defer_Abort (Self_Id); Entry_Call.Needs_Requeue := True; Entry_Call.Requeue_With_Abort := With_Abort; Entry_Call.E := Entry_Index (E); Entry_Call.Called_Task := Acceptor; Initialization.Undefer_Abort (Self_Id); end Requeue_Task_Entry; -------------------- -- Selective_Wait -- -------------------- -- Compiler interface only. Do not call from within the RTS. -- See comments on Accept_Call. -- source code: -- select accept e1 do -- ...A... -- end e1; -- ...B... -- or accept e2; -- ...C... -- end select; -- expansion: -- A32b : address; -- declare -- null; -- if accept_alternative'size * 2 >= 16#8000_0000# then -- raise storage_error; -- end if; -- A37b : T36b; -- A37b (1) := (null_body => false, s => 1); -- A37b (2) := (null_body => true, s => 2); -- if accept_alternative'size * 2 >= 16#8000_0000# then -- raise storage_error; -- end if; -- S0 : aliased T36b := accept_list'A37b; -- J1 : select_index := 0; -- L3 : label -- L1 : label -- L2 : label -- procedure e1A is -- begin -- abort_undefer.all; -- L31b : label -- ...A... -- <<L31b>> -- complete_rendezvous; -- exception -- when all others => -- exceptional_complete_rendezvous (get_gnat_exception); -- end e1A; -- begin -- selective_wait (S0'unchecked_access, simple_mode, A32b, J1); -- case J1 is -- when 0 => -- goto L3; -- when 1 => -- e1A; -- goto L1; -- when 2 => -- goto L2; -- when others => -- goto L3; -- end case; -- <<L1>> -- ...B... -- goto L3; -- <<L2>> -- ...C... -- goto L3; -- <<L3>> -- end; procedure Selective_Wait (Open_Accepts : Accept_List_Access; Select_Mode : Select_Modes; Uninterpreted_Data : out System.Address; Index : out Select_Index) is Self_Id : constant Task_ID := STPO.Self; Entry_Call : Entry_Call_Link; Treatment : Select_Treatment; Caller : Task_ID; Selection : Select_Index; Open_Alternative : Boolean; begin Initialization.Defer_Abort (Self_Id); STPO.Write_Lock (Self_Id); if not Self_Id.Callable then pragma Assert (Self_Id.Pending_ATC_Level = 0); pragma Assert (Self_Id.Pending_Action); STPO.Unlock (Self_Id); -- ??? In some cases abort is deferred more than once. Need to figure -- out why. Self_Id.Deferral_Level := 1; Initialization.Undefer_Abort (Self_Id); -- Should never get here ??? pragma Assert (False); raise Standard'Abort_Signal; end if; -- If someone completed this task, this task should not try to -- access its pending entry calls or queues in this case, as they -- are being emptied. Wait for abortion to kill us. -- ????? -- Recheck the correctness of the above, now that we have made -- changes. pragma Assert (Open_Accepts /= null); Queuing.Select_Task_Entry_Call (Self_Id, Open_Accepts, Entry_Call, Selection, Open_Alternative); -- Determine the kind and disposition of the select. Treatment := Default_Treatment (Select_Mode); Self_Id.Chosen_Index := No_Rendezvous; if Open_Alternative then if Entry_Call /= null then if Open_Accepts (Selection).Null_Body then Treatment := Accept_Alternative_Completed; else Setup_For_Rendezvous_With_Body (Entry_Call, Self_Id); Treatment := Accept_Alternative_Selected; end if; Self_Id.Chosen_Index := Selection; elsif Treatment = No_Alternative_Open then Treatment := Accept_Alternative_Open; end if; end if; -- ?????? -- Recheck the logic above against the ARM. -- Handle the select according to the disposition selected above. case Treatment is when Accept_Alternative_Selected => -- Ready to rendezvous Uninterpreted_Data := Self_Id.Common.Call.Uninterpreted_Data; -- In this case the accept body is not Null_Body. Defer abortion -- until it gets into the accept body. pragma Assert (Self_Id.Deferral_Level = 1); Initialization.Defer_Abort_Nestable (Self_Id); STPO.Unlock (Self_Id); when Accept_Alternative_Completed => -- Accept body is null, so rendezvous is over immediately. STPO.Unlock (Self_Id); Caller := Entry_Call.Self; STPO.Write_Lock (Caller); Initialization.Wakeup_Entry_Caller (Self_Id, Entry_Call, Done); STPO.Unlock (Caller); when Accept_Alternative_Open => -- Wait for caller. Self_Id.Open_Accepts := Open_Accepts; pragma Debug (Debug.Trace (Self_Id, "Selective_Wait: wait", 'R')); Wait_For_Call (Self_Id); pragma Assert (Self_Id.Open_Accepts = null); -- Self_Id.Common.Call should already be updated by the Caller if -- not aborted. It might also be ready to do rendezvous even if -- this wakes up due to an abortion. -- Therefore, if the call is not empty we need to do the rendezvous -- if the accept body is not Null_Body. -- ????? -- aren't the first two conditions below redundant? if Self_Id.Chosen_Index /= No_Rendezvous and then Self_Id.Common.Call /= null and then not Open_Accepts (Self_Id.Chosen_Index).Null_Body then Uninterpreted_Data := Self_Id.Common.Call.Uninterpreted_Data; pragma Assert (Self_Id.Deferral_Level = 1); Initialization.Defer_Abort_Nestable (Self_Id); -- Leave abort deferred until the accept body end if; STPO.Unlock (Self_Id); when Else_Selected => pragma Assert (Self_Id.Open_Accepts = null); STPO.Unlock (Self_Id); when Terminate_Selected => -- Terminate alternative is open Self_Id.Open_Accepts := Open_Accepts; Self_Id.Common.State := Acceptor_Sleep; STPO.Unlock (Self_Id); -- ????? -- We need to check if a signal is pending on an open interrupt -- entry. Otherwise this task would become potentially terminatable -- and, if none of the siblings are active -- any more, the task could not wake up any more, even though a -- signal might be pending on an open interrupt entry. -- ------------- -- This comment paragraph does not make sense. Is it obsolete? -- There was no code here to check for pending signals. -- Notify ancestors that this task is on a terminate alternative. Utilities.Make_Passive (Self_Id, Task_Completed => False); -- Wait for normal entry call or termination pragma Assert (Self_Id.ATC_Nesting_Level = 1); STPO.Write_Lock (Self_Id); loop Initialization.Poll_Base_Priority_Change (Self_Id); exit when Self_Id.Open_Accepts = null; Sleep (Self_Id, Acceptor_Sleep); end loop; Self_Id.Common.State := Runnable; pragma Assert (Self_Id.Open_Accepts = null); if Self_Id.Terminate_Alternative then -- An entry call should have reset this to False, -- so we must be aborted. -- We cannot be in an async. select, since that -- is not legal, so the abort must be of the entire -- task. Therefore, we do not need to cancel the -- terminate alternative. The cleanup will be done -- in Complete_Master. pragma Assert (Self_Id.Pending_ATC_Level = 0); pragma Assert (Self_Id.Awake_Count = 0); -- Trust that it is OK to fall through. null; else -- Self_Id.Common.Call and Self_Id.Chosen_Index -- should already be updated by the Caller. if Self_Id.Chosen_Index /= No_Rendezvous and then not Open_Accepts (Self_Id.Chosen_Index).Null_Body then Uninterpreted_Data := Self_Id.Common.Call.Uninterpreted_Data; pragma Assert (Self_Id.Deferral_Level = 1); -- We need an extra defer here, to keep abort -- deferred until we get into the accept body Initialization.Defer_Abort_Nestable (Self_Id); end if; end if; STPO.Unlock (Self_Id); when No_Alternative_Open => -- In this case, Index will be No_Rendezvous on return, which -- should cause a Program_Error if it is not a Delay_Mode. -- If delay alternative exists (Delay_Mode) we should suspend -- until the delay expires. Self_Id.Open_Accepts := null; if Select_Mode = Delay_Mode then Self_Id.Common.State := Delay_Sleep; loop Initialization.Poll_Base_Priority_Change (Self_Id); exit when Self_Id.Pending_ATC_Level < Self_Id.ATC_Nesting_Level; Sleep (Self_Id, Delay_Sleep); end loop; Self_Id.Common.State := Runnable; STPO.Unlock (Self_Id); else STPO.Unlock (Self_Id); Initialization.Undefer_Abort (Self_Id); Ada.Exceptions.Raise_Exception (Program_Error'Identity, "Entry call not a delay mode"); end if; end case; -- Caller has been chosen. -- Self_Id.Common.Call should already be updated by the Caller. -- Self_Id.Chosen_Index should either be updated by the Caller -- or by Test_Selective_Wait. -- On return, we sill start rendezvous unless the accept body is -- null. In the latter case, we will have already completed the RV. Index := Self_Id.Chosen_Index; Initialization.Undefer_Abort_Nestable (Self_Id); end Selective_Wait; ------------------------------------ -- Setup_For_Rendezvous_With_Body -- ------------------------------------ -- Call this only with abort deferred and holding lock of Acceptor. procedure Setup_For_Rendezvous_With_Body (Entry_Call : Entry_Call_Link; Acceptor : Task_ID) is begin Entry_Call.Acceptor_Prev_Call := Acceptor.Common.Call; Acceptor.Common.Call := Entry_Call; if Entry_Call.State = Now_Abortable then Entry_Call.State := Was_Abortable; end if; Boost_Priority (Entry_Call, Acceptor); end Setup_For_Rendezvous_With_Body; ---------------- -- Task_Count -- ---------------- -- Compiler interface only. Do not call from within the RTS. function Task_Count (E : Task_Entry_Index) return Natural is Self_Id : constant Task_ID := STPO.Self; Return_Count : Natural; begin Initialization.Defer_Abort (Self_Id); STPO.Write_Lock (Self_Id); Return_Count := Queuing.Count_Waiting (Self_Id.Entry_Queues (E)); STPO.Unlock (Self_Id); Initialization.Undefer_Abort (Self_Id); return Return_Count; end Task_Count; ---------------------- -- Task_Do_Or_Queue -- ---------------------- -- Call this only with abort deferred and holding no locks. -- May propagate an exception, including Abort_Signal & Tasking_Error. -- ????? -- See Check_Callable. Check all call contexts to verify -- it is OK to raise an exception. -- Find out whether Entry_Call can be accepted immediately. -- If the Acceptor is not callable, raise Tasking_Error. -- If the rendezvous can start, initiate it. -- If the accept-body is trivial, also complete the rendezvous. -- If the acceptor is not ready, enqueue the call. -- ????? -- This should have a special case for Accept_Call and -- Accept_Trivial, so that -- we don't have the loop setup overhead, below. -- ????? -- The call state Done is used here and elsewhere to include -- both the case of normal successful completion, and the case -- of an exception being raised. The difference is that if an -- exception is raised no one will pay attention to the fact -- that State = Done. Instead the exception will be raised in -- Undefer_Abort, and control will skip past the place where -- we normally would resume from an entry call. function Task_Do_Or_Queue (Self_ID : Task_ID; Entry_Call : Entry_Call_Link; With_Abort : Boolean) return Boolean is E : constant Task_Entry_Index := Task_Entry_Index (Entry_Call.E); Old_State : constant Entry_Call_State := Entry_Call.State; Acceptor : constant Task_ID := Entry_Call.Called_Task; Parent : constant Task_ID := Acceptor.Common.Parent; Parent_Locked : Boolean := False; Null_Body : Boolean; begin pragma Assert (not Queuing.Onqueue (Entry_Call)); -- We rely that the call is off-queue for protection, -- that the caller will not exit the Entry_Caller_Sleep, -- and so will not reuse the call record for another call. -- We rely on the Caller's lock for call State mod's. -- We can't lock Acceptor.Parent while holding Acceptor, -- so lock it in advance if we expect to need to lock it. -- ????? -- Is there some better solution? if Acceptor.Terminate_Alternative then STPO.Write_Lock (Parent); Parent_Locked := True; end if; STPO.Write_Lock (Acceptor); -- If the acceptor is not callable, abort the call -- and raise Tasking_Error. The call is not aborted -- for an asynchronous call, since Cancel_Task_Entry_Call -- will do the cancelation in that case. -- ????? ..... -- Does the above still make sense? if not Acceptor.Callable then STPO.Unlock (Acceptor); if Parent_Locked then STPO.Unlock (Acceptor.Common.Parent); end if; pragma Assert (Entry_Call.State < Done); -- In case we are not the caller, set up the caller -- to raise Tasking_Error when it wakes up. STPO.Write_Lock (Entry_Call.Self); Entry_Call.Exception_To_Raise := Tasking_Error'Identity; Initialization.Wakeup_Entry_Caller (Self_ID, Entry_Call, Done); STPO.Unlock (Entry_Call.Self); return False; end if; -- Try to serve the call immediately. if Acceptor.Open_Accepts /= null then for J in Acceptor.Open_Accepts'Range loop if Entry_Call.E = Entry_Index (Acceptor.Open_Accepts (J).S) then -- Commit acceptor to rendezvous with us. Acceptor.Chosen_Index := J; Null_Body := Acceptor.Open_Accepts (J).Null_Body; Acceptor.Open_Accepts := null; -- Prevent abort while call is being served. if Entry_Call.State = Now_Abortable then Entry_Call.State := Was_Abortable; end if; if Acceptor.Terminate_Alternative then -- Cancel terminate alternative. -- See matching code in Selective_Wait and -- Vulnerable_Complete_Master. Acceptor.Terminate_Alternative := False; Acceptor.Awake_Count := Acceptor.Awake_Count + 1; if Acceptor.Awake_Count = 1 then -- Notify parent that acceptor is awake. pragma Assert (Parent.Awake_Count > 0); Parent.Awake_Count := Parent.Awake_Count + 1; if Parent.Common.State = Master_Completion_Sleep and then Acceptor.Master_of_Task = Parent.Master_Within then Parent.Common.Wait_Count := Parent.Common.Wait_Count + 1; end if; end if; end if; if Null_Body then -- Rendezvous is over immediately. STPO.Wakeup (Acceptor, Acceptor_Sleep); STPO.Unlock (Acceptor); if Parent_Locked then STPO.Unlock (Parent); end if; STPO.Write_Lock (Entry_Call.Self); Initialization.Wakeup_Entry_Caller (Self_ID, Entry_Call, Done); STPO.Unlock (Entry_Call.Self); else Setup_For_Rendezvous_With_Body (Entry_Call, Acceptor); -- For terminate_alternative, acceptor may not be -- asleep yet, so we skip the wakeup if Acceptor.Common.State /= Runnable then STPO.Wakeup (Acceptor, Acceptor_Sleep); end if; STPO.Unlock (Acceptor); if Parent_Locked then STPO.Unlock (Parent); end if; end if; return True; end if; end loop; -- The acceptor is accepting, but not this entry. end if; -- If the acceptor was ready to accept this call, -- we would not have gotten this far, so now we should -- (re)enqueue the call, if the mode permits that. if Entry_Call.Mode /= Conditional_Call or else not With_Abort then -- Timed_Call, Simple_Call, or Asynchronous_Call Queuing.Enqueue (Acceptor.Entry_Queues (E), Entry_Call); -- Update abortability of call pragma Assert (Old_State < Done); Entry_Call.State := New_State (With_Abort, Entry_Call.State); STPO.Unlock (Acceptor); if Parent_Locked then STPO.Unlock (Parent); end if; if Old_State /= Entry_Call.State and then Entry_Call.State = Now_Abortable and then Entry_Call.Mode > Simple_Call and then -- Asynchronous_Call or Conditional_Call Entry_Call.Self /= Self_ID then -- Because of ATCB lock ordering rule STPO.Write_Lock (Entry_Call.Self); if Entry_Call.Self.Common.State = Async_Select_Sleep then -- Caller may not yet have reached wait-point STPO.Wakeup (Entry_Call.Self, Async_Select_Sleep); end if; STPO.Unlock (Entry_Call.Self); end if; else -- Conditional_Call and With_Abort STPO.Unlock (Acceptor); if Parent_Locked then STPO.Unlock (Parent); end if; STPO.Write_Lock (Entry_Call.Self); pragma Assert (Entry_Call.State >= Was_Abortable); Initialization.Wakeup_Entry_Caller (Self_ID, Entry_Call, Cancelled); STPO.Unlock (Entry_Call.Self); end if; return True; end Task_Do_Or_Queue; --------------------- -- Task_Entry_Call -- --------------------- procedure Task_Entry_Call (Acceptor : Task_ID; E : Task_Entry_Index; Uninterpreted_Data : System.Address; Mode : Call_Modes; Rendezvous_Successful : out Boolean) is Self_Id : constant Task_ID := STPO.Self; Entry_Call : Entry_Call_Link; begin if Mode = Simple_Call or else Mode = Conditional_Call then Call_Synchronous (Acceptor, E, Uninterpreted_Data, Mode, Rendezvous_Successful); else -- This is an asynchronous call -- Abortion must already be deferred by the compiler-generated -- code. Without this, an abortion that occurs between the time -- that this call is made and the time that the abortable part's -- cleanup handler is set up might miss the cleanup handler and -- leave the call pending. Self_Id.ATC_Nesting_Level := Self_Id.ATC_Nesting_Level + 1; pragma Debug (Debug.Trace (Self_Id, "TEC: entered ATC level: " & ATC_Level'Image (Self_Id.ATC_Nesting_Level), 'A')); Entry_Call := Self_Id.Entry_Calls (Self_Id.ATC_Nesting_Level)'Access; Entry_Call.Next := null; Entry_Call.Mode := Mode; Entry_Call.Cancellation_Attempted := False; Entry_Call.State := Not_Yet_Abortable; Entry_Call.E := Entry_Index (E); Entry_Call.Prio := Get_Priority (Self_Id); Entry_Call.Uninterpreted_Data := Uninterpreted_Data; Entry_Call.Called_Task := Acceptor; Entry_Call.Called_PO := Null_Address; Entry_Call.Exception_To_Raise := Ada.Exceptions.Null_Id; if not Task_Do_Or_Queue (Self_Id, Entry_Call, With_Abort => True) then Self_Id.ATC_Nesting_Level := Self_Id.ATC_Nesting_Level - 1; pragma Debug (Debug.Trace (Self_Id, "TEC: exited to ATC level: " & ATC_Level'Image (Self_Id.ATC_Nesting_Level), 'A')); Initialization.Undefer_Abort (Self_Id); raise Tasking_Error; end if; -- The following is special for async. entry calls. -- If the call was not queued abortably, we need to wait until -- it is before proceeding with the abortable part. -- Wait_Until_Abortable can be called unconditionally here, -- but it is expensive. if Entry_Call.State < Was_Abortable then Entry_Calls.Wait_Until_Abortable (Self_Id, Entry_Call); end if; -- Note: following assignment needs to be atomic. Rendezvous_Successful := Entry_Call.State = Done; end if; end Task_Entry_Call; ----------------------- -- Task_Entry_Caller -- ----------------------- -- Compiler interface only. function Task_Entry_Caller (D : Task_Entry_Nesting_Depth) return Task_ID is Self_Id : constant Task_ID := STPO.Self; Entry_Call : Entry_Call_Link; begin Entry_Call := Self_Id.Common.Call; for Depth in 1 .. D loop Entry_Call := Entry_Call.Acceptor_Prev_Call; pragma Assert (Entry_Call /= null); end loop; return Entry_Call.Self; end Task_Entry_Caller; -------------------------- -- Timed_Selective_Wait -- -------------------------- -- Compiler interface only. Do not call from within the RTS. procedure Timed_Selective_Wait (Open_Accepts : Accept_List_Access; Select_Mode : Select_Modes; Uninterpreted_Data : out System.Address; Timeout : Duration; Mode : Delay_Modes; Index : out Select_Index) is Self_Id : constant Task_ID := STPO.Self; Treatment : Select_Treatment; Entry_Call : Entry_Call_Link; Caller : Task_ID; Selection : Select_Index; Open_Alternative : Boolean; Timedout : Boolean := False; Yielded : Boolean := False; begin pragma Assert (Select_Mode = Delay_Mode); Initialization.Defer_Abort (Self_Id); -- If we are aborted here, the effect will be pending STPO.Write_Lock (Self_Id); if not Self_Id.Callable then pragma Assert (Self_Id.Pending_ATC_Level = 0); pragma Assert (Self_Id.Pending_Action); STPO.Unlock (Self_Id); Initialization.Undefer_Abort (Self_Id); -- Should never get here ??? pragma Assert (False); raise Standard'Abort_Signal; end if; -- If someone completed this task, this task should not try to -- access its pending entry calls or queues in this case, as they -- are being emptied. Wait for abortion to kill us. -- ????? -- Recheck the correctness of the above, now that we have made -- changes. pragma Assert (Open_Accepts /= null); Queuing.Select_Task_Entry_Call (Self_Id, Open_Accepts, Entry_Call, Selection, Open_Alternative); -- Determine the kind and disposition of the select. Treatment := Default_Treatment (Select_Mode); Self_Id.Chosen_Index := No_Rendezvous; if Open_Alternative then if Entry_Call /= null then if Open_Accepts (Selection).Null_Body then Treatment := Accept_Alternative_Completed; else Setup_For_Rendezvous_With_Body (Entry_Call, Self_Id); Treatment := Accept_Alternative_Selected; end if; Self_Id.Chosen_Index := Selection; elsif Treatment = No_Alternative_Open then Treatment := Accept_Alternative_Open; end if; end if; -- Handle the select according to the disposition selected above. case Treatment is when Accept_Alternative_Selected => -- Ready to rendezvous -- In this case the accept body is not Null_Body. Defer abortion -- until it gets into the accept body. Uninterpreted_Data := Self_Id.Common.Call.Uninterpreted_Data; Initialization.Defer_Abort (Self_Id); STPO.Unlock (Self_Id); when Accept_Alternative_Completed => -- Rendezvous is over STPO.Unlock (Self_Id); Caller := Entry_Call.Self; STPO.Write_Lock (Caller); Initialization.Wakeup_Entry_Caller (Self_Id, Entry_Call, Done); STPO.Unlock (Caller); when Accept_Alternative_Open => -- Wait for caller. Self_Id.Open_Accepts := Open_Accepts; -- Wait for a normal call and a pending action until the -- Wakeup_Time is reached. Self_Id.Common.State := Acceptor_Sleep; loop Initialization.Poll_Base_Priority_Change (Self_Id); exit when Self_Id.Open_Accepts = null; if Timedout then Sleep (Self_Id, Acceptor_Sleep); else STPO.Timed_Sleep (Self_Id, Timeout, Mode, Acceptor_Sleep, Timedout, Yielded); end if; if Timedout then Self_Id.Open_Accepts := null; end if; end loop; Self_Id.Common.State := Runnable; -- Self_Id.Common.Call should already be updated by the Caller if -- not aborted. It might also be ready to do rendezvous even if -- this wakes up due to an abortion. -- Therefore, if the call is not empty we need to do the rendezvous -- if the accept body is not Null_Body. if Self_Id.Chosen_Index /= No_Rendezvous and then Self_Id.Common.Call /= null and then not Open_Accepts (Self_Id.Chosen_Index).Null_Body then Uninterpreted_Data := Self_Id.Common.Call.Uninterpreted_Data; pragma Assert (Self_Id.Deferral_Level = 1); Initialization.Defer_Abort_Nestable (Self_Id); -- Leave abort deferred until the accept body end if; STPO.Unlock (Self_Id); if not Yielded then Yield; end if; when No_Alternative_Open => -- In this case, Index will be No_Rendezvous on return. We sleep -- for the time we need to. -- Wait for a signal or timeout. A wakeup can be made -- for several reasons: -- 1) Delay is expired -- 2) Pending_Action needs to be checked -- (Abortion, Priority change) -- 3) Spurious wakeup Self_Id.Open_Accepts := null; Self_Id.Common.State := Acceptor_Sleep; Initialization.Poll_Base_Priority_Change (Self_Id); STPO.Timed_Sleep (Self_Id, Timeout, Mode, Acceptor_Sleep, Timedout, Yielded); Self_Id.Common.State := Runnable; STPO.Unlock (Self_Id); if not Yielded then Yield; end if; when others => -- Should never get here ??? pragma Assert (False); null; end case; -- Caller has been chosen -- Self_Id.Common.Call should already be updated by the Caller -- Self_Id.Chosen_Index should either be updated by the Caller -- or by Test_Selective_Wait Index := Self_Id.Chosen_Index; Initialization.Undefer_Abort_Nestable (Self_Id); -- Start rendezvous, if not already completed end Timed_Selective_Wait; --------------------------- -- Timed_Task_Entry_Call -- --------------------------- -- Compiler interface only. Do not call from within the RTS. procedure Timed_Task_Entry_Call (Acceptor : Task_ID; E : Task_Entry_Index; Uninterpreted_Data : System.Address; Timeout : Duration; Mode : Delay_Modes; Rendezvous_Successful : out Boolean) is Self_Id : constant Task_ID := STPO.Self; Level : ATC_Level; Entry_Call : Entry_Call_Link; begin Initialization.Defer_Abort (Self_Id); Self_Id.ATC_Nesting_Level := Self_Id.ATC_Nesting_Level + 1; pragma Debug (Debug.Trace (Self_Id, "TTEC: entered ATC level: " & ATC_Level'Image (Self_Id.ATC_Nesting_Level), 'A')); Level := Self_Id.ATC_Nesting_Level; Entry_Call := Self_Id.Entry_Calls (Level)'Access; Entry_Call.Next := null; Entry_Call.Mode := Timed_Call; Entry_Call.Cancellation_Attempted := False; -- If this is a call made inside of an abort deferred region, -- the call should be never abortable. if Self_Id.Deferral_Level > 1 then Entry_Call.State := Never_Abortable; else Entry_Call.State := Now_Abortable; end if; Entry_Call.E := Entry_Index (E); Entry_Call.Prio := Get_Priority (Self_Id); Entry_Call.Uninterpreted_Data := Uninterpreted_Data; Entry_Call.Called_Task := Acceptor; Entry_Call.Called_PO := Null_Address; Entry_Call.Exception_To_Raise := Ada.Exceptions.Null_Id; -- Note: the caller will undefer abortion on return (see WARNING above) if not Task_Do_Or_Queue (Self_Id, Entry_Call, With_Abort => True) then Self_Id.ATC_Nesting_Level := Self_Id.ATC_Nesting_Level - 1; pragma Debug (Debug.Trace (Self_Id, "TTEC: exited to ATC level: " & ATC_Level'Image (Self_Id.ATC_Nesting_Level), 'A')); Initialization.Undefer_Abort (Self_Id); raise Tasking_Error; end if; Entry_Calls.Wait_For_Completion_With_Timeout (Self_Id, Entry_Call, Timeout, Mode); Rendezvous_Successful := Entry_Call.State = Done; Initialization.Undefer_Abort (Self_Id); Entry_Calls.Check_Exception (Self_Id, Entry_Call); end Timed_Task_Entry_Call; ------------------- -- Wait_For_Call -- ------------------- -- Call this only with abort deferred and holding lock of Self_Id. -- Wait for normal call and a pending action. procedure Wait_For_Call (Self_Id : Task_ID) is begin Self_Id.Common.State := Acceptor_Sleep; loop Initialization.Poll_Base_Priority_Change (Self_Id); exit when Self_Id.Open_Accepts = null; Sleep (Self_Id, Acceptor_Sleep); end loop; Self_Id.Common.State := Runnable; end Wait_For_Call; end System.Tasking.Rendezvous;
haskell-ghc.g4
haskix/spec
0
7595
// SPDX-License-Identifier: MIT // --------------------------------------------------------------------------- (c) The University of // Glasgow 1997-2003 - The GHC grammar. // // Author(s): <NAME>, <NAME> 1997, 1998, 1999 // --------------------------------------------------------------------------- grammar ghc; // %expect 0 -- shift/reduce conflicts /* Note [shift/reduce conflicts] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'happy' tool turns this grammar into an efficient parser that follows the shift-reduce parsing model. There's a parse stack that contains items parsed so far (both terminals and non-terminals). Every next token produced by the lexer results in one of two actions: SHIFT: push the token onto the parse stack REDUCE: pop a few items off the parse stack and combine them with a function (reduction rule) However, sometimes it's unclear which of the two actions to take. Consider this code example: if x then y else f z There are two ways to parse it: (if x then y else f) z if x then y else (f z) How is this determined? At some point, the parser gets to the following state: parse stack: 'if' exp 'then' exp 'else' "f" next token: "z" Scenario A (simplified): 1. REDUCE, parse stack: 'if' exp 'then' exp 'else' exp next token: "z" (Note that "f" reduced to exp here) 2. REDUCE, parse stack: exp next token: "z" 3. SHIFT, parse stack: exp "z" next token: ... 4. REDUCE, parse stack: exp next token: ... This way we get: (if x then y else f) z Scenario B (simplified): 1. SHIFT, parse stack: 'if' exp 'then' exp 'else' "f" "z" next token: ... 2. REDUCE, parse stack: 'if' exp 'then' exp 'else' exp next token: ... 3. REDUCE, parse stack: exp next token: ... This way we get: if x then y else (f z) The end result is determined by the chosen action. When Happy detects this, it reports a shift/reduce conflict. At the top of the file, we have the following directive: %expect 0 It means that we expect no unresolved shift/reduce conflicts in this grammar. If you modify the grammar and get shift/reduce conflicts, follow the steps below to resolve them. STEP ONE is to figure out what causes the conflict. That's where the -i flag comes in handy: happy -agc --strict compiler/GHC/Parser.y -idetailed-info By analysing the output of this command, in a new file `detailed-info`, you can figure out which reduction rule causes the issue. At the top of the generated report, you will see a line like this: state 147 contains 67 shift/reduce conflicts. Scroll down to section State 147 (in your case it could be a different state). The start of the section lists the reduction rules that can fire and shows their context: exp10 -> fexp . (rule 492) fexp -> fexp . aexp (rule 498) fexp -> fexp . PREFIX_AT atype (rule 499) And then, for every token, it tells you the parsing action: ']' reduce using rule 492 '::' reduce using rule 492 '(' shift, and enter state 178 QVARID shift, and enter state 44 DO shift, and enter state 182 ... But if you look closer, some of these tokens also have another parsing action in parentheses: QVARID shift, and enter state 44 (reduce using rule 492) That's how you know rule 492 is causing trouble. Scroll back to the top to see what this rule is: ---------------------------------- Grammar ---------------------------------- ... ... exp10 -> fexp (492) optSemi -> ';' (493) ... ... Hence the shift/reduce conflict is caused by this parser production: exp10 :: { ECP } : '-' fexp { ... } | fexp { ... } -- problematic rule STEP TWO is to mark the problematic rule with the %shift pragma. This signals to 'happy' that any shift/reduce conflicts involving this rule must be resolved in favor of a shift. There's currently no dedicated pragma to resolve in favor of the reduce. STEP THREE is to add a dedicated Note for this specific conflict, as is done for all other conflicts below. */ /* Note [%shift: rule_activation -> {- empty -}] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: rule -> STRING . rule_activation rule_foralls infixexp '=' exp Example: {-# RULES "name" [0] f = rhs #-} Ambiguity: If we reduced, then we'd get an empty activation rule, and [0] would be parsed as part of the left-hand side expression. We shift, so [0] is parsed as an activation rule. */ /* Note [%shift: rule_foralls -> 'forall' rule_vars '.'] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: rule_foralls -> 'forall' rule_vars '.' . 'forall' rule_vars '.' rule_foralls -> 'forall' rule_vars '.' . Example: {-# RULES "name" forall a1. forall a2. lhs = rhs #-} Ambiguity: Same as in Note [%shift: rule_foralls -> {- empty -}] but for the second 'forall'. */ /* Note [%shift: rule_foralls -> {- empty -}] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: rule -> STRING rule_activation . rule_foralls infixexp '=' exp Example: {-# RULES "name" forall a1. lhs = rhs #-} Ambiguity: If we reduced, then we would get an empty rule_foralls; the 'forall', being a valid term-level identifier, would be parsed as part of the left-hand side expression. We shift, so the 'forall' is parsed as part of rule_foralls. */ /* Note [%shift: type -> btype] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: context -> btype . type -> btype . type -> btype . '->' ctype type -> btype . '->.' ctype Example: a :: Maybe Integer -> Bool Ambiguity: If we reduced, we would get: (a :: Maybe Integer) -> Bool We shift to get this instead: a :: (Maybe Integer -> Bool) */ /* Note [%shift: infixtype -> ftype] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: infixtype -> ftype . infixtype -> ftype . tyop infixtype ftype -> ftype . tyarg ftype -> ftype . PREFIX_AT tyarg Example: a :: Maybe Integer Ambiguity: If we reduced, we would get: (a :: Maybe) Integer We shift to get this instead: a :: (Maybe Integer) */ /* Note [%shift: atype -> tyvar] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: atype -> tyvar . tv_bndr_no_braces -> '(' tyvar . '::' kind ')' Example: class C a where type D a = (a :: Type ... Ambiguity: If we reduced, we could specify a default for an associated type like this: class C a where type D a type D a = (a :: Type) But we shift in order to allow injectivity signatures like this: class C a where type D a = (r :: Type) | r -> a */ /* Note [%shift: exp -> infixexp] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: exp -> infixexp . '::' sigtype exp -> infixexp . '-<' exp exp -> infixexp . '>-' exp exp -> infixexp . '-<<' exp exp -> infixexp . '>>-' exp exp -> infixexp . infixexp -> infixexp . qop exp10p Examples: 1) if x then y else z -< e 2) if x then y else z :: T 3) if x then y else z + 1 -- (NB: '+' is in VARSYM) Ambiguity: If we reduced, we would get: 1) (if x then y else z) -< e 2) (if x then y else z) :: T 3) (if x then y else z) + 1 We shift to get this instead: 1) if x then y else (z -< e) 2) if x then y else (z :: T) 3) if x then y else (z + 1) */ /* Note [%shift: exp10 -> '-' fexp] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: exp10 -> '-' fexp . fexp -> fexp . aexp fexp -> fexp . PREFIX_AT atype Examples & Ambiguity: Same as in Note [%shift: exp10 -> fexp], but with a '-' in front. */ /* Note [%shift: exp10 -> fexp] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: exp10 -> fexp . fexp -> fexp . aexp fexp -> fexp . PREFIX_AT atype Examples: 1) if x then y else f z 2) if x then y else f @z Ambiguity: If we reduced, we would get: 1) (if x then y else f) z 2) (if x then y else f) @z We shift to get this instead: 1) if x then y else (f z) 2) if x then y else (f @z) */ /* Note [%shift: aexp2 -> ipvar] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: aexp2 -> ipvar . dbind -> ipvar . '=' exp Example: let ?x = ... Ambiguity: If we reduced, ?x would be parsed as the LHS of a normal binding, eventually producing an error. We shift, so it is parsed as the LHS of an implicit binding. */ /* Note [%shift: aexp2 -> TH_TY_QUOTE] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: aexp2 -> TH_TY_QUOTE . tyvar aexp2 -> TH_TY_QUOTE . gtycon aexp2 -> TH_TY_QUOTE . Examples: 1) x = '' 2) x = ''a 3) x = ''T Ambiguity: If we reduced, the '' would result in reportEmptyDoubleQuotes even when followed by a type variable or a type constructor. But the only reason this reduction rule exists is to improve error messages. Naturally, we shift instead, so that ''a and ''T work as expected. */ /* Note [%shift: tup_tail -> {- empty -}] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: tup_exprs -> commas . tup_tail sysdcon_nolist -> '(' commas . ')' sysdcon_nolist -> '(#' commas . '#)' commas -> commas . ',' Example: (,,) Ambiguity: A tuple section with no components is indistinguishable from the Haskell98 data constructor for a tuple. If we reduced, (,,) would be parsed as a tuple section. We shift, so (,,) is parsed as a data constructor. This is preferable because we want to accept (,,) without -XTupleSections. See also Note [ExplicitTuple] in GHC.Hs.Expr. */ /* Note [%shift: qtyconop -> qtyconsym] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: oqtycon -> '(' qtyconsym . ')' qtyconop -> qtyconsym . Example: foo :: (:%) Ambiguity: If we reduced, (:%) would be parsed as a parenthehsized infix type expression without arguments, resulting in the 'failOpFewArgs' error. We shift, so it is parsed as a type constructor. */ /* Note [%shift: special_id -> 'group'] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: transformqual -> 'then' 'group' . 'using' exp transformqual -> 'then' 'group' . 'by' exp 'using' exp special_id -> 'group' . Example: [ ... | then group by dept using groupWith , then take 5 ] Ambiguity: If we reduced, 'group' would be parsed as a term-level identifier, just as 'take' in the other clause. We shift, so it is parsed as part of the 'group by' clause introduced by the -XTransformListComp extension. */ /* Note [%shift: activation -> {- empty -}] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Context: sigdecl -> '{-# INLINE' . activation qvarcon '#-}' activation -> {- empty -} activation -> explicit_activation Example: {-# INLINE [0] Something #-} Ambiguity: We don't know whether the '[' is the start of the activation or the beginning of the [] data constructor. We parse this as having '[0]' activation for inlining 'Something', rather than empty activation and inlining '[0] Something'. */ /* Note [Parser API Annotations] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A lot of the productions are now cluttered with calls to aa,am,acs,acsA etc. These are helper functions to make sure that the locations of the various keywords such as do / let / in are captured for use by tools that want to do source to source conversions, such as refactorers or structured editors. The helper functions are defined at the bottom of this file. See https://gitlab.haskell.org/ghc/ghc/wikis/api-annotations and https://gitlab.haskell.org/ghc/ghc/wikis/ghc-ast-annotations for some background. */ /* Note [Parsing lists] ~~~~~~~~~~~~~~~~~~~~~~~ You might be wondering why we spend so much effort encoding our lists this way: importdecls : importdecls ';' importdecl | importdecls ';' | importdecl | {- empty -} This might seem like an awfully roundabout way to declare a list; plus, to add insult to injury you have to reverse the results at the end. The answer is that left recursion prevents us from running out of stack space when parsing long sequences. See: https://www.haskell.org/happy/doc/html/sec-sequences.html for more guidance. By adding/removing branches, you can affect what lists are accepted. Here are the most common patterns, rewritten as regular expressions for clarity: -- Equivalent to: ';'* (x ';'+)* x? (can be empty, permits leading/trailing semis) xs : xs ';' x | xs ';' | x | {- empty -} -- Equivalent to x (';' x)* ';'* (non-empty, permits trailing semis) xs : xs ';' x | xs ';' | x -- Equivalent to ';'* alts (';' alts)* ';'* (non-empty, permits leading/trailing semis) alts : alts1 | ';' alts alts1 : alts1 ';' alt | alts1 ';' | alt -- Equivalent to x (',' x)+ (non-empty, no trailing semis) xs : x | x ',' xs */ tokens { TIGHT_INFIX_AT /*{ L _ ITat }*/, PREFIX_TILDE /*{ L _ ITtilde }*/, PREFIX_BANG /*{ L _ ITbang }*/, PREFIX_MINUS /*{ L _ ITprefixminus }*/, PREFIX_PROJ /*{ L _ (ITproj True) } -- RecordDotSyntax*/, TIGHT_INFIX_PROJ /*{ L _ (ITproj False) } -- RecordDotSyntax*/, PREFIX_AT /*{ L _ ITtypeApp }*/, PREFIX_PERCENT /*{ L _ ITpercent } -- for linear types*/, vocurly /*{ L _ ITvocurly } -- virtual open curly (from layout)*/, vccurly /*{ L _ ITvccurly } -- virtual close curly (from layout)*/, SIMPLEQUOTE /*{ L _ ITsimpleQuote } -- 'x*/, VARID /*{ L _ (ITvarid _) } -- identifiers*/, CONID /*{ L _ (ITconid _) }*/, VARSYM /*{ L _ (ITvarsym _) }*/, CONSYM /*{ L _ (ITconsym _) }*/, QVARID /*{ L _ (ITqvarid _) }*/, QCONID /*{ L _ (ITqconid _) }*/, QVARSYM /*{ L _ (ITqvarsym _) }*/, QCONSYM /*{ L _ (ITqconsym _) }*/, DO /*{ L _ (ITdo _) }*/, MDO /*{ L _ (ITmdo _) }*/, IPDUPVARID /*{ L _ (ITdupipvarid _) } -- GHC extension*/, LABELVARID /*{ L _ (ITlabelvarid _) }*/, CHAR /*{ L _ (ITchar _ _) }*/, STRING /*{ L _ (ITstring _ _) }*/, INTEGER /*{ L _ (ITinteger _) }*/, RATIONAL /*{ L _ (ITrational _) }*/, PRIMCHAR /*{ L _ (ITprimchar _ _) }*/, PRIMSTRING /*{ L _ (ITprimstring _ _) }*/, PRIMINTEGER /*{ L _ (ITprimint _ _) }*/, PRIMWORD /*{ L _ (ITprimword _ _) }*/, PRIMFLOAT /*{ L _ (ITprimfloat _) }*/, PRIMDOUBLE /*{ L _ (ITprimdouble _) }*/, PREFIX_DOLLAR /*{ L _ ITdollar }*/, PREFIX_DOLLAR_DOLLAR /*{ L _ ITdollardollar }*/, TH_TY_QUOTE /*{ L _ ITtyQuote } -- ''T*/, TH_QUASIQUOTE /*{ L _ (ITquasiQuote _) }*/, TH_QQUASIQUOTE /*{ L _ (ITqQuasiQuote _) }*/ } // %monad { P } { >>= } { return } %lexer { (lexer True) } { L _ ITeof } -- Replace 'lexer' above // with 'lexerDbg' -- to dump the tokens fed to the parser. %tokentype { (Located Token) } // -- Exported parsers %name parseModuleNoHaddock module %name parseSignature signature %name // parseImport importdecl %name parseStatement e_stmt %name parseDeclaration topdecl %name // parseExpression exp %name parsePattern pat %name parseTypeSignature sigdecl %name parseStmt // maybe_stmt %name parseIdentifier identifier %name parseType ktype %name parseBackpack backpack // %partial parseHeader header //--------------------------------------------------------------------------- // Identifiers; one of the entry points identifier: qvar | qcon | qvarop | qconop | '(' '->' ')' | '->'; //--------------------------------------------------------------------------- // Backpack stuff backpack: implicit_top units close | '{' units '}'; units: units ';' unit | units ';' | unit; unit: 'unit' pkgname 'where' unitbody; unitid: pkgname | pkgname '[' msubsts ']'; msubsts: msubsts ',' msubst | msubsts ',' | msubst; msubst: modid '=' moduleid | modid VARSYM modid VARSYM; moduleid: VARSYM modid VARSYM | unitid ':' modid; pkgname: STRING | litpkgname; litpkgname_segment: VARID | CONID | special_id; // Parse a minus sign regardless of whether -XLexicalNegation is turned on or off. See Note [Minus // tokens] in GHC.Parser.Lexer HYPHEN: '-' | PREFIX_MINUS | VARSYM; litpkgname: litpkgname_segment // a bit of a hack, means p - b is parsed same as p-b, enough for now. | litpkgname_segment HYPHEN litpkgname; mayberns: | '(' rns ')'; rns: rns ',' rn | rns ',' | rn; rn: modid 'as' modid | modid; unitbody: '{' unitdecls '}' | vocurly unitdecls close; unitdecls: unitdecls ';' unitdecl | unitdecls ';' | unitdecl; unitdecl: 'module' maybe_src modid maybemodwarning maybeexports 'where' body // XXX not accurate | 'signature' modid maybemodwarning maybeexports 'where' body | 'dependency' unitid mayberns | 'dependency' 'signature' unitid; //--------------------------------------------------------------------------- // Module Header // The place for module deprecation is really too restrictive, but if it was allowed at its natural // place just before 'module', we get an ugly s/r conflict with the second alternative. Another // solution would be the introduction of a new pragma DEPRECATED_MODULE, but this is not very nice, // either, and DEPRECATED is only expected to be used by people who really know what they are doing. // :-) signature: 'signature' modid maybemodwarning maybeexports 'where' body; module: 'module' modid maybemodwarning maybeexports 'where' body | body2; missing_module_keyword:; implicit_top:; maybemodwarning: '{-# DEPRECATED' strings '#-}' | '{-# WARNING' strings '#-}' |; body: '{' top '}' | vocurly top close; body2: '{' top '}' | missing_module_keyword top close; top: semis top1; top1: importdecls_semi topdecls_cs_semi | importdecls_semi topdecls_cs | importdecls; //--------------------------------------------------------------------------- // Module declaration & imports only header: 'module' modid maybemodwarning maybeexports 'where' header_body | 'signature' modid maybemodwarning maybeexports 'where' header_body | header_body2; header_body: '{' header_top | vocurly header_top; header_body2: '{' header_top | missing_module_keyword header_top; header_top: semis header_top_importdecls; header_top_importdecls: importdecls_semi | importdecls; //--------------------------------------------------------------------------- // The Export List maybeexports: '(' exportlist ')' |; exportlist: exportlist1 | // trailing comma: | exportlist1 ',' | ','; exportlist1: exportlist1 ',' export | export; // No longer allow things like [] and (,,,) to be exported They are built in syntax, always // available export: qcname_ext export_subspec | 'module' modid | 'pattern' qcon; export_subspec: | '(' qcnames ')'; qcnames: | qcnames1; qcnames1: qcnames1 ',' qcname_ext_w_wildcard // Annotations re-added in mkImpExpSubSpec | qcname_ext_w_wildcard; // Variable, data constructor or wildcard or tagged type constructor qcname_ext_w_wildcard: qcname_ext | '..'; qcname_ext: qcname | 'type' oqtycon; qcname: // Variable or type constructor qvar // Things which look like functions // Note: This includes record selectors but also (-.->), see #11432 | oqtycon_no_varcon; //- see Note [Type constructors in export list] //--------------------------------------------------------------------------- // Import Declarations // importdecls and topdecls must contain at least one declaration; top handles the fact that these // may be optional. // One or more semicolons semis1: semis1 ';' | ';'; // Zero or more semicolons semis: semis ';' |; // No trailing semicolons, non-empty importdecls: importdecls_semi importdecl; // May have trailing semicolons, can be empty importdecls_semi: importdecls_semi importdecl semis1 |; importdecl: 'import' maybe_src maybe_safe optqualified maybe_pkg modid optqualified maybeas maybeimpspec; maybe_src: '{-# SOURCE' '#-}' |; maybe_safe: 'safe' |; maybe_pkg: STRING |; optqualified: 'qualified' |; maybeas: 'as' modid |; maybeimpspec: impspec |; impspec: '(' exportlist ')' | 'hiding' '(' exportlist ')'; //--------------------------------------------------------------------------- // Fixity Declarations prec: | INTEGER; infix: 'infix' | 'infixl' | 'infixr'; ops: ops ',' op | op; //--------------------------------------------------------------------------- // Top-Level Declarations // No trailing semicolons, non-empty topdecls: topdecls_semi topdecl; // May have trailing semicolons, can be empty topdecls_semi: topdecls_semi topdecl semis1 |; //--------------------------------------------------------------------------- // Each topdecl accumulates prior comments No trailing semicolons, non-empty topdecls_cs: topdecls_cs_semi topdecl_cs; // May have trailing semicolons, can be empty topdecls_cs_semi: topdecls_cs_semi topdecl_cs semis1 |; // Each topdecl accumulates prior comments topdecl_cs: topdecl; //--------------------------------------------------------------------------- topdecl: cl_decl | ty_decl | standalone_kind_sig | inst_decl | stand_alone_deriving | role_annot | 'default' '(' comma_types0 ')' | 'foreign' fdecl | '{-# DEPRECATED' deprecations '#-}' | '{-# WARNING' warnings '#-}' | '{-# RULES' rules '#-}' | annotation | decl_no_th // Template Haskell Extension The $(..) form is one possible form of infixexp but we treat an // arbitrary expression just as if it had a $(..) wrapped around it | infixexp; // Type classes cl_decl: 'class' tycl_hdr fds where_cls; // Type declarations (toplevel) ty_decl: // ordinary type synonyms 'type' type '=' ktype // Note ktype, not sigtype, on the right of '=' We allow an explicit for-all but we don't insert // one in type Foo a = (b,b) Instead we just say b is out of scope // // Note the use of type for the head; this allows infix type constructors to be declared // type family declarations | 'type' 'family' type opt_tyfam_kind_sig opt_injective_info where_type_family // Note the use of type for the head; this allows infix type constructors to be declared // ordinary data type or newtype declaration | data_or_newtype capi_ctype tycl_hdr constrs maybe_derivings // We need the location on tycl_hdr in case constrs and deriving are both empty // ordinary GADT declaration | data_or_newtype capi_ctype tycl_hdr opt_kind_sig gadt_constrlist maybe_derivings // We need the location on tycl_hdr in case constrs and deriving are both empty // data/newtype family | 'data' 'family' type opt_datafam_kind_sig; // standalone kind signature standalone_kind_sig: 'type' sks_vars '::' sigktype; // See also: sig_vars sks_vars: sks_vars ',' oqtycon; inst_decl: 'instance' overlap_pragma inst_type where_inst // type instance declarations | 'type' 'instance' ty_fam_inst_eqn // data/newtype instance declaration | data_or_newtype 'instance' capi_ctype datafam_inst_hdr constrs maybe_derivings // GADT instance declaration | data_or_newtype 'instance' capi_ctype datafam_inst_hdr opt_kind_sig gadt_constrlist maybe_derivings; overlap_pragma: '{-# OVERLAPPABLE' '#-}' | '{-# OVERLAPPING' '#-}' | '{-# OVERLAPS' '#-}' | '{-# INCOHERENT' '#-}' |; deriv_strategy_no_via: 'stock' | 'anyclass' | 'newtype'; deriv_strategy_via: 'via' sigktype; deriv_standalone_strategy: 'stock' | 'anyclass' | 'newtype' | deriv_strategy_via |; // Injective type families opt_injective_info: | '|' injectivity_cond; injectivity_cond: tyvarid '->' inj_varids; inj_varids: inj_varids tyvarid | tyvarid; // Closed type families where_type_family: | 'where' ty_fam_inst_eqn_list; ty_fam_inst_eqn_list: '{' ty_fam_inst_eqns '}' | vocurly ty_fam_inst_eqns close | '{' '..' '}' | vocurly '..' close; ty_fam_inst_eqns: ty_fam_inst_eqns ';' ty_fam_inst_eqn | ty_fam_inst_eqns ';' | ty_fam_inst_eqn |; ty_fam_inst_eqn: 'forall' tv_bndrs '.' type '=' ktype | type '=' ktype; // Note the use of type for the head; this allows infix type constructors and type patterns // Associated type family declarations // // * They have a different syntax than on the toplevel (no family special identifier). // // * They also need to be separate from instances; otherwise, data family declarations without a // kind signature cause parsing conflicts with empty data declarations. at_decl_cls: //- data family declarations, with optional 'family' keyword 'data' opt_family type opt_datafam_kind_sig // type family declarations, with optional 'family' keyword (can't use opt_instance because you // get shift/reduce errors | 'type' type opt_at_kind_inj_sig | 'type' 'family' type opt_at_kind_inj_sig // default type instances, with optional 'instance' keyword | 'type' ty_fam_inst_eqn | 'type' 'instance' ty_fam_inst_eqn; opt_family: | 'family'; opt_instance: | 'instance'; // Associated type instances at_decl_inst: // type instance declarations, with optional 'instance' keyword 'type' opt_instance ty_fam_inst_eqn // Note the use of type for the head; this allows infix type constructors and type patterns // data/newtype instance declaration, with optional 'instance' keyword | data_or_newtype opt_instance capi_ctype datafam_inst_hdr constrs maybe_derivings // GADT instance declaration, with optional 'instance' keyword | data_or_newtype opt_instance capi_ctype datafam_inst_hdr opt_kind_sig gadt_constrlist maybe_derivings; data_or_newtype: 'data' | 'newtype'; // Family result/return kind signatures opt_kind_sig: | '::' kind; opt_datafam_kind_sig: | '::' kind; opt_tyfam_kind_sig: | '::' kind | '=' tv_bndr; opt_at_kind_inj_sig: | '::' kind | '=' tv_bndr_no_braces '|' injectivity_cond; // tycl_hdr parses the header of a class or data type decl, which takes the form T a b Eq a => T a // (Eq a, Ord b) => T a b T Int [a] -- for associated types Rather a lot of inlining here, else we // get reduce/reduce errors tycl_hdr: context '=>' type | type; datafam_inst_hdr: 'forall' tv_bndrs '.' context '=>' type | 'forall' tv_bndrs '.' type | context '=>' type | type; capi_ctype: '{-# CTYPE' STRING STRING '#-}' | '{-# CTYPE' STRING '#-}' |; //--------------------------------------------------------------------------- // Stand-alone deriving // Glasgow extension: stand-alone deriving declarations stand_alone_deriving: 'deriving' deriv_standalone_strategy 'instance' overlap_pragma inst_type; //--------------------------------------------------------------------------- // Role annotations role_annot: 'type' 'role' oqtycon maybe_roles; // Reversed! maybe_roles: | roles; roles: role | roles role; // read it in as a varid for better error messages role: VARID | '_'; // Pattern synonyms // Glasgow extension: pattern synonyms pattern_synonym_decl: 'pattern' pattern_synonym_lhs '=' pat | 'pattern' pattern_synonym_lhs '<-' pat | 'pattern' pattern_synonym_lhs '<-' pat where_decls; pattern_synonym_lhs: con vars0 | varid conop varid | con '{' cvars1 '}'; vars0: | varid vars0; cvars1: var | var ',' cvars1; where_decls: 'where' '{' decls '}' | 'where' vocurly decls close; pattern_synonym_sig: 'pattern' con_list '::' sigtype; qvarcon: qvar | qcon; //--------------------------------------------------------------------------- // Nested declarations // Declaration in class bodies decl_cls: at_decl_cls | decl // A 'default' signature used with the generic-programming extension | 'default' infixexp '::' sigtype; decls_cls: //- Reversed decls_cls ';' decl_cls | decls_cls ';' | decl_cls |; decllist_cls: // Reversed '{' decls_cls '}' | vocurly decls_cls close; // Class body where_cls: // No implicit parameters May have type declarations: 'where' decllist_cls; // Declarations in instance bodies decl_inst: at_decl_inst | decl; decls_inst: //- Reversed decls_inst ';' decl_inst | decls_inst ';' | decl_inst |; decllist_inst: // Reversed '{' decls_inst '}' | vocurly decls_inst close; // Instance body where_inst: // Reversed No implicit parameters May have type declarations: 'where' decllist_inst |; // Declarations in binding groups other than classes and instances decls: decls ';' decl | decls ';' | decl |; decllist: '{' decls '}' | vocurly decls close; // Binding groups other than those of class and instance declarations binds: // May have implicit parameters No type declarations: decllist | '{' dbinds '}' | vocurly dbinds close; wherebinds: // May have implicit parameters No type declarations: 'where' binds |; //--------------------------------------------------------------------------- // Transformation Rules rules: //- Reversed rules ';' rule | rules ';' | rule |; rule: STRING rule_activation rule_foralls infixexp '=' exp; // Rules can be specified to be NeverActive, unlike inline/specialize pragmas rule_activation: // See Note [%shift: rule_activation -> {- empty -}] /*%shift */ | rule_explicit_activation; // This production is used to parse the tilde syntax in pragmas such as * {-# INLINE[~2] ... #-} * // {-# SPECIALISE [~ 001] ... #-} * {-# RULES ... [~0] ... g #-} Note that it can be written either // without a space [~1] (the PREFIX_TILDE case), or with a space [~ 1] (the VARSYM case). See Note // [Whitespace-sensitive operator parsing] in GHC.Parser.Lexer rule_activation_marker: PREFIX_TILDE | VARSYM; rule_explicit_activation: // In brackets '[' INTEGER ']' | '[' rule_activation_marker INTEGER ']' | '[' rule_activation_marker ']'; rule_foralls: 'forall' rule_vars '.' 'forall' rule_vars '.' // See Note [%shift: rule_foralls -> 'forall' rule_vars '.'] | 'forall' rule_vars '.' /*%shift*/ // See Note [%shift: rule_foralls -> {- empty -}] | /*%shift */; rule_vars: rule_var rule_vars |; rule_var: varid | '(' varid '::' ctype ')'; /* Note [Parsing explicit foralls in Rules] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We really want the above definition of rule_foralls to be: rule_foralls : 'forall' tv_bndrs '.' 'forall' rule_vars '.' | 'forall' rule_vars '.' | {- empty -} where rule_vars (term variables) can be named "forall", "family", or "role", but tv_vars (type variables) cannot be. However, such a definition results in a reduce/reduce conflict. For example, when parsing: > {-# RULE "name" forall a ... #-} before the '...' it is impossible to determine whether we should be in the first or second case of the above. This is resolved by using rule_vars (which is more general) for both, and ensuring that type-level quantified variables do not have the names "forall", "family", or "role" in the function 'checkRuleTyVarBndrNames' in GHC.Parser.PostProcess. Thus, whenever the definition of tyvarid (used for tv_bndrs) is changed relative to varid (used for rule_vars), 'checkRuleTyVarBndrNames' must be updated. */ //--------------------------------------------------------------------------- // Warnings and deprecations (c.f. rules) warnings: warnings ';' warning | warnings ';' | warning |; // SUP: TEMPORARY HACK, not checking for `module Foo' warning: namelist strings; deprecations: deprecations ';' deprecation | deprecations ';' | deprecation |; // SUP: TEMPORARY HACK, not checking for `module Foo' deprecation: namelist strings; strings: STRING | '[' stringlist ']'; stringlist: stringlist ',' STRING | STRING |; //--------------------------------------------------------------------------- // Annotations annotation: '{-# ANN' name_var aexp '#-}' | '{-# ANN' 'type' otycon aexp '#-}' | '{-# ANN' 'module' aexp '#-}'; //--------------------------------------------------------------------------- // Foreign import and export declarations fdecl: 'import' callconv safety fspec | 'import' callconv fspec | 'export' callconv fspec; callconv: 'stdcall' | 'ccall' | 'capi' | 'prim' | 'javascript'; safety: 'unsafe' | 'safe' | 'interruptible'; fspec: STRING var '::' sigtype | var '::' sigtype; // if the entity string is missing, it defaults to the empty string; the meaning of an empty entity // string depends on the calling convention //--------------------------------------------------------------------------- // Type signatures opt_sig: | '::' ctype; opt_tyconsig: | '::' gtycon; // Like ktype, but for types that obey the forall-or-nothing rule. See Note [forall-or-nothing rule] // in GHC.Hs.Type. sigktype: sigtype | ctype '::' kind; // Like ctype, but for types that obey the forall-or-nothing rule. See Note [forall-or-nothing rule] // in GHC.Hs.Type. To avoid duplicating the logic in ctype here, we simply reuse the ctype // production and perform surgery on the LHsType it returns to turn it into an LHsSigType. sigtype: ctype; sig_vars: //- Returned in reversed order sig_vars ',' var | var; sigtypes1: sigtype | sigtype ',' sigtypes1; //--------------------------------------------------------------------------- // Types unpackedness: '{-# UNPACK' '#-}' | '{-# NOUNPACK' '#-}'; forall_telescope: 'forall' tv_bndrs '.' | 'forall' tv_bndrs '->'; // A ktype is a ctype, possibly with a kind annotation ktype: ctype | ctype '::' kind; // A ctype is a for-all type ctype: forall_telescope ctype | context '=>' ctype | ipvar '::' ctype | type; //-------------------- // Notes for 'context' We parse a context as a btype so that we don't get reduce/reduce errors in // ctype. The basic problem is that (Eq a, Ord a) looks so much like a tuple type. We can't tell // until we find the => context: btype; /* Note [GADT decl discards annotations] ~~~~~~~~~~~~~~~~~~~~~ The type production for btype `->` ctype add the AnnRarrow annotation twice, in different places. This is because if the type is processed as usual, it belongs on the annotations for the type as a whole. But if the type is passed to mkGadtDecl, it discards the top level SrcSpan, and the top-level annotation will be disconnected. Hence for this specific case it is connected to the first type too. */ type: // See Note [%shift: type -> btype] btype /*shift*/ | btype '->' ctype | btype mult '->' ctype | btype '->.' ctype; // [mu AnnLollyU $2] } mult: PREFIX_PERCENT atype; btype: infixtype; infixtype: // See Note [%shift: infixtype -> ftype] ftype /*%shift*/ | ftype tyop infixtype | unpackedness infixtype; ftype: atype | tyop | ftype tyarg | ftype PREFIX_AT atype; tyarg: atype | unpackedness atype; tyop: qtyconop | tyvarop | SIMPLEQUOTE qconop | SIMPLEQUOTE varop; atype: ntgtycon //- Not including unit tuples // See Note [%shift: atype -> tyvar] | tyvar /*%shift*/ //- (See Note [Unit tuples]) | '*' // See Note [Whitespace-sensitive operator parsing] in GHC.Parser.Lexer | PREFIX_TILDE atype | PREFIX_BANG atype | '{' fielddecls '}' // Constructor sigs only | '(' ')' | '(' ktype ',' comma_types1 ')' | '(#' '#)' | '(#' comma_types1 '#)' | '(#' bar_types2 '#)' | '[' ktype ']' | '(' ktype ')' | quasiquote | splice_untyped // see Note [Promotion] for the followings | SIMPLEQUOTE qcon_nowiredlist | SIMPLEQUOTE '(' ktype ',' comma_types1 ')' | SIMPLEQUOTE '[' comma_types0 ']' | SIMPLEQUOTE var // Two or more [ty, ty, ty] must be a promoted list type, just as if you had written '[ty, ty, // ty] (One means a list type, zero means the list type constructor, so you have to quote // those.) | '[' ktype ',' comma_types1 ']' | INTEGER | CHAR | STRING | '_'; // An inst_type is what occurs in the head of an instance decl e.g. (Foo a, Gaz b) => Wibble a b // It's kept as a single type for convenience. inst_type: sigtype; deriv_types: sigktype | sigktype ',' deriv_types; comma_types0: //- Zero or more: ty,ty,ty comma_types1 | {- empty -}; comma_types1: //- One or more: ty,ty,ty ktype | ktype ',' comma_types1; bar_types2: //- Two or more: ty|ty|ty ktype '|' ktype | ktype '|' bar_types2; tv_bndrs: tv_bndr tv_bndrs | {- empty -}; tv_bndr: tv_bndr_no_braces | '{' tyvar '}' | '{' tyvar '::' kind '}'; tv_bndr_no_braces: tyvar | '(' tyvar '::' kind ')'; fds: {- empty -} | '|' fds1; fds1: fds1 ',' fd | fd; fd: varids0 '->' varids0; varids0: {- empty -} | varids0 tyvar; //--------------------------------------------------------------------------- // Kinds kind: ctype; /* Note [Promotion] ~~~~~~~~~~~~~~~~ - Syntax of promoted qualified names We write 'Nat.Zero instead of Nat.'Zero when dealing with qualified names. Moreover ticks are only allowed in types, not in kinds, for a few reasons: 1. we don't need quotes since we cannot define names in kinds 2. if one day we merge types and kinds, tick would mean look in DataName 3. we don't have a kind namespace anyway - Name resolution When the user write Zero instead of 'Zero in types, we parse it a HsTyVar ("Zero", TcClsName) instead of HsTyVar ("Zero", DataName). We deal with this in the renamer. If a HsTyVar ("Zero", TcClsName) is not bounded in the type level, then we look for it in the term level (we change its namespace to DataName, see Note [Demotion] in GHC.Types.Names.OccName). And both become a HsTyVar ("Zero", DataName) after the renamer. */ //--------------------------------------------------------------------------- // Datatype declarations gadt_constrlist: // Returned in order 'where' '{' gadt_constrs '}' | 'where' vocurly gadt_constrs close | {- empty -}; gadt_constrs: gadt_constr ';' gadt_constrs | gadt_constr |; // We allow the following forms: C :: Eq a => a -> T a C :: forall a. Eq a => !a -> T a D { x,y :: a // } :: T a forall a. Eq a => D { x,y :: a } :: T a gadt_constr: optSemi con_list '::' sigtype; // see Note [Difference in parsing GADT and data constructors] Returns a list because of: C,D :: ty // TODO:AZ capture the optSemi. Why leading?: optSemi con_list '::' sigtype; /* Note [Difference in parsing GADT and data constructors] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GADT constructors have simpler syntax than usual data constructors: in GADTs, types cannot occur to the left of '::', so they cannot be mixed with constructor names (see Note [Parsing data constructors is hard]). Due to simplified syntax, GADT constructor names (left-hand side of '::') use simpler grammar production than usual data constructor names. As a consequence, GADT constructor names are restricted (names like '(*)' are allowed in usual data constructors, but not in GADTs). */ constrs: '=' constrs1; constrs1: constrs1 '|' constr | constr; constr: forall context '=>' constr_stuff | forall constr_stuff; forall: 'forall' tv_bndrs '.' |; constr_stuff: infixtype; fielddecls: | fielddecls1; fielddecls1: fielddecl ',' fielddecls1 | fielddecl; fielddecl: sig_vars '::' ctype; // A list because of f,g :: Int // Reversed! maybe_derivings: | derivings; // A list of one or more deriving clauses at the end of a datatype derivings: derivings deriving // AZ: order? | deriving; // The outer Located is just to allow the caller to know the rightmost extremity of the 'deriving' // clause deriving: 'deriving' deriv_clause_types | 'deriving' deriv_strategy_no_via deriv_clause_types | 'deriving' deriv_clause_types deriv_strategy_via; deriv_clause_types: qtycon | '(' ')' | '(' deriv_types ')'; //--------------------------------------------------------------------------- // Value definitions /* Note [Declaration/signature overlap] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There's an awkward overlap with a type signature. Consider f :: Int -> Int = ...rhs... Then we can't tell whether it's a type signature or a value definition with a result signature until we see the '='. So we have to inline enough to postpone reductions until we know. */ /* ATTENTION: Dirty Hackery Ahead! If the second alternative of vars is var instead of qvar, we get another shift/reduce-conflict. Consider the following programs: { (^^) :: Int->Int ; } Type signature; only var allowed { (^^) :: Int->Int = ... ; } Value defn with result signature; qvar allowed (because of instance decls) We can't tell whether to reduce var to qvar until after we've read the signatures. */ decl_no_th: sigdecl | infixexp opt_sig rhs | pattern_synonym_decl; decl: decl_no_th // Why do we only allow naked declaration splices in top-level declarations and not here? Short // answer: because readFail009 fails terribly with a panic in cvBindsAndSigs otherwise. | splice_exp; rhs: '=' exp wherebinds | gdrhs wherebinds; gdrhs: gdrhs gdrh | gdrh; gdrh: '|' guardquals '=' exp; sigdecl: // See Note [Declaration/signature overlap] for why we need infixexp here infixexp '::' sigtype | var ',' sig_vars '::' sigtype | infix prec ops | pattern_synonym_sig | '{-# COMPLETE' con_list opt_tyconsig '#-}' // This rule is for both INLINE and INLINABLE pragmas | '{-# INLINE' activation qvarcon '#-}' | '{-# SCC' qvar '#-}' | '{-# SCC' qvar STRING '#-}' | '{-# SPECIALISE' activation qvar '::' sigtypes1 '#-}' | '{-# SPECIALISE_INLINE' activation qvar '::' sigtypes1 '#-}' | '{-# SPECIALISE' 'instance' inst_type '#-}' // A minimal complete definition | '{-# MINIMAL' name_boolformula_opt '#-}'; activation: // See Note [%shift: activation -> {- empty -}] {- empty -} /*%shift*/ | explicit_activation; explicit_activation: //- In brackets '[' INTEGER ']' | '[' rule_activation_marker INTEGER ']'; //--------------------------------------------------------------------------- // Expressions quasiquote: TH_QUASIQUOTE | TH_QQUASIQUOTE; exp: infixexp '::' ctype | infixexp '-<' exp | infixexp '>-' exp | infixexp '-<<' exp | infixexp '>>-' exp // See Note [%shift: exp -> infixexp] | infixexp /*shift*/ | exp_prag_exp; //- See Note [Pragmas and operator fixity] infixexp: exp10 | infixexp qop exp10p; //- See Note [Pragmas and operator fixity] // AnnVal annotation for NPlusKPat, which discards the operator exp10p: exp10 | exp_prag_exp10p; //- See Note [Pragmas and operator fixity] exp_prag_exp10p: prag_e exp10p; exp_prag_exp: prag_e exp; // exp_prag(e) : prag_e e //- See Note [Pragmas and operator fixity] {% runPV (unECP $2) >>= \ $2 -> // fmap ecpFromExp $ return $ (reLocA $ sLLlA $1 $> $ HsPragE noExtField (unLoc $1) $2) }; exp10: // See Note [%shift: exp10 -> '-' fexp] '-' fexp /*%shift*/ // See Note [%shift: exp10 -> fexp] | fexp /*%shift*/; optSemi: ';' |; /* Note [Pragmas and operator fixity] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 'prag_e' is an expression pragma, such as {-# SCC ... #-}. It must be used with care, or else #15730 happens. Consider this infix expression: 1 / 2 / 2 There are two ways to parse it: 1. (1 / 2) / 2 = 0.25 2. 1 / (2 / 2) = 1.0 Due to the fixity of the (/) operator (assuming it comes from Prelude), option 1 is the correct parse. However, in the past GHC's parser used to get confused by the SCC annotation when it occurred in the middle of an infix expression: 1 / {-# SCC ann #-} 2 / 2 -- used to get parsed as option 2 There are several ways to address this issue, see GHC Proposal #176 for a detailed exposition: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0176-scc-parsing.rst The accepted fix is to disallow pragmas that occur within infix expressions. Infix expressions are assembled out of 'exp10', so 'exp10' must not accept pragmas. Instead, we accept them in exactly two places: at the start of an expression or a parenthesized subexpression: f = {-# SCC ann #-} 1 / 2 / 2 -- at the start of the expression g = 5 + ({-# SCC ann #-} 1 / 2 / 2) -- at the start of a parenthesized subexpression immediately after the last operator: f = 1 / 2 / {-# SCC ann #-} 2 In both cases, the parse does not depend on operator fixity. The second case may sound unnecessary, but it's actually needed to support a common idiom: f $ {-# SCC ann $-} ... */ prag_e: '{-# SCC' STRING '#-}' | '{-# SCC' VARID '#-}'; fexp: fexp aexp // See Note [Whitespace-sensitive operator parsing] in GHC.Parser.Lexer | fexp PREFIX_AT atype | 'static' aexp | aexp; aexp: // See Note [Whitespace-sensitive operator parsing] in GHC.Parser.Lexer qvar TIGHT_INFIX_AT aexp // See Note [Whitespace-sensitive operator parsing] in GHC.Parser.Lexer | PREFIX_TILDE aexp | PREFIX_BANG aexp | PREFIX_MINUS aexp | '\\' apats '->' exp | 'let' binds 'in' exp | '\\' 'lcase' altslist | 'if' exp optSemi 'then' exp optSemi 'else' exp | 'if' ifgdpats | 'case' exp 'of' altslist // QualifiedDo. | DO stmtlist | MDO stmtlist | 'proc' aexp '->' exp | aexp1; aexp1: aexp1 '{' fbinds '}' // See Note [Whitespace-sensitive operator parsing] in GHC.Parser.Lexer | aexp1 TIGHT_INFIX_PROJ field | aexp2; aexp2: qvar | qcon // See Note [%shift: aexp2 -> ipvar] | ipvar /*shift */ | overloaded_label | literal // This will enable overloaded strings permanently. Normally the renamer turns HsString into // HsOverLit when -XOverloadedStrings is on. | STRING { sL (getLoc $1) (HsOverLit $! // mkHsIsString (getSTRINGs $1) (getSTRING $1) noExtField) } | INTEGER | RATIONAL // N.B.: sections get parsed by these next two productions. This allows you to write, e.g., '(+ // 3, 4 -)', which isn't correct Haskell (you'd have to write '((+ 3), (4 -))') but the less // cluttered version fell out of having texps. | '(' texp ')' | '(' tup_exprs ')' // This case is only possible when 'OverloadedRecordDotBit' is enabled. | '(' projection ')' | '(#' texp '#)' | '(#' tup_exprs '#)' | '[' list ']' | '_' // Template Haskell Extension | splice_untyped | splice_typed | SIMPLEQUOTE qvar | SIMPLEQUOTE qcon | TH_TY_QUOTE tyvar | TH_TY_QUOTE gtycon // See Note [%shift: aexp2 -> TH_TY_QUOTE] | TH_TY_QUOTE /*shift */ | '[|' exp '|]' | '[||' exp '||]' | '[t|' ktype '|]' | '[p|' infixexp '|]' | '[d|' cvtopbody '|]' | quasiquote // arrow notation extension | '(|' aexp cmdargs '|)'; projection: // See Note [Whitespace-sensitive operator parsing] in GHC.Parsing.Lexer projection TIGHT_INFIX_PROJ field | PREFIX_PROJ field; splice_exp: splice_untyped | splice_typed; splice_untyped: // See Note [Whitespace-sensitive operator parsing] in GHC.Parser.Lexer PREFIX_DOLLAR aexp2; splice_typed: // See Note [Whitespace-sensitive operator parsing] in GHC.Parser.Lexer PREFIX_DOLLAR_DOLLAR aexp2; cmdargs: cmdargs acmd |; acmd: aexp; cvtopbody: '{' cvtopdecls0 '}' | vocurly cvtopdecls0 close; cvtopdecls0: topdecls_semi | topdecls; //--------------------------------------------------------------------------- // Tuple expressions // "texp" is short for tuple expressions: things that can appear unparenthesized as long as they're // inside parens or delimited by commas texp: exp // Note [Parsing sections] ~~~~~~~~~~~~~~~~~~~~~~~ We include left and right sections here, // which isn't technically right according to the Haskell standard. For example (3 +, True) // isn't legal. However, we want to parse bang patterns like (!x, !y) and it's convenient to do // so here as a section Then when converting expr to pattern we unravel it again Meanwhile, the // renamer checks that real sections appear inside parens. | infixexp qop | qopm infixexp // View patterns get parenthesized above | exp '->' texp; // Always at least one comma or bar. Though this can parse just commas (without any expressions), it // won't in practice, because (,,,) is parsed as a name. See Note [ExplicitTuple] in GHC.Hs.Expr. tup_exprs: texp commas_tup_tail | commas tup_tail | texp bars | bars texp bars0; // Always starts with commas; always follows an expr commas_tup_tail: commas tup_tail; // Always follows a comma tup_tail: texp commas_tup_tail | texp // See Note [%shift: tup_tail -> {- empty -}] | /*%shift*/; //--------------------------------------------------------------------------- // List expressions // The rules below are little bit contorted to keep lexps left-recursive while avoiding another // shift/reduce-conflict. Never empty. list: texp | lexps | texp '..' | texp ',' exp '..' | texp '..' exp | texp ',' exp '..' exp | texp '|' flattenedpquals; lexps: lexps ',' texp | texp ',' texp; //--------------------------------------------------------------------------- // List Comprehensions flattenedpquals: pquals; pquals: squals '|' pquals | squals; squals: // one can "grab" the earlier ones squals ',' transformqual | squals ',' qual | transformqual | qual; // | transformquals1 ',' '{|' pquals '|}' { sLL $1 $> ($4 : unLoc $1) } | '{|' pquals '|}' { sL1 $1 // [$2] } // It is possible to enable bracketing (associating) qualifier lists by uncommenting the lines with // {| |} above. Due to a lack of consensus on the syntax, this feature is not being used until we // get user demand. transformqual: // Function is applied to a list of stmts *in order* 'then' exp | 'then' exp 'by' exp | 'then' 'group' 'using' exp | 'then' 'group' 'by' exp 'using' exp; // Note that 'group' is a special_id, which means that you can enable TransformListComp while still // using Data.List.group. However, this introduces a shift/reduce conflict. Happy chooses to resolve // the conflict in by choosing the "group by" variant, which is what we want. //--------------------------------------------------------------------------- // Guards guardquals: guardquals1; guardquals1: guardquals1 ',' qual | qual; //--------------------------------------------------------------------------- // Case alternatives altslist: '{' alts '}' | vocurly alts close | '{' '}' | vocurly close; alts: alts1 | ';' alts; alts1: alts1 ';' alt | alts1 ';' | alt; alt: pat alt_rhs; alt_rhs: ralt wherebinds; ralt: '->' exp | gdpats; gdpats: gdpats gdpat | gdpat; // layout for MultiWayIf doesn't begin with an open brace, because it's hard to generate the open // brace in addition to the vertical bar in the lexer, and we don't need it. ifgdpats: '{' gdpats '}' | gdpats close; gdpat: '|' guardquals '->' exp; // 'pat' recognises a pattern, including one with a bang at the top e.g. "!x" or "!(x,y)" or "C a b" // etc Bangs inside are parsed as infix operator applications, so that we parse them right when // bang-patterns are off pat: exp; bindpat: exp; apat: aexp; apats: apat apats | {- empty -}; //--------------------------------------------------------------------------- // Statement sequences stmtlist: '{' stmts '}' | vocurly stmts close; // do { ;; s ; s ; ; s ;; } The last Stmt should be an expression, but that's hard to enforce here, // because we need too much lookahead if we see do { e ; } So we use BodyStmts throughout, and // switch the last one over in ParseUtils.checkDo instead stmts: stmts ';' stmt | stmts ';' | stmt |; // For typing stmts at the GHCi prompt, where the input may consist of just comments. maybe_stmt: stmt |; // For GHC API. e_stmt: stmt; stmt: qual | 'rec' stmtlist; qual: bindpat '<-' exp | exp | 'let' binds; //--------------------------------------------------------------------------- // Record Field Update/Construction fbinds: fbinds1 | {- empty -}; fbinds1: fbind ',' fbinds1 | fbind | '..'; fbind: qvar '=' texp // RHS is a 'texp', allowing view patterns (#6038) and, incidentally, sections. Eg f (R { x = // show -> s }) = ... | qvar // In the punning case, use a place-holder The renamer fills in the final value // See Note [Whitespace-sensitive operator parsing] in GHC.Parser.Lexer AZ: need to pull out the // let block into a helper | field TIGHT_INFIX_PROJ fieldToUpdate '=' texp // See Note [Whitespace-sensitive operator parsing] in GHC.Parser.Lexer AZ: need to pull out the // let block into a helper | field TIGHT_INFIX_PROJ fieldToUpdate; fieldToUpdate: // See Note [Whitespace-sensitive operator parsing] in Lexer.x fieldToUpdate TIGHT_INFIX_PROJ field | field; //--------------------------------------------------------------------------- // Implicit Parameter Bindings dbinds: dbinds ';' dbind | dbinds ';'; //- reversed // | {- empty -} { [] } dbind: ipvar '=' exp; ipvar: IPDUPVARID; //--------------------------------------------------------------------------- // Overloaded labels overloaded_label: LABELVARID; //--------------------------------------------------------------------------- // Warnings and deprecations name_boolformula_opt: name_boolformula | {- empty -}; name_boolformula: name_boolformula_and | name_boolformula_and '|' name_boolformula; name_boolformula_and: name_boolformula_and_list; name_boolformula_and_list: name_boolformula_atom | name_boolformula_atom ',' name_boolformula_and_list; name_boolformula_atom: '(' name_boolformula ')' | name_var; namelist: name_var | name_var ',' namelist; name_var: var | con; //--------------------------------------- // Data constructors There are two different productions here as lifted list constructors are parsed // differently. qcon_nowiredlist: gen_qcon | sysdcon_nolist; qcon: gen_qcon | sysdcon; gen_qcon: qconid | '(' qconsym ')'; con: conid | '(' consym ')' | sysdcon; con_list: con | con ',' con_list; // See Note [ExplicitTuple] in GHC.Hs.Expr sysdcon_nolist: //- Wired in data constructors '(' ')' | '(' commas ')' | '(#' '#)' | '(#' commas '#)'; // See Note [Empty lists] in GHC.Hs.Expr sysdcon: sysdcon_nolist | '[' ']'; conop: consym | '`' conid '`'; qconop: qconsym | '`' qconid '`'; //-------------------------------------------------------------------------- // Type constructors // See Note [Unit tuples] in GHC.Hs.Type for the distinction between gtycon and ntgtycon gtycon: //- A "general" qualified tycon, including unit tuples ntgtycon | '(' ')' | '(#' '#)'; ntgtycon: //- A "general" qualified tycon, excluding unit tuples oqtycon | '(' commas ')' | '(#' commas '#)' | '(#' bars '#)' | '(' '->' ')' | '[' ']'; oqtycon: //- An "ordinary" qualified tycon; qtycon | '(' qtyconsym ')'; // These can appear in export lists oqtycon_no_varcon: //- Type constructor which cannot be mistaken qtycon | '(' QCONSYM ')' | '(' CONSYM ')' | '(' ':' ')'; // for variable constructor in export lists see Note [Type constructors in export list]: qtycon | '(' QCONSYM ')' | '(' CONSYM ')' | '(' ':' ')'; /* Note [Type constructors in export list] ~~~~~~~~~~~~~~~~~~~~~ Mixing type constructors and data constructors in export lists introduces ambiguity in grammar: e.g. (*) may be both a type constructor and a function. -XExplicitNamespaces allows to disambiguate by explicitly prefixing type constructors with 'type' keyword. This ambiguity causes reduce/reduce conflicts in parser, which are always resolved in favour of data constructors. To get rid of conflicts we demand that ambiguous type constructors (those, which are formed by the same productions as variable constructors) are always prefixed with 'type' keyword. Unambiguous type constructors may occur both with or without 'type' keyword. Note that in the parser we still parse data constructors as type constructors. As such, they still end up in the type constructor namespace until after renaming when we resolve the proper namespace for each exported child. */ qtyconop: // See Note [%shift: qtyconop -> qtyconsym] qtyconsym /*shift */ | '`' qtycon '`'; qtycon: QCONID | tycon; //- Qualified or unqualified tycon: CONID; //- Unqualified qtyconsym: QCONSYM | QVARSYM | tyconsym; tyconsym: CONSYM | VARSYM | ':' | '-' | '.'; // An "ordinary" unqualified tycon. See `oqtycon` for the qualified version. These can appear in // `ANN type` declarations (#19374). otycon: tycon | '(' tyconsym ')'; //--------------------------------------------------------------------------- // Operators op: varop | conop | '->'; //- used in infix decls varop: varsym | '`' varid '`'; qop: qvarop | qconop | hole_op; //- used in sections qopm: qvaropm | qconop | hole_op; //- used in sections // used in sections hole_op: '`' '_' '`'; qvarop: qvarsym | '`' qvarid '`'; qvaropm: qvarsym_no_minus | '`' qvarid '`'; //--------------------------------------------------------------------------- // Type variables tyvar: tyvarid; tyvarop: '`' tyvarid '`'; tyvarid: VARID | special_id | 'unsafe' | 'safe' | 'interruptible'; // If this changes relative to varid, update 'checkRuleTyVarBndrNames' in GHC.Parser.PostProcess See // Note [Parsing explicit foralls in Rules] //--------------------------------------------------------------------------- // Variables var: varid | '(' varsym ')'; qvar: qvarid | '(' varsym ')' | '(' qvarsym1 ')'; // We've inlined qvarsym here so that the decision about whether it's a qvar or a var can be // postponed until *after* we see the close paren. field: varid; qvarid: varid | QVARID; // Note that 'role' and 'family' get lexed separately regardless of the use of extensions. However, // because they are listed here, this is OK and they can be used as normal varids. See Note [Lexing // type pseudo-keywords] in GHC.Parser.Lexer varid: VARID | special_id | 'unsafe' | 'safe' | 'interruptible' | 'forall' | 'family' | 'role'; // If this changes relative to tyvarid, update 'checkRuleTyVarBndrNames' in GHC.Parser.PostProcess // See Note [Parsing explicit foralls in Rules] qvarsym: varsym | qvarsym1; qvarsym_no_minus: varsym_no_minus | qvarsym1; qvarsym1: QVARSYM; varsym: varsym_no_minus | '-'; varsym_no_minus: //- varsym not including '-' VARSYM | special_sym; // These special_ids are treated as keywords in various places, but as ordinary ids elsewhere. // 'special_id' collects all these except 'unsafe', 'interruptible', 'forall', 'family', 'role', // 'stock', and 'anyclass', whose treatment differs depending on context special_id: 'as' | 'qualified' | 'hiding' | 'export' | 'label' | 'dynamic' | 'stdcall' | 'ccall' | 'capi' | 'prim' | 'javascript' // See Note [%shift: special_id -> 'group'] | 'group' /*shift */ | 'stock' | 'anyclass' | 'via' | 'unit' | 'dependency' | 'signature'; special_sym: '.' | '*'; //--------------------------------------------------------------------------- // Data constructors qconid: conid | QCONID; //- Qualified or unqualified conid: CONID; qconsym: consym | QCONSYM; //- Qualified or unqualified consym: CONSYM // ':' means only list cons | ':'; //--------------------------------------------------------------------------- // Literals literal: CHAR | STRING | PRIMINTEGER | PRIMWORD | PRIMCHAR | PRIMSTRING | PRIMFLOAT | PRIMDOUBLE; //--------------------------------------------------------------------------- // Layout close: vccurly //- context popped in lexer. | /*error*/; //--------------------------------------------------------------------------- // Miscellaneous (mostly renamings) modid: CONID | QCONID; commas: commas ',' | ','; //- One or more commas bars0: bars |; //- Zero or more bars bars: bars '|' | '|'; //- One or more bars
lib/math.asm
VincentFoulon80/vixx
1
167911
; Get the left part of a byte ; rolls the part to the right ; params ; accumulator !macro get_left { lsr lsr lsr lsr } ; Get the right part of a byte ; params ; accumulator !macro get_right { and #$0F } ; Increment for 16 bit values ; params ; .address: address of a 16-bit value !macro inc16 .address { inc .address ; increment low byte bne + ; if byte reached zero (an overflow occured) inc .address+1 ; increment high byte + } ; Decrement for 16 bit values ; params ; .address: address of a 16-bit value !macro dec16 .address { lda .address ; load low byte bne + ; if byte is zero dec .address+1 ; decrement high byte + dec .address ; after that, decrement low byte } ; Add with Carry for 16 bit values of a 8 bit value ; no carry operation is performed before and after the actual addition ; params ; .address: address of a 16-bit value ; .value: 8-bit value !macro adc16 .address, .value { lda .address ; load low byte adc #.value ; add the value bcc + ; if the carry is set inc .address+1 ; increment the high byte + sta .address ; store the low byte } ; Add with Carry for 16 bit values of a 8 bit value ; no carry operation is performed before and after the actual addition ; params ; .address: address of a 16-bit value ; .value: address !macro adc16_ptr .address, .value { lda .address ; load low byte adc .value ; add the value bcc + ; if the carry is set inc .address+1 ; increment the high byte + sta .address ; store the low byte } ; Substract with Carry for 16 bit values of a 8 bit value ; no carry operation is performed before and after the actual substraction ; params ; .address: address of a 16-bit value ; .value: 8-bit value !macro sbc16 .address, .value { lda .address ; load low byte sbc #.value ; substract the value bcs + ; if the carry is cleared dec .address+1 ; decrement the high byte + sta .address ; store the low byte } ; Add with Carry for 16 bit values of a 16 bit value ; no carry operation is performed before and after the actual addition ; params ; .address: address of a 16-bit value ; .value: 16-bit value !macro adc16_16 .address, .value { lda .address ; \ adc #<.value ; |- classic addition of low byte sta .address ; / lda .address+1 ; \ adc #>.value ; |- classic addition of high byte (the carry will do its job) sta .address+1 ; / } ; Add with Carry for 16 bit values of a 16 bit value ; no carry operation is performed before and after the actual addition ; params ; .address: address of a 16-bit value ; .value: 16-bit adress !macro adc16_16_ptr .address, .value { lda .address ; \ adc <.value ; |- classic addition of low byte sta .address ; / lda .address+1 ; \ adc >.value ; |- classic addition of high byte (the carry will do its job) sta .address+1 ; / } ; Substract with Carry for 16 bit values of a 16 bit value ; no carry operation is performed before and after the actual substraction ; params ; .address: address of a 16-bit value ; .value: 16-bit value !macro sbc16_16 .address, .value { lda .address ; \ sbc #<.value ; |- classic substraction of low byte sta .address ; / lda .address+1 ; \ sbc #>.value ; |- classic substraction of high byte (the carry will do its job) sta .address+1 ; / } ; Multiply a value with another one ; params ; .value: 8-bit value ; .multiplier: 8-bit value !macro multiply .value, .multiplier { lda #.value +mul .multiplier } ; Accumulator Multiply ; params ; Accumulator: 8-bit value ; .multiplier: 8-bit value !macro mul .multiplier { tax lda #0 - clc adc #.multiplier dex bne - } !macro mul16 .address, .multiplier, .result { ldx #.multiplier stz .result stz .result+1 - clc +adc16_16_ptr .result, .address dex bne - } ; Divide a value with another one ; params ; .dividend: 8-bit value ; .divider: 8-bit value !macro divide .dividend, .divider { lda #.dividend ; load the dividend +dva .divider } ; Divide Accumulator ; params ; Accumulator: 8-bit value ; .divider: 8-bit value !macro dva .divider { ; assuming the accumulator contains the dividend and the divider is not zero ldx #0 ; reset the x register sec ; set the carry (for the following substractions) - inx ; incement x sbc #.divider ; substract the divider bcs - ; if the carry is cleared (the result is now positive) dex txa ; transfer x to accumulator } ; Modulate a value with another one ; params ; .value: 8-bit value ; .base: 8-bit value !macro modulo .value, .base { lda #.value ; load the value +mda .base } ; Modulate Accumulator ; params ; Accumulator: 8-bit value ; .base: 8-bit value !macro mda .base { ; assuming the accumulator contains the main value and the base is not zero sec ; set the carry (for the following substractions) - sbc #.base ; substraction loop bcs - ; until the carry is cleared (the result is now negative) adc #.base ; restore the value to the positive side } ; Square root of a value ; see : http://6502org.wikidot.com/software-math-sqrt ; params ; .value: address to a 16-bit value ; .result: address to a 8-bit value (output) ; .remainder: address to a 8-bit value (output) ; additional output: ; Flag Carry: 9th bit of the remainder !macro squareroot .value, .result, .remainder { stz .result stz .remainder ldx #8 - sec lda .value+1 sbc #$40 tay lda .remainder sbc .result bcc + sty .value+1 sta .remainder + rol .result asl .value rol .value+1 rol .remainder asl .value rol .value+1 rol .remainder dex bne - }
src/sqlite/sqlite3_h.ads
Letractively/ada-ado
0
13870
<reponame>Letractively/ada-ado with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; -- with Interfaces.C.Extensions; with System; package Sqlite3_H is pragma Preelaborate; pragma Warnings (Off); pragma Warnings (Off, "*style*"); -- unsupported macro: SQLITE_EXTERN extern SQLITE_VERSION : aliased constant String := "3.6.22" & ASCII.NUL; -- /usr/include/sqlite3.h:110 SQLITE_VERSION_NUMBER : constant := 3006022; -- /usr/include/sqlite3.h:111 SQLITE_SOURCE_ID : aliased constant String := "2010-01-05 15:30:36 28d0d7710761114a44a1a3a425a6883c661f06e7" & ASCII.NUL; -- /usr/include/sqlite3.h:112 SQLITE_OK : constant := 0; -- /usr/include/sqlite3.h:353 SQLITE_ERROR : constant := 1; -- /usr/include/sqlite3.h:355 SQLITE_INTERNAL : constant := 2; -- /usr/include/sqlite3.h:356 SQLITE_PERM : constant := 3; -- /usr/include/sqlite3.h:357 SQLITE_ABORT : constant := 4; -- /usr/include/sqlite3.h:358 SQLITE_BUSY : constant := 5; -- /usr/include/sqlite3.h:359 SQLITE_LOCKED : constant := 6; -- /usr/include/sqlite3.h:360 SQLITE_NOMEM : constant := 7; -- /usr/include/sqlite3.h:361 SQLITE_READONLY : constant := 8; -- /usr/include/sqlite3.h:362 SQLITE_INTERRUPT : constant := 9; -- /usr/include/sqlite3.h:363 SQLITE_IOERR : constant := 10; -- /usr/include/sqlite3.h:364 SQLITE_CORRUPT : constant := 11; -- /usr/include/sqlite3.h:365 SQLITE_NOTFOUND : constant := 12; -- /usr/include/sqlite3.h:366 SQLITE_FULL : constant := 13; -- /usr/include/sqlite3.h:367 SQLITE_CANTOPEN : constant := 14; -- /usr/include/sqlite3.h:368 SQLITE_PROTOCOL : constant := 15; -- /usr/include/sqlite3.h:369 SQLITE_EMPTY : constant := 16; -- /usr/include/sqlite3.h:370 SQLITE_SCHEMA : constant := 17; -- /usr/include/sqlite3.h:371 SQLITE_TOOBIG : constant := 18; -- /usr/include/sqlite3.h:372 SQLITE_CONSTRAINT : constant := 19; -- /usr/include/sqlite3.h:373 SQLITE_MISMATCH : constant := 20; -- /usr/include/sqlite3.h:374 SQLITE_MISUSE : constant := 21; -- /usr/include/sqlite3.h:375 SQLITE_NOLFS : constant := 22; -- /usr/include/sqlite3.h:376 SQLITE_AUTH : constant := 23; -- /usr/include/sqlite3.h:377 SQLITE_FORMAT : constant := 24; -- /usr/include/sqlite3.h:378 SQLITE_RANGE : constant := 25; -- /usr/include/sqlite3.h:379 SQLITE_NOTADB : constant := 26; -- /usr/include/sqlite3.h:380 SQLITE_ROW : constant := 100; -- /usr/include/sqlite3.h:381 SQLITE_DONE : constant := 101; -- /usr/include/sqlite3.h:382 -- unsupported macro: SQLITE_IOERR_READ (SQLITE_IOERR | (1<<8)) -- unsupported macro: SQLITE_IOERR_SHORT_READ (SQLITE_IOERR | (2<<8)) -- unsupported macro: SQLITE_IOERR_WRITE (SQLITE_IOERR | (3<<8)) -- unsupported macro: SQLITE_IOERR_FSYNC (SQLITE_IOERR | (4<<8)) -- unsupported macro: SQLITE_IOERR_DIR_FSYNC (SQLITE_IOERR | (5<<8)) -- unsupported macro: SQLITE_IOERR_TRUNCATE (SQLITE_IOERR | (6<<8)) -- unsupported macro: SQLITE_IOERR_FSTAT (SQLITE_IOERR | (7<<8)) -- unsupported macro: SQLITE_IOERR_UNLOCK (SQLITE_IOERR | (8<<8)) -- unsupported macro: SQLITE_IOERR_RDLOCK (SQLITE_IOERR | (9<<8)) -- unsupported macro: SQLITE_IOERR_DELETE (SQLITE_IOERR | (10<<8)) -- unsupported macro: SQLITE_IOERR_BLOCKED (SQLITE_IOERR | (11<<8)) -- unsupported macro: SQLITE_IOERR_NOMEM (SQLITE_IOERR | (12<<8)) -- unsupported macro: SQLITE_IOERR_ACCESS (SQLITE_IOERR | (13<<8)) -- unsupported macro: SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8)) -- unsupported macro: SQLITE_IOERR_LOCK (SQLITE_IOERR | (15<<8)) -- unsupported macro: SQLITE_IOERR_CLOSE (SQLITE_IOERR | (16<<8)) -- unsupported macro: SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17<<8)) -- unsupported macro: SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8) ) SQLITE_OPEN_READONLY : constant := 16#00000001#; -- /usr/include/sqlite3.h:435 SQLITE_OPEN_READWRITE : constant := 16#00000002#; -- /usr/include/sqlite3.h:436 SQLITE_OPEN_CREATE : constant := 16#00000004#; -- /usr/include/sqlite3.h:437 SQLITE_OPEN_DELETEONCLOSE : constant := 16#00000008#; -- /usr/include/sqlite3.h:438 SQLITE_OPEN_EXCLUSIVE : constant := 16#00000010#; -- /usr/include/sqlite3.h:439 SQLITE_OPEN_MAIN_DB : constant := 16#00000100#; -- /usr/include/sqlite3.h:440 SQLITE_OPEN_TEMP_DB : constant := 16#00000200#; -- /usr/include/sqlite3.h:441 SQLITE_OPEN_TRANSIENT_DB : constant := 16#00000400#; -- /usr/include/sqlite3.h:442 SQLITE_OPEN_MAIN_JOURNAL : constant := 16#00000800#; -- /usr/include/sqlite3.h:443 SQLITE_OPEN_TEMP_JOURNAL : constant := 16#00001000#; -- /usr/include/sqlite3.h:444 SQLITE_OPEN_SUBJOURNAL : constant := 16#00002000#; -- /usr/include/sqlite3.h:445 SQLITE_OPEN_MASTER_JOURNAL : constant := 16#00004000#; -- /usr/include/sqlite3.h:446 SQLITE_OPEN_NOMUTEX : constant := 16#00008000#; -- /usr/include/sqlite3.h:447 SQLITE_OPEN_FULLMUTEX : constant := 16#00010000#; -- /usr/include/sqlite3.h:448 SQLITE_OPEN_SHAREDCACHE : constant := 16#00020000#; -- /usr/include/sqlite3.h:449 SQLITE_OPEN_PRIVATECACHE : constant := 16#00040000#; -- /usr/include/sqlite3.h:450 SQLITE_IOCAP_ATOMIC : constant := 16#00000001#; -- /usr/include/sqlite3.h:472 SQLITE_IOCAP_ATOMIC512 : constant := 16#00000002#; -- /usr/include/sqlite3.h:473 SQLITE_IOCAP_ATOMIC1K : constant := 16#00000004#; -- /usr/include/sqlite3.h:474 SQLITE_IOCAP_ATOMIC2K : constant := 16#00000008#; -- /usr/include/sqlite3.h:475 SQLITE_IOCAP_ATOMIC4K : constant := 16#00000010#; -- /usr/include/sqlite3.h:476 SQLITE_IOCAP_ATOMIC8K : constant := 16#00000020#; -- /usr/include/sqlite3.h:477 SQLITE_IOCAP_ATOMIC16K : constant := 16#00000040#; -- /usr/include/sqlite3.h:478 SQLITE_IOCAP_ATOMIC32K : constant := 16#00000080#; -- /usr/include/sqlite3.h:479 SQLITE_IOCAP_ATOMIC64K : constant := 16#00000100#; -- /usr/include/sqlite3.h:480 SQLITE_IOCAP_SAFE_APPEND : constant := 16#00000200#; -- /usr/include/sqlite3.h:481 SQLITE_IOCAP_SEQUENTIAL : constant := 16#00000400#; -- /usr/include/sqlite3.h:482 SQLITE_LOCK_NONE : constant := 0; -- /usr/include/sqlite3.h:491 SQLITE_LOCK_SHARED : constant := 1; -- /usr/include/sqlite3.h:492 SQLITE_LOCK_RESERVED : constant := 2; -- /usr/include/sqlite3.h:493 SQLITE_LOCK_PENDING : constant := 3; -- /usr/include/sqlite3.h:494 SQLITE_LOCK_EXCLUSIVE : constant := 4; -- /usr/include/sqlite3.h:495 SQLITE_SYNC_NORMAL : constant := 16#00002#; -- /usr/include/sqlite3.h:511 SQLITE_SYNC_FULL : constant := 16#00003#; -- /usr/include/sqlite3.h:512 SQLITE_SYNC_DATAONLY : constant := 16#00010#; -- /usr/include/sqlite3.h:513 SQLITE_FCNTL_LOCKSTATE : constant := 1; -- /usr/include/sqlite3.h:651 SQLITE_GET_LOCKPROXYFILE : constant := 2; -- /usr/include/sqlite3.h:652 SQLITE_SET_LOCKPROXYFILE : constant := 3; -- /usr/include/sqlite3.h:653 SQLITE_LAST_ERRNO : constant := 4; -- /usr/include/sqlite3.h:654 SQLITE_ACCESS_EXISTS : constant := 0; -- /usr/include/sqlite3.h:835 SQLITE_ACCESS_READWRITE : constant := 1; -- /usr/include/sqlite3.h:836 SQLITE_ACCESS_READ : constant := 2; -- /usr/include/sqlite3.h:837 SQLITE_CONFIG_SINGLETHREAD : constant := 1; -- /usr/include/sqlite3.h:1247 SQLITE_CONFIG_MULTITHREAD : constant := 2; -- /usr/include/sqlite3.h:1248 SQLITE_CONFIG_SERIALIZED : constant := 3; -- /usr/include/sqlite3.h:1249 SQLITE_CONFIG_MALLOC : constant := 4; -- /usr/include/sqlite3.h:1250 SQLITE_CONFIG_GETMALLOC : constant := 5; -- /usr/include/sqlite3.h:1251 SQLITE_CONFIG_SCRATCH : constant := 6; -- /usr/include/sqlite3.h:1252 SQLITE_CONFIG_PAGECACHE : constant := 7; -- /usr/include/sqlite3.h:1253 SQLITE_CONFIG_HEAP : constant := 8; -- /usr/include/sqlite3.h:1254 SQLITE_CONFIG_MEMSTATUS : constant := 9; -- /usr/include/sqlite3.h:1255 SQLITE_CONFIG_MUTEX : constant := 10; -- /usr/include/sqlite3.h:1256 SQLITE_CONFIG_GETMUTEX : constant := 11; -- /usr/include/sqlite3.h:1257 SQLITE_CONFIG_LOOKASIDE : constant := 13; -- /usr/include/sqlite3.h:1259 SQLITE_CONFIG_PCACHE : constant := 14; -- /usr/include/sqlite3.h:1260 SQLITE_CONFIG_GETPCACHE : constant := 15; -- /usr/include/sqlite3.h:1261 SQLITE_DBCONFIG_LOOKASIDE : constant := 1001; -- /usr/include/sqlite3.h:1296 SQLITE_DENY : constant := 1; -- /usr/include/sqlite3.h:1982 SQLITE_IGNORE : constant := 2; -- /usr/include/sqlite3.h:1983 SQLITE_CREATE_INDEX : constant := 1; -- /usr/include/sqlite3.h:2005 SQLITE_CREATE_TABLE : constant := 2; -- /usr/include/sqlite3.h:2006 SQLITE_CREATE_TEMP_INDEX : constant := 3; -- /usr/include/sqlite3.h:2007 SQLITE_CREATE_TEMP_TABLE : constant := 4; -- /usr/include/sqlite3.h:2008 SQLITE_CREATE_TEMP_TRIGGER : constant := 5; -- /usr/include/sqlite3.h:2009 SQLITE_CREATE_TEMP_VIEW : constant := 6; -- /usr/include/sqlite3.h:2010 SQLITE_CREATE_TRIGGER : constant := 7; -- /usr/include/sqlite3.h:2011 SQLITE_CREATE_VIEW : constant := 8; -- /usr/include/sqlite3.h:2012 SQLITE_DELETE : constant := 9; -- /usr/include/sqlite3.h:2013 SQLITE_DROP_INDEX : constant := 10; -- /usr/include/sqlite3.h:2014 SQLITE_DROP_TABLE : constant := 11; -- /usr/include/sqlite3.h:2015 SQLITE_DROP_TEMP_INDEX : constant := 12; -- /usr/include/sqlite3.h:2016 SQLITE_DROP_TEMP_TABLE : constant := 13; -- /usr/include/sqlite3.h:2017 SQLITE_DROP_TEMP_TRIGGER : constant := 14; -- /usr/include/sqlite3.h:2018 SQLITE_DROP_TEMP_VIEW : constant := 15; -- /usr/include/sqlite3.h:2019 SQLITE_DROP_TRIGGER : constant := 16; -- /usr/include/sqlite3.h:2020 SQLITE_DROP_VIEW : constant := 17; -- /usr/include/sqlite3.h:2021 SQLITE_INSERT : constant := 18; -- /usr/include/sqlite3.h:2022 SQLITE_PRAGMA : constant := 19; -- /usr/include/sqlite3.h:2023 SQLITE_READ : constant := 20; -- /usr/include/sqlite3.h:2024 SQLITE_SELECT : constant := 21; -- /usr/include/sqlite3.h:2025 SQLITE_TRANSACTION : constant := 22; -- /usr/include/sqlite3.h:2026 SQLITE_UPDATE : constant := 23; -- /usr/include/sqlite3.h:2027 SQLITE_ATTACH : constant := 24; -- /usr/include/sqlite3.h:2028 SQLITE_DETACH : constant := 25; -- /usr/include/sqlite3.h:2029 SQLITE_ALTER_TABLE : constant := 26; -- /usr/include/sqlite3.h:2030 SQLITE_REINDEX : constant := 27; -- /usr/include/sqlite3.h:2031 SQLITE_ANALYZE : constant := 28; -- /usr/include/sqlite3.h:2032 SQLITE_CREATE_VTABLE : constant := 29; -- /usr/include/sqlite3.h:2033 SQLITE_DROP_VTABLE : constant := 30; -- /usr/include/sqlite3.h:2034 SQLITE_FUNCTION : constant := 31; -- /usr/include/sqlite3.h:2035 SQLITE_SAVEPOINT : constant := 32; -- /usr/include/sqlite3.h:2036 SQLITE_COPY : constant := 0; -- /usr/include/sqlite3.h:2037 SQLITE_LIMIT_LENGTH : constant := 0; -- /usr/include/sqlite3.h:2337 SQLITE_LIMIT_SQL_LENGTH : constant := 1; -- /usr/include/sqlite3.h:2338 SQLITE_LIMIT_COLUMN : constant := 2; -- /usr/include/sqlite3.h:2339 SQLITE_LIMIT_EXPR_DEPTH : constant := 3; -- /usr/include/sqlite3.h:2340 SQLITE_LIMIT_COMPOUND_SELECT : constant := 4; -- /usr/include/sqlite3.h:2341 SQLITE_LIMIT_VDBE_OP : constant := 5; -- /usr/include/sqlite3.h:2342 SQLITE_LIMIT_FUNCTION_ARG : constant := 6; -- /usr/include/sqlite3.h:2343 SQLITE_LIMIT_ATTACHED : constant := 7; -- /usr/include/sqlite3.h:2344 SQLITE_LIMIT_LIKE_PATTERN_LENGTH : constant := 8; -- /usr/include/sqlite3.h:2345 SQLITE_LIMIT_VARIABLE_NUMBER : constant := 9; -- /usr/include/sqlite3.h:2346 SQLITE_LIMIT_TRIGGER_DEPTH : constant := 10; -- /usr/include/sqlite3.h:2347 SQLITE_INTEGER : constant := 1; -- /usr/include/sqlite3.h:2895 SQLITE_FLOAT : constant := 2; -- /usr/include/sqlite3.h:2896 SQLITE_BLOB : constant := 4; -- /usr/include/sqlite3.h:2897 SQLITE_NULL : constant := 5; -- /usr/include/sqlite3.h:2898 SQLITE_TEXT : constant := 3; -- /usr/include/sqlite3.h:2902 SQLITE3_TEXT : constant := 3; -- /usr/include/sqlite3.h:2904 SQLITE_UTF8 : constant := 1; -- /usr/include/sqlite3.h:3222 SQLITE_UTF16LE : constant := 2; -- /usr/include/sqlite3.h:3223 SQLITE_UTF16BE : constant := 3; -- /usr/include/sqlite3.h:3224 SQLITE_UTF16 : constant := 4; -- /usr/include/sqlite3.h:3225 SQLITE_ANY : constant := 5; -- /usr/include/sqlite3.h:3226 SQLITE_UTF16_ALIGNED : constant := 8; -- /usr/include/sqlite3.h:3227 -- unsupported macro: SQLITE_STATIC ((sqlite3_destructor_type)0) -- unsupported macro: SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) SQLITE_INDEX_CONSTRAINT_EQ : constant := 2; -- /usr/include/sqlite3.h:4255 SQLITE_INDEX_CONSTRAINT_GT : constant := 4; -- /usr/include/sqlite3.h:4256 SQLITE_INDEX_CONSTRAINT_LE : constant := 8; -- /usr/include/sqlite3.h:4257 SQLITE_INDEX_CONSTRAINT_LT : constant := 16; -- /usr/include/sqlite3.h:4258 SQLITE_INDEX_CONSTRAINT_GE : constant := 32; -- /usr/include/sqlite3.h:4259 SQLITE_INDEX_CONSTRAINT_MATCH : constant := 64; -- /usr/include/sqlite3.h:4260 SQLITE_MUTEX_FAST : constant := 0; -- /usr/include/sqlite3.h:4852 SQLITE_MUTEX_RECURSIVE : constant := 1; -- /usr/include/sqlite3.h:4853 SQLITE_MUTEX_STATIC_MASTER : constant := 2; -- /usr/include/sqlite3.h:4854 SQLITE_MUTEX_STATIC_MEM : constant := 3; -- /usr/include/sqlite3.h:4855 SQLITE_MUTEX_STATIC_MEM2 : constant := 4; -- /usr/include/sqlite3.h:4856 SQLITE_MUTEX_STATIC_OPEN : constant := 4; -- /usr/include/sqlite3.h:4857 SQLITE_MUTEX_STATIC_PRNG : constant := 5; -- /usr/include/sqlite3.h:4858 SQLITE_MUTEX_STATIC_LRU : constant := 6; -- /usr/include/sqlite3.h:4859 SQLITE_MUTEX_STATIC_LRU2 : constant := 7; -- /usr/include/sqlite3.h:4860 SQLITE_TESTCTRL_FIRST : constant := 5; -- /usr/include/sqlite3.h:4931 SQLITE_TESTCTRL_PRNG_SAVE : constant := 5; -- /usr/include/sqlite3.h:4932 SQLITE_TESTCTRL_PRNG_RESTORE : constant := 6; -- /usr/include/sqlite3.h:4933 SQLITE_TESTCTRL_PRNG_RESET : constant := 7; -- /usr/include/sqlite3.h:4934 SQLITE_TESTCTRL_BITVEC_TEST : constant := 8; -- /usr/include/sqlite3.h:4935 SQLITE_TESTCTRL_FAULT_INSTALL : constant := 9; -- /usr/include/sqlite3.h:4936 SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS : constant := 10; -- /usr/include/sqlite3.h:4937 SQLITE_TESTCTRL_PENDING_BYTE : constant := 11; -- /usr/include/sqlite3.h:4938 SQLITE_TESTCTRL_ASSERT : constant := 12; -- /usr/include/sqlite3.h:4939 SQLITE_TESTCTRL_ALWAYS : constant := 13; -- /usr/include/sqlite3.h:4940 SQLITE_TESTCTRL_RESERVE : constant := 14; -- /usr/include/sqlite3.h:4941 SQLITE_TESTCTRL_OPTIMIZATIONS : constant := 15; -- /usr/include/sqlite3.h:4942 SQLITE_TESTCTRL_ISKEYWORD : constant := 16; -- /usr/include/sqlite3.h:4943 SQLITE_TESTCTRL_LAST : constant := 16; -- /usr/include/sqlite3.h:4944 SQLITE_STATUS_MEMORY_USED : constant := 0; -- /usr/include/sqlite3.h:5056 SQLITE_STATUS_PAGECACHE_USED : constant := 1; -- /usr/include/sqlite3.h:5057 SQLITE_STATUS_PAGECACHE_OVERFLOW : constant := 2; -- /usr/include/sqlite3.h:5058 SQLITE_STATUS_SCRATCH_USED : constant := 3; -- /usr/include/sqlite3.h:5059 SQLITE_STATUS_SCRATCH_OVERFLOW : constant := 4; -- /usr/include/sqlite3.h:5060 SQLITE_STATUS_MALLOC_SIZE : constant := 5; -- /usr/include/sqlite3.h:5061 SQLITE_STATUS_PARSER_STACK : constant := 6; -- /usr/include/sqlite3.h:5062 SQLITE_STATUS_PAGECACHE_SIZE : constant := 7; -- /usr/include/sqlite3.h:5063 SQLITE_STATUS_SCRATCH_SIZE : constant := 8; -- /usr/include/sqlite3.h:5064 SQLITE_DBSTATUS_LOOKASIDE_USED : constant := 0; -- /usr/include/sqlite3.h:5105 SQLITE_STMTSTATUS_FULLSCAN_STEP : constant := 1; -- /usr/include/sqlite3.h:5156 SQLITE_STMTSTATUS_SORT : constant := 2; -- /usr/include/sqlite3.h:5157 --** 2001 September 15 --** --** The author disclaims copyright to this source code. In place of --** a legal notice, here is a blessing: --** --** May you do good and not evil. --** May you find forgiveness for yourself and forgive others. --** May you share freely, never taking more than you give. --** --************************************************************************* --** This header file defines the interface that the SQLite library --** presents to client programs. If a C-function, structure, datatype, --** or constant definition does not appear in this file, then it is --** not a published API of SQLite, is subject to change without --** notice, and should not be referenced by programs that use SQLite. --** --** Some of the definitions that are in this file are marked as --** "experimental". Experimental interfaces are normally new --** features recently added to SQLite. We do not anticipate changes --** to experimental interfaces but reserve the right to make minor changes --** if experience from use "in the wild" suggest such changes are prudent. --** --** The official C-language API documentation for SQLite is derived --** from comments in this file. This file is the authoritative source --** on how SQLite interfaces are suppose to operate. --** --** The name of this file under configuration management is "sqlite.h.in". --** The makefile makes some minor changes to this file (such as inserting --** the version number) and changes its name to "sqlite3.h" as --** part of the build process. -- -- Needed for the definition of va_list --** Make sure we can call this stuff from C++. -- --** Add the ability to override 'extern' -- --** These no-op macros are used in front of interfaces to mark those --** interfaces as either deprecated or experimental. New applications --** should not use deprecated interfaces - they are support for backwards --** compatibility only. Application writers should be aware that --** experimental interfaces are subject to change in point releases. --** --** These macros used to resolve to various kinds of compiler magic that --** would generate warning messages when they were used. But that --** compiler magic ended up generating such a flurry of bug reports --** that we have taken it all out and gone back to using simple --** noop macros. -- --** Ensure these symbols were not defined by some previous header file. -- --** CAPI3REF: Compile-Time Library Version Numbers --** --** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header --** evaluates to a string literal that is the SQLite version in the --** format "X.Y.Z" where X is the major version number (always 3 for --** SQLite3) and Y is the minor version number and Z is the release number.)^ --** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer --** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same --** numbers used in [SQLITE_VERSION].)^ --** The SQLITE_VERSION_NUMBER for any given release of SQLite will also --** be larger than the release from which it is derived. Either Y will --** be held constant and Z will be incremented or else Y will be incremented --** and Z will be reset to zero. --** --** Since version 3.6.18, SQLite source code has been stored in the --** <a href="http://www.fossil-scm.org/">Fossil configuration management --** system</a>. ^The SQLITE_SOURCE_ID macro evalutes to --** a string which identifies a particular check-in of SQLite --** within its configuration management system. ^The SQLITE_SOURCE_ID --** string contains the date and time of the check-in (UTC) and an SHA1 --** hash of the entire source tree. --** --** See also: [sqlite3_libversion()], --** [sqlite3_libversion_number()], [sqlite3_sourceid()], --** [sqlite_version()] and [sqlite_source_id()]. -- --** CAPI3REF: Run-Time Library Version Numbers --** KEYWORDS: sqlite3_version --** --** These interfaces provide the same information as the [SQLITE_VERSION], --** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros --** but are associated with the library instead of the header file. ^(Cautious --** programmers might include assert() statements in their application to --** verify that values returned by these interfaces match the macros in --** the header, and thus insure that the application is --** compiled with matching library and header files. --** --** <blockquote><pre> --** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER ); --** assert( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)==0 ); --** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 ); --** </pre></blockquote>)^ --** --** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION] --** macro. ^The sqlite3_libversion() function returns a pointer to the --** to the sqlite3_version[] string constant. The sqlite3_libversion() --** function is provided for use in DLLs since DLL users usually do not have --** direct access to string constants within the DLL. ^The --** sqlite3_libversion_number() function returns an integer equal to --** [SQLITE_VERSION_NUMBER]. ^The sqlite3_sourceid() function a pointer --** to a string constant whose value is the same as the [SQLITE_SOURCE_ID] --** C preprocessor macro. --** --** See also: [sqlite_version()] and [sqlite_source_id()]. -- sqlite3_version : aliased array (0 .. int'Last) of aliased char; -- /usr/include/sqlite3.h:144:37 pragma Import (C, sqlite3_version, "sqlite3_version"); function sqlite3_libversion return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:145:24 pragma Import (C, sqlite3_libversion, "sqlite3_libversion"); function sqlite3_sourceid return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:146:24 pragma Import (C, sqlite3_sourceid, "sqlite3_sourceid"); function sqlite3_libversion_number return int; -- /usr/include/sqlite3.h:147:16 pragma Import (C, sqlite3_libversion_number, "sqlite3_libversion_number"); --** CAPI3REF: Test To See If The Library Is Threadsafe --** --** ^The sqlite3_threadsafe() function returns zero if and only if --** SQLite was compiled mutexing code omitted due to the --** [SQLITE_THREADSAFE] compile-time option being set to 0. --** --** SQLite can be compiled with or without mutexes. When --** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes --** are enabled and SQLite is threadsafe. When the --** [SQLITE_THREADSAFE] macro is 0, --** the mutexes are omitted. Without the mutexes, it is not safe --** to use SQLite concurrently from more than one thread. --** --** Enabling mutexes incurs a measurable performance penalty. --** So if speed is of utmost importance, it makes sense to disable --** the mutexes. But for maximum safety, mutexes should be enabled. --** ^The default behavior is for mutexes to be enabled. --** --** This interface can be used by an application to make sure that the --** version of SQLite that it is linking against was compiled with --** the desired setting of the [SQLITE_THREADSAFE] macro. --** --** This interface only reports on the compile-time mutex setting --** of the [SQLITE_THREADSAFE] flag. If SQLite is compiled with --** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but --** can be fully or partially disabled using a call to [sqlite3_config()] --** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD], --** or [SQLITE_CONFIG_MUTEX]. ^(The return value of the --** sqlite3_threadsafe() function shows only the compile-time setting of --** thread safety, not any run-time changes to that setting made by --** sqlite3_config(). In other words, the return value from sqlite3_threadsafe() --** is unchanged by calls to sqlite3_config().)^ --** --** See the [threading mode] documentation for additional information. -- function sqlite3_threadsafe return int; -- /usr/include/sqlite3.h:185:16 pragma Import (C, sqlite3_threadsafe, "sqlite3_threadsafe"); --** CAPI3REF: Database Connection Handle --** KEYWORDS: {database connection} {database connections} --** --** Each open SQLite database is represented by a pointer to an instance of --** the opaque structure named "sqlite3". It is useful to think of an sqlite3 --** pointer as an object. The [sqlite3_open()], [sqlite3_open16()], and --** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()] --** is its destructor. There are many other interfaces (such as --** [sqlite3_prepare_v2()], [sqlite3_create_function()], and --** [sqlite3_busy_timeout()] to name but three) that are methods on an --** sqlite3 object. -- -- skipped empty struct sqlite3 --** CAPI3REF: 64-Bit Integer Types --** KEYWORDS: sqlite_int64 sqlite_uint64 --** --** Because there is no cross-platform way to specify 64-bit integer types --** SQLite includes typedefs for 64-bit signed and unsigned integers. --** --** The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions. --** The sqlite_int64 and sqlite_uint64 types are supported for backwards --** compatibility only. --** --** ^The sqlite3_int64 and sqlite_int64 types can store integer values --** between -9223372036854775808 and +9223372036854775807 inclusive. ^The --** sqlite3_uint64 and sqlite_uint64 types can store integer values --** between 0 and +18446744073709551615 inclusive. -- subtype sqlite_int64 is Long_Long_Integer; -- /usr/include/sqlite3.h:225:25 -- subtype sqlite_uint64 is Extensions.unsigned_long_long; -- /usr/include/sqlite3.h:226:34 subtype sqlite_uint64 is Long_Long_Integer; subtype sqlite3_int64 is sqlite_int64; -- /usr/include/sqlite3.h:228:22 subtype sqlite3_uint64 is sqlite_uint64; -- /usr/include/sqlite3.h:229:23 --** If compiling for a processor that lacks floating point support, --** substitute integer for floating-point. -- --** CAPI3REF: Closing A Database Connection --** --** ^The sqlite3_close() routine is the destructor for the [sqlite3] object. --** ^Calls to sqlite3_close() return SQLITE_OK if the [sqlite3] object is --** successfullly destroyed and all associated resources are deallocated. --** --** Applications must [sqlite3_finalize | finalize] all [prepared statements] --** and [sqlite3_blob_close | close] all [BLOB handles] associated with --** the [sqlite3] object prior to attempting to close the object. ^If --** sqlite3_close() is called on a [database connection] that still has --** outstanding [prepared statements] or [BLOB handles], then it returns --** SQLITE_BUSY. --** --** ^If [sqlite3_close()] is invoked while a transaction is open, --** the transaction is automatically rolled back. --** --** The C parameter to [sqlite3_close(C)] must be either a NULL --** pointer or an [sqlite3] object pointer obtained --** from [sqlite3_open()], [sqlite3_open16()], or --** [sqlite3_open_v2()], and not previously closed. --** ^Calling sqlite3_close() with a NULL pointer argument is a --** harmless no-op. -- function sqlite3_close (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:263:16 pragma Import (C, sqlite3_close, "sqlite3_close"); --** The type for a callback function. --** This is legacy and deprecated. It is included for historical --** compatibility and is not documented. -- type sqlite3_callback is access function (arg1 : System.Address; arg2 : int; arg3 : System.Address; arg4 : System.Address) return int; -- /usr/include/sqlite3.h:270:15 --** CAPI3REF: One-Step Query Execution Interface --** --** The sqlite3_exec() interface is a convenience wrapper around --** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()], --** that allows an application to run multiple statements of SQL --** without having to use a lot of C code. --** --** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded, --** semicolon-separate SQL statements passed into its 2nd argument, --** in the context of the [database connection] passed in as its 1st --** argument. ^If the callback function of the 3rd argument to --** sqlite3_exec() is not NULL, then it is invoked for each result row --** coming out of the evaluated SQL statements. ^The 4th argument to --** to sqlite3_exec() is relayed through to the 1st argument of each --** callback invocation. ^If the callback pointer to sqlite3_exec() --** is NULL, then no callback is ever invoked and result rows are --** ignored. --** --** ^If an error occurs while evaluating the SQL statements passed into --** sqlite3_exec(), then execution of the current statement stops and --** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec() --** is not NULL then any error message is written into memory obtained --** from [sqlite3_malloc()] and passed back through the 5th parameter. --** To avoid memory leaks, the application should invoke [sqlite3_free()] --** on error message strings returned through the 5th parameter of --** of sqlite3_exec() after the error message string is no longer needed. --** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors --** occur, then sqlite3_exec() sets the pointer in its 5th parameter to --** NULL before returning. --** --** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec() --** routine returns SQLITE_ABORT without invoking the callback again and --** without running any subsequent SQL statements. --** --** ^The 2nd argument to the sqlite3_exec() callback function is the --** number of columns in the result. ^The 3rd argument to the sqlite3_exec() --** callback is an array of pointers to strings obtained as if from --** [sqlite3_column_text()], one for each column. ^If an element of a --** result row is NULL then the corresponding string pointer for the --** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the --** sqlite3_exec() callback is an array of pointers to strings where each --** entry represents the name of corresponding result column as obtained --** from [sqlite3_column_name()]. --** --** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer --** to an empty string, or a pointer that contains only whitespace and/or --** SQL comments, then no SQL statements are evaluated and the database --** is not changed. --** --** Restrictions: --** --** <ul> --** <li> The application must insure that the 1st parameter to sqlite3_exec() --** is a valid and open [database connection]. --** <li> The application must not close [database connection] specified by --** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. --** <li> The application must not modify the SQL statement text passed into --** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. --** </ul> -- function sqlite3_exec (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : access function (arg1 : System.Address; arg2 : int; arg3 : System.Address; arg4 : System.Address) return int; arg4 : System.Address; arg5 : System.Address) return int; -- /usr/include/sqlite3.h:333:16 pragma Import (C, sqlite3_exec, "sqlite3_exec"); -- An open database -- SQL to be evaluated -- Callback function -- 1st argument to callback -- Error msg written here --** CAPI3REF: Result Codes --** KEYWORDS: SQLITE_OK {error code} {error codes} --** KEYWORDS: {result code} {result codes} --** --** Many SQLite functions return an integer result code from the set shown --** here in order to indicates success or failure. --** --** New error codes may be added in future versions of SQLite. --** --** See also: [SQLITE_IOERR_READ | extended result codes] -- -- beginning-of-error-codes -- end-of-error-codes --** CAPI3REF: Extended Result Codes --** KEYWORDS: {extended error code} {extended error codes} --** KEYWORDS: {extended result code} {extended result codes} --** --** In its default configuration, SQLite API routines return one of 26 integer --** [SQLITE_OK | result codes]. However, experience has shown that many of --** these result codes are too coarse-grained. They do not provide as --** much information about problems as programmers might like. In an effort to --** address this, newer versions of SQLite (version 3.3.8 and later) include --** support for additional result codes that provide more detailed information --** about errors. The extended result codes are enabled or disabled --** on a per database connection basis using the --** [sqlite3_extended_result_codes()] API. --** --** Some of the available extended result codes are listed here. --** One may expect the number of extended result codes will be expand --** over time. Software that uses extended result codes should expect --** to see new result codes in future releases of SQLite. --** --** The SQLITE_OK result code will never be extended. It will always --** be exactly zero. -- --** CAPI3REF: Flags For File Open Operations --** --** These bit values are intended for use in the --** 3rd parameter to the [sqlite3_open_v2()] interface and --** in the 4th parameter to the xOpen method of the --** [sqlite3_vfs] object. -- --** CAPI3REF: Device Characteristics --** --** The xDeviceCapabilities method of the [sqlite3_io_methods] --** object returns an integer which is a vector of the these --** bit values expressing I/O characteristics of the mass storage --** device that holds the file that the [sqlite3_io_methods] --** refers to. --** --** The SQLITE_IOCAP_ATOMIC property means that all writes of --** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values --** mean that writes of blocks that are nnn bytes in size and --** are aligned to an address which is an integer multiple of --** nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means --** that when data is appended to a file, the data is appended --** first then the size of the file is extended, never the other --** way around. The SQLITE_IOCAP_SEQUENTIAL property means that --** information is written to disk in the same order as calls --** to xWrite(). -- --** CAPI3REF: File Locking Levels --** --** SQLite uses one of these integer values as the second --** argument to calls it makes to the xLock() and xUnlock() methods --** of an [sqlite3_io_methods] object. -- --** CAPI3REF: Synchronization Type Flags --** --** When SQLite invokes the xSync() method of an --** [sqlite3_io_methods] object it uses a combination of --** these integer values as the second argument. --** --** When the SQLITE_SYNC_DATAONLY flag is used, it means that the --** sync operation only needs to flush data to mass storage. Inode --** information need not be flushed. If the lower four bits of the flag --** equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics. --** If the lower four bits equal SQLITE_SYNC_FULL, that means --** to use Mac OS X style fullsync instead of fsync(). -- --** CAPI3REF: OS Interface Open File Handle --** --** An [sqlite3_file] object represents an open file in the --** [sqlite3_vfs | OS interface layer]. Individual OS interface --** implementations will --** want to subclass this object by appending additional fields --** for their own use. The pMethods entry is a pointer to an --** [sqlite3_io_methods] object that defines methods for performing --** I/O operations on the open file. -- -- Methods for an open file type sqlite3_file is record pMethods : System.Address; -- /usr/include/sqlite3.h:528:36 end record; pragma Convention (C, sqlite3_file); -- /usr/include/sqlite3.h:526:16 --** CAPI3REF: OS Interface File Virtual Methods Object --** --** Every file opened by the [sqlite3_vfs] xOpen method populates an --** [sqlite3_file] object (or, more commonly, a subclass of the --** [sqlite3_file] object) with a pointer to an instance of this object. --** This object defines the methods used to perform various operations --** against the open file represented by the [sqlite3_file] object. --** --** If the xOpen method sets the sqlite3_file.pMethods element --** to a non-NULL pointer, then the sqlite3_io_methods.xClose method --** may be invoked even if the xOpen reported that it failed. The --** only way to prevent a call to xClose following a failed xOpen --** is for the xOpen to set the sqlite3_file.pMethods element to NULL. --** --** The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or --** [SQLITE_SYNC_FULL]. The first choice is the normal fsync(). --** The second choice is a Mac OS X style fullsync. The [SQLITE_SYNC_DATAONLY] --** flag may be ORed in to indicate that only the data of the file --** and not its inode needs to be synced. --** --** The integer values to xLock() and xUnlock() are one of --** <ul> --** <li> [SQLITE_LOCK_NONE], --** <li> [SQLITE_LOCK_SHARED], --** <li> [SQLITE_LOCK_RESERVED], --** <li> [SQLITE_LOCK_PENDING], or --** <li> [SQLITE_LOCK_EXCLUSIVE]. --** </ul> --** xLock() increases the lock. xUnlock() decreases the lock. --** The xCheckReservedLock() method checks whether any database connection, --** either in this process or in some other process, is holding a RESERVED, --** PENDING, or EXCLUSIVE lock on the file. It returns true --** if such a lock exists and false otherwise. --** --** The xFileControl() method is a generic interface that allows custom --** VFS implementations to directly control an open file using the --** [sqlite3_file_control()] interface. The second "op" argument is an --** integer opcode. The third argument is a generic pointer intended to --** point to a structure that may contain arguments or space in which to --** write return values. Potential uses for xFileControl() might be --** functions to enable blocking locks with timeouts, to change the --** locking strategy (for example to use dot-file locks), to inquire --** about the status of a lock, or to break stale locks. The SQLite --** core reserves all opcodes less than 100 for its own use. --** A [SQLITE_FCNTL_LOCKSTATE | list of opcodes] less than 100 is available. --** Applications that define a custom xFileControl method should use opcodes --** greater than 100 to avoid conflicts. --** --** The xSectorSize() method returns the sector size of the --** device that underlies the file. The sector size is the --** minimum write that can be performed without disturbing --** other bytes in the file. The xDeviceCharacteristics() --** method returns a bit vector describing behaviors of the --** underlying device: --** --** <ul> --** <li> [SQLITE_IOCAP_ATOMIC] --** <li> [SQLITE_IOCAP_ATOMIC512] --** <li> [SQLITE_IOCAP_ATOMIC1K] --** <li> [SQLITE_IOCAP_ATOMIC2K] --** <li> [SQLITE_IOCAP_ATOMIC4K] --** <li> [SQLITE_IOCAP_ATOMIC8K] --** <li> [SQLITE_IOCAP_ATOMIC16K] --** <li> [SQLITE_IOCAP_ATOMIC32K] --** <li> [SQLITE_IOCAP_ATOMIC64K] --** <li> [SQLITE_IOCAP_SAFE_APPEND] --** <li> [SQLITE_IOCAP_SEQUENTIAL] --** </ul> --** --** The SQLITE_IOCAP_ATOMIC property means that all writes of --** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values --** mean that writes of blocks that are nnn bytes in size and --** are aligned to an address which is an integer multiple of --** nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means --** that when data is appended to a file, the data is appended --** first then the size of the file is extended, never the other --** way around. The SQLITE_IOCAP_SEQUENTIAL property means that --** information is written to disk in the same order as calls --** to xWrite(). --** --** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill --** in the unread portions of the buffer with zeros. A VFS that --** fails to zero-fill short reads might seem to work. However, --** failure to zero-fill short reads will eventually lead to --** database corruption. -- type sqlite3_io_methods is record iVersion : aliased int; -- /usr/include/sqlite3.h:620:7 xClose : access function (arg1 : access sqlite3_file) return int; -- /usr/include/sqlite3.h:621:9 xRead : access function (arg1 : access sqlite3_file; arg2 : System.Address; arg3 : int; arg4 : sqlite3_int64) return int; -- /usr/include/sqlite3.h:622:9 xWrite : access function (arg1 : access sqlite3_file; arg2 : System.Address; arg3 : int; arg4 : sqlite3_int64) return int; -- /usr/include/sqlite3.h:623:9 xTruncate : access function (arg1 : access sqlite3_file; arg2 : sqlite3_int64) return int; -- /usr/include/sqlite3.h:624:9 xSync : access function (arg1 : access sqlite3_file; arg2 : int) return int; -- /usr/include/sqlite3.h:625:9 xFileSize : access function (arg1 : access sqlite3_file; arg2 : access sqlite3_int64) return int; -- /usr/include/sqlite3.h:626:9 xLock : access function (arg1 : access sqlite3_file; arg2 : int) return int; -- /usr/include/sqlite3.h:627:9 xUnlock : access function (arg1 : access sqlite3_file; arg2 : int) return int; -- /usr/include/sqlite3.h:628:9 xCheckReservedLock : access function (arg1 : access sqlite3_file; arg2 : access int) return int; -- /usr/include/sqlite3.h:629:9 xFileControl : access function (arg1 : access sqlite3_file; arg2 : int; arg3 : System.Address) return int; -- /usr/include/sqlite3.h:630:9 xSectorSize : access function (arg1 : access sqlite3_file) return int; -- /usr/include/sqlite3.h:631:9 xDeviceCharacteristics : access function (arg1 : access sqlite3_file) return int; -- /usr/include/sqlite3.h:632:9 end record; pragma Convention (C, sqlite3_io_methods); -- /usr/include/sqlite3.h:528:16 -- Additional methods may be added in future releases --** CAPI3REF: Standard File Control Opcodes --** --** These integer constants are opcodes for the xFileControl method --** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] --** interface. --** --** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This --** opcode causes the xFileControl method to write the current state of --** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], --** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) --** into an integer that the pArg argument points to. This capability --** is used during testing and only needs to be supported when SQLITE_TEST --** is defined. -- --** CAPI3REF: Mutex Handle --** --** The mutex module within SQLite defines [sqlite3_mutex] to be an --** abstract type for a mutex object. The SQLite core never looks --** at the internal representation of an [sqlite3_mutex]. It only --** deals with pointers to the [sqlite3_mutex] object. --** --** Mutexes are created using [sqlite3_mutex_alloc()]. -- -- skipped empty struct sqlite3_mutex --** CAPI3REF: OS Interface Object --** --** An instance of the sqlite3_vfs object defines the interface between --** the SQLite core and the underlying operating system. The "vfs" --** in the name of the object stands for "virtual file system". --** --** The value of the iVersion field is initially 1 but may be larger in --** future versions of SQLite. Additional fields may be appended to this --** object when the iVersion value is increased. Note that the structure --** of the sqlite3_vfs object changes in the transaction between --** SQLite version 3.5.9 and 3.6.0 and yet the iVersion field was not --** modified. --** --** The szOsFile field is the size of the subclassed [sqlite3_file] --** structure used by this VFS. mxPathname is the maximum length of --** a pathname in this VFS. --** --** Registered sqlite3_vfs objects are kept on a linked list formed by --** the pNext pointer. The [sqlite3_vfs_register()] --** and [sqlite3_vfs_unregister()] interfaces manage this list --** in a thread-safe way. The [sqlite3_vfs_find()] interface --** searches the list. Neither the application code nor the VFS --** implementation should use the pNext pointer. --** --** The pNext field is the only field in the sqlite3_vfs --** structure that SQLite will ever modify. SQLite will only access --** or modify this field while holding a particular static mutex. --** The application should never modify anything within the sqlite3_vfs --** object once the object has been registered. --** --** The zName field holds the name of the VFS module. The name must --** be unique across all VFS modules. --** --** SQLite will guarantee that the zFilename parameter to xOpen --** is either a NULL pointer or string obtained --** from xFullPathname(). SQLite further guarantees that --** the string will be valid and unchanged until xClose() is --** called. Because of the previous sentence, --** the [sqlite3_file] can safely store a pointer to the --** filename if it needs to remember the filename for some reason. --** If the zFilename parameter is xOpen is a NULL pointer then xOpen --** must invent its own temporary name for the file. Whenever the --** xFilename parameter is NULL it will also be the case that the --** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE]. --** --** The flags argument to xOpen() includes all bits set in --** the flags argument to [sqlite3_open_v2()]. Or if [sqlite3_open()] --** or [sqlite3_open16()] is used, then flags includes at least --** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. --** If xOpen() opens a file read-only then it sets *pOutFlags to --** include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set. --** --** SQLite will also add one of the following flags to the xOpen() --** call, depending on the object being opened: --** --** <ul> --** <li> [SQLITE_OPEN_MAIN_DB] --** <li> [SQLITE_OPEN_MAIN_JOURNAL] --** <li> [SQLITE_OPEN_TEMP_DB] --** <li> [SQLITE_OPEN_TEMP_JOURNAL] --** <li> [SQLITE_OPEN_TRANSIENT_DB] --** <li> [SQLITE_OPEN_SUBJOURNAL] --** <li> [SQLITE_OPEN_MASTER_JOURNAL] --** </ul> --** --** The file I/O implementation can use the object type flags to --** change the way it deals with files. For example, an application --** that does not care about crash recovery or rollback might make --** the open of a journal file a no-op. Writes to this journal would --** also be no-ops, and any attempt to read the journal would return --** SQLITE_IOERR. Or the implementation might recognize that a database --** file will be doing page-aligned sector reads and writes in a random --** order and set up its I/O subsystem accordingly. --** --** SQLite might also add one of the following flags to the xOpen method: --** --** <ul> --** <li> [SQLITE_OPEN_DELETEONCLOSE] --** <li> [SQLITE_OPEN_EXCLUSIVE] --** </ul> --** --** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be --** deleted when it is closed. The [SQLITE_OPEN_DELETEONCLOSE] --** will be set for TEMP databases, journals and for subjournals. --** --** The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction --** with the [SQLITE_OPEN_CREATE] flag, which are both directly --** analogous to the O_EXCL and O_CREAT flags of the POSIX open() --** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the --** SQLITE_OPEN_CREATE, is used to indicate that file should always --** be created, and that it is an error if it already exists. --** It is <i>not</i> used to indicate the file should be opened --** for exclusive access. --** --** At least szOsFile bytes of memory are allocated by SQLite --** to hold the [sqlite3_file] structure passed as the third --** argument to xOpen. The xOpen method does not have to --** allocate the structure; it should just fill it in. Note that --** the xOpen method must set the sqlite3_file.pMethods to either --** a valid [sqlite3_io_methods] object or to NULL. xOpen must do --** this even if the open fails. SQLite expects that the sqlite3_file.pMethods --** element will be valid after xOpen returns regardless of the success --** or failure of the xOpen call. --** --** The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS] --** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to --** test whether a file is readable and writable, or [SQLITE_ACCESS_READ] --** to test whether a file is at least readable. The file can be a --** directory. --** --** SQLite will always allocate at least mxPathname+1 bytes for the --** output buffer xFullPathname. The exact size of the output buffer --** is also passed as a parameter to both methods. If the output buffer --** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is --** handled as a fatal error by SQLite, vfs implementations should endeavor --** to prevent this by setting mxPathname to a sufficiently large value. --** --** The xRandomness(), xSleep(), and xCurrentTime() interfaces --** are not strictly a part of the filesystem, but they are --** included in the VFS structure for completeness. --** The xRandomness() function attempts to return nBytes bytes --** of good-quality randomness into zOut. The return value is --** the actual number of bytes of randomness obtained. --** The xSleep() method causes the calling thread to sleep for at --** least the number of microseconds given. The xCurrentTime() --** method returns a Julian Day Number for the current date and time. --** -- -- Structure version number type sqlite3_vfs is record iVersion : aliased int; -- /usr/include/sqlite3.h:799:7 szOsFile : aliased int; -- /usr/include/sqlite3.h:800:7 mxPathname : aliased int; -- /usr/include/sqlite3.h:801:7 pNext : access sqlite3_vfs; -- /usr/include/sqlite3.h:802:16 zName : Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:803:15 pAppData : System.Address; -- /usr/include/sqlite3.h:804:9 xOpen : access function (arg1 : access sqlite3_vfs; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : access sqlite3_file; arg4 : int; arg5 : access int) return int; -- /usr/include/sqlite3.h:805:9 xDelete : access function (arg1 : access sqlite3_vfs; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : int) return int; -- /usr/include/sqlite3.h:807:9 xAccess : access function (arg1 : access sqlite3_vfs; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : int; arg4 : access int) return int; -- /usr/include/sqlite3.h:808:9 xFullPathname : access function (arg1 : access sqlite3_vfs; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : int; arg4 : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/sqlite3.h:809:9 xDlOpen : access function (arg1 : access sqlite3_vfs; arg2 : Interfaces.C.Strings.chars_ptr) return System.Address; -- /usr/include/sqlite3.h:810:11 xDlError : access procedure (arg1 : access sqlite3_vfs; arg2 : int; arg3 : Interfaces.C.Strings.chars_ptr); -- /usr/include/sqlite3.h:811:10 xDlSym : access function (arg1 : access sqlite3_vfs; arg2 : System.Address; arg3 : Interfaces.C.Strings.chars_ptr) return access procedure; -- /usr/include/sqlite3.h:812:12 xDlClose : access procedure (arg1 : access sqlite3_vfs; arg2 : System.Address); -- /usr/include/sqlite3.h:813:10 xRandomness : access function (arg1 : access sqlite3_vfs; arg2 : int; arg3 : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/sqlite3.h:814:9 xSleep : access function (arg1 : access sqlite3_vfs; arg2 : int) return int; -- /usr/include/sqlite3.h:815:9 xCurrentTime : access function (arg1 : access sqlite3_vfs; arg2 : access double) return int; -- /usr/include/sqlite3.h:816:9 xGetLastError : access function (arg1 : access sqlite3_vfs; arg2 : int; arg3 : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/sqlite3.h:817:9 end record; pragma Convention (C, sqlite3_vfs); -- /usr/include/sqlite3.h:797:16 -- Size of subclassed sqlite3_file -- Maximum file pathname length -- Next registered VFS -- Name of this virtual file system -- Pointer to application-specific data -- New fields may be appended in figure versions. The iVersion -- ** value will increment whenever this happens. --** CAPI3REF: Flags for the xAccess VFS method --** --** These integer constants can be used as the third parameter to --** the xAccess method of an [sqlite3_vfs] object. They determine --** what kind of permissions the xAccess method is looking for. --** With SQLITE_ACCESS_EXISTS, the xAccess method --** simply checks whether the file exists. --** With SQLITE_ACCESS_READWRITE, the xAccess method --** checks whether the file is both readable and writable. --** With SQLITE_ACCESS_READ, the xAccess method --** checks whether the file is readable. -- --** CAPI3REF: Initialize The SQLite Library --** --** ^The sqlite3_initialize() routine initializes the --** SQLite library. ^The sqlite3_shutdown() routine --** deallocates any resources that were allocated by sqlite3_initialize(). --** These routines are designed to aid in process initialization and --** shutdown on embedded systems. Workstation applications using --** SQLite normally do not need to invoke either of these routines. --** --** A call to sqlite3_initialize() is an "effective" call if it is --** the first time sqlite3_initialize() is invoked during the lifetime of --** the process, or if it is the first time sqlite3_initialize() is invoked --** following a call to sqlite3_shutdown(). ^(Only an effective call --** of sqlite3_initialize() does any initialization. All other calls --** are harmless no-ops.)^ --** --** A call to sqlite3_shutdown() is an "effective" call if it is the first --** call to sqlite3_shutdown() since the last sqlite3_initialize(). ^(Only --** an effective call to sqlite3_shutdown() does any deinitialization. --** All other valid calls to sqlite3_shutdown() are harmless no-ops.)^ --** --** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown() --** is not. The sqlite3_shutdown() interface must only be called from a --** single thread. All open [database connections] must be closed and all --** other SQLite resources must be deallocated prior to invoking --** sqlite3_shutdown(). --** --** Among other things, ^sqlite3_initialize() will invoke --** sqlite3_os_init(). Similarly, ^sqlite3_shutdown() --** will invoke sqlite3_os_end(). --** --** ^The sqlite3_initialize() routine returns [SQLITE_OK] on success. --** ^If for some reason, sqlite3_initialize() is unable to initialize --** the library (perhaps it is unable to allocate a needed resource such --** as a mutex) it returns an [error code] other than [SQLITE_OK]. --** --** ^The sqlite3_initialize() routine is called internally by many other --** SQLite interfaces so that an application usually does not need to --** invoke sqlite3_initialize() directly. For example, [sqlite3_open()] --** calls sqlite3_initialize() so the SQLite library will be automatically --** initialized when [sqlite3_open()] is called if it has not be initialized --** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT] --** compile-time option, then the automatic calls to sqlite3_initialize() --** are omitted and the application must call sqlite3_initialize() directly --** prior to using any other SQLite interface. For maximum portability, --** it is recommended that applications always invoke sqlite3_initialize() --** directly prior to using any other SQLite interface. Future releases --** of SQLite may require this. In other words, the behavior exhibited --** when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the --** default behavior in some future release of SQLite. --** --** The sqlite3_os_init() routine does operating-system specific --** initialization of the SQLite library. The sqlite3_os_end() --** routine undoes the effect of sqlite3_os_init(). Typical tasks --** performed by these routines include allocation or deallocation --** of static resources, initialization of global variables, --** setting up a default [sqlite3_vfs] module, or setting up --** a default configuration using [sqlite3_config()]. --** --** The application should never invoke either sqlite3_os_init() --** or sqlite3_os_end() directly. The application should only invoke --** sqlite3_initialize() and sqlite3_shutdown(). The sqlite3_os_init() --** interface is called automatically by sqlite3_initialize() and --** sqlite3_os_end() is called by sqlite3_shutdown(). Appropriate --** implementations for sqlite3_os_init() and sqlite3_os_end() --** are built into SQLite when it is compiled for Unix, Windows, or OS/2. --** When [custom builds | built for other platforms] --** (using the [SQLITE_OS_OTHER=1] compile-time --** option) the application must supply a suitable implementation for --** sqlite3_os_init() and sqlite3_os_end(). An application-supplied --** implementation of sqlite3_os_init() or sqlite3_os_end() --** must return [SQLITE_OK] on success and some other [error code] upon --** failure. -- function sqlite3_initialize return int; -- /usr/include/sqlite3.h:914:16 pragma Import (C, sqlite3_initialize, "sqlite3_initialize"); function sqlite3_shutdown return int; -- /usr/include/sqlite3.h:915:16 pragma Import (C, sqlite3_shutdown, "sqlite3_shutdown"); function sqlite3_os_init return int; -- /usr/include/sqlite3.h:916:16 pragma Import (C, sqlite3_os_init, "sqlite3_os_init"); function sqlite3_os_end return int; -- /usr/include/sqlite3.h:917:16 pragma Import (C, sqlite3_os_end, "sqlite3_os_end"); --** CAPI3REF: Configuring The SQLite Library --** EXPERIMENTAL --** --** The sqlite3_config() interface is used to make global configuration --** changes to SQLite in order to tune SQLite to the specific needs of --** the application. The default configuration is recommended for most --** applications and so this routine is usually not necessary. It is --** provided to support rare applications with unusual needs. --** --** The sqlite3_config() interface is not threadsafe. The application --** must insure that no other SQLite interfaces are invoked by other --** threads while sqlite3_config() is running. Furthermore, sqlite3_config() --** may only be invoked prior to library initialization using --** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()]. --** ^If sqlite3_config() is called after [sqlite3_initialize()] and before --** [sqlite3_shutdown()] then it will return SQLITE_MISUSE. --** Note, however, that ^sqlite3_config() can be called as part of the --** implementation of an application-defined [sqlite3_os_init()]. --** --** The first argument to sqlite3_config() is an integer --** [SQLITE_CONFIG_SINGLETHREAD | configuration option] that determines --** what property of SQLite is to be configured. Subsequent arguments --** vary depending on the [SQLITE_CONFIG_SINGLETHREAD | configuration option] --** in the first argument. --** --** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK]. --** ^If the option is unknown or SQLite is unable to set the option --** then this routine returns a non-zero [error code]. -- function sqlite3_config (arg1 : int -- , ... ) return int; -- /usr/include/sqlite3.h:949:36 pragma Import (C, sqlite3_config, "sqlite3_config"); --** CAPI3REF: Configure database connections --** EXPERIMENTAL --** --** The sqlite3_db_config() interface is used to make configuration --** changes to a [database connection]. The interface is similar to --** [sqlite3_config()] except that the changes apply to a single --** [database connection] (specified in the first argument). The --** sqlite3_db_config() interface should only be used immediately after --** the database connection is created using [sqlite3_open()], --** [sqlite3_open16()], or [sqlite3_open_v2()]. --** --** The second argument to sqlite3_db_config(D,V,...) is the --** configuration verb - an integer code that indicates what --** aspect of the [database connection] is being configured. --** The only choice for this value is [SQLITE_DBCONFIG_LOOKASIDE]. --** New verbs are likely to be added in future releases of SQLite. --** Additional arguments depend on the verb. --** --** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if --** the call is considered successful. -- function sqlite3_db_config (arg1 : System.Address; arg2 : int -- , ... ) return int; -- /usr/include/sqlite3.h:973:36 pragma Import (C, sqlite3_db_config, "sqlite3_db_config"); --** CAPI3REF: Memory Allocation Routines --** EXPERIMENTAL --** --** An instance of this object defines the interface between SQLite --** and low-level memory allocation routines. --** --** This object is used in only one place in the SQLite interface. --** A pointer to an instance of this object is the argument to --** [sqlite3_config()] when the configuration option is --** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC]. --** By creating an instance of this object --** and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC]) --** during configuration, an application can specify an alternative --** memory allocation subsystem for SQLite to use for all of its --** dynamic memory needs. --** --** Note that SQLite comes with several [built-in memory allocators] --** that are perfectly adequate for the overwhelming majority of applications --** and that this object is only useful to a tiny minority of applications --** with specialized memory allocation requirements. This object is --** also used during testing of SQLite in order to specify an alternative --** memory allocator that simulates memory out-of-memory conditions in --** order to verify that SQLite recovers gracefully from such --** conditions. --** --** The xMalloc and xFree methods must work like the --** malloc() and free() functions from the standard C library. --** The xRealloc method must work like realloc() from the standard C library --** with the exception that if the second argument to xRealloc is zero, --** xRealloc must be a no-op - it must not perform any allocation or --** deallocation. ^SQLite guarantees that the second argument to --** xRealloc is always a value returned by a prior call to xRoundup. --** And so in cases where xRoundup always returns a positive number, --** xRealloc can perform exactly as the standard library realloc() and --** still be in compliance with this specification. --** --** xSize should return the allocated size of a memory allocation --** previously obtained from xMalloc or xRealloc. The allocated size --** is always at least as big as the requested size but may be larger. --** --** The xRoundup method returns what would be the allocated size of --** a memory allocation given a particular requested size. Most memory --** allocators round up memory allocations at least to the next multiple --** of 8. Some allocators round up to a larger multiple or to a power of 2. --** Every memory allocation request coming in through [sqlite3_malloc()] --** or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0, --** that causes the corresponding memory allocation to fail. --** --** The xInit method initializes the memory allocator. (For example, --** it might allocate any require mutexes or initialize internal data --** structures. The xShutdown method is invoked (indirectly) by --** [sqlite3_shutdown()] and should deallocate any resources acquired --** by xInit. The pAppData pointer is used as the only parameter to --** xInit and xShutdown. --** --** SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes --** the xInit method, so the xInit method need not be threadsafe. The --** xShutdown method is only called from [sqlite3_shutdown()] so it does --** not need to be threadsafe either. For all other methods, SQLite --** holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the --** [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which --** it is by default) and so the methods are automatically serialized. --** However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other --** methods must be threadsafe or else make their own arrangements for --** serialization. --** --** SQLite will never invoke xInit() more than once without an intervening --** call to xShutdown(). -- -- Memory allocation function type sqlite3_mem_methods is record xMalloc : access function (arg1 : int) return System.Address; -- /usr/include/sqlite3.h:1047:11 xFree : access procedure (arg1 : System.Address); -- /usr/include/sqlite3.h:1048:10 xRealloc : access function (arg1 : System.Address; arg2 : int) return System.Address; -- /usr/include/sqlite3.h:1049:11 xSize : access function (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:1050:9 xRoundup : access function (arg1 : int) return int; -- /usr/include/sqlite3.h:1051:9 xInit : access function (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:1052:9 xShutdown : access procedure (arg1 : System.Address); -- /usr/include/sqlite3.h:1053:10 pAppData : System.Address; -- /usr/include/sqlite3.h:1054:9 end record; pragma Convention (C, sqlite3_mem_methods); -- /usr/include/sqlite3.h:1045:16 -- Free a prior allocation -- Resize an allocation -- Return the size of an allocation -- Round up request size to allocation size -- Initialize the memory allocator -- Deinitialize the memory allocator -- Argument to xInit() and xShutdown() --** CAPI3REF: Configuration Options --** EXPERIMENTAL --** --** These constants are the available integer configuration options that --** can be passed as the first argument to the [sqlite3_config()] interface. --** --** New configuration options may be added in future releases of SQLite. --** Existing configuration options might be discontinued. Applications --** should check the return code from [sqlite3_config()] to make sure that --** the call worked. The [sqlite3_config()] interface will return a --** non-zero [error code] if a discontinued or unsupported configuration option --** is invoked. --** --** <dl> --** <dt>SQLITE_CONFIG_SINGLETHREAD</dt> --** <dd>There are no arguments to this option. ^This option sets the --** [threading mode] to Single-thread. In other words, it disables --** all mutexing and puts SQLite into a mode where it can only be used --** by a single thread. ^If SQLite is compiled with --** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then --** it is not possible to change the [threading mode] from its default --** value of Single-thread and so [sqlite3_config()] will return --** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD --** configuration option.</dd> --** --** <dt>SQLITE_CONFIG_MULTITHREAD</dt> --** <dd>There are no arguments to this option. ^This option sets the --** [threading mode] to Multi-thread. In other words, it disables --** mutexing on [database connection] and [prepared statement] objects. --** The application is responsible for serializing access to --** [database connections] and [prepared statements]. But other mutexes --** are enabled so that SQLite will be safe to use in a multi-threaded --** environment as long as no two threads attempt to use the same --** [database connection] at the same time. ^If SQLite is compiled with --** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then --** it is not possible to set the Multi-thread [threading mode] and --** [sqlite3_config()] will return [SQLITE_ERROR] if called with the --** SQLITE_CONFIG_MULTITHREAD configuration option.</dd> --** --** <dt>SQLITE_CONFIG_SERIALIZED</dt> --** <dd>There are no arguments to this option. ^This option sets the --** [threading mode] to Serialized. In other words, this option enables --** all mutexes including the recursive --** mutexes on [database connection] and [prepared statement] objects. --** In this mode (which is the default when SQLite is compiled with --** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access --** to [database connections] and [prepared statements] so that the --** application is free to use the same [database connection] or the --** same [prepared statement] in different threads at the same time. --** ^If SQLite is compiled with --** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then --** it is not possible to set the Serialized [threading mode] and --** [sqlite3_config()] will return [SQLITE_ERROR] if called with the --** SQLITE_CONFIG_SERIALIZED configuration option.</dd> --** --** <dt>SQLITE_CONFIG_MALLOC</dt> --** <dd> ^(This option takes a single argument which is a pointer to an --** instance of the [sqlite3_mem_methods] structure. The argument specifies --** alternative low-level memory allocation routines to be used in place of --** the memory allocation routines built into SQLite.)^ ^SQLite makes --** its own private copy of the content of the [sqlite3_mem_methods] structure --** before the [sqlite3_config()] call returns.</dd> --** --** <dt>SQLITE_CONFIG_GETMALLOC</dt> --** <dd> ^(This option takes a single argument which is a pointer to an --** instance of the [sqlite3_mem_methods] structure. The [sqlite3_mem_methods] --** structure is filled with the currently defined memory allocation routines.)^ --** This option can be used to overload the default memory allocation --** routines with a wrapper that simulations memory allocation failure or --** tracks memory usage, for example. </dd> --** --** <dt>SQLITE_CONFIG_MEMSTATUS</dt> --** <dd> ^This option takes single argument of type int, interpreted as a --** boolean, which enables or disables the collection of memory allocation --** statistics. ^(When memory allocation statistics are disabled, the --** following SQLite interfaces become non-operational: --** <ul> --** <li> [sqlite3_memory_used()] --** <li> [sqlite3_memory_highwater()] --** <li> [sqlite3_soft_heap_limit()] --** <li> [sqlite3_status()] --** </ul>)^ --** ^Memory allocation statistics are enabled by default unless SQLite is --** compiled with [SQLITE_DEFAULT_MEMSTATUS]=0 in which case memory --** allocation statistics are disabled by default. --** </dd> --** --** <dt>SQLITE_CONFIG_SCRATCH</dt> --** <dd> ^This option specifies a static memory buffer that SQLite can use for --** scratch memory. There are three arguments: A pointer an 8-byte --** aligned memory buffer from which the scrach allocations will be --** drawn, the size of each scratch allocation (sz), --** and the maximum number of scratch allocations (N). The sz --** argument must be a multiple of 16. The sz parameter should be a few bytes --** larger than the actual scratch space required due to internal overhead. --** The first argument must be a pointer to an 8-byte aligned buffer --** of at least sz*N bytes of memory. --** ^SQLite will use no more than one scratch buffer per thread. So --** N should be set to the expected maximum number of threads. ^SQLite will --** never require a scratch buffer that is more than 6 times the database --** page size. ^If SQLite needs needs additional scratch memory beyond --** what is provided by this configuration option, then --** [sqlite3_malloc()] will be used to obtain the memory needed.</dd> --** --** <dt>SQLITE_CONFIG_PAGECACHE</dt> --** <dd> ^This option specifies a static memory buffer that SQLite can use for --** the database page cache with the default page cache implemenation. --** This configuration should not be used if an application-define page --** cache implementation is loaded using the SQLITE_CONFIG_PCACHE option. --** There are three arguments to this option: A pointer to 8-byte aligned --** memory, the size of each page buffer (sz), and the number of pages (N). --** The sz argument should be the size of the largest database page --** (a power of two between 512 and 32768) plus a little extra for each --** page header. ^The page header size is 20 to 40 bytes depending on --** the host architecture. ^It is harmless, apart from the wasted memory, --** to make sz a little too large. The first --** argument should point to an allocation of at least sz*N bytes of memory. --** ^SQLite will use the memory provided by the first argument to satisfy its --** memory needs for the first N pages that it adds to cache. ^If additional --** page cache memory is needed beyond what is provided by this option, then --** SQLite goes to [sqlite3_malloc()] for the additional storage space. --** ^The implementation might use one or more of the N buffers to hold --** memory accounting information. The pointer in the first argument must --** be aligned to an 8-byte boundary or subsequent behavior of SQLite --** will be undefined.</dd> --** --** <dt>SQLITE_CONFIG_HEAP</dt> --** <dd> ^This option specifies a static memory buffer that SQLite will use --** for all of its dynamic memory allocation needs beyond those provided --** for by [SQLITE_CONFIG_SCRATCH] and [SQLITE_CONFIG_PAGECACHE]. --** There are three arguments: An 8-byte aligned pointer to the memory, --** the number of bytes in the memory buffer, and the minimum allocation size. --** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts --** to using its default memory allocator (the system malloc() implementation), --** undoing any prior invocation of [SQLITE_CONFIG_MALLOC]. ^If the --** memory pointer is not NULL and either [SQLITE_ENABLE_MEMSYS3] or --** [SQLITE_ENABLE_MEMSYS5] are defined, then the alternative memory --** allocator is engaged to handle all of SQLites memory allocation needs. --** The first pointer (the memory pointer) must be aligned to an 8-byte --** boundary or subsequent behavior of SQLite will be undefined.</dd> --** --** <dt>SQLITE_CONFIG_MUTEX</dt> --** <dd> ^(This option takes a single argument which is a pointer to an --** instance of the [sqlite3_mutex_methods] structure. The argument specifies --** alternative low-level mutex routines to be used in place --** the mutex routines built into SQLite.)^ ^SQLite makes a copy of the --** content of the [sqlite3_mutex_methods] structure before the call to --** [sqlite3_config()] returns. ^If SQLite is compiled with --** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then --** the entire mutexing subsystem is omitted from the build and hence calls to --** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will --** return [SQLITE_ERROR].</dd> --** --** <dt>SQLITE_CONFIG_GETMUTEX</dt> --** <dd> ^(This option takes a single argument which is a pointer to an --** instance of the [sqlite3_mutex_methods] structure. The --** [sqlite3_mutex_methods] --** structure is filled with the currently defined mutex routines.)^ --** This option can be used to overload the default mutex allocation --** routines with a wrapper used to track mutex usage for performance --** profiling or testing, for example. ^If SQLite is compiled with --** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then --** the entire mutexing subsystem is omitted from the build and hence calls to --** [sqlite3_config()] with the SQLITE_CONFIG_GETMUTEX configuration option will --** return [SQLITE_ERROR].</dd> --** --** <dt>SQLITE_CONFIG_LOOKASIDE</dt> --** <dd> ^(This option takes two arguments that determine the default --** memory allocation for the lookaside memory allocator on each --** [database connection]. The first argument is the --** size of each lookaside buffer slot and the second is the number of --** slots allocated to each database connection.)^ ^(This option sets the --** <i>default</i> lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE] --** verb to [sqlite3_db_config()] can be used to change the lookaside --** configuration on individual connections.)^ </dd> --** --** <dt>SQLITE_CONFIG_PCACHE</dt> --** <dd> ^(This option takes a single argument which is a pointer to --** an [sqlite3_pcache_methods] object. This object specifies the interface --** to a custom page cache implementation.)^ ^SQLite makes a copy of the --** object and uses it for page cache memory allocations.</dd> --** --** <dt>SQLITE_CONFIG_GETPCACHE</dt> --** <dd> ^(This option takes a single argument which is a pointer to an --** [sqlite3_pcache_methods] object. SQLite copies of the current --** page cache implementation into that object.)^ </dd> --** --** </dl> -- -- previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. --** CAPI3REF: Configuration Options --** EXPERIMENTAL --** --** These constants are the available integer configuration options that --** can be passed as the second argument to the [sqlite3_db_config()] interface. --** --** New configuration options may be added in future releases of SQLite. --** Existing configuration options might be discontinued. Applications --** should check the return code from [sqlite3_db_config()] to make sure that --** the call worked. ^The [sqlite3_db_config()] interface will return a --** non-zero [error code] if a discontinued or unsupported configuration option --** is invoked. --** --** <dl> --** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt> --** <dd> ^This option takes three additional arguments that determine the --** [lookaside memory allocator] configuration for the [database connection]. --** ^The first argument (the third parameter to [sqlite3_db_config()] is a --** pointer to an memory buffer to use for lookaside memory. --** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb --** may be NULL in which case SQLite will allocate the --** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the --** size of each lookaside buffer slot. ^The third argument is the number of --** slots. The size of the buffer in the first argument must be greater than --** or equal to the product of the second and third arguments. The buffer --** must be aligned to an 8-byte boundary. ^If the second argument to --** SQLITE_DBCONFIG_LOOKASIDE is not a multiple of 8, it is internally --** rounded down to the next smaller --** multiple of 8. See also: [SQLITE_CONFIG_LOOKASIDE]</dd> --** --** </dl> -- --** CAPI3REF: Enable Or Disable Extended Result Codes --** --** ^The sqlite3_extended_result_codes() routine enables or disables the --** [extended result codes] feature of SQLite. ^The extended result --** codes are disabled by default for historical compatibility. -- function sqlite3_extended_result_codes (arg1 : System.Address; arg2 : int) return int; -- /usr/include/sqlite3.h:1306:16 pragma Import (C, sqlite3_extended_result_codes, "sqlite3_extended_result_codes"); --** CAPI3REF: Last Insert Rowid --** --** ^Each entry in an SQLite table has a unique 64-bit signed --** integer key called the [ROWID | "rowid"]. ^The rowid is always available --** as an undeclared column named ROWID, OID, or _ROWID_ as long as those --** names are not also used by explicitly declared columns. ^If --** the table has a column of type [INTEGER PRIMARY KEY] then that column --** is another alias for the rowid. --** --** ^This routine returns the [rowid] of the most recent --** successful [INSERT] into the database from the [database connection] --** in the first argument. ^If no successful [INSERT]s --** have ever occurred on that database connection, zero is returned. --** --** ^(If an [INSERT] occurs within a trigger, then the [rowid] of the inserted --** row is returned by this routine as long as the trigger is running. --** But once the trigger terminates, the value returned by this routine --** reverts to the last value inserted before the trigger fired.)^ --** --** ^An [INSERT] that fails due to a constraint violation is not a --** successful [INSERT] and does not change the value returned by this --** routine. ^Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK, --** and INSERT OR ABORT make no changes to the return value of this --** routine when their insertion fails. ^(When INSERT OR REPLACE --** encounters a constraint violation, it does not fail. The --** INSERT continues to completion after deleting rows that caused --** the constraint problem so INSERT OR REPLACE will always change --** the return value of this interface.)^ --** --** ^For the purposes of this routine, an [INSERT] is considered to --** be successful even if it is subsequently rolled back. --** --** This function is accessible to SQL statements via the --** [last_insert_rowid() SQL function]. --** --** If a separate thread performs a new [INSERT] on the same --** database connection while the [sqlite3_last_insert_rowid()] --** function is running and thus changes the last insert [rowid], --** then the value returned by [sqlite3_last_insert_rowid()] is --** unpredictable and might not equal either the old or the new --** last insert [rowid]. -- function sqlite3_last_insert_rowid (arg1 : System.Address) return sqlite3_int64; -- /usr/include/sqlite3.h:1351:26 pragma Import (C, sqlite3_last_insert_rowid, "sqlite3_last_insert_rowid"); --** CAPI3REF: Count The Number Of Rows Modified --** --** ^This function returns the number of database rows that were changed --** or inserted or deleted by the most recently completed SQL statement --** on the [database connection] specified by the first parameter. --** ^(Only changes that are directly specified by the [INSERT], [UPDATE], --** or [DELETE] statement are counted. Auxiliary changes caused by --** triggers or [foreign key actions] are not counted.)^ Use the --** [sqlite3_total_changes()] function to find the total number of changes --** including changes caused by triggers and foreign key actions. --** --** ^Changes to a view that are simulated by an [INSTEAD OF trigger] --** are not counted. Only real table changes are counted. --** --** ^(A "row change" is a change to a single row of a single table --** caused by an INSERT, DELETE, or UPDATE statement. Rows that --** are changed as side effects of [REPLACE] constraint resolution, --** rollback, ABORT processing, [DROP TABLE], or by any other --** mechanisms do not count as direct row changes.)^ --** --** A "trigger context" is a scope of execution that begins and --** ends with the script of a [CREATE TRIGGER | trigger]. --** Most SQL statements are --** evaluated outside of any trigger. This is the "top level" --** trigger context. If a trigger fires from the top level, a --** new trigger context is entered for the duration of that one --** trigger. Subtriggers create subcontexts for their duration. --** --** ^Calling [sqlite3_exec()] or [sqlite3_step()] recursively does --** not create a new trigger context. --** --** ^This function returns the number of direct row changes in the --** most recent INSERT, UPDATE, or DELETE statement within the same --** trigger context. --** --** ^Thus, when called from the top level, this function returns the --** number of changes in the most recent INSERT, UPDATE, or DELETE --** that also occurred at the top level. ^(Within the body of a trigger, --** the sqlite3_changes() interface can be called to find the number of --** changes in the most recently completed INSERT, UPDATE, or DELETE --** statement within the body of the same trigger. --** However, the number returned does not include changes --** caused by subtriggers since those have their own context.)^ --** --** See also the [sqlite3_total_changes()] interface, the --** [count_changes pragma], and the [changes() SQL function]. --** --** If a separate thread makes changes on the same database connection --** while [sqlite3_changes()] is running then the value returned --** is unpredictable and not meaningful. -- function sqlite3_changes (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:1405:16 pragma Import (C, sqlite3_changes, "sqlite3_changes"); --** CAPI3REF: Total Number Of Rows Modified --** --** ^This function returns the number of row changes caused by [INSERT], --** [UPDATE] or [DELETE] statements since the [database connection] was opened. --** ^(The count returned by sqlite3_total_changes() includes all changes --** from all [CREATE TRIGGER | trigger] contexts and changes made by --** [foreign key actions]. However, --** the count does not include changes used to implement [REPLACE] constraints, --** do rollbacks or ABORT processing, or [DROP TABLE] processing. The --** count does not include rows of views that fire an [INSTEAD OF trigger], --** though if the INSTEAD OF trigger makes changes of its own, those changes --** are counted.)^ --** ^The sqlite3_total_changes() function counts the changes as soon as --** the statement that makes them is completed (when the statement handle --** is passed to [sqlite3_reset()] or [sqlite3_finalize()]). --** --** See also the [sqlite3_changes()] interface, the --** [count_changes pragma], and the [total_changes() SQL function]. --** --** If a separate thread makes changes on the same database connection --** while [sqlite3_total_changes()] is running then the value --** returned is unpredictable and not meaningful. -- function sqlite3_total_changes (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:1431:16 pragma Import (C, sqlite3_total_changes, "sqlite3_total_changes"); --** CAPI3REF: Interrupt A Long-Running Query --** --** ^This function causes any pending database operation to abort and --** return at its earliest opportunity. This routine is typically --** called in response to a user action such as pressing "Cancel" --** or Ctrl-C where the user wants a long query operation to halt --** immediately. --** --** ^It is safe to call this routine from a thread different from the --** thread that is currently running the database operation. But it --** is not safe to call this routine with a [database connection] that --** is closed or might close before sqlite3_interrupt() returns. --** --** ^If an SQL operation is very nearly finished at the time when --** sqlite3_interrupt() is called, then it might not have an opportunity --** to be interrupted and might continue to completion. --** --** ^An SQL operation that is interrupted will return [SQLITE_INTERRUPT]. --** ^If the interrupted SQL operation is an INSERT, UPDATE, or DELETE --** that is inside an explicit transaction, then the entire transaction --** will be rolled back automatically. --** --** ^The sqlite3_interrupt(D) call is in effect until all currently running --** SQL statements on [database connection] D complete. ^Any new SQL statements --** that are started after the sqlite3_interrupt() call and before the --** running statements reaches zero are interrupted as if they had been --** running prior to the sqlite3_interrupt() call. ^New SQL statements --** that are started after the running statement count reaches zero are --** not effected by the sqlite3_interrupt(). --** ^A call to sqlite3_interrupt(D) that occurs when there are no running --** SQL statements is a no-op and has no effect on SQL statements --** that are started after the sqlite3_interrupt() call returns. --** --** If the database connection closes while [sqlite3_interrupt()] --** is running then bad things will likely happen. -- procedure sqlite3_interrupt (arg1 : System.Address); -- /usr/include/sqlite3.h:1470:17 pragma Import (C, sqlite3_interrupt, "sqlite3_interrupt"); --** CAPI3REF: Determine If An SQL Statement Is Complete --** --** These routines are useful during command-line input to determine if the --** currently entered text seems to form a complete SQL statement or --** if additional input is needed before sending the text into --** SQLite for parsing. ^These routines return 1 if the input string --** appears to be a complete SQL statement. ^A statement is judged to be --** complete if it ends with a semicolon token and is not a prefix of a --** well-formed CREATE TRIGGER statement. ^Semicolons that are embedded within --** string literals or quoted identifier names or comments are not --** independent tokens (they are part of the token in which they are --** embedded) and thus do not count as a statement terminator. ^Whitespace --** and comments that follow the final semicolon are ignored. --** --** ^These routines return 0 if the statement is incomplete. ^If a --** memory allocation fails, then SQLITE_NOMEM is returned. --** --** ^These routines do not parse the SQL statements thus --** will not detect syntactically incorrect SQL. --** --** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior --** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked --** automatically by sqlite3_complete16(). If that initialization fails, --** then the return value from sqlite3_complete16() will be non-zero --** regardless of whether or not the input SQL is complete.)^ --** --** The input to [sqlite3_complete()] must be a zero-terminated --** UTF-8 string. --** --** The input to [sqlite3_complete16()] must be a zero-terminated --** UTF-16 string in native byte order. -- function sqlite3_complete (arg1 : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/sqlite3.h:1505:16 pragma Import (C, sqlite3_complete, "sqlite3_complete"); function sqlite3_complete16 (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:1506:16 pragma Import (C, sqlite3_complete16, "sqlite3_complete16"); --** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors --** --** ^This routine sets a callback function that might be invoked whenever --** an attempt is made to open a database table that another thread --** or process has locked. --** --** ^If the busy callback is NULL, then [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] --** is returned immediately upon encountering the lock. ^If the busy callback --** is not NULL, then the callback might be invoked with two arguments. --** --** ^The first argument to the busy handler is a copy of the void* pointer which --** is the third argument to sqlite3_busy_handler(). ^The second argument to --** the busy handler callback is the number of times that the busy handler has --** been invoked for this locking event. ^If the --** busy callback returns 0, then no additional attempts are made to --** access the database and [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] is returned. --** ^If the callback returns non-zero, then another attempt --** is made to open the database for reading and the cycle repeats. --** --** The presence of a busy handler does not guarantee that it will be invoked --** when there is lock contention. ^If SQLite determines that invoking the busy --** handler could result in a deadlock, it will go ahead and return [SQLITE_BUSY] --** or [SQLITE_IOERR_BLOCKED] instead of invoking the busy handler. --** Consider a scenario where one process is holding a read lock that --** it is trying to promote to a reserved lock and --** a second process is holding a reserved lock that it is trying --** to promote to an exclusive lock. The first process cannot proceed --** because it is blocked by the second and the second process cannot --** proceed because it is blocked by the first. If both processes --** invoke the busy handlers, neither will make any progress. Therefore, --** SQLite returns [SQLITE_BUSY] for the first process, hoping that this --** will induce the first process to release its read lock and allow --** the second process to proceed. --** --** ^The default busy callback is NULL. --** --** ^The [SQLITE_BUSY] error is converted to [SQLITE_IOERR_BLOCKED] --** when SQLite is in the middle of a large transaction where all the --** changes will not fit into the in-memory cache. SQLite will --** already hold a RESERVED lock on the database file, but it needs --** to promote this lock to EXCLUSIVE so that it can spill cache --** pages into the database file without harm to concurrent --** readers. ^If it is unable to promote the lock, then the in-memory --** cache will be left in an inconsistent state and so the error --** code is promoted from the relatively benign [SQLITE_BUSY] to --** the more severe [SQLITE_IOERR_BLOCKED]. ^This error code promotion --** forces an automatic rollback of the changes. See the --** <a href="/cvstrac/wiki?p=CorruptionFollowingBusyError"> --** CorruptionFollowingBusyError</a> wiki page for a discussion of why --** this is important. --** --** ^(There can only be a single busy handler defined for each --** [database connection]. Setting a new busy handler clears any --** previously set handler.)^ ^Note that calling [sqlite3_busy_timeout()] --** will also set or clear the busy handler. --** --** The busy callback should not take any actions which modify the --** database connection that invoked the busy handler. Any such actions --** result in undefined behavior. --** --** A busy handler must not close the database connection --** or [prepared statement] that invoked the busy handler. -- function sqlite3_busy_handler (arg1 : System.Address; arg2 : access function (arg1 : System.Address; arg2 : int) return int; arg3 : System.Address) return int; -- /usr/include/sqlite3.h:1572:16 pragma Import (C, sqlite3_busy_handler, "sqlite3_busy_handler"); --** CAPI3REF: Set A Busy Timeout --** --** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps --** for a specified amount of time when a table is locked. ^The handler --** will sleep multiple times until at least "ms" milliseconds of sleeping --** have accumulated. ^After at least "ms" milliseconds of sleeping, --** the handler returns 0 which causes [sqlite3_step()] to return --** [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED]. --** --** ^Calling this routine with an argument less than or equal to zero --** turns off all busy handlers. --** --** ^(There can only be a single busy handler for a particular --** [database connection] any any given moment. If another busy handler --** was defined (using [sqlite3_busy_handler()]) prior to calling --** this routine, that other busy handler is cleared.)^ -- function sqlite3_busy_timeout (arg1 : System.Address; arg2 : int) return int; -- /usr/include/sqlite3.h:1592:16 pragma Import (C, sqlite3_busy_timeout, "sqlite3_busy_timeout"); --** CAPI3REF: Convenience Routines For Running Queries --** --** Definition: A <b>result table</b> is memory data structure created by the --** [sqlite3_get_table()] interface. A result table records the --** complete query results from one or more queries. --** --** The table conceptually has a number of rows and columns. But --** these numbers are not part of the result table itself. These --** numbers are obtained separately. Let N be the number of rows --** and M be the number of columns. --** --** A result table is an array of pointers to zero-terminated UTF-8 strings. --** There are (N+1)*M elements in the array. The first M pointers point --** to zero-terminated strings that contain the names of the columns. --** The remaining entries all point to query results. NULL values result --** in NULL pointers. All other values are in their UTF-8 zero-terminated --** string representation as returned by [sqlite3_column_text()]. --** --** A result table might consist of one or more memory allocations. --** It is not safe to pass a result table directly to [sqlite3_free()]. --** A result table should be deallocated using [sqlite3_free_table()]. --** --** As an example of the result table format, suppose a query result --** is as follows: --** --** <blockquote><pre> --** Name | Age --** ----------------------- --** Alice | 43 --** Bob | 28 --** Cindy | 21 --** </pre></blockquote> --** --** There are two column (M==2) and three rows (N==3). Thus the --** result table has 8 entries. Suppose the result table is stored --** in an array names azResult. Then azResult holds this content: --** --** <blockquote><pre> --** azResult&#91;0] = "Name"; --** azResult&#91;1] = "Age"; --** azResult&#91;2] = "Alice"; --** azResult&#91;3] = "43"; --** azResult&#91;4] = "Bob"; --** azResult&#91;5] = "28"; --** azResult&#91;6] = "Cindy"; --** azResult&#91;7] = "21"; --** </pre></blockquote> --** --** ^The sqlite3_get_table() function evaluates one or more --** semicolon-separated SQL statements in the zero-terminated UTF-8 --** string of its 2nd parameter and returns a result table to the --** pointer given in its 3rd parameter. --** --** After the application has finished with the result from sqlite3_get_table(), --** it should pass the result table pointer to sqlite3_free_table() in order to --** release the memory that was malloced. Because of the way the --** [sqlite3_malloc()] happens within sqlite3_get_table(), the calling --** function must not try to call [sqlite3_free()] directly. Only --** [sqlite3_free_table()] is able to release the memory properly and safely. --** --** ^(The sqlite3_get_table() interface is implemented as a wrapper around --** [sqlite3_exec()]. The sqlite3_get_table() routine does not have access --** to any internal data structures of SQLite. It uses only the public --** interface defined here. As a consequence, errors that occur in the --** wrapper layer outside of the internal [sqlite3_exec()] call are not --** reflected in subsequent calls to [sqlite3_errcode()] or --** [sqlite3_errmsg()].)^ -- function sqlite3_get_table (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : System.Address; arg4 : access int; arg5 : access int; arg6 : System.Address) return int; -- /usr/include/sqlite3.h:1663:16 pragma Import (C, sqlite3_get_table, "sqlite3_get_table"); -- An open database -- SQL to be evaluated -- Results of the query -- Number of result rows written here -- Number of result columns written here -- Error msg written here procedure sqlite3_free_table (arg1 : System.Address); -- /usr/include/sqlite3.h:1671:17 pragma Import (C, sqlite3_free_table, "sqlite3_free_table"); --** CAPI3REF: Formatted String Printing Functions --** --** These routines are work-alikes of the "printf()" family of functions --** from the standard C library. --** --** ^The sqlite3_mprintf() and sqlite3_vmprintf() routines write their --** results into memory obtained from [sqlite3_malloc()]. --** The strings returned by these two routines should be --** released by [sqlite3_free()]. ^Both routines return a --** NULL pointer if [sqlite3_malloc()] is unable to allocate enough --** memory to hold the resulting string. --** --** ^(In sqlite3_snprintf() routine is similar to "snprintf()" from --** the standard C library. The result is written into the --** buffer supplied as the second parameter whose size is given by --** the first parameter. Note that the order of the --** first two parameters is reversed from snprintf().)^ This is an --** historical accident that cannot be fixed without breaking --** backwards compatibility. ^(Note also that sqlite3_snprintf() --** returns a pointer to its buffer instead of the number of --** characters actually written into the buffer.)^ We admit that --** the number of characters written would be a more useful return --** value but we cannot change the implementation of sqlite3_snprintf() --** now without breaking compatibility. --** --** ^As long as the buffer size is greater than zero, sqlite3_snprintf() --** guarantees that the buffer is always zero-terminated. ^The first --** parameter "n" is the total size of the buffer, including space for --** the zero terminator. So the longest string that can be completely --** written will be n-1 characters. --** --** These routines all implement some additional formatting --** options that are useful for constructing SQL statements. --** All of the usual printf() formatting options apply. In addition, there --** is are "%q", "%Q", and "%z" options. --** --** ^(The %q option works like %s in that it substitutes a null-terminated --** string from the argument list. But %q also doubles every '\'' character. --** %q is designed for use inside a string literal.)^ By doubling each '\'' --** character it escapes that character and allows it to be inserted into --** the string. --** --** For example, assume the string variable zText contains text as follows: --** --** <blockquote><pre> --** char *zText = "It's a happy day!"; --** </pre></blockquote> --** --** One can use this text in an SQL statement as follows: --** --** <blockquote><pre> --** char *zSQL = sqlite3_mprintf("INSERT INTO table VALUES('%q')", zText); --** sqlite3_exec(db, zSQL, 0, 0, 0); --** sqlite3_free(zSQL); --** </pre></blockquote> --** --** Because the %q format string is used, the '\'' character in zText --** is escaped and the SQL generated is as follows: --** --** <blockquote><pre> --** INSERT INTO table1 VALUES('It''s a happy day!') --** </pre></blockquote> --** --** This is correct. Had we used %s instead of %q, the generated SQL --** would have looked like this: --** --** <blockquote><pre> --** INSERT INTO table1 VALUES('It's a happy day!'); --** </pre></blockquote> --** --** This second example is an SQL syntax error. As a general rule you should --** always use %q instead of %s when inserting text into a string literal. --** --** ^(The %Q option works like %q except it also adds single quotes around --** the outside of the total string. Additionally, if the parameter in the --** argument list is a NULL pointer, %Q substitutes the text "NULL" (without --** single quotes).)^ So, for example, one could say: --** --** <blockquote><pre> --** char *zSQL = sqlite3_mprintf("INSERT INTO table VALUES(%Q)", zText); --** sqlite3_exec(db, zSQL, 0, 0, 0); --** sqlite3_free(zSQL); --** </pre></blockquote> --** --** The code above will render a correct SQL statement in the zSQL --** variable even if the zText variable is a NULL pointer. --** --** ^(The "%z" formatting option works like "%s" but with the --** addition that after the string has been read and copied into --** the result, [sqlite3_free()] is called on the input string.)^ -- function sqlite3_mprintf (arg1 : Interfaces.C.Strings.chars_ptr -- , ... ) return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:1765:18 pragma Import (C, sqlite3_mprintf, "sqlite3_mprintf"); -- -- function sqlite3_vmprintf (arg1 : Interfaces.C.Strings.chars_ptr; arg2 : stdarg_h.va_list) return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:1766:18 -- pragma Import (C, sqlite3_vmprintf, "sqlite3_vmprintf"); -- -- function sqlite3_snprintf -- (arg1 : int; -- arg2 : Interfaces.C.Strings.chars_ptr; -- arg3 : Interfaces.C.Strings.chars_ptr -- , ... -- ) return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:1767:18 -- pragma Import (C, sqlite3_snprintf, "sqlite3_snprintf"); --** CAPI3REF: Memory Allocation Subsystem --** --** The SQLite core uses these three routines for all of its own --** internal memory allocation needs. "Core" in the previous sentence --** does not include operating-system specific VFS implementation. The --** Windows VFS uses native malloc() and free() for some operations. --** --** ^The sqlite3_malloc() routine returns a pointer to a block --** of memory at least N bytes in length, where N is the parameter. --** ^If sqlite3_malloc() is unable to obtain sufficient free --** memory, it returns a NULL pointer. ^If the parameter N to --** sqlite3_malloc() is zero or negative then sqlite3_malloc() returns --** a NULL pointer. --** --** ^Calling sqlite3_free() with a pointer previously returned --** by sqlite3_malloc() or sqlite3_realloc() releases that memory so --** that it might be reused. ^The sqlite3_free() routine is --** a no-op if is called with a NULL pointer. Passing a NULL pointer --** to sqlite3_free() is harmless. After being freed, memory --** should neither be read nor written. Even reading previously freed --** memory might result in a segmentation fault or other severe error. --** Memory corruption, a segmentation fault, or other severe error --** might result if sqlite3_free() is called with a non-NULL pointer that --** was not obtained from sqlite3_malloc() or sqlite3_realloc(). --** --** ^(The sqlite3_realloc() interface attempts to resize a --** prior memory allocation to be at least N bytes, where N is the --** second parameter. The memory allocation to be resized is the first --** parameter.)^ ^ If the first parameter to sqlite3_realloc() --** is a NULL pointer then its behavior is identical to calling --** sqlite3_malloc(N) where N is the second parameter to sqlite3_realloc(). --** ^If the second parameter to sqlite3_realloc() is zero or --** negative then the behavior is exactly the same as calling --** sqlite3_free(P) where P is the first parameter to sqlite3_realloc(). --** ^sqlite3_realloc() returns a pointer to a memory allocation --** of at least N bytes in size or NULL if sufficient memory is unavailable. --** ^If M is the size of the prior allocation, then min(N,M) bytes --** of the prior allocation are copied into the beginning of buffer returned --** by sqlite3_realloc() and the prior allocation is freed. --** ^If sqlite3_realloc() returns NULL, then the prior allocation --** is not freed. --** --** ^The memory returned by sqlite3_malloc() and sqlite3_realloc() --** is always aligned to at least an 8 byte boundary. --** --** In SQLite version 3.5.0 and 3.5.1, it was possible to define --** the SQLITE_OMIT_MEMORY_ALLOCATION which would cause the built-in --** implementation of these routines to be omitted. That capability --** is no longer provided. Only built-in memory allocators can be used. --** --** The Windows OS interface layer calls --** the system malloc() and free() directly when converting --** filenames between the UTF-8 encoding used by SQLite --** and whatever filename encoding is used by the particular Windows --** installation. Memory allocation errors are detected, but --** they are reported back as [SQLITE_CANTOPEN] or --** [SQLITE_IOERR] rather than [SQLITE_NOMEM]. --** --** The pointer arguments to [sqlite3_free()] and [sqlite3_realloc()] --** must be either NULL or else pointers obtained from a prior --** invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have --** not yet been released. --** --** The application must not read or write any part of --** a block of memory after it has been released using --** [sqlite3_free()] or [sqlite3_realloc()]. -- function sqlite3_malloc (arg1 : int) return System.Address; -- /usr/include/sqlite3.h:1837:18 pragma Import (C, sqlite3_malloc, "sqlite3_malloc"); function sqlite3_realloc (arg1 : System.Address; arg2 : int) return System.Address; -- /usr/include/sqlite3.h:1838:18 pragma Import (C, sqlite3_realloc, "sqlite3_realloc"); procedure sqlite3_free (arg1 : System.Address); -- /usr/include/sqlite3.h:1839:17 pragma Import (C, sqlite3_free, "sqlite3_free"); --** CAPI3REF: Memory Allocator Statistics --** --** SQLite provides these two interfaces for reporting on the status --** of the [sqlite3_malloc()], [sqlite3_free()], and [sqlite3_realloc()] --** routines, which form the built-in memory allocation subsystem. --** --** ^The [sqlite3_memory_used()] routine returns the number of bytes --** of memory currently outstanding (malloced but not freed). --** ^The [sqlite3_memory_highwater()] routine returns the maximum --** value of [sqlite3_memory_used()] since the high-water mark --** was last reset. ^The values returned by [sqlite3_memory_used()] and --** [sqlite3_memory_highwater()] include any overhead --** added by SQLite in its implementation of [sqlite3_malloc()], --** but not overhead added by the any underlying system library --** routines that [sqlite3_malloc()] may call. --** --** ^The memory high-water mark is reset to the current value of --** [sqlite3_memory_used()] if and only if the parameter to --** [sqlite3_memory_highwater()] is true. ^The value returned --** by [sqlite3_memory_highwater(1)] is the high-water mark --** prior to the reset. -- function sqlite3_memory_used return sqlite3_int64; -- /usr/include/sqlite3.h:1864:26 pragma Import (C, sqlite3_memory_used, "sqlite3_memory_used"); function sqlite3_memory_highwater (arg1 : int) return sqlite3_int64; -- /usr/include/sqlite3.h:1865:26 pragma Import (C, sqlite3_memory_highwater, "sqlite3_memory_highwater"); --** CAPI3REF: Pseudo-Random Number Generator --** --** SQLite contains a high-quality pseudo-random number generator (PRNG) used to --** select random [ROWID | ROWIDs] when inserting new records into a table that --** already uses the largest possible [ROWID]. The PRNG is also used for --** the build-in random() and randomblob() SQL functions. This interface allows --** applications to access the same PRNG for other purposes. --** --** ^A call to this routine stores N bytes of randomness into buffer P. --** --** ^The first time this routine is invoked (either internally or by --** the application) the PRNG is seeded using randomness obtained --** from the xRandomness method of the default [sqlite3_vfs] object. --** ^On all subsequent invocations, the pseudo-randomness is generated --** internally and without recourse to the [sqlite3_vfs] xRandomness --** method. -- procedure sqlite3_randomness (arg1 : int; arg2 : System.Address); -- /usr/include/sqlite3.h:1885:17 pragma Import (C, sqlite3_randomness, "sqlite3_randomness"); --** CAPI3REF: Compile-Time Authorization Callbacks --** --** ^This routine registers a authorizer callback with a particular --** [database connection], supplied in the first argument. --** ^The authorizer callback is invoked as SQL statements are being compiled --** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()], --** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()]. ^At various --** points during the compilation process, as logic is being created --** to perform various actions, the authorizer callback is invoked to --** see if those actions are allowed. ^The authorizer callback should --** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the --** specific action but allow the SQL statement to continue to be --** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be --** rejected with an error. ^If the authorizer callback returns --** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY] --** then the [sqlite3_prepare_v2()] or equivalent call that triggered --** the authorizer will fail with an error message. --** --** When the callback returns [SQLITE_OK], that means the operation --** requested is ok. ^When the callback returns [SQLITE_DENY], the --** [sqlite3_prepare_v2()] or equivalent call that triggered the --** authorizer will fail with an error message explaining that --** access is denied. --** --** ^The first parameter to the authorizer callback is a copy of the third --** parameter to the sqlite3_set_authorizer() interface. ^The second parameter --** to the callback is an integer [SQLITE_COPY | action code] that specifies --** the particular action to be authorized. ^The third through sixth parameters --** to the callback are zero-terminated strings that contain additional --** details about the action to be authorized. --** --** ^If the action code is [SQLITE_READ] --** and the callback returns [SQLITE_IGNORE] then the --** [prepared statement] statement is constructed to substitute --** a NULL value in place of the table column that would have --** been read if [SQLITE_OK] had been returned. The [SQLITE_IGNORE] --** return can be used to deny an untrusted user access to individual --** columns of a table. --** ^If the action code is [SQLITE_DELETE] and the callback returns --** [SQLITE_IGNORE] then the [DELETE] operation proceeds but the --** [truncate optimization] is disabled and all rows are deleted individually. --** --** An authorizer is used when [sqlite3_prepare | preparing] --** SQL statements from an untrusted source, to ensure that the SQL statements --** do not try to access data they are not allowed to see, or that they do not --** try to execute malicious statements that damage the database. For --** example, an application may allow a user to enter arbitrary --** SQL queries for evaluation by a database. But the application does --** not want the user to be able to make arbitrary changes to the --** database. An authorizer could then be put in place while the --** user-entered SQL is being [sqlite3_prepare | prepared] that --** disallows everything except [SELECT] statements. --** --** Applications that need to process SQL from untrusted sources --** might also consider lowering resource limits using [sqlite3_limit()] --** and limiting database size using the [max_page_count] [PRAGMA] --** in addition to using an authorizer. --** --** ^(Only a single authorizer can be in place on a database connection --** at a time. Each call to sqlite3_set_authorizer overrides the --** previous call.)^ ^Disable the authorizer by installing a NULL callback. --** The authorizer is disabled by default. --** --** The authorizer callback must not do anything that will modify --** the database connection that invoked the authorizer callback. --** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their --** database connections for the meaning of "modify" in this paragraph. --** --** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the --** statement might be re-prepared during [sqlite3_step()] due to a --** schema change. Hence, the application should ensure that the --** correct authorizer callback remains in place during the [sqlite3_step()]. --** --** ^Note that the authorizer callback is invoked only during --** [sqlite3_prepare()] or its variants. Authorization is not --** performed during statement evaluation in [sqlite3_step()], unless --** as stated in the previous paragraph, sqlite3_step() invokes --** sqlite3_prepare_v2() to reprepare a statement after a schema change. -- function sqlite3_set_authorizer (arg1 : System.Address; arg2 : access function (arg1 : System.Address; arg2 : int; arg3 : Interfaces.C.Strings.chars_ptr; arg4 : Interfaces.C.Strings.chars_ptr; arg5 : Interfaces.C.Strings.chars_ptr; arg6 : Interfaces.C.Strings.chars_ptr) return int; arg3 : System.Address) return int; -- /usr/include/sqlite3.h:1967:16 pragma Import (C, sqlite3_set_authorizer, "sqlite3_set_authorizer"); --** CAPI3REF: Authorizer Return Codes --** --** The [sqlite3_set_authorizer | authorizer callback function] must --** return either [SQLITE_OK] or one of these two constants in order --** to signal SQLite whether or not the action is permitted. See the --** [sqlite3_set_authorizer | authorizer documentation] for additional --** information. -- --** CAPI3REF: Authorizer Action Codes --** --** The [sqlite3_set_authorizer()] interface registers a callback function --** that is invoked to authorize certain SQL statement actions. The --** second parameter to the callback is an integer code that specifies --** what action is being authorized. These are the integer action codes that --** the authorizer callback may be passed. --** --** These action code values signify what kind of operation is to be --** authorized. The 3rd and 4th parameters to the authorization --** callback function will be parameters or NULL depending on which of these --** codes is used as the second parameter. ^(The 5th parameter to the --** authorizer callback is the name of the database ("main", "temp", --** etc.) if applicable.)^ ^The 6th parameter to the authorizer callback --** is the name of the inner-most trigger or view that is responsible for --** the access attempt or NULL if this access attempt is directly from --** top-level SQL code. -- --****************************************** 3rd ************ 4th ********** --** CAPI3REF: Tracing And Profiling Functions --** EXPERIMENTAL --** --** These routines register callback functions that can be used for --** tracing and profiling the execution of SQL statements. --** --** ^The callback function registered by sqlite3_trace() is invoked at --** various times when an SQL statement is being run by [sqlite3_step()]. --** ^The sqlite3_trace() callback is invoked with a UTF-8 rendering of the --** SQL statement text as the statement first begins executing. --** ^(Additional sqlite3_trace() callbacks might occur --** as each triggered subprogram is entered. The callbacks for triggers --** contain a UTF-8 SQL comment that identifies the trigger.)^ --** --** ^The callback function registered by sqlite3_profile() is invoked --** as each SQL statement finishes. ^The profile callback contains --** the original statement text and an estimate of wall-clock time --** of how long that statement took to run. -- function sqlite3_trace (arg1 : System.Address; arg2 : access procedure (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr); arg3 : System.Address) return System.Address; -- /usr/include/sqlite3.h:2059:38 pragma Import (C, sqlite3_trace, "sqlite3_trace"); function sqlite3_profile (arg1 : System.Address; arg2 : access procedure (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : sqlite3_uint64); arg3 : System.Address) return System.Address; -- /usr/include/sqlite3.h:2060:38 pragma Import (C, sqlite3_profile, "sqlite3_profile"); --** CAPI3REF: Query Progress Callbacks --** --** ^This routine configures a callback function - the --** progress callback - that is invoked periodically during long --** running calls to [sqlite3_exec()], [sqlite3_step()] and --** [sqlite3_get_table()]. An example use for this --** interface is to keep a GUI updated during a large query. --** --** ^If the progress callback returns non-zero, the operation is --** interrupted. This feature can be used to implement a --** "Cancel" button on a GUI progress dialog box. --** --** The progress handler must not do anything that will modify --** the database connection that invoked the progress handler. --** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their --** database connections for the meaning of "modify" in this paragraph. --** -- procedure sqlite3_progress_handler (arg1 : System.Address; arg2 : int; arg3 : access function (arg1 : System.Address) return int; arg4 : System.Address); -- /usr/include/sqlite3.h:2082:17 pragma Import (C, sqlite3_progress_handler, "sqlite3_progress_handler"); --** CAPI3REF: Opening A New Database Connection --** --** ^These routines open an SQLite database file whose name is given by the --** filename argument. ^The filename argument is interpreted as UTF-8 for --** sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte --** order for sqlite3_open16(). ^(A [database connection] handle is usually --** returned in *ppDb, even if an error occurs. The only exception is that --** if SQLite is unable to allocate memory to hold the [sqlite3] object, --** a NULL will be written into *ppDb instead of a pointer to the [sqlite3] --** object.)^ ^(If the database is opened (and/or created) successfully, then --** [SQLITE_OK] is returned. Otherwise an [error code] is returned.)^ ^The --** [sqlite3_errmsg()] or [sqlite3_errmsg16()] routines can be used to obtain --** an English language description of the error following a failure of any --** of the sqlite3_open() routines. --** --** ^The default encoding for the database will be UTF-8 if --** sqlite3_open() or sqlite3_open_v2() is called and --** UTF-16 in the native byte order if sqlite3_open16() is used. --** --** Whether or not an error occurs when it is opened, resources --** associated with the [database connection] handle should be released by --** passing it to [sqlite3_close()] when it is no longer required. --** --** The sqlite3_open_v2() interface works like sqlite3_open() --** except that it accepts two additional parameters for additional control --** over the new database connection. ^(The flags parameter to --** sqlite3_open_v2() can take one of --** the following three values, optionally combined with the --** [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], [SQLITE_OPEN_SHAREDCACHE], --** and/or [SQLITE_OPEN_PRIVATECACHE] flags:)^ --** --** <dl> --** ^(<dt>[SQLITE_OPEN_READONLY]</dt> --** <dd>The database is opened in read-only mode. If the database does not --** already exist, an error is returned.</dd>)^ --** --** ^(<dt>[SQLITE_OPEN_READWRITE]</dt> --** <dd>The database is opened for reading and writing if possible, or reading --** only if the file is write protected by the operating system. In either --** case the database must already exist, otherwise an error is returned.</dd>)^ --** --** ^(<dt>[SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]</dt> --** <dd>The database is opened for reading and writing, and is creates it if --** it does not already exist. This is the behavior that is always used for --** sqlite3_open() and sqlite3_open16().</dd>)^ --** </dl> --** --** If the 3rd parameter to sqlite3_open_v2() is not one of the --** combinations shown above or one of the combinations shown above combined --** with the [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], --** [SQLITE_OPEN_SHAREDCACHE] and/or [SQLITE_OPEN_SHAREDCACHE] flags, --** then the behavior is undefined. --** --** ^If the [SQLITE_OPEN_NOMUTEX] flag is set, then the database connection --** opens in the multi-thread [threading mode] as long as the single-thread --** mode has not been set at compile-time or start-time. ^If the --** [SQLITE_OPEN_FULLMUTEX] flag is set then the database connection opens --** in the serialized [threading mode] unless single-thread was --** previously selected at compile-time or start-time. --** ^The [SQLITE_OPEN_SHAREDCACHE] flag causes the database connection to be --** eligible to use [shared cache mode], regardless of whether or not shared --** cache is enabled using [sqlite3_enable_shared_cache()]. ^The --** [SQLITE_OPEN_PRIVATECACHE] flag causes the database connection to not --** participate in [shared cache mode] even if it is enabled. --** --** ^If the filename is ":memory:", then a private, temporary in-memory database --** is created for the connection. ^This in-memory database will vanish when --** the database connection is closed. Future versions of SQLite might --** make use of additional special filenames that begin with the ":" character. --** It is recommended that when a database filename actually does begin with --** a ":" character you should prefix the filename with a pathname such as --** "./" to avoid ambiguity. --** --** ^If the filename is an empty string, then a private, temporary --** on-disk database will be created. ^This private database will be --** automatically deleted as soon as the database connection is closed. --** --** ^The fourth parameter to sqlite3_open_v2() is the name of the --** [sqlite3_vfs] object that defines the operating system interface that --** the new database connection should use. ^If the fourth parameter is --** a NULL pointer then the default [sqlite3_vfs] object is used. --** --** <b>Note to Windows users:</b> The encoding used for the filename argument --** of sqlite3_open() and sqlite3_open_v2() must be UTF-8, not whatever --** codepage is currently defined. Filenames containing international --** characters must be converted to UTF-8 prior to passing them into --** sqlite3_open() or sqlite3_open_v2(). -- function sqlite3_open (arg1 : Interfaces.C.Strings.chars_ptr; arg2 : access System.Address) return int; -- /usr/include/sqlite3.h:2173:16 pragma Import (C, sqlite3_open, "sqlite3_open"); -- Database filename (UTF-8) -- OUT: SQLite db handle function sqlite3_open16 (arg1 : System.Address; arg2 : System.Address) return int; -- /usr/include/sqlite3.h:2177:16 pragma Import (C, sqlite3_open16, "sqlite3_open16"); -- Database filename (UTF-16) -- OUT: SQLite db handle function sqlite3_open_v2 (arg1 : Interfaces.C.Strings.chars_ptr; arg2 : access System.Address; arg3 : int; arg4 : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/sqlite3.h:2181:16 pragma Import (C, sqlite3_open_v2, "sqlite3_open_v2"); -- Database filename (UTF-8) -- OUT: SQLite db handle -- Flags -- Name of VFS module to use --** CAPI3REF: Error Codes And Messages --** --** ^The sqlite3_errcode() interface returns the numeric [result code] or --** [extended result code] for the most recent failed sqlite3_* API call --** associated with a [database connection]. If a prior API call failed --** but the most recent API call succeeded, the return value from --** sqlite3_errcode() is undefined. ^The sqlite3_extended_errcode() --** interface is the same except that it always returns the --** [extended result code] even when extended result codes are --** disabled. --** --** ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language --** text that describes the error, as either UTF-8 or UTF-16 respectively. --** ^(Memory to hold the error message string is managed internally. --** The application does not need to worry about freeing the result. --** However, the error string might be overwritten or deallocated by --** subsequent calls to other SQLite interface functions.)^ --** --** When the serialized [threading mode] is in use, it might be the --** case that a second error occurs on a separate thread in between --** the time of the first error and the call to these interfaces. --** When that happens, the second error will be reported since these --** interfaces always report the most recent result. To avoid --** this, each thread can obtain exclusive use of the [database connection] D --** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning --** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after --** all calls to the interfaces listed here are completed. --** --** If an interface fails with SQLITE_MISUSE, that means the interface --** was invoked incorrectly by the application. In that case, the --** error code and message may or may not be set. -- function sqlite3_errcode (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:2221:16 pragma Import (C, sqlite3_errcode, "sqlite3_errcode"); function sqlite3_extended_errcode (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:2222:16 pragma Import (C, sqlite3_extended_errcode, "sqlite3_extended_errcode"); function sqlite3_errmsg (arg1 : System.Address) return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:2223:24 pragma Import (C, sqlite3_errmsg, "sqlite3_errmsg"); function sqlite3_errmsg16 (arg1 : System.Address) return System.Address; -- /usr/include/sqlite3.h:2224:24 pragma Import (C, sqlite3_errmsg16, "sqlite3_errmsg16"); --** CAPI3REF: SQL Statement Object --** KEYWORDS: {prepared statement} {prepared statements} --** --** An instance of this object represents a single SQL statement. --** This object is variously known as a "prepared statement" or a --** "compiled SQL statement" or simply as a "statement". --** --** The life of a statement object goes something like this: --** --** <ol> --** <li> Create the object using [sqlite3_prepare_v2()] or a related --** function. --** <li> Bind values to [host parameters] using the sqlite3_bind_*() --** interfaces. --** <li> Run the SQL by calling [sqlite3_step()] one or more times. --** <li> Reset the statement using [sqlite3_reset()] then go back --** to step 2. Do this zero or more times. --** <li> Destroy the object using [sqlite3_finalize()]. --** </ol> --** --** Refer to documentation on individual methods above for additional --** information. -- -- skipped empty struct sqlite3_stmt --** CAPI3REF: Run-time Limits --** --** ^(This interface allows the size of various constructs to be limited --** on a connection by connection basis. The first parameter is the --** [database connection] whose limit is to be set or queried. The --** second parameter is one of the [limit categories] that define a --** class of constructs to be size limited. The third parameter is the --** new limit for that construct. The function returns the old limit.)^ --** --** ^If the new limit is a negative number, the limit is unchanged. --** ^(For the limit category of SQLITE_LIMIT_XYZ there is a --** [limits | hard upper bound] --** set by a compile-time C preprocessor macro named --** [limits | SQLITE_MAX_XYZ]. --** (The "_LIMIT_" in the name is changed to "_MAX_".))^ --** ^Attempts to increase a limit above its hard upper bound are --** silently truncated to the hard upper bound. --** --** Run-time limits are intended for use in applications that manage --** both their own internal database and also databases that are controlled --** by untrusted external sources. An example application might be a --** web browser that has its own databases for storing history and --** separate databases controlled by JavaScript applications downloaded --** off the Internet. The internal databases can be given the --** large, default limits. Databases managed by external sources can --** be given much smaller limits designed to prevent a denial of service --** attack. Developers might also want to use the [sqlite3_set_authorizer()] --** interface to further control untrusted SQL. The size of the database --** created by an untrusted script can be contained using the --** [max_page_count] [PRAGMA]. --** --** New run-time limit categories may be added in future releases. -- function sqlite3_limit (arg1 : System.Address; arg2 : int; arg3 : int) return int; -- /usr/include/sqlite3.h:2286:16 pragma Import (C, sqlite3_limit, "sqlite3_limit"); --** CAPI3REF: Run-Time Limit Categories --** KEYWORDS: {limit category} {*limit categories} --** --** These constants define various performance limits --** that can be lowered at run-time using [sqlite3_limit()]. --** The synopsis of the meanings of the various limits is shown below. --** Additional information is available at [limits | Limits in SQLite]. --** --** <dl> --** ^(<dt>SQLITE_LIMIT_LENGTH</dt> --** <dd>The maximum size of any string or BLOB or table row.<dd>)^ --** --** ^(<dt>SQLITE_LIMIT_SQL_LENGTH</dt> --** <dd>The maximum length of an SQL statement, in bytes.</dd>)^ --** --** ^(<dt>SQLITE_LIMIT_COLUMN</dt> --** <dd>The maximum number of columns in a table definition or in the --** result set of a [SELECT] or the maximum number of columns in an index --** or in an ORDER BY or GROUP BY clause.</dd>)^ --** --** ^(<dt>SQLITE_LIMIT_EXPR_DEPTH</dt> --** <dd>The maximum depth of the parse tree on any expression.</dd>)^ --** --** ^(<dt>SQLITE_LIMIT_COMPOUND_SELECT</dt> --** <dd>The maximum number of terms in a compound SELECT statement.</dd>)^ --** --** ^(<dt>SQLITE_LIMIT_VDBE_OP</dt> --** <dd>The maximum number of instructions in a virtual machine program --** used to implement an SQL statement.</dd>)^ --** --** ^(<dt>SQLITE_LIMIT_FUNCTION_ARG</dt> --** <dd>The maximum number of arguments on a function.</dd>)^ --** --** ^(<dt>SQLITE_LIMIT_ATTACHED</dt> --** <dd>The maximum number of [ATTACH | attached databases].)^</dd> --** --** ^(<dt>SQLITE_LIMIT_LIKE_PATTERN_LENGTH</dt> --** <dd>The maximum length of the pattern argument to the [LIKE] or --** [GLOB] operators.</dd>)^ --** --** ^(<dt>SQLITE_LIMIT_VARIABLE_NUMBER</dt> --** <dd>The maximum number of variables in an SQL statement that can --** be bound.</dd>)^ --** --** ^(<dt>SQLITE_LIMIT_TRIGGER_DEPTH</dt> --** <dd>The maximum depth of recursion for triggers.</dd>)^ --** </dl> -- --** CAPI3REF: Compiling An SQL Statement --** KEYWORDS: {SQL statement compiler} --** --** To execute an SQL query, it must first be compiled into a byte-code --** program using one of these routines. --** --** The first argument, "db", is a [database connection] obtained from a --** prior successful call to [sqlite3_open()], [sqlite3_open_v2()] or --** [sqlite3_open16()]. The database connection must not have been closed. --** --** The second argument, "zSql", is the statement to be compiled, encoded --** as either UTF-8 or UTF-16. The sqlite3_prepare() and sqlite3_prepare_v2() --** interfaces use UTF-8, and sqlite3_prepare16() and sqlite3_prepare16_v2() --** use UTF-16. --** --** ^If the nByte argument is less than zero, then zSql is read up to the --** first zero terminator. ^If nByte is non-negative, then it is the maximum --** number of bytes read from zSql. ^When nByte is non-negative, the --** zSql string ends at either the first '\000' or '\u0000' character or --** the nByte-th byte, whichever comes first. If the caller knows --** that the supplied string is nul-terminated, then there is a small --** performance advantage to be gained by passing an nByte parameter that --** is equal to the number of bytes in the input string <i>including</i> --** the nul-terminator bytes. --** --** ^If pzTail is not NULL then *pzTail is made to point to the first byte --** past the end of the first SQL statement in zSql. These routines only --** compile the first statement in zSql, so *pzTail is left pointing to --** what remains uncompiled. --** --** ^*ppStmt is left pointing to a compiled [prepared statement] that can be --** executed using [sqlite3_step()]. ^If there is an error, *ppStmt is set --** to NULL. ^If the input text contains no SQL (if the input is an empty --** string or a comment) then *ppStmt is set to NULL. --** The calling procedure is responsible for deleting the compiled --** SQL statement using [sqlite3_finalize()] after it has finished with it. --** ppStmt may not be NULL. --** --** ^On success, the sqlite3_prepare() family of routines return [SQLITE_OK]; --** otherwise an [error code] is returned. --** --** The sqlite3_prepare_v2() and sqlite3_prepare16_v2() interfaces are --** recommended for all new programs. The two older interfaces are retained --** for backwards compatibility, but their use is discouraged. --** ^In the "v2" interfaces, the prepared statement --** that is returned (the [sqlite3_stmt] object) contains a copy of the --** original SQL text. This causes the [sqlite3_step()] interface to --** behave differently in three ways: --** --** <ol> --** <li> --** ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it --** always used to do, [sqlite3_step()] will automatically recompile the SQL --** statement and try to run it again. ^If the schema has changed in --** a way that makes the statement no longer valid, [sqlite3_step()] will still --** return [SQLITE_SCHEMA]. But unlike the legacy behavior, [SQLITE_SCHEMA] is --** now a fatal error. Calling [sqlite3_prepare_v2()] again will not make the --** error go away. Note: use [sqlite3_errmsg()] to find the text --** of the parsing error that results in an [SQLITE_SCHEMA] return. --** </li> --** --** <li> --** ^When an error occurs, [sqlite3_step()] will return one of the detailed --** [error codes] or [extended error codes]. ^The legacy behavior was that --** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code --** and the application would have to make a second call to [sqlite3_reset()] --** in order to find the underlying cause of the problem. With the "v2" prepare --** interfaces, the underlying reason for the error is returned immediately. --** </li> --** --** <li> --** ^If the value of a [parameter | host parameter] in the WHERE clause might --** change the query plan for a statement, then the statement may be --** automatically recompiled (as if there had been a schema change) on the first --** [sqlite3_step()] call following any change to the --** [sqlite3_bind_text | bindings] of the [parameter]. --** </li> --** </ol> -- function sqlite3_prepare (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : int; arg4 : System.Address; arg5 : System.Address) return int; -- /usr/include/sqlite3.h:2429:16 pragma Import (C, sqlite3_prepare, "sqlite3_prepare"); -- Database handle -- SQL statement, UTF-8 encoded -- Maximum length of zSql in bytes. -- OUT: Statement handle -- OUT: Pointer to unused portion of zSql function sqlite3_prepare_v2 (db : System.Address; zSql : Interfaces.C.Strings.chars_ptr; nByte : int; ppStmt : System.Address; pzTail : System.Address) return int; -- /usr/include/sqlite3.h:2436:16 pragma Import (C, sqlite3_prepare_v2, "sqlite3_prepare_v2"); -- Database handle -- SQL statement, UTF-8 encoded -- Maximum length of zSql in bytes. -- OUT: Statement handle -- OUT: Pointer to unused portion of zSql function sqlite3_prepare16 (arg1 : System.Address; arg2 : System.Address; arg3 : int; arg4 : System.Address; arg5 : System.Address) return int; -- /usr/include/sqlite3.h:2443:16 pragma Import (C, sqlite3_prepare16, "sqlite3_prepare16"); -- Database handle -- SQL statement, UTF-16 encoded -- Maximum length of zSql in bytes. -- OUT: Statement handle -- OUT: Pointer to unused portion of zSql function sqlite3_prepare16_v2 (arg1 : System.Address; arg2 : System.Address; arg3 : int; arg4 : System.Address; arg5 : System.Address) return int; -- /usr/include/sqlite3.h:2450:16 pragma Import (C, sqlite3_prepare16_v2, "sqlite3_prepare16_v2"); -- Database handle -- SQL statement, UTF-16 encoded -- Maximum length of zSql in bytes. -- OUT: Statement handle -- OUT: Pointer to unused portion of zSql --** CAPI3REF: Retrieving Statement SQL --** --** ^This interface can be used to retrieve a saved copy of the original --** SQL text used to create a [prepared statement] if that statement was --** compiled using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()]. -- function sqlite3_sql (arg1 : System.Address) return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:2465:24 pragma Import (C, sqlite3_sql, "sqlite3_sql"); --** CAPI3REF: Dynamically Typed Value Object --** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} --** --** SQLite uses the sqlite3_value object to represent all values --** that can be stored in a database table. SQLite uses dynamic typing --** for the values it stores. ^Values stored in sqlite3_value objects --** can be integers, floating point values, strings, BLOBs, or NULL. --** --** An sqlite3_value object may be either "protected" or "unprotected". --** Some interfaces require a protected sqlite3_value. Other interfaces --** will accept either a protected or an unprotected sqlite3_value. --** Every interface that accepts sqlite3_value arguments specifies --** whether or not it requires a protected sqlite3_value. --** --** The terms "protected" and "unprotected" refer to whether or not --** a mutex is held. A internal mutex is held for a protected --** sqlite3_value object but no mutex is held for an unprotected --** sqlite3_value object. If SQLite is compiled to be single-threaded --** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0) --** or if SQLite is run in one of reduced mutex modes --** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD] --** then there is no distinction between protected and unprotected --** sqlite3_value objects and they can be used interchangeably. However, --** for maximum code portability it is recommended that applications --** still make the distinction between between protected and unprotected --** sqlite3_value objects even when not strictly required. --** --** ^The sqlite3_value objects that are passed as parameters into the --** implementation of [application-defined SQL functions] are protected. --** ^The sqlite3_value object returned by --** [sqlite3_column_value()] is unprotected. --** Unprotected sqlite3_value objects may only be used with --** [sqlite3_result_value()] and [sqlite3_bind_value()]. --** The [sqlite3_value_blob | sqlite3_value_type()] family of --** interfaces require protected sqlite3_value objects. -- -- skipped empty struct Mem -- skipped empty struct sqlite3_value --** CAPI3REF: SQL Function Context Object --** --** The context in which an SQL function executes is stored in an --** sqlite3_context object. ^A pointer to an sqlite3_context object --** is always first parameter to [application-defined SQL functions]. --** The application-defined SQL function implementation will pass this --** pointer through into calls to [sqlite3_result_int | sqlite3_result()], --** [sqlite3_aggregate_context()], [sqlite3_user_data()], --** [sqlite3_context_db_handle()], [sqlite3_get_auxdata()], --** and/or [sqlite3_set_auxdata()]. -- -- skipped empty struct sqlite3_context --** CAPI3REF: Binding Values To Prepared Statements --** KEYWORDS: {host parameter} {host parameters} {host parameter name} --** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding} --** --** ^(In the SQL statement text input to [sqlite3_prepare_v2()] and its variants, --** literals may be replaced by a [parameter] that matches one of following --** templates: --** --** <ul> --** <li> ? --** <li> ?NNN --** <li> :VVV --** <li> @VVV --** <li> $VVV --** </ul> --** --** In the templates above, NNN represents an integer literal, --** and VVV represents an alphanumeric identifer.)^ ^The values of these --** parameters (also called "host parameter names" or "SQL parameters") --** can be set using the sqlite3_bind_*() routines defined here. --** --** ^The first argument to the sqlite3_bind_*() routines is always --** a pointer to the [sqlite3_stmt] object returned from --** [sqlite3_prepare_v2()] or its variants. --** --** ^The second argument is the index of the SQL parameter to be set. --** ^The leftmost SQL parameter has an index of 1. ^When the same named --** SQL parameter is used more than once, second and subsequent --** occurrences have the same index as the first occurrence. --** ^The index for named parameters can be looked up using the --** [sqlite3_bind_parameter_index()] API if desired. ^The index --** for "?NNN" parameters is the value of NNN. --** ^The NNN value must be between 1 and the [sqlite3_limit()] --** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 999). --** --** ^The third argument is the value to bind to the parameter. --** --** ^(In those routines that have a fourth argument, its value is the --** number of bytes in the parameter. To be clear: the value is the --** number of <u>bytes</u> in the value, not the number of characters.)^ --** ^If the fourth parameter is negative, the length of the string is --** the number of bytes up to the first zero terminator. --** --** ^The fifth argument to sqlite3_bind_blob(), sqlite3_bind_text(), and --** sqlite3_bind_text16() is a destructor used to dispose of the BLOB or --** string after SQLite has finished with it. ^If the fifth argument is --** the special value [SQLITE_STATIC], then SQLite assumes that the --** information is in static, unmanaged space and does not need to be freed. --** ^If the fifth argument has the value [SQLITE_TRANSIENT], then --** SQLite makes its own private copy of the data immediately, before --** the sqlite3_bind_*() routine returns. --** --** ^The sqlite3_bind_zeroblob() routine binds a BLOB of length N that --** is filled with zeroes. ^A zeroblob uses a fixed amount of memory --** (just an integer to hold its size) while it is being processed. --** Zeroblobs are intended to serve as placeholders for BLOBs whose --** content is later written using --** [sqlite3_blob_open | incremental BLOB I/O] routines. --** ^A negative value for the zeroblob results in a zero-length BLOB. --** --** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer --** for the [prepared statement] or with a prepared statement for which --** [sqlite3_step()] has been called more recently than [sqlite3_reset()], --** then the call will return [SQLITE_MISUSE]. If any sqlite3_bind_() --** routine is passed a [prepared statement] that has been finalized, the --** result is undefined and probably harmful. --** --** ^Bindings are not cleared by the [sqlite3_reset()] routine. --** ^Unbound parameters are interpreted as NULL. --** --** ^The sqlite3_bind_* routines return [SQLITE_OK] on success or an --** [error code] if anything goes wrong. --** ^[SQLITE_RANGE] is returned if the parameter --** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails. --** --** See also: [sqlite3_bind_parameter_count()], --** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. -- function sqlite3_bind_blob (arg1 : System.Address; arg2 : int; arg3 : System.Address; arg4 : int; arg5 : access procedure (arg1 : System.Address)) return int; -- /usr/include/sqlite3.h:2599:16 pragma Import (C, sqlite3_bind_blob, "sqlite3_bind_blob"); function sqlite3_bind_double (arg1 : System.Address; arg2 : int; arg3 : double) return int; -- /usr/include/sqlite3.h:2600:16 pragma Import (C, sqlite3_bind_double, "sqlite3_bind_double"); function sqlite3_bind_int (arg1 : System.Address; arg2 : int; arg3 : int) return int; -- /usr/include/sqlite3.h:2601:16 pragma Import (C, sqlite3_bind_int, "sqlite3_bind_int"); function sqlite3_bind_int64 (arg1 : System.Address; arg2 : int; arg3 : sqlite3_int64) return int; -- /usr/include/sqlite3.h:2602:16 pragma Import (C, sqlite3_bind_int64, "sqlite3_bind_int64"); function sqlite3_bind_null (arg1 : System.Address; arg2 : int) return int; -- /usr/include/sqlite3.h:2603:16 pragma Import (C, sqlite3_bind_null, "sqlite3_bind_null"); function sqlite3_bind_text (arg1 : System.Address; arg2 : int; arg3 : Interfaces.C.Strings.chars_ptr; arg4 : int; arg5 : access procedure (arg1 : System.Address)) return int; -- /usr/include/sqlite3.h:2604:16 pragma Import (C, sqlite3_bind_text, "sqlite3_bind_text"); function sqlite3_bind_text16 (arg1 : System.Address; arg2 : int; arg3 : System.Address; arg4 : int; arg5 : access procedure (arg1 : System.Address)) return int; -- /usr/include/sqlite3.h:2605:16 pragma Import (C, sqlite3_bind_text16, "sqlite3_bind_text16"); function sqlite3_bind_value (arg1 : System.Address; arg2 : int; arg3 : System.Address) return int; -- /usr/include/sqlite3.h:2606:16 pragma Import (C, sqlite3_bind_value, "sqlite3_bind_value"); function sqlite3_bind_zeroblob (arg1 : System.Address; arg2 : int; arg3 : int) return int; -- /usr/include/sqlite3.h:2607:16 pragma Import (C, sqlite3_bind_zeroblob, "sqlite3_bind_zeroblob"); --** CAPI3REF: Number Of SQL Parameters --** --** ^This routine can be used to find the number of [SQL parameters] --** in a [prepared statement]. SQL parameters are tokens of the --** form "?", "?NNN", ":AAA", "$AAA", or "@AAA" that serve as --** placeholders for values that are [sqlite3_bind_blob | bound] --** to the parameters at a later time. --** --** ^(This routine actually returns the index of the largest (rightmost) --** parameter. For all forms except ?NNN, this will correspond to the --** number of unique parameters. If parameters of the ?NNN form are used, --** there may be gaps in the list.)^ --** --** See also: [sqlite3_bind_blob|sqlite3_bind()], --** [sqlite3_bind_parameter_name()], and --** [sqlite3_bind_parameter_index()]. -- function sqlite3_bind_parameter_count (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:2627:16 pragma Import (C, sqlite3_bind_parameter_count, "sqlite3_bind_parameter_count"); --** CAPI3REF: Name Of A Host Parameter --** --** ^The sqlite3_bind_parameter_name(P,N) interface returns --** the name of the N-th [SQL parameter] in the [prepared statement] P. --** ^(SQL parameters of the form "?NNN" or ":AAA" or "@AAA" or "$AAA" --** have a name which is the string "?NNN" or ":AAA" or "@AAA" or "$AAA" --** respectively. --** In other words, the initial ":" or "$" or "@" or "?" --** is included as part of the name.)^ --** ^Parameters of the form "?" without a following integer have no name --** and are referred to as "nameless" or "anonymous parameters". --** --** ^The first host parameter has an index of 1, not 0. --** --** ^If the value N is out of range or if the N-th parameter is --** nameless, then NULL is returned. ^The returned string is --** always in UTF-8 encoding even if the named parameter was --** originally specified as UTF-16 in [sqlite3_prepare16()] or --** [sqlite3_prepare16_v2()]. --** --** See also: [sqlite3_bind_blob|sqlite3_bind()], --** [sqlite3_bind_parameter_count()], and --** [sqlite3_bind_parameter_index()]. -- function sqlite3_bind_parameter_name (arg1 : System.Address; arg2 : int) return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:2654:24 pragma Import (C, sqlite3_bind_parameter_name, "sqlite3_bind_parameter_name"); --** CAPI3REF: Index Of A Parameter With A Given Name --** --** ^Return the index of an SQL parameter given its name. ^The --** index value returned is suitable for use as the second --** parameter to [sqlite3_bind_blob|sqlite3_bind()]. ^A zero --** is returned if no matching parameter is found. ^The parameter --** name must be given in UTF-8 even if the original statement --** was prepared from UTF-16 text using [sqlite3_prepare16_v2()]. --** --** See also: [sqlite3_bind_blob|sqlite3_bind()], --** [sqlite3_bind_parameter_count()], and --** [sqlite3_bind_parameter_index()]. -- function sqlite3_bind_parameter_index (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/sqlite3.h:2670:16 pragma Import (C, sqlite3_bind_parameter_index, "sqlite3_bind_parameter_index"); --** CAPI3REF: Reset All Bindings On A Prepared Statement --** --** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset --** the [sqlite3_bind_blob | bindings] on a [prepared statement]. --** ^Use this routine to reset all host parameters to NULL. -- function sqlite3_clear_bindings (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:2679:16 pragma Import (C, sqlite3_clear_bindings, "sqlite3_clear_bindings"); --** CAPI3REF: Number Of Columns In A Result Set --** --** ^Return the number of columns in the result set returned by the --** [prepared statement]. ^This routine returns 0 if pStmt is an SQL --** statement that does not return data (for example an [UPDATE]). -- function sqlite3_column_count (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:2688:16 pragma Import (C, sqlite3_column_count, "sqlite3_column_count"); --** CAPI3REF: Column Names In A Result Set --** --** ^These routines return the name assigned to a particular column --** in the result set of a [SELECT] statement. ^The sqlite3_column_name() --** interface returns a pointer to a zero-terminated UTF-8 string --** and sqlite3_column_name16() returns a pointer to a zero-terminated --** UTF-16 string. ^The first parameter is the [prepared statement] --** that implements the [SELECT] statement. ^The second parameter is the --** column number. ^The leftmost column is number 0. --** --** ^The returned string pointer is valid until either the [prepared statement] --** is destroyed by [sqlite3_finalize()] or until the next call to --** sqlite3_column_name() or sqlite3_column_name16() on the same column. --** --** ^If sqlite3_malloc() fails during the processing of either routine --** (for example during a conversion from UTF-8 to UTF-16) then a --** NULL pointer is returned. --** --** ^The name of a result column is the value of the "AS" clause for --** that column, if there is an AS clause. If there is no AS clause --** then the name of the column is unspecified and may change from --** one release of SQLite to the next. -- function sqlite3_column_name (arg1 : System.Address; arg2 : int) return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:2714:24 pragma Import (C, sqlite3_column_name, "sqlite3_column_name"); function sqlite3_column_name16 (arg1 : System.Address; arg2 : int) return System.Address; -- /usr/include/sqlite3.h:2715:24 pragma Import (C, sqlite3_column_name16, "sqlite3_column_name16"); --** CAPI3REF: Source Of Data In A Query Result --** --** ^These routines provide a means to determine the database, table, and --** table column that is the origin of a particular result column in --** [SELECT] statement. --** ^The name of the database or table or column can be returned as --** either a UTF-8 or UTF-16 string. ^The _database_ routines return --** the database name, the _table_ routines return the table name, and --** the origin_ routines return the column name. --** ^The returned string is valid until the [prepared statement] is destroyed --** using [sqlite3_finalize()] or until the same information is requested --** again in a different encoding. --** --** ^The names returned are the original un-aliased names of the --** database, table, and column. --** --** ^The first argument to these interfaces is a [prepared statement]. --** ^These functions return information about the Nth result column returned by --** the statement, where N is the second function argument. --** ^The left-most column is column 0 for these routines. --** --** ^If the Nth column returned by the statement is an expression or --** subquery and is not a column value, then all of these functions return --** NULL. ^These routine might also return NULL if a memory allocation error --** occurs. ^Otherwise, they return the name of the attached database, table, --** or column that query result column was extracted from. --** --** ^As with all other SQLite APIs, those whose names end with "16" return --** UTF-16 encoded strings and the other functions return UTF-8. --** --** ^These APIs are only available if the library was compiled with the --** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol. --** --** If two or more threads call one or more of these routines against the same --** prepared statement and column at the same time then the results are --** undefined. --** --** If two or more threads call one or more --** [sqlite3_column_database_name | column metadata interfaces] --** for the same [prepared statement] and result column --** at the same time then the results are undefined. -- function sqlite3_column_database_name (arg1 : System.Address; arg2 : int) return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:2760:24 pragma Import (C, sqlite3_column_database_name, "sqlite3_column_database_name"); function sqlite3_column_database_name16 (arg1 : System.Address; arg2 : int) return System.Address; -- /usr/include/sqlite3.h:2761:24 pragma Import (C, sqlite3_column_database_name16, "sqlite3_column_database_name16"); function sqlite3_column_table_name (arg1 : System.Address; arg2 : int) return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:2762:24 pragma Import (C, sqlite3_column_table_name, "sqlite3_column_table_name"); function sqlite3_column_table_name16 (arg1 : System.Address; arg2 : int) return System.Address; -- /usr/include/sqlite3.h:2763:24 pragma Import (C, sqlite3_column_table_name16, "sqlite3_column_table_name16"); function sqlite3_column_origin_name (arg1 : System.Address; arg2 : int) return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:2764:24 pragma Import (C, sqlite3_column_origin_name, "sqlite3_column_origin_name"); function sqlite3_column_origin_name16 (arg1 : System.Address; arg2 : int) return System.Address; -- /usr/include/sqlite3.h:2765:24 pragma Import (C, sqlite3_column_origin_name16, "sqlite3_column_origin_name16"); --** CAPI3REF: Declared Datatype Of A Query Result --** --** ^(The first parameter is a [prepared statement]. --** If this statement is a [SELECT] statement and the Nth column of the --** returned result set of that [SELECT] is a table column (not an --** expression or subquery) then the declared type of the table --** column is returned.)^ ^If the Nth column of the result set is an --** expression or subquery, then a NULL pointer is returned. --** ^The returned string is always UTF-8 encoded. --** --** ^(For example, given the database schema: --** --** CREATE TABLE t1(c1 VARIANT); --** --** and the following statement to be compiled: --** --** SELECT c1 + 1, c1 FROM t1; --** --** this routine would return the string "VARIANT" for the second result --** column (i==1), and a NULL pointer for the first result column (i==0).)^ --** --** ^SQLite uses dynamic run-time typing. ^So just because a column --** is declared to contain a particular type does not mean that the --** data stored in that column is of the declared type. SQLite is --** strongly typed, but the typing is dynamic not static. ^Type --** is associated with individual values, not with the containers --** used to hold those values. -- function sqlite3_column_decltype (arg1 : System.Address; arg2 : int) return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:2796:24 pragma Import (C, sqlite3_column_decltype, "sqlite3_column_decltype"); function sqlite3_column_decltype16 (arg1 : System.Address; arg2 : int) return System.Address; -- /usr/include/sqlite3.h:2797:24 pragma Import (C, sqlite3_column_decltype16, "sqlite3_column_decltype16"); --** CAPI3REF: Evaluate An SQL Statement --** --** After a [prepared statement] has been prepared using either --** [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] or one of the legacy --** interfaces [sqlite3_prepare()] or [sqlite3_prepare16()], this function --** must be called one or more times to evaluate the statement. --** --** The details of the behavior of the sqlite3_step() interface depend --** on whether the statement was prepared using the newer "v2" interface --** [sqlite3_prepare_v2()] and [sqlite3_prepare16_v2()] or the older legacy --** interface [sqlite3_prepare()] and [sqlite3_prepare16()]. The use of the --** new "v2" interface is recommended for new applications but the legacy --** interface will continue to be supported. --** --** ^In the legacy interface, the return value will be either [SQLITE_BUSY], --** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE]. --** ^With the "v2" interface, any of the other [result codes] or --** [extended result codes] might be returned as well. --** --** ^[SQLITE_BUSY] means that the database engine was unable to acquire the --** database locks it needs to do its job. ^If the statement is a [COMMIT] --** or occurs outside of an explicit transaction, then you can retry the --** statement. If the statement is not a [COMMIT] and occurs within a --** explicit transaction then you should rollback the transaction before --** continuing. --** --** ^[SQLITE_DONE] means that the statement has finished executing --** successfully. sqlite3_step() should not be called again on this virtual --** machine without first calling [sqlite3_reset()] to reset the virtual --** machine back to its initial state. --** --** ^If the SQL statement being executed returns any data, then [SQLITE_ROW] --** is returned each time a new row of data is ready for processing by the --** caller. The values may be accessed using the [column access functions]. --** sqlite3_step() is called again to retrieve the next row of data. --** --** ^[SQLITE_ERROR] means that a run-time error (such as a constraint --** violation) has occurred. sqlite3_step() should not be called again on --** the VM. More information may be found by calling [sqlite3_errmsg()]. --** ^With the legacy interface, a more specific error code (for example, --** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth) --** can be obtained by calling [sqlite3_reset()] on the --** [prepared statement]. ^In the "v2" interface, --** the more specific error code is returned directly by sqlite3_step(). --** --** [SQLITE_MISUSE] means that the this routine was called inappropriately. --** Perhaps it was called on a [prepared statement] that has --** already been [sqlite3_finalize | finalized] or on one that had --** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could --** be the case that the same database connection is being used by two or --** more threads at the same moment in time. --** --** <b>Goofy Interface Alert:</b> In the legacy interface, the sqlite3_step() --** API always returns a generic error code, [SQLITE_ERROR], following any --** error other than [SQLITE_BUSY] and [SQLITE_MISUSE]. You must call --** [sqlite3_reset()] or [sqlite3_finalize()] in order to find one of the --** specific [error codes] that better describes the error. --** We admit that this is a goofy design. The problem has been fixed --** with the "v2" interface. If you prepare all of your SQL statements --** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead --** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces, --** then the more specific [error codes] are returned directly --** by sqlite3_step(). The use of the "v2" interface is recommended. -- function sqlite3_step (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:2864:16 pragma Import (C, sqlite3_step, "sqlite3_step"); --** CAPI3REF: Number of columns in a result set --** --** ^The sqlite3_data_count(P) the number of columns in the --** of the result set of [prepared statement] P. -- function sqlite3_data_count (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:2872:16 pragma Import (C, sqlite3_data_count, "sqlite3_data_count"); --** CAPI3REF: Fundamental Datatypes --** KEYWORDS: SQLITE_TEXT --** --** ^(Every value in SQLite has one of five fundamental datatypes: --** --** <ul> --** <li> 64-bit signed integer --** <li> 64-bit IEEE floating point number --** <li> string --** <li> BLOB --** <li> NULL --** </ul>)^ --** --** These constants are codes for each of those types. --** --** Note that the SQLITE_TEXT constant was also used in SQLite version 2 --** for a completely different meaning. Software that links against both --** SQLite version 2 and SQLite version 3 should use SQLITE3_TEXT, not --** SQLITE_TEXT. -- --** CAPI3REF: Result Values From A Query --** KEYWORDS: {column access functions} --** --** These routines form the "result set" interface. --** --** ^These routines return information about a single column of the current --** result row of a query. ^In every case the first argument is a pointer --** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*] --** that was returned from [sqlite3_prepare_v2()] or one of its variants) --** and the second argument is the index of the column for which information --** should be returned. ^The leftmost column of the result set has the index 0. --** ^The number of columns in the result can be determined using --** [sqlite3_column_count()]. --** --** If the SQL statement does not currently point to a valid row, or if the --** column index is out of range, the result is undefined. --** These routines may only be called when the most recent call to --** [sqlite3_step()] has returned [SQLITE_ROW] and neither --** [sqlite3_reset()] nor [sqlite3_finalize()] have been called subsequently. --** If any of these routines are called after [sqlite3_reset()] or --** [sqlite3_finalize()] or after [sqlite3_step()] has returned --** something other than [SQLITE_ROW], the results are undefined. --** If [sqlite3_step()] or [sqlite3_reset()] or [sqlite3_finalize()] --** are called from a different thread while any of these routines --** are pending, then the results are undefined. --** --** ^The sqlite3_column_type() routine returns the --** [SQLITE_INTEGER | datatype code] for the initial data type --** of the result column. ^The returned value is one of [SQLITE_INTEGER], --** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL]. The value --** returned by sqlite3_column_type() is only meaningful if no type --** conversions have occurred as described below. After a type conversion, --** the value returned by sqlite3_column_type() is undefined. Future --** versions of SQLite may change the behavior of sqlite3_column_type() --** following a type conversion. --** --** ^If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes() --** routine returns the number of bytes in that BLOB or string. --** ^If the result is a UTF-16 string, then sqlite3_column_bytes() converts --** the string to UTF-8 and then returns the number of bytes. --** ^If the result is a numeric value then sqlite3_column_bytes() uses --** [sqlite3_snprintf()] to convert that value to a UTF-8 string and returns --** the number of bytes in that string. --** ^The value returned does not include the zero terminator at the end --** of the string. ^For clarity: the value returned is the number of --** bytes in the string, not the number of characters. --** --** ^Strings returned by sqlite3_column_text() and sqlite3_column_text16(), --** even empty strings, are always zero terminated. ^The return --** value from sqlite3_column_blob() for a zero-length BLOB is an arbitrary --** pointer, possibly even a NULL pointer. --** --** ^The sqlite3_column_bytes16() routine is similar to sqlite3_column_bytes() --** but leaves the result in UTF-16 in native byte order instead of UTF-8. --** ^The zero terminator is not included in this count. --** --** ^The object returned by [sqlite3_column_value()] is an --** [unprotected sqlite3_value] object. An unprotected sqlite3_value object --** may only be used with [sqlite3_bind_value()] and [sqlite3_result_value()]. --** If the [unprotected sqlite3_value] object returned by --** [sqlite3_column_value()] is used in any other way, including calls --** to routines like [sqlite3_value_int()], [sqlite3_value_text()], --** or [sqlite3_value_bytes()], then the behavior is undefined. --** --** These routines attempt to convert the value where appropriate. ^For --** example, if the internal representation is FLOAT and a text result --** is requested, [sqlite3_snprintf()] is used internally to perform the --** conversion automatically. ^(The following table details the conversions --** that are applied: --** --** <blockquote> --** <table border="1"> --** <tr><th> Internal<br>Type <th> Requested<br>Type <th> Conversion --** --** <tr><td> NULL <td> INTEGER <td> Result is 0 --** <tr><td> NULL <td> FLOAT <td> Result is 0.0 --** <tr><td> NULL <td> TEXT <td> Result is NULL pointer --** <tr><td> NULL <td> BLOB <td> Result is NULL pointer --** <tr><td> INTEGER <td> FLOAT <td> Convert from integer to float --** <tr><td> INTEGER <td> TEXT <td> ASCII rendering of the integer --** <tr><td> INTEGER <td> BLOB <td> Same as INTEGER->TEXT --** <tr><td> FLOAT <td> INTEGER <td> Convert from float to integer --** <tr><td> FLOAT <td> TEXT <td> ASCII rendering of the float --** <tr><td> FLOAT <td> BLOB <td> Same as FLOAT->TEXT --** <tr><td> TEXT <td> INTEGER <td> Use atoi() --** <tr><td> TEXT <td> FLOAT <td> Use atof() --** <tr><td> TEXT <td> BLOB <td> No change --** <tr><td> BLOB <td> INTEGER <td> Convert to TEXT then use atoi() --** <tr><td> BLOB <td> FLOAT <td> Convert to TEXT then use atof() --** <tr><td> BLOB <td> TEXT <td> Add a zero terminator if needed --** </table> --** </blockquote>)^ --** --** The table above makes reference to standard C library functions atoi() --** and atof(). SQLite does not really use these functions. It has its --** own equivalent internal routines. The atoi() and atof() names are --** used in the table for brevity and because they are familiar to most --** C programmers. --** --** ^Note that when type conversions occur, pointers returned by prior --** calls to sqlite3_column_blob(), sqlite3_column_text(), and/or --** sqlite3_column_text16() may be invalidated. --** ^(Type conversions and pointer invalidations might occur --** in the following cases: --** --** <ul> --** <li> The initial content is a BLOB and sqlite3_column_text() or --** sqlite3_column_text16() is called. A zero-terminator might --** need to be added to the string.</li> --** <li> The initial content is UTF-8 text and sqlite3_column_bytes16() or --** sqlite3_column_text16() is called. The content must be converted --** to UTF-16.</li> --** <li> The initial content is UTF-16 text and sqlite3_column_bytes() or --** sqlite3_column_text() is called. The content must be converted --** to UTF-8.</li> --** </ul>)^ --** --** ^Conversions between UTF-16be and UTF-16le are always done in place and do --** not invalidate a prior pointer, though of course the content of the buffer --** that the prior pointer points to will have been modified. Other kinds --** of conversion are done in place when it is possible, but sometimes they --** are not possible and in those cases prior pointers are invalidated. --** --** ^(The safest and easiest to remember policy is to invoke these routines --** in one of the following ways: --** --** <ul> --** <li>sqlite3_column_text() followed by sqlite3_column_bytes()</li> --** <li>sqlite3_column_blob() followed by sqlite3_column_bytes()</li> --** <li>sqlite3_column_text16() followed by sqlite3_column_bytes16()</li> --** </ul>)^ --** --** In other words, you should call sqlite3_column_text(), --** sqlite3_column_blob(), or sqlite3_column_text16() first to force the result --** into the desired format, then invoke sqlite3_column_bytes() or --** sqlite3_column_bytes16() to find the size of the result. Do not mix calls --** to sqlite3_column_text() or sqlite3_column_blob() with calls to --** sqlite3_column_bytes16(), and do not mix calls to sqlite3_column_text16() --** with calls to sqlite3_column_bytes(). --** --** ^The pointers returned are valid until a type conversion occurs as --** described above, or until [sqlite3_step()] or [sqlite3_reset()] or --** [sqlite3_finalize()] is called. ^The memory space used to hold strings --** and BLOBs is freed automatically. Do <b>not</b> pass the pointers returned --** [sqlite3_column_blob()], [sqlite3_column_text()], etc. into --** [sqlite3_free()]. --** --** ^(If a memory allocation error occurs during the evaluation of any --** of these routines, a default value is returned. The default value --** is either the integer 0, the floating point number 0.0, or a NULL --** pointer. Subsequent calls to [sqlite3_errcode()] will return --** [SQLITE_NOMEM].)^ -- function sqlite3_column_blob (arg1 : System.Address; arg2 : int) return System.Address; -- /usr/include/sqlite3.h:3060:24 pragma Import (C, sqlite3_column_blob, "sqlite3_column_blob"); function sqlite3_column_bytes (arg1 : System.Address; arg2 : int) return int; -- /usr/include/sqlite3.h:3061:16 pragma Import (C, sqlite3_column_bytes, "sqlite3_column_bytes"); function sqlite3_column_bytes16 (arg1 : System.Address; arg2 : int) return int; -- /usr/include/sqlite3.h:3062:16 pragma Import (C, sqlite3_column_bytes16, "sqlite3_column_bytes16"); function sqlite3_column_double (arg1 : System.Address; arg2 : int) return double; -- /usr/include/sqlite3.h:3063:19 pragma Import (C, sqlite3_column_double, "sqlite3_column_double"); function sqlite3_column_int (arg1 : System.Address; arg2 : int) return int; -- /usr/include/sqlite3.h:3064:16 pragma Import (C, sqlite3_column_int, "sqlite3_column_int"); function sqlite3_column_int64 (arg1 : System.Address; arg2 : int) return sqlite3_int64; -- /usr/include/sqlite3.h:3065:26 pragma Import (C, sqlite3_column_int64, "sqlite3_column_int64"); function sqlite3_column_text (arg1 : System.Address; arg2 : int) return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:3066:33 pragma Import (C, sqlite3_column_text, "sqlite3_column_text"); function sqlite3_column_text16 (arg1 : System.Address; arg2 : int) return Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:3067:24 pragma Import (C, sqlite3_column_text16, "sqlite3_column_text16"); function sqlite3_column_type (arg1 : System.Address; arg2 : int) return int; -- /usr/include/sqlite3.h:3068:16 pragma Import (C, sqlite3_column_type, "sqlite3_column_type"); function sqlite3_column_value (arg1 : System.Address; arg2 : int) return System.Address; -- /usr/include/sqlite3.h:3069:27 pragma Import (C, sqlite3_column_value, "sqlite3_column_value"); --** CAPI3REF: Destroy A Prepared Statement Object --** --** ^The sqlite3_finalize() function is called to delete a [prepared statement]. --** ^If the statement was executed successfully or not executed at all, then --** SQLITE_OK is returned. ^If execution of the statement failed then an --** [error code] or [extended error code] is returned. --** --** ^This routine can be called at any point during the execution of the --** [prepared statement]. ^If the virtual machine has not --** completed execution when this routine is called, that is like --** encountering an error or an [sqlite3_interrupt | interrupt]. --** ^Incomplete updates may be rolled back and transactions canceled, --** depending on the circumstances, and the --** [error code] returned will be [SQLITE_ABORT]. -- function sqlite3_finalize (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:3087:16 pragma Import (C, sqlite3_finalize, "sqlite3_finalize"); --** CAPI3REF: Reset A Prepared Statement Object --** --** The sqlite3_reset() function is called to reset a [prepared statement] --** object back to its initial state, ready to be re-executed. --** ^Any SQL statement variables that had values bound to them using --** the [sqlite3_bind_blob | sqlite3_bind_*() API] retain their values. --** Use [sqlite3_clear_bindings()] to reset the bindings. --** --** ^The [sqlite3_reset(S)] interface resets the [prepared statement] S --** back to the beginning of its program. --** --** ^If the most recent call to [sqlite3_step(S)] for the --** [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE], --** or if [sqlite3_step(S)] has never before been called on S, --** then [sqlite3_reset(S)] returns [SQLITE_OK]. --** --** ^If the most recent call to [sqlite3_step(S)] for the --** [prepared statement] S indicated an error, then --** [sqlite3_reset(S)] returns an appropriate [error code]. --** --** ^The [sqlite3_reset(S)] interface does not change the values --** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. -- function sqlite3_reset (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:3113:16 pragma Import (C, sqlite3_reset, "sqlite3_reset"); --** CAPI3REF: Create Or Redefine SQL Functions --** KEYWORDS: {function creation routines} --** KEYWORDS: {application-defined SQL function} --** KEYWORDS: {application-defined SQL functions} --** --** ^These two functions (collectively known as "function creation routines") --** are used to add SQL functions or aggregates or to redefine the behavior --** of existing SQL functions or aggregates. The only difference between the --** two is that the second parameter, the name of the (scalar) function or --** aggregate, is encoded in UTF-8 for sqlite3_create_function() and UTF-16 --** for sqlite3_create_function16(). --** --** ^The first parameter is the [database connection] to which the SQL --** function is to be added. ^If an application uses more than one database --** connection then application-defined SQL functions must be added --** to each database connection separately. --** --** The second parameter is the name of the SQL function to be created or --** redefined. ^The length of the name is limited to 255 bytes, exclusive of --** the zero-terminator. Note that the name length limit is in bytes, not --** characters. ^Any attempt to create a function with a longer name --** will result in [SQLITE_ERROR] being returned. --** --** ^The third parameter (nArg) --** is the number of arguments that the SQL function or --** aggregate takes. ^If this parameter is -1, then the SQL function or --** aggregate may take any number of arguments between 0 and the limit --** set by [sqlite3_limit]([SQLITE_LIMIT_FUNCTION_ARG]). If the third --** parameter is less than -1 or greater than 127 then the behavior is --** undefined. --** --** The fourth parameter, eTextRep, specifies what --** [SQLITE_UTF8 | text encoding] this SQL function prefers for --** its parameters. Any SQL function implementation should be able to work --** work with UTF-8, UTF-16le, or UTF-16be. But some implementations may be --** more efficient with one encoding than another. ^An application may --** invoke sqlite3_create_function() or sqlite3_create_function16() multiple --** times with the same function but with different values of eTextRep. --** ^When multiple implementations of the same function are available, SQLite --** will pick the one that involves the least amount of data conversion. --** If there is only a single implementation which does not care what text --** encoding is used, then the fourth argument should be [SQLITE_ANY]. --** --** ^(The fifth parameter is an arbitrary pointer. The implementation of the --** function can gain access to this pointer using [sqlite3_user_data()].)^ --** --** The seventh, eighth and ninth parameters, xFunc, xStep and xFinal, are --** pointers to C-language functions that implement the SQL function or --** aggregate. ^A scalar SQL function requires an implementation of the xFunc --** callback only; NULL pointers should be passed as the xStep and xFinal --** parameters. ^An aggregate SQL function requires an implementation of xStep --** and xFinal and NULL should be passed for xFunc. ^To delete an existing --** SQL function or aggregate, pass NULL for all three function callbacks. --** --** ^It is permitted to register multiple implementations of the same --** functions with the same name but with either differing numbers of --** arguments or differing preferred text encodings. ^SQLite will use --** the implementation that most closely matches the way in which the --** SQL function is used. ^A function implementation with a non-negative --** nArg parameter is a better match than a function implementation with --** a negative nArg. ^A function where the preferred text encoding --** matches the database encoding is a better --** match than a function where the encoding is different. --** ^A function where the encoding difference is between UTF16le and UTF16be --** is a closer match than a function where the encoding difference is --** between UTF8 and UTF16. --** --** ^Built-in functions may be overloaded by new application-defined functions. --** ^The first application-defined function with a given name overrides all --** built-in functions in the same [database connection] with the same name. --** ^Subsequent application-defined functions of the same name only override --** prior application-defined functions that are an exact match for the --** number of parameters and preferred encoding. --** --** ^An application-defined function is permitted to call other --** SQLite interfaces. However, such calls must not --** close the database connection nor finalize or reset the prepared --** statement in which the function is running. -- function sqlite3_create_function (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : int; arg4 : int; arg5 : System.Address; arg6 : access procedure (arg1 : System.Address; arg2 : int; arg3 : System.Address); arg7 : access procedure (arg1 : System.Address; arg2 : int; arg3 : System.Address); arg8 : access procedure (arg1 : System.Address)) return int; -- /usr/include/sqlite3.h:3195:16 pragma Import (C, sqlite3_create_function, "sqlite3_create_function"); function sqlite3_create_function16 (arg1 : System.Address; arg2 : System.Address; arg3 : int; arg4 : int; arg5 : System.Address; arg6 : access procedure (arg1 : System.Address; arg2 : int; arg3 : System.Address); arg7 : access procedure (arg1 : System.Address; arg2 : int; arg3 : System.Address); arg8 : access procedure (arg1 : System.Address)) return int; -- /usr/include/sqlite3.h:3205:16 pragma Import (C, sqlite3_create_function16, "sqlite3_create_function16"); --** CAPI3REF: Text Encodings --** --** These constant define integer codes that represent the various --** text encodings supported by SQLite. -- --** CAPI3REF: Deprecated Functions --** DEPRECATED --** --** These functions are [deprecated]. In order to maintain --** backwards compatibility with older code, these functions continue --** to be supported. However, new applications should avoid --** the use of these functions. To help encourage people to avoid --** using these functions, we are not going to tell you what they do. -- function sqlite3_aggregate_count (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:3240:34 pragma Import (C, sqlite3_aggregate_count, "sqlite3_aggregate_count"); function sqlite3_expired (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:3241:34 pragma Import (C, sqlite3_expired, "sqlite3_expired"); function sqlite3_transfer_bindings (arg1 : System.Address; arg2 : System.Address) return int; -- /usr/include/sqlite3.h:3242:34 pragma Import (C, sqlite3_transfer_bindings, "sqlite3_transfer_bindings"); function sqlite3_global_recover return int; -- /usr/include/sqlite3.h:3243:34 pragma Import (C, sqlite3_global_recover, "sqlite3_global_recover"); procedure sqlite3_thread_cleanup; -- /usr/include/sqlite3.h:3244:35 pragma Import (C, sqlite3_thread_cleanup, "sqlite3_thread_cleanup"); function sqlite3_memory_alarm (arg1 : access procedure (arg1 : System.Address; arg2 : sqlite3_int64; arg3 : int); arg2 : System.Address; arg3 : sqlite3_int64) return int; -- /usr/include/sqlite3.h:3245:34 pragma Import (C, sqlite3_memory_alarm, "sqlite3_memory_alarm"); --** CAPI3REF: Obtaining SQL Function Parameter Values --** --** The C-language implementation of SQL functions and aggregates uses --** this set of interface routines to access the parameter values on --** the function or aggregate. --** --** The xFunc (for scalar functions) or xStep (for aggregates) parameters --** to [sqlite3_create_function()] and [sqlite3_create_function16()] --** define callbacks that implement the SQL functions and aggregates. --** The 4th parameter to these callbacks is an array of pointers to --** [protected sqlite3_value] objects. There is one [sqlite3_value] object for --** each parameter to the SQL function. These routines are used to --** extract values from the [sqlite3_value] objects. --** --** These routines work only with [protected sqlite3_value] objects. --** Any attempt to use these routines on an [unprotected sqlite3_value] --** object results in undefined behavior. --** --** ^These routines work just like the corresponding [column access functions] --** except that these routines take a single [protected sqlite3_value] object --** pointer instead of a [sqlite3_stmt*] pointer and an integer column number. --** --** ^The sqlite3_value_text16() interface extracts a UTF-16 string --** in the native byte-order of the host machine. ^The --** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces --** extract UTF-16 strings as big-endian and little-endian respectively. --** --** ^(The sqlite3_value_numeric_type() interface attempts to apply --** numeric affinity to the value. This means that an attempt is --** made to convert the value to an integer or floating point. If --** such a conversion is possible without loss of information (in other --** words, if the value is a string that looks like a number) --** then the conversion is performed. Otherwise no conversion occurs. --** The [SQLITE_INTEGER | datatype] after conversion is returned.)^ --** --** Please pay particular attention to the fact that the pointer returned --** from [sqlite3_value_blob()], [sqlite3_value_text()], or --** [sqlite3_value_text16()] can be invalidated by a subsequent call to --** [sqlite3_value_bytes()], [sqlite3_value_bytes16()], [sqlite3_value_text()], --** or [sqlite3_value_text16()]. --** --** These routines must be called from the same thread as --** the SQL function that supplied the [sqlite3_value*] parameters. -- function sqlite3_value_blob (arg1 : System.Address) return System.Address; -- /usr/include/sqlite3.h:3293:24 pragma Import (C, sqlite3_value_blob, "sqlite3_value_blob"); function sqlite3_value_bytes (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:3294:16 pragma Import (C, sqlite3_value_bytes, "sqlite3_value_bytes"); function sqlite3_value_bytes16 (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:3295:16 pragma Import (C, sqlite3_value_bytes16, "sqlite3_value_bytes16"); function sqlite3_value_double (arg1 : System.Address) return double; -- /usr/include/sqlite3.h:3296:19 pragma Import (C, sqlite3_value_double, "sqlite3_value_double"); function sqlite3_value_int (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:3297:16 pragma Import (C, sqlite3_value_int, "sqlite3_value_int"); function sqlite3_value_int64 (arg1 : System.Address) return sqlite3_int64; -- /usr/include/sqlite3.h:3298:26 pragma Import (C, sqlite3_value_int64, "sqlite3_value_int64"); function sqlite3_value_text (arg1 : System.Address) return access unsigned_char; -- /usr/include/sqlite3.h:3299:33 pragma Import (C, sqlite3_value_text, "sqlite3_value_text"); function sqlite3_value_text16 (arg1 : System.Address) return System.Address; -- /usr/include/sqlite3.h:3300:24 pragma Import (C, sqlite3_value_text16, "sqlite3_value_text16"); function sqlite3_value_text16le (arg1 : System.Address) return System.Address; -- /usr/include/sqlite3.h:3301:24 pragma Import (C, sqlite3_value_text16le, "sqlite3_value_text16le"); function sqlite3_value_text16be (arg1 : System.Address) return System.Address; -- /usr/include/sqlite3.h:3302:24 pragma Import (C, sqlite3_value_text16be, "sqlite3_value_text16be"); function sqlite3_value_type (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:3303:16 pragma Import (C, sqlite3_value_type, "sqlite3_value_type"); function sqlite3_value_numeric_type (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:3304:16 pragma Import (C, sqlite3_value_numeric_type, "sqlite3_value_numeric_type"); --** CAPI3REF: Obtain Aggregate Function Context --** --** Implementions of aggregate SQL functions use this --** routine to allocate memory for storing their state. --** --** ^The first time the sqlite3_aggregate_context(C,N) routine is called --** for a particular aggregate function, SQLite --** allocates N of memory, zeroes out that memory, and returns a pointer --** to the new memory. ^On second and subsequent calls to --** sqlite3_aggregate_context() for the same aggregate function instance, --** the same buffer is returned. Sqlite3_aggregate_context() is normally --** called once for each invocation of the xStep callback and then one --** last time when the xFinal callback is invoked. ^(When no rows match --** an aggregate query, the xStep() callback of the aggregate function --** implementation is never called and xFinal() is called exactly once. --** In those cases, sqlite3_aggregate_context() might be called for the --** first time from within xFinal().)^ --** --** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer if N is --** less than or equal to zero or if a memory allocate error occurs. --** --** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is --** determined by the N parameter on first successful call. Changing the --** value of N in subsequent call to sqlite3_aggregate_context() within --** the same aggregate function instance will not resize the memory --** allocation.)^ --** --** ^SQLite automatically frees the memory allocated by --** sqlite3_aggregate_context() when the aggregate query concludes. --** --** The first parameter must be a copy of the --** [sqlite3_context | SQL function context] that is the first parameter --** to the xStep or xFinal callback routine that implements the aggregate --** function. --** --** This routine must be called from the same thread in which --** the aggregate SQL function is running. -- function sqlite3_aggregate_context (arg1 : System.Address; arg2 : int) return System.Address; -- /usr/include/sqlite3.h:3345:18 pragma Import (C, sqlite3_aggregate_context, "sqlite3_aggregate_context"); --** CAPI3REF: User Data For Functions --** --** ^The sqlite3_user_data() interface returns a copy of --** the pointer that was the pUserData parameter (the 5th parameter) --** of the [sqlite3_create_function()] --** and [sqlite3_create_function16()] routines that originally --** registered the application defined function. --** --** This routine must be called from the same thread in which --** the application-defined function is running. -- function sqlite3_user_data (arg1 : System.Address) return System.Address; -- /usr/include/sqlite3.h:3359:18 pragma Import (C, sqlite3_user_data, "sqlite3_user_data"); --** CAPI3REF: Database Connection For Functions --** --** ^The sqlite3_context_db_handle() interface returns a copy of --** the pointer to the [database connection] (the 1st parameter) --** of the [sqlite3_create_function()] --** and [sqlite3_create_function16()] routines that originally --** registered the application defined function. -- function sqlite3_context_db_handle (arg1 : System.Address) return System.Address; -- /usr/include/sqlite3.h:3370:21 pragma Import (C, sqlite3_context_db_handle, "sqlite3_context_db_handle"); --** CAPI3REF: Function Auxiliary Data --** --** The following two functions may be used by scalar SQL functions to --** associate metadata with argument values. If the same value is passed to --** multiple invocations of the same SQL function during query execution, under --** some circumstances the associated metadata may be preserved. This may --** be used, for example, to add a regular-expression matching scalar --** function. The compiled version of the regular expression is stored as --** metadata associated with the SQL value passed as the regular expression --** pattern. The compiled regular expression can be reused on multiple --** invocations of the same function so that the original pattern string --** does not need to be recompiled on each invocation. --** --** ^The sqlite3_get_auxdata() interface returns a pointer to the metadata --** associated by the sqlite3_set_auxdata() function with the Nth argument --** value to the application-defined function. ^If no metadata has been ever --** been set for the Nth argument of the function, or if the corresponding --** function parameter has changed since the meta-data was set, --** then sqlite3_get_auxdata() returns a NULL pointer. --** --** ^The sqlite3_set_auxdata() interface saves the metadata --** pointed to by its 3rd parameter as the metadata for the N-th --** argument of the application-defined function. Subsequent --** calls to sqlite3_get_auxdata() might return this data, if it has --** not been destroyed. --** ^If it is not NULL, SQLite will invoke the destructor --** function given by the 4th parameter to sqlite3_set_auxdata() on --** the metadata when the corresponding function parameter changes --** or when the SQL statement completes, whichever comes first. --** --** SQLite is free to call the destructor and drop metadata on any --** parameter of any function at any time. ^The only guarantee is that --** the destructor will be called before the metadata is dropped. --** --** ^(In practice, metadata is preserved between function calls for --** expressions that are constant at compile time. This includes literal --** values and [parameters].)^ --** --** These routines must be called from the same thread in which --** the SQL function is running. -- function sqlite3_get_auxdata (arg1 : System.Address; arg2 : int) return System.Address; -- /usr/include/sqlite3.h:3414:18 pragma Import (C, sqlite3_get_auxdata, "sqlite3_get_auxdata"); procedure sqlite3_set_auxdata (arg1 : System.Address; arg2 : int; arg3 : System.Address; arg4 : access procedure (arg1 : System.Address)); -- /usr/include/sqlite3.h:3415:17 pragma Import (C, sqlite3_set_auxdata, "sqlite3_set_auxdata"); --** CAPI3REF: Constants Defining Special Destructor Behavior --** --** These are special values for the destructor that is passed in as the --** final argument to routines like [sqlite3_result_blob()]. ^If the destructor --** argument is SQLITE_STATIC, it means that the content pointer is constant --** and will never change. It does not need to be destroyed. ^The --** SQLITE_TRANSIENT value means that the content will likely change in --** the near future and that SQLite should make its own private copy of --** the content before returning. --** --** The typedef is necessary to work around problems in certain --** C++ compilers. See ticket #2191. -- type sqlite3_destructor_type is access procedure (arg1 : System.Address); -- /usr/include/sqlite3.h:3432:16 --** CAPI3REF: Setting The Result Of An SQL Function --** --** These routines are used by the xFunc or xFinal callbacks that --** implement SQL functions and aggregates. See --** [sqlite3_create_function()] and [sqlite3_create_function16()] --** for additional information. --** --** These functions work very much like the [parameter binding] family of --** functions used to bind values to host parameters in prepared statements. --** Refer to the [SQL parameter] documentation for additional information. --** --** ^The sqlite3_result_blob() interface sets the result from --** an application-defined function to be the BLOB whose content is pointed --** to by the second parameter and which is N bytes long where N is the --** third parameter. --** --** ^The sqlite3_result_zeroblob() interfaces set the result of --** the application-defined function to be a BLOB containing all zero --** bytes and N bytes in size, where N is the value of the 2nd parameter. --** --** ^The sqlite3_result_double() interface sets the result from --** an application-defined function to be a floating point value specified --** by its 2nd argument. --** --** ^The sqlite3_result_error() and sqlite3_result_error16() functions --** cause the implemented SQL function to throw an exception. --** ^SQLite uses the string pointed to by the --** 2nd parameter of sqlite3_result_error() or sqlite3_result_error16() --** as the text of an error message. ^SQLite interprets the error --** message string from sqlite3_result_error() as UTF-8. ^SQLite --** interprets the string from sqlite3_result_error16() as UTF-16 in native --** byte order. ^If the third parameter to sqlite3_result_error() --** or sqlite3_result_error16() is negative then SQLite takes as the error --** message all text up through the first zero character. --** ^If the third parameter to sqlite3_result_error() or --** sqlite3_result_error16() is non-negative then SQLite takes that many --** bytes (not characters) from the 2nd parameter as the error message. --** ^The sqlite3_result_error() and sqlite3_result_error16() --** routines make a private copy of the error message text before --** they return. Hence, the calling function can deallocate or --** modify the text after they return without harm. --** ^The sqlite3_result_error_code() function changes the error code --** returned by SQLite as a result of an error in a function. ^By default, --** the error code is SQLITE_ERROR. ^A subsequent call to sqlite3_result_error() --** or sqlite3_result_error16() resets the error code to SQLITE_ERROR. --** --** ^The sqlite3_result_toobig() interface causes SQLite to throw an error --** indicating that a string or BLOB is too long to represent. --** --** ^The sqlite3_result_nomem() interface causes SQLite to throw an error --** indicating that a memory allocation failed. --** --** ^The sqlite3_result_int() interface sets the return value --** of the application-defined function to be the 32-bit signed integer --** value given in the 2nd argument. --** ^The sqlite3_result_int64() interface sets the return value --** of the application-defined function to be the 64-bit signed integer --** value given in the 2nd argument. --** --** ^The sqlite3_result_null() interface sets the return value --** of the application-defined function to be NULL. --** --** ^The sqlite3_result_text(), sqlite3_result_text16(), --** sqlite3_result_text16le(), and sqlite3_result_text16be() interfaces --** set the return value of the application-defined function to be --** a text string which is represented as UTF-8, UTF-16 native byte order, --** UTF-16 little endian, or UTF-16 big endian, respectively. --** ^SQLite takes the text result from the application from --** the 2nd parameter of the sqlite3_result_text* interfaces. --** ^If the 3rd parameter to the sqlite3_result_text* interfaces --** is negative, then SQLite takes result text from the 2nd parameter --** through the first zero character. --** ^If the 3rd parameter to the sqlite3_result_text* interfaces --** is non-negative, then as many bytes (not characters) of the text --** pointed to by the 2nd parameter are taken as the application-defined --** function result. --** ^If the 4th parameter to the sqlite3_result_text* interfaces --** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that --** function as the destructor on the text or BLOB result when it has --** finished using that result. --** ^If the 4th parameter to the sqlite3_result_text* interfaces or to --** sqlite3_result_blob is the special constant SQLITE_STATIC, then SQLite --** assumes that the text or BLOB result is in constant space and does not --** copy the content of the parameter nor call a destructor on the content --** when it has finished using that result. --** ^If the 4th parameter to the sqlite3_result_text* interfaces --** or sqlite3_result_blob is the special constant SQLITE_TRANSIENT --** then SQLite makes a copy of the result into space obtained from --** from [sqlite3_malloc()] before it returns. --** --** ^The sqlite3_result_value() interface sets the result of --** the application-defined function to be a copy the --** [unprotected sqlite3_value] object specified by the 2nd parameter. ^The --** sqlite3_result_value() interface makes a copy of the [sqlite3_value] --** so that the [sqlite3_value] specified in the parameter may change or --** be deallocated after sqlite3_result_value() returns without harm. --** ^A [protected sqlite3_value] object may always be used where an --** [unprotected sqlite3_value] object is required, so either --** kind of [sqlite3_value] object can be used with this interface. --** --** If these routines are called from within the different thread --** than the one containing the application-defined function that received --** the [sqlite3_context] pointer, the results are undefined. -- procedure sqlite3_result_blob (arg1 : System.Address; arg2 : System.Address; arg3 : int; arg4 : access procedure (arg1 : System.Address)); -- /usr/include/sqlite3.h:3541:17 pragma Import (C, sqlite3_result_blob, "sqlite3_result_blob"); procedure sqlite3_result_double (arg1 : System.Address; arg2 : double); -- /usr/include/sqlite3.h:3542:17 pragma Import (C, sqlite3_result_double, "sqlite3_result_double"); procedure sqlite3_result_error (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : int); -- /usr/include/sqlite3.h:3543:17 pragma Import (C, sqlite3_result_error, "sqlite3_result_error"); procedure sqlite3_result_error16 (arg1 : System.Address; arg2 : System.Address; arg3 : int); -- /usr/include/sqlite3.h:3544:17 pragma Import (C, sqlite3_result_error16, "sqlite3_result_error16"); procedure sqlite3_result_error_toobig (arg1 : System.Address); -- /usr/include/sqlite3.h:3545:17 pragma Import (C, sqlite3_result_error_toobig, "sqlite3_result_error_toobig"); procedure sqlite3_result_error_nomem (arg1 : System.Address); -- /usr/include/sqlite3.h:3546:17 pragma Import (C, sqlite3_result_error_nomem, "sqlite3_result_error_nomem"); procedure sqlite3_result_error_code (arg1 : System.Address; arg2 : int); -- /usr/include/sqlite3.h:3547:17 pragma Import (C, sqlite3_result_error_code, "sqlite3_result_error_code"); procedure sqlite3_result_int (arg1 : System.Address; arg2 : int); -- /usr/include/sqlite3.h:3548:17 pragma Import (C, sqlite3_result_int, "sqlite3_result_int"); procedure sqlite3_result_int64 (arg1 : System.Address; arg2 : sqlite3_int64); -- /usr/include/sqlite3.h:3549:17 pragma Import (C, sqlite3_result_int64, "sqlite3_result_int64"); procedure sqlite3_result_null (arg1 : System.Address); -- /usr/include/sqlite3.h:3550:17 pragma Import (C, sqlite3_result_null, "sqlite3_result_null"); procedure sqlite3_result_text (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : int; arg4 : access procedure (arg1 : System.Address)); -- /usr/include/sqlite3.h:3551:17 pragma Import (C, sqlite3_result_text, "sqlite3_result_text"); procedure sqlite3_result_text16 (arg1 : System.Address; arg2 : System.Address; arg3 : int; arg4 : access procedure (arg1 : System.Address)); -- /usr/include/sqlite3.h:3552:17 pragma Import (C, sqlite3_result_text16, "sqlite3_result_text16"); procedure sqlite3_result_text16le (arg1 : System.Address; arg2 : System.Address; arg3 : int; arg4 : access procedure (arg1 : System.Address)); -- /usr/include/sqlite3.h:3553:17 pragma Import (C, sqlite3_result_text16le, "sqlite3_result_text16le"); procedure sqlite3_result_text16be (arg1 : System.Address; arg2 : System.Address; arg3 : int; arg4 : access procedure (arg1 : System.Address)); -- /usr/include/sqlite3.h:3554:17 pragma Import (C, sqlite3_result_text16be, "sqlite3_result_text16be"); procedure sqlite3_result_value (arg1 : System.Address; arg2 : System.Address); -- /usr/include/sqlite3.h:3555:17 pragma Import (C, sqlite3_result_value, "sqlite3_result_value"); procedure sqlite3_result_zeroblob (arg1 : System.Address; arg2 : int); -- /usr/include/sqlite3.h:3556:17 pragma Import (C, sqlite3_result_zeroblob, "sqlite3_result_zeroblob"); --** CAPI3REF: Define New Collating Sequences --** --** These functions are used to add new collation sequences to the --** [database connection] specified as the first argument. --** --** ^The name of the new collation sequence is specified as a UTF-8 string --** for sqlite3_create_collation() and sqlite3_create_collation_v2() --** and a UTF-16 string for sqlite3_create_collation16(). ^In all cases --** the name is passed as the second function argument. --** --** ^The third argument may be one of the constants [SQLITE_UTF8], --** [SQLITE_UTF16LE], or [SQLITE_UTF16BE], indicating that the user-supplied --** routine expects to be passed pointers to strings encoded using UTF-8, --** UTF-16 little-endian, or UTF-16 big-endian, respectively. ^The --** third argument might also be [SQLITE_UTF16] to indicate that the routine --** expects pointers to be UTF-16 strings in the native byte order, or the --** argument can be [SQLITE_UTF16_ALIGNED] if the --** the routine expects pointers to 16-bit word aligned strings --** of UTF-16 in the native byte order. --** --** A pointer to the user supplied routine must be passed as the fifth --** argument. ^If it is NULL, this is the same as deleting the collation --** sequence (so that SQLite cannot call it anymore). --** ^Each time the application supplied function is invoked, it is passed --** as its first parameter a copy of the void* passed as the fourth argument --** to sqlite3_create_collation() or sqlite3_create_collation16(). --** --** ^The remaining arguments to the application-supplied routine are two strings, --** each represented by a (length, data) pair and encoded in the encoding --** that was passed as the third argument when the collation sequence was --** registered. The application defined collation routine should --** return negative, zero or positive if the first string is less than, --** equal to, or greater than the second string. i.e. (STRING1 - STRING2). --** --** ^The sqlite3_create_collation_v2() works like sqlite3_create_collation() --** except that it takes an extra argument which is a destructor for --** the collation. ^The destructor is called when the collation is --** destroyed and is passed a copy of the fourth parameter void* pointer --** of the sqlite3_create_collation_v2(). --** ^Collations are destroyed when they are overridden by later calls to the --** collation creation functions or when the [database connection] is closed --** using [sqlite3_close()]. --** --** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. -- function sqlite3_create_collation (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : int; arg4 : System.Address; arg5 : access function (arg1 : System.Address; arg2 : int; arg3 : System.Address; arg4 : int; arg5 : System.Address) return int) return int; -- /usr/include/sqlite3.h:3604:16 pragma Import (C, sqlite3_create_collation, "sqlite3_create_collation"); function sqlite3_create_collation_v2 (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : int; arg4 : System.Address; arg5 : access function (arg1 : System.Address; arg2 : int; arg3 : System.Address; arg4 : int; arg5 : System.Address) return int; arg6 : access procedure (arg1 : System.Address)) return int; -- /usr/include/sqlite3.h:3611:16 pragma Import (C, sqlite3_create_collation_v2, "sqlite3_create_collation_v2"); function sqlite3_create_collation16 (arg1 : System.Address; arg2 : System.Address; arg3 : int; arg4 : System.Address; arg5 : access function (arg1 : System.Address; arg2 : int; arg3 : System.Address; arg4 : int; arg5 : System.Address) return int) return int; -- /usr/include/sqlite3.h:3619:16 pragma Import (C, sqlite3_create_collation16, "sqlite3_create_collation16"); --** CAPI3REF: Collation Needed Callbacks --** --** ^To avoid having to register all collation sequences before a database --** can be used, a single callback function may be registered with the --** [database connection] to be invoked whenever an undefined collation --** sequence is required. --** --** ^If the function is registered using the sqlite3_collation_needed() API, --** then it is passed the names of undefined collation sequences as strings --** encoded in UTF-8. ^If sqlite3_collation_needed16() is used, --** the names are passed as UTF-16 in machine native byte order. --** ^A call to either function replaces the existing collation-needed callback. --** --** ^(When the callback is invoked, the first argument passed is a copy --** of the second argument to sqlite3_collation_needed() or --** sqlite3_collation_needed16(). The second argument is the database --** connection. The third argument is one of [SQLITE_UTF8], [SQLITE_UTF16BE], --** or [SQLITE_UTF16LE], indicating the most desirable form of the collation --** sequence function required. The fourth parameter is the name of the --** required collation sequence.)^ --** --** The callback function should register the desired collation using --** [sqlite3_create_collation()], [sqlite3_create_collation16()], or --** [sqlite3_create_collation_v2()]. -- function sqlite3_collation_needed (arg1 : System.Address; arg2 : System.Address; arg3 : access procedure (arg1 : System.Address; arg2 : System.Address; arg3 : int; arg4 : Interfaces.C.Strings.chars_ptr)) return int; -- /usr/include/sqlite3.h:3653:16 pragma Import (C, sqlite3_collation_needed, "sqlite3_collation_needed"); function sqlite3_collation_needed16 (arg1 : System.Address; arg2 : System.Address; arg3 : access procedure (arg1 : System.Address; arg2 : System.Address; arg3 : int; arg4 : System.Address)) return int; -- /usr/include/sqlite3.h:3658:16 pragma Import (C, sqlite3_collation_needed16, "sqlite3_collation_needed16"); --** Specify the key for an encrypted database. This routine should be --** called right after sqlite3_open(). --** --** The code to implement this API is not available in the public release --** of SQLite. -- function sqlite3_key (arg1 : System.Address; arg2 : System.Address; arg3 : int) return int; -- /usr/include/sqlite3.h:3671:16 pragma Import (C, sqlite3_key, "sqlite3_key"); -- Database to be rekeyed -- The key --** Change the key on an open database. If the current database is not --** encrypted, this routine will encrypt it. If pNew==0 or nNew==0, the --** database is decrypted. --** --** The code to implement this API is not available in the public release --** of SQLite. -- function sqlite3_rekey (arg1 : System.Address; arg2 : System.Address; arg3 : int) return int; -- /usr/include/sqlite3.h:3684:16 pragma Import (C, sqlite3_rekey, "sqlite3_rekey"); -- Database to be rekeyed -- The new key --** CAPI3REF: Suspend Execution For A Short Time --** --** ^The sqlite3_sleep() function causes the current thread to suspend execution --** for at least a number of milliseconds specified in its parameter. --** --** ^If the operating system does not support sleep requests with --** millisecond time resolution, then the time will be rounded up to --** the nearest second. ^The number of milliseconds of sleep actually --** requested from the operating system is returned. --** --** ^SQLite implements this interface by calling the xSleep() --** method of the default [sqlite3_vfs] object. -- function sqlite3_sleep (arg1 : int) return int; -- /usr/include/sqlite3.h:3703:16 pragma Import (C, sqlite3_sleep, "sqlite3_sleep"); --** CAPI3REF: Name Of The Folder Holding Temporary Files --** --** ^(If this global variable is made to point to a string which is --** the name of a folder (a.k.a. directory), then all temporary files --** created by SQLite when using a built-in [sqlite3_vfs | VFS] --** will be placed in that directory.)^ ^If this variable --** is a NULL pointer, then SQLite performs a search for an appropriate --** temporary file directory. --** --** It is not safe to read or modify this variable in more than one --** thread at a time. It is not safe to read or modify this variable --** if a [database connection] is being used at the same time in a separate --** thread. --** It is intended that this variable be set once --** as part of process initialization and before any SQLite interface --** routines have been called and that this variable remain unchanged --** thereafter. --** --** ^The [temp_store_directory pragma] may modify this variable and cause --** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, --** the [temp_store_directory pragma] always assumes that any string --** that this variable points to is held in memory obtained from --** [sqlite3_malloc] and the pragma may attempt to free that memory --** using [sqlite3_free]. --** Hence, if this variable is modified directly, either it should be --** made NULL or made to point to memory obtained from [sqlite3_malloc] --** or else the use of the [temp_store_directory pragma] should be avoided. -- sqlite3_temp_directory : Interfaces.C.Strings.chars_ptr; -- /usr/include/sqlite3.h:3734:32 pragma Import (C, sqlite3_temp_directory, "sqlite3_temp_directory"); --** CAPI3REF: Test For Auto-Commit Mode --** KEYWORDS: {autocommit mode} --** --** ^The sqlite3_get_autocommit() interface returns non-zero or --** zero if the given database connection is or is not in autocommit mode, --** respectively. ^Autocommit mode is on by default. --** ^Autocommit mode is disabled by a [BEGIN] statement. --** ^Autocommit mode is re-enabled by a [COMMIT] or [ROLLBACK]. --** --** If certain kinds of errors occur on a statement within a multi-statement --** transaction (errors including [SQLITE_FULL], [SQLITE_IOERR], --** [SQLITE_NOMEM], [SQLITE_BUSY], and [SQLITE_INTERRUPT]) then the --** transaction might be rolled back automatically. The only way to --** find out whether SQLite automatically rolled back the transaction after --** an error is to use this function. --** --** If another thread changes the autocommit status of the database --** connection while this routine is running, then the return value --** is undefined. -- function sqlite3_get_autocommit (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:3757:16 pragma Import (C, sqlite3_get_autocommit, "sqlite3_get_autocommit"); --** CAPI3REF: Find The Database Handle Of A Prepared Statement --** --** ^The sqlite3_db_handle interface returns the [database connection] handle --** to which a [prepared statement] belongs. ^The [database connection] --** returned by sqlite3_db_handle is the same [database connection] --** that was the first argument --** to the [sqlite3_prepare_v2()] call (or its variants) that was used to --** create the statement in the first place. -- function sqlite3_db_handle (arg1 : System.Address) return System.Address; -- /usr/include/sqlite3.h:3769:21 pragma Import (C, sqlite3_db_handle, "sqlite3_db_handle"); --** CAPI3REF: Find the next prepared statement --** --** ^This interface returns a pointer to the next [prepared statement] after --** pStmt associated with the [database connection] pDb. ^If pStmt is NULL --** then this interface returns a pointer to the first prepared statement --** associated with the database connection pDb. ^If no prepared statement --** satisfies the conditions of this routine, it returns NULL. --** --** The [database connection] pointer D in a call to --** [sqlite3_next_stmt(D,S)] must refer to an open database --** connection and in particular must not be a NULL pointer. -- function sqlite3_next_stmt (arg1 : System.Address; arg2 : System.Address) return System.Address; -- /usr/include/sqlite3.h:3784:26 pragma Import (C, sqlite3_next_stmt, "sqlite3_next_stmt"); --** CAPI3REF: Commit And Rollback Notification Callbacks --** --** ^The sqlite3_commit_hook() interface registers a callback --** function to be invoked whenever a transaction is [COMMIT | committed]. --** ^Any callback set by a previous call to sqlite3_commit_hook() --** for the same database connection is overridden. --** ^The sqlite3_rollback_hook() interface registers a callback --** function to be invoked whenever a transaction is [ROLLBACK | rolled back]. --** ^Any callback set by a previous call to sqlite3_rollback_hook() --** for the same database connection is overridden. --** ^The pArg argument is passed through to the callback. --** ^If the callback on a commit hook function returns non-zero, --** then the commit is converted into a rollback. --** --** ^The sqlite3_commit_hook(D,C,P) and sqlite3_rollback_hook(D,C,P) functions --** return the P argument from the previous call of the same function --** on the same [database connection] D, or NULL for --** the first call for each function on D. --** --** The callback implementation must not do anything that will modify --** the database connection that invoked the callback. Any actions --** to modify the database connection must be deferred until after the --** completion of the [sqlite3_step()] call that triggered the commit --** or rollback hook in the first place. --** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their --** database connections for the meaning of "modify" in this paragraph. --** --** ^Registering a NULL function disables the callback. --** --** ^When the commit hook callback routine returns zero, the [COMMIT] --** operation is allowed to continue normally. ^If the commit hook --** returns non-zero, then the [COMMIT] is converted into a [ROLLBACK]. --** ^The rollback hook is invoked on a rollback that results from a commit --** hook returning non-zero, just as it would be with any other rollback. --** --** ^For the purposes of this API, a transaction is said to have been --** rolled back if an explicit "ROLLBACK" statement is executed, or --** an error or constraint causes an implicit rollback to occur. --** ^The rollback callback is not invoked if a transaction is --** automatically rolled back because the database connection is closed. --** ^The rollback callback is not invoked if a transaction is --** rolled back because a commit callback returned non-zero. --** --** See also the [sqlite3_update_hook()] interface. -- function sqlite3_commit_hook (arg1 : System.Address; arg2 : access function (arg1 : System.Address) return int; arg3 : System.Address) return System.Address; -- /usr/include/sqlite3.h:3832:18 pragma Import (C, sqlite3_commit_hook, "sqlite3_commit_hook"); function sqlite3_rollback_hook (arg1 : System.Address; arg2 : access procedure (arg1 : System.Address); arg3 : System.Address) return System.Address; -- /usr/include/sqlite3.h:3833:18 pragma Import (C, sqlite3_rollback_hook, "sqlite3_rollback_hook"); --** CAPI3REF: Data Change Notification Callbacks --** --** ^The sqlite3_update_hook() interface registers a callback function --** with the [database connection] identified by the first argument --** to be invoked whenever a row is updated, inserted or deleted. --** ^Any callback set by a previous call to this function --** for the same database connection is overridden. --** --** ^The second argument is a pointer to the function to invoke when a --** row is updated, inserted or deleted. --** ^The first argument to the callback is a copy of the third argument --** to sqlite3_update_hook(). --** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE], --** or [SQLITE_UPDATE], depending on the operation that caused the callback --** to be invoked. --** ^The third and fourth arguments to the callback contain pointers to the --** database and table name containing the affected row. --** ^The final callback parameter is the [rowid] of the row. --** ^In the case of an update, this is the [rowid] after the update takes place. --** --** ^(The update hook is not invoked when internal system tables are --** modified (i.e. sqlite_master and sqlite_sequence).)^ --** --** ^In the current implementation, the update hook --** is not invoked when duplication rows are deleted because of an --** [ON CONFLICT | ON CONFLICT REPLACE] clause. ^Nor is the update hook --** invoked when rows are deleted using the [truncate optimization]. --** The exceptions defined in this paragraph might change in a future --** release of SQLite. --** --** The update hook implementation must not do anything that will modify --** the database connection that invoked the update hook. Any actions --** to modify the database connection must be deferred until after the --** completion of the [sqlite3_step()] call that triggered the update hook. --** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their --** database connections for the meaning of "modify" in this paragraph. --** --** ^The sqlite3_update_hook(D,C,P) function --** returns the P argument from the previous call --** on the same [database connection] D, or NULL for --** the first call on D. --** --** See also the [sqlite3_commit_hook()] and [sqlite3_rollback_hook()] --** interfaces. -- function sqlite3_update_hook (arg1 : System.Address; arg2 : access procedure (arg1 : System.Address; arg2 : int; arg3 : Interfaces.C.Strings.chars_ptr; arg4 : Interfaces.C.Strings.chars_ptr; arg5 : sqlite3_int64); arg3 : System.Address) return System.Address; -- /usr/include/sqlite3.h:3881:18 pragma Import (C, sqlite3_update_hook, "sqlite3_update_hook"); --** CAPI3REF: Enable Or Disable Shared Pager Cache --** KEYWORDS: {shared cache} --** --** ^(This routine enables or disables the sharing of the database cache --** and schema data structures between [database connection | connections] --** to the same database. Sharing is enabled if the argument is true --** and disabled if the argument is false.)^ --** --** ^Cache sharing is enabled and disabled for an entire process. --** This is a change as of SQLite version 3.5.0. In prior versions of SQLite, --** sharing was enabled or disabled for each thread separately. --** --** ^(The cache sharing mode set by this interface effects all subsequent --** calls to [sqlite3_open()], [sqlite3_open_v2()], and [sqlite3_open16()]. --** Existing database connections continue use the sharing mode --** that was in effect at the time they were opened.)^ --** --** ^(This routine returns [SQLITE_OK] if shared cache was enabled or disabled --** successfully. An [error code] is returned otherwise.)^ --** --** ^Shared cache is disabled by default. But this might change in --** future releases of SQLite. Applications that care about shared --** cache setting should set it explicitly. --** --** See Also: [SQLite Shared-Cache Mode] -- function sqlite3_enable_shared_cache (arg1 : int) return int; -- /usr/include/sqlite3.h:3914:16 pragma Import (C, sqlite3_enable_shared_cache, "sqlite3_enable_shared_cache"); --** CAPI3REF: Attempt To Free Heap Memory --** --** ^The sqlite3_release_memory() interface attempts to free N bytes --** of heap memory by deallocating non-essential memory allocations --** held by the database library. Memory used to cache database --** pages to improve performance is an example of non-essential memory. --** ^sqlite3_release_memory() returns the number of bytes actually freed, --** which might be more or less than the amount requested. -- function sqlite3_release_memory (arg1 : int) return int; -- /usr/include/sqlite3.h:3926:16 pragma Import (C, sqlite3_release_memory, "sqlite3_release_memory"); --** CAPI3REF: Impose A Limit On Heap Size --** --** ^The sqlite3_soft_heap_limit() interface places a "soft" limit --** on the amount of heap memory that may be allocated by SQLite. --** ^If an internal allocation is requested that would exceed the --** soft heap limit, [sqlite3_release_memory()] is invoked one or --** more times to free up some space before the allocation is performed. --** --** ^The limit is called "soft" because if [sqlite3_release_memory()] --** cannot free sufficient memory to prevent the limit from being exceeded, --** the memory is allocated anyway and the current operation proceeds. --** --** ^A negative or zero value for N means that there is no soft heap limit and --** [sqlite3_release_memory()] will only be called when memory is exhausted. --** ^The default value for the soft heap limit is zero. --** --** ^(SQLite makes a best effort to honor the soft heap limit. --** But if the soft heap limit cannot be honored, execution will --** continue without error or notification.)^ This is why the limit is --** called a "soft" limit. It is advisory only. --** --** Prior to SQLite version 3.5.0, this routine only constrained the memory --** allocated by a single thread - the same thread in which this routine --** runs. Beginning with SQLite version 3.5.0, the soft heap limit is --** applied to all threads. The value specified for the soft heap limit --** is an upper bound on the total memory allocation for all threads. In --** version 3.5.0 there is no mechanism for limiting the heap usage for --** individual threads. -- procedure sqlite3_soft_heap_limit (arg1 : int); -- /usr/include/sqlite3.h:3958:17 pragma Import (C, sqlite3_soft_heap_limit, "sqlite3_soft_heap_limit"); --** CAPI3REF: Extract Metadata About A Column Of A Table --** --** ^This routine returns metadata about a specific column of a specific --** database table accessible using the [database connection] handle --** passed as the first function argument. --** --** ^The column is identified by the second, third and fourth parameters to --** this function. ^The second parameter is either the name of the database --** (i.e. "main", "temp", or an attached database) containing the specified --** table or NULL. ^If it is NULL, then all attached databases are searched --** for the table using the same algorithm used by the database engine to --** resolve unqualified table references. --** --** ^The third and fourth parameters to this function are the table and column --** name of the desired column, respectively. Neither of these parameters --** may be NULL. --** --** ^Metadata is returned by writing to the memory locations passed as the 5th --** and subsequent parameters to this function. ^Any of these arguments may be --** NULL, in which case the corresponding element of metadata is omitted. --** --** ^(<blockquote> --** <table border="1"> --** <tr><th> Parameter <th> Output<br>Type <th> Description --** --** <tr><td> 5th <td> const char* <td> Data type --** <tr><td> 6th <td> const char* <td> Name of default collation sequence --** <tr><td> 7th <td> int <td> True if column has a NOT NULL constraint --** <tr><td> 8th <td> int <td> True if column is part of the PRIMARY KEY --** <tr><td> 9th <td> int <td> True if column is [AUTOINCREMENT] --** </table> --** </blockquote>)^ --** --** ^The memory pointed to by the character pointers returned for the --** declaration type and collation sequence is valid only until the next --** call to any SQLite API function. --** --** ^If the specified table is actually a view, an [error code] is returned. --** --** ^If the specified column is "rowid", "oid" or "_rowid_" and an --** [INTEGER PRIMARY KEY] column has been explicitly declared, then the output --** parameters are set for the explicitly declared column. ^(If there is no --** explicitly declared [INTEGER PRIMARY KEY] column, then the output --** parameters are set as follows: --** --** <pre> --** data type: "INTEGER" --** collation sequence: "BINARY" --** not null: 0 --** primary key: 1 --** auto increment: 0 --** </pre>)^ --** --** ^(This function may load one or more schemas from database files. If an --** error occurs during this process, or if the requested table or column --** cannot be found, an [error code] is returned and an error message left --** in the [database connection] (to be retrieved using sqlite3_errmsg()).)^ --** --** ^This API is only available if the library was compiled with the --** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol defined. -- function sqlite3_table_column_metadata (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : Interfaces.C.Strings.chars_ptr; arg4 : Interfaces.C.Strings.chars_ptr; arg5 : System.Address; arg6 : System.Address; arg7 : access int; arg8 : access int; arg9 : access int) return int; -- /usr/include/sqlite3.h:4022:16 pragma Import (C, sqlite3_table_column_metadata, "sqlite3_table_column_metadata"); -- Connection handle -- Database name or NULL -- Table name -- Column name -- OUTPUT: Declared data type -- OUTPUT: Collation sequence name -- OUTPUT: True if NOT NULL constraint exists -- OUTPUT: True if column part of PK -- OUTPUT: True if column is auto-increment --** CAPI3REF: Load An Extension --** --** ^This interface loads an SQLite extension library from the named file. --** --** ^The sqlite3_load_extension() interface attempts to load an --** SQLite extension library contained in the file zFile. --** --** ^The entry point is zProc. --** ^zProc may be 0, in which case the name of the entry point --** defaults to "sqlite3_extension_init". --** ^The sqlite3_load_extension() interface returns --** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. --** ^If an error occurs and pzErrMsg is not 0, then the --** [sqlite3_load_extension()] interface shall attempt to --** fill *pzErrMsg with error message text stored in memory --** obtained from [sqlite3_malloc()]. The calling function --** should free this memory by calling [sqlite3_free()]. --** --** ^Extension loading must be enabled using --** [sqlite3_enable_load_extension()] prior to calling this API, --** otherwise an error will be returned. --** --** See also the [load_extension() SQL function]. -- function sqlite3_load_extension (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : Interfaces.C.Strings.chars_ptr; arg4 : System.Address) return int; -- /usr/include/sqlite3.h:4059:16 pragma Import (C, sqlite3_load_extension, "sqlite3_load_extension"); -- Load the extension into this database connection -- Name of the shared library containing extension -- Entry point. Derived from zFile if 0 -- Put error message here if not 0 --** CAPI3REF: Enable Or Disable Extension Loading --** --** ^So as not to open security holes in older applications that are --** unprepared to deal with extension loading, and as a means of disabling --** extension loading while evaluating user-entered SQL, the following API --** is provided to turn the [sqlite3_load_extension()] mechanism on and off. --** --** ^Extension loading is off by default. See ticket #1863. --** ^Call the sqlite3_enable_load_extension() routine with onoff==1 --** to turn extension loading on and call it with onoff==0 to turn --** it back off again. -- function sqlite3_enable_load_extension (arg1 : System.Address; arg2 : int) return int; -- /usr/include/sqlite3.h:4079:16 pragma Import (C, sqlite3_enable_load_extension, "sqlite3_enable_load_extension"); --** CAPI3REF: Automatically Load An Extensions --** --** ^This API can be invoked at program startup in order to register --** one or more statically linked extensions that will be available --** to all new [database connections]. --** --** ^(This routine stores a pointer to the extension entry point --** in an array that is obtained from [sqlite3_malloc()]. That memory --** is deallocated by [sqlite3_reset_auto_extension()].)^ --** --** ^This function registers an extension entry point that is --** automatically invoked whenever a new [database connection] --** is opened using [sqlite3_open()], [sqlite3_open16()], --** or [sqlite3_open_v2()]. --** ^Duplicate extensions are detected so calling this routine --** multiple times with the same extension is harmless. --** ^Automatic extensions apply across all threads. -- function sqlite3_auto_extension (arg1 : access procedure) return int; -- /usr/include/sqlite3.h:4100:16 pragma Import (C, sqlite3_auto_extension, "sqlite3_auto_extension"); --** CAPI3REF: Reset Automatic Extension Loading --** --** ^(This function disables all previously registered automatic --** extensions. It undoes the effect of all prior --** [sqlite3_auto_extension()] calls.)^ --** --** ^This function disables automatic extensions in all threads. -- procedure sqlite3_reset_auto_extension; -- /usr/include/sqlite3.h:4111:17 pragma Import (C, sqlite3_reset_auto_extension, "sqlite3_reset_auto_extension"); --** CAPI3REF: A Handle To An Open BLOB --** KEYWORDS: {BLOB handle} {BLOB handles} --** --** An instance of this object represents an open BLOB on which --** [sqlite3_blob_open | incremental BLOB I/O] can be performed. --** ^Objects of this type are created by [sqlite3_blob_open()] --** and destroyed by [sqlite3_blob_close()]. --** ^The [sqlite3_blob_read()] and [sqlite3_blob_write()] interfaces --** can be used to read or write small subsections of the BLOB. --** ^The [sqlite3_blob_bytes()] interface returns the size of the BLOB in bytes. -- -- skipped empty struct sqlite3_blob --** CAPI3REF: Open A BLOB For Incremental I/O --** --** ^(This interfaces opens a [BLOB handle | handle] to the BLOB located --** in row iRow, column zColumn, table zTable in database zDb; --** in other words, the same BLOB that would be selected by: --** --** <pre> --** SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow; --** </pre>)^ --** --** ^If the flags parameter is non-zero, then the BLOB is opened for read --** and write access. ^If it is zero, the BLOB is opened for read access. --** ^It is not possible to open a column that is part of an index or primary --** key for writing. ^If [foreign key constraints] are enabled, it is --** not possible to open a column that is part of a [child key] for writing. --** --** ^Note that the database name is not the filename that contains --** the database but rather the symbolic name of the database that --** appears after the AS keyword when the database is connected using [ATTACH]. --** ^For the main database file, the database name is "main". --** ^For TEMP tables, the database name is "temp". --** --** ^(On success, [SQLITE_OK] is returned and the new [BLOB handle] is written --** to *ppBlob. Otherwise an [error code] is returned and *ppBlob is set --** to be a null pointer.)^ --** ^This function sets the [database connection] error code and message --** accessible via [sqlite3_errcode()] and [sqlite3_errmsg()] and related --** functions. ^Note that the *ppBlob variable is always initialized in a --** way that makes it safe to invoke [sqlite3_blob_close()] on *ppBlob --** regardless of the success or failure of this routine. --** --** ^(If the row that a BLOB handle points to is modified by an --** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects --** then the BLOB handle is marked as "expired". --** This is true if any column of the row is changed, even a column --** other than the one the BLOB handle is open on.)^ --** ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for --** a expired BLOB handle fail with an return code of [SQLITE_ABORT]. --** ^(Changes written into a BLOB prior to the BLOB expiring are not --** rolled back by the expiration of the BLOB. Such changes will eventually --** commit if the transaction continues to completion.)^ --** --** ^Use the [sqlite3_blob_bytes()] interface to determine the size of --** the opened blob. ^The size of a blob may not be changed by this --** interface. Use the [UPDATE] SQL command to change the size of a --** blob. --** --** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces --** and the built-in [zeroblob] SQL function can be used, if desired, --** to create an empty, zero-filled blob in which to read or write using --** this interface. --** --** To avoid a resource leak, every open [BLOB handle] should eventually --** be released by a call to [sqlite3_blob_close()]. -- function sqlite3_blob_open (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : Interfaces.C.Strings.chars_ptr; arg4 : Interfaces.C.Strings.chars_ptr; arg5 : sqlite3_int64; arg6 : int; arg7 : System.Address) return int; -- /usr/include/sqlite3.h:4461:16 pragma Import (C, sqlite3_blob_open, "sqlite3_blob_open"); --** CAPI3REF: Close A BLOB Handle --** --** ^Closes an open [BLOB handle]. --** --** ^Closing a BLOB shall cause the current transaction to commit --** if there are no other BLOBs, no pending prepared statements, and the --** database connection is in [autocommit mode]. --** ^If any writes were made to the BLOB, they might be held in cache --** until the close operation if they will fit. --** --** ^(Closing the BLOB often forces the changes --** out to disk and so if any I/O errors occur, they will likely occur --** at the time when the BLOB is closed. Any errors that occur during --** closing are reported as a non-zero return value.)^ --** --** ^(The BLOB is closed unconditionally. Even if this routine returns --** an error code, the BLOB is still closed.)^ --** --** ^Calling this routine with a null pointer (such as would be returned --** by a failed call to [sqlite3_blob_open()]) is a harmless no-op. -- function sqlite3_blob_close (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:4493:16 pragma Import (C, sqlite3_blob_close, "sqlite3_blob_close"); --** CAPI3REF: Return The Size Of An Open BLOB --** --** ^Returns the size in bytes of the BLOB accessible via the --** successfully opened [BLOB handle] in its only argument. ^The --** incremental blob I/O routines can only read or overwriting existing --** blob content; they cannot change the size of a blob. --** --** This routine only works on a [BLOB handle] which has been created --** by a prior successful call to [sqlite3_blob_open()] and which has not --** been closed by [sqlite3_blob_close()]. Passing any other pointer in --** to this routine results in undefined and probably undesirable behavior. -- function sqlite3_blob_bytes (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:4508:16 pragma Import (C, sqlite3_blob_bytes, "sqlite3_blob_bytes"); --** CAPI3REF: Read Data From A BLOB Incrementally --** --** ^(This function is used to read data from an open [BLOB handle] into a --** caller-supplied buffer. N bytes of data are copied into buffer Z --** from the open BLOB, starting at offset iOffset.)^ --** --** ^If offset iOffset is less than N bytes from the end of the BLOB, --** [SQLITE_ERROR] is returned and no data is read. ^If N or iOffset is --** less than zero, [SQLITE_ERROR] is returned and no data is read. --** ^The size of the blob (and hence the maximum value of N+iOffset) --** can be determined using the [sqlite3_blob_bytes()] interface. --** --** ^An attempt to read from an expired [BLOB handle] fails with an --** error code of [SQLITE_ABORT]. --** --** ^(On success, sqlite3_blob_read() returns SQLITE_OK. --** Otherwise, an [error code] or an [extended error code] is returned.)^ --** --** This routine only works on a [BLOB handle] which has been created --** by a prior successful call to [sqlite3_blob_open()] and which has not --** been closed by [sqlite3_blob_close()]. Passing any other pointer in --** to this routine results in undefined and probably undesirable behavior. --** --** See also: [sqlite3_blob_write()]. -- function sqlite3_blob_read (arg1 : System.Address; arg2 : System.Address; arg3 : int; arg4 : int) return int; -- /usr/include/sqlite3.h:4536:16 pragma Import (C, sqlite3_blob_read, "sqlite3_blob_read"); --** CAPI3REF: Write Data Into A BLOB Incrementally --** --** ^This function is used to write data into an open [BLOB handle] from a --** caller-supplied buffer. ^N bytes of data are copied from the buffer Z --** into the open BLOB, starting at offset iOffset. --** --** ^If the [BLOB handle] passed as the first argument was not opened for --** writing (the flags parameter to [sqlite3_blob_open()] was zero), --** this function returns [SQLITE_READONLY]. --** --** ^This function may only modify the contents of the BLOB; it is --** not possible to increase the size of a BLOB using this API. --** ^If offset iOffset is less than N bytes from the end of the BLOB, --** [SQLITE_ERROR] is returned and no data is written. ^If N is --** less than zero [SQLITE_ERROR] is returned and no data is written. --** The size of the BLOB (and hence the maximum value of N+iOffset) --** can be determined using the [sqlite3_blob_bytes()] interface. --** --** ^An attempt to write to an expired [BLOB handle] fails with an --** error code of [SQLITE_ABORT]. ^Writes to the BLOB that occurred --** before the [BLOB handle] expired are not rolled back by the --** expiration of the handle, though of course those changes might --** have been overwritten by the statement that expired the BLOB handle --** or by other independent statements. --** --** ^(On success, sqlite3_blob_write() returns SQLITE_OK. --** Otherwise, an [error code] or an [extended error code] is returned.)^ --** --** This routine only works on a [BLOB handle] which has been created --** by a prior successful call to [sqlite3_blob_open()] and which has not --** been closed by [sqlite3_blob_close()]. Passing any other pointer in --** to this routine results in undefined and probably undesirable behavior. --** --** See also: [sqlite3_blob_read()]. -- function sqlite3_blob_write (arg1 : System.Address; arg2 : System.Address; arg3 : int; arg4 : int) return int; -- /usr/include/sqlite3.h:4574:16 pragma Import (C, sqlite3_blob_write, "sqlite3_blob_write"); --** CAPI3REF: Virtual File System Objects --** --** A virtual filesystem (VFS) is an [sqlite3_vfs] object --** that SQLite uses to interact --** with the underlying operating system. Most SQLite builds come with a --** single default VFS that is appropriate for the host computer. --** New VFSes can be registered and existing VFSes can be unregistered. --** The following interfaces are provided. --** --** ^The sqlite3_vfs_find() interface returns a pointer to a VFS given its name. --** ^Names are case sensitive. --** ^Names are zero-terminated UTF-8 strings. --** ^If there is no match, a NULL pointer is returned. --** ^If zVfsName is NULL then the default VFS is returned. --** --** ^New VFSes are registered with sqlite3_vfs_register(). --** ^Each new VFS becomes the default VFS if the makeDflt flag is set. --** ^The same VFS can be registered multiple times without injury. --** ^To make an existing VFS into the default VFS, register it again --** with the makeDflt flag set. If two different VFSes with the --** same name are registered, the behavior is undefined. If a --** VFS is registered with a name that is NULL or an empty string, --** then the behavior is undefined. --** --** ^Unregister a VFS with the sqlite3_vfs_unregister() interface. --** ^(If the default VFS is unregistered, another VFS is chosen as --** the default. The choice for the new VFS is arbitrary.)^ -- function sqlite3_vfs_find (arg1 : Interfaces.C.Strings.chars_ptr) return access sqlite3_vfs; -- /usr/include/sqlite3.h:4605:25 pragma Import (C, sqlite3_vfs_find, "sqlite3_vfs_find"); function sqlite3_vfs_register (arg1 : access sqlite3_vfs; arg2 : int) return int; -- /usr/include/sqlite3.h:4606:16 pragma Import (C, sqlite3_vfs_register, "sqlite3_vfs_register"); function sqlite3_vfs_unregister (arg1 : access sqlite3_vfs) return int; -- /usr/include/sqlite3.h:4607:16 pragma Import (C, sqlite3_vfs_unregister, "sqlite3_vfs_unregister"); --** CAPI3REF: Mutexes --** --** The SQLite core uses these routines for thread --** synchronization. Though they are intended for internal --** use by SQLite, code that links against SQLite is --** permitted to use any of these routines. --** --** The SQLite source code contains multiple implementations --** of these mutex routines. An appropriate implementation --** is selected automatically at compile-time. ^(The following --** implementations are available in the SQLite core: --** --** <ul> --** <li> SQLITE_MUTEX_OS2 --** <li> SQLITE_MUTEX_PTHREAD --** <li> SQLITE_MUTEX_W32 --** <li> SQLITE_MUTEX_NOOP --** </ul>)^ --** --** ^The SQLITE_MUTEX_NOOP implementation is a set of routines --** that does no real locking and is appropriate for use in --** a single-threaded application. ^The SQLITE_MUTEX_OS2, --** SQLITE_MUTEX_PTHREAD, and SQLITE_MUTEX_W32 implementations --** are appropriate for use on OS/2, Unix, and Windows. --** --** ^(If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor --** macro defined (with "-DSQLITE_MUTEX_APPDEF=1"), then no mutex --** implementation is included with the library. In this case the --** application must supply a custom mutex implementation using the --** [SQLITE_CONFIG_MUTEX] option of the sqlite3_config() function --** before calling sqlite3_initialize() or any other public sqlite3_ --** function that calls sqlite3_initialize().)^ --** --** ^The sqlite3_mutex_alloc() routine allocates a new --** mutex and returns a pointer to it. ^If it returns NULL --** that means that a mutex could not be allocated. ^SQLite --** will unwind its stack and return an error. ^(The argument --** to sqlite3_mutex_alloc() is one of these integer constants: --** --** <ul> --** <li> SQLITE_MUTEX_FAST --** <li> SQLITE_MUTEX_RECURSIVE --** <li> SQLITE_MUTEX_STATIC_MASTER --** <li> SQLITE_MUTEX_STATIC_MEM --** <li> SQLITE_MUTEX_STATIC_MEM2 --** <li> SQLITE_MUTEX_STATIC_PRNG --** <li> SQLITE_MUTEX_STATIC_LRU --** <li> SQLITE_MUTEX_STATIC_LRU2 --** </ul>)^ --** --** ^The first two constants (SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) --** cause sqlite3_mutex_alloc() to create --** a new mutex. ^The new mutex is recursive when SQLITE_MUTEX_RECURSIVE --** is used but not necessarily so when SQLITE_MUTEX_FAST is used. --** The mutex implementation does not need to make a distinction --** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does --** not want to. ^SQLite will only request a recursive mutex in --** cases where it really needs one. ^If a faster non-recursive mutex --** implementation is available on the host platform, the mutex subsystem --** might return such a mutex in response to SQLITE_MUTEX_FAST. --** --** ^The other allowed parameters to sqlite3_mutex_alloc() (anything other --** than SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) each return --** a pointer to a static preexisting mutex. ^Six static mutexes are --** used by the current version of SQLite. Future versions of SQLite --** may add additional static mutexes. Static mutexes are for internal --** use by SQLite only. Applications that use SQLite mutexes should --** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or --** SQLITE_MUTEX_RECURSIVE. --** --** ^Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST --** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() --** returns a different mutex on every call. ^But for the static --** mutex types, the same mutex is returned on every call that has --** the same type number. --** --** ^The sqlite3_mutex_free() routine deallocates a previously --** allocated dynamic mutex. ^SQLite is careful to deallocate every --** dynamic mutex that it allocates. The dynamic mutexes must not be in --** use when they are deallocated. Attempting to deallocate a static --** mutex results in undefined behavior. ^SQLite never deallocates --** a static mutex. --** --** ^The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt --** to enter a mutex. ^If another thread is already within the mutex, --** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return --** SQLITE_BUSY. ^The sqlite3_mutex_try() interface returns [SQLITE_OK] --** upon successful entry. ^(Mutexes created using --** SQLITE_MUTEX_RECURSIVE can be entered multiple times by the same thread. --** In such cases the, --** mutex must be exited an equal number of times before another thread --** can enter.)^ ^(If the same thread tries to enter any other --** kind of mutex more than once, the behavior is undefined. --** SQLite will never exhibit --** such behavior in its own use of mutexes.)^ --** --** ^(Some systems (for example, Windows 95) do not support the operation --** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try() --** will always return SQLITE_BUSY. The SQLite core only ever uses --** sqlite3_mutex_try() as an optimization so this is acceptable behavior.)^ --** --** ^The sqlite3_mutex_leave() routine exits a mutex that was --** previously entered by the same thread. ^(The behavior --** is undefined if the mutex is not currently entered by the --** calling thread or is not currently allocated. SQLite will --** never do either.)^ --** --** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or --** sqlite3_mutex_leave() is a NULL pointer, then all three routines --** behave as no-ops. --** --** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. -- function sqlite3_mutex_alloc (arg1 : int) return System.Address; -- /usr/include/sqlite3.h:4723:27 pragma Import (C, sqlite3_mutex_alloc, "sqlite3_mutex_alloc"); procedure sqlite3_mutex_free (arg1 : System.Address); -- /usr/include/sqlite3.h:4724:17 pragma Import (C, sqlite3_mutex_free, "sqlite3_mutex_free"); procedure sqlite3_mutex_enter (arg1 : System.Address); -- /usr/include/sqlite3.h:4725:17 pragma Import (C, sqlite3_mutex_enter, "sqlite3_mutex_enter"); function sqlite3_mutex_try (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:4726:16 pragma Import (C, sqlite3_mutex_try, "sqlite3_mutex_try"); procedure sqlite3_mutex_leave (arg1 : System.Address); -- /usr/include/sqlite3.h:4727:17 pragma Import (C, sqlite3_mutex_leave, "sqlite3_mutex_leave"); --** CAPI3REF: Mutex Methods Object --** EXPERIMENTAL --** --** An instance of this structure defines the low-level routines --** used to allocate and use mutexes. --** --** Usually, the default mutex implementations provided by SQLite are --** sufficient, however the user has the option of substituting a custom --** implementation for specialized deployments or systems for which SQLite --** does not provide a suitable implementation. In this case, the user --** creates and populates an instance of this structure to pass --** to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option. --** Additionally, an instance of this structure can be used as an --** output variable when querying the system for the current mutex --** implementation, using the [SQLITE_CONFIG_GETMUTEX] option. --** --** ^The xMutexInit method defined by this structure is invoked as --** part of system initialization by the sqlite3_initialize() function. --** ^The xMutexInit routine is calle by SQLite exactly once for each --** effective call to [sqlite3_initialize()]. --** --** ^The xMutexEnd method defined by this structure is invoked as --** part of system shutdown by the sqlite3_shutdown() function. The --** implementation of this method is expected to release all outstanding --** resources obtained by the mutex methods implementation, especially --** those obtained by the xMutexInit method. ^The xMutexEnd() --** interface is invoked exactly once for each call to [sqlite3_shutdown()]. --** --** ^(The remaining seven methods defined by this structure (xMutexAlloc, --** xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and --** xMutexNotheld) implement the following interfaces (respectively): --** --** <ul> --** <li> [sqlite3_mutex_alloc()] </li> --** <li> [sqlite3_mutex_free()] </li> --** <li> [sqlite3_mutex_enter()] </li> --** <li> [sqlite3_mutex_try()] </li> --** <li> [sqlite3_mutex_leave()] </li> --** <li> [sqlite3_mutex_held()] </li> --** <li> [sqlite3_mutex_notheld()] </li> --** </ul>)^ --** --** The only difference is that the public sqlite3_XXX functions enumerated --** above silently ignore any invocations that pass a NULL pointer instead --** of a valid mutex handle. The implementations of the methods defined --** by this structure are not required to handle this case, the results --** of passing a NULL pointer instead of a valid mutex handle are undefined --** (i.e. it is acceptable to provide an implementation that segfaults if --** it is passed a NULL pointer). --** --** The xMutexInit() method must be threadsafe. ^It must be harmless to --** invoke xMutexInit() mutiple times within the same process and without --** intervening calls to xMutexEnd(). Second and subsequent calls to --** xMutexInit() must be no-ops. --** --** ^xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()] --** and its associates). ^Similarly, xMutexAlloc() must not use SQLite memory --** allocation for a static mutex. ^However xMutexAlloc() may use SQLite --** memory allocation for a fast or recursive mutex. --** --** ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is --** called, but only if the prior call to xMutexInit returned SQLITE_OK. --** If xMutexInit fails in any way, it is expected to clean up after itself --** prior to returning. -- type sqlite3_mutex_methods is record xMutexInit : access function return int; -- /usr/include/sqlite3.h:4797:9 xMutexEnd : access function return int; -- /usr/include/sqlite3.h:4798:9 xMutexAlloc : access function (arg1 : int) return System.Address; -- /usr/include/sqlite3.h:4799:20 xMutexFree : access procedure (arg1 : System.Address); -- /usr/include/sqlite3.h:4800:10 xMutexEnter : access procedure (arg1 : System.Address); -- /usr/include/sqlite3.h:4801:10 xMutexTry : access function (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:4802:9 xMutexLeave : access procedure (arg1 : System.Address); -- /usr/include/sqlite3.h:4803:10 xMutexHeld : access function (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:4804:9 xMutexNotheld : access function (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:4805:9 end record; pragma Convention (C, sqlite3_mutex_methods); -- /usr/include/sqlite3.h:4795:16 --** CAPI3REF: Mutex Verification Routines --** --** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routines --** are intended for use inside assert() statements. ^The SQLite core --** never uses these routines except inside an assert() and applications --** are advised to follow the lead of the core. ^The SQLite core only --** provides implementations for these routines when it is compiled --** with the SQLITE_DEBUG flag. ^External mutex implementations --** are only required to provide these routines if SQLITE_DEBUG is --** defined and if NDEBUG is not defined. --** --** ^These routines should return true if the mutex in their argument --** is held or not held, respectively, by the calling thread. --** --** ^The implementation is not required to provided versions of these --** routines that actually work. If the implementation does not provide working --** versions of these routines, it should at least provide stubs that always --** return true so that one does not get spurious assertion failures. --** --** ^If the argument to sqlite3_mutex_held() is a NULL pointer then --** the routine should return 1. This seems counter-intuitive since --** clearly the mutex cannot be held if it does not exist. But the --** the reason the mutex does not exist is because the build is not --** using mutexes. And we do not want the assert() containing the --** call to sqlite3_mutex_held() to fail, so a non-zero return is --** the appropriate thing to do. ^The sqlite3_mutex_notheld() --** interface should also return 1 when given a NULL pointer. -- function sqlite3_mutex_held (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:4838:16 pragma Import (C, sqlite3_mutex_held, "sqlite3_mutex_held"); function sqlite3_mutex_notheld (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:4839:16 pragma Import (C, sqlite3_mutex_notheld, "sqlite3_mutex_notheld"); --** CAPI3REF: Mutex Types --** --** The [sqlite3_mutex_alloc()] interface takes a single argument --** which is one of these integer constants. --** --** The set of static mutexes may change from one SQLite release to the --** next. Applications that override the built-in mutex logic must be --** prepared to accommodate additional static mutexes. -- --** CAPI3REF: Retrieve the mutex for a database connection --** --** ^This interface returns a pointer the [sqlite3_mutex] object that --** serializes access to the [database connection] given in the argument --** when the [threading mode] is Serialized. --** ^If the [threading mode] is Single-thread or Multi-thread then this --** routine returns a NULL pointer. -- function sqlite3_db_mutex (arg1 : System.Address) return System.Address; -- /usr/include/sqlite3.h:4871:27 pragma Import (C, sqlite3_db_mutex, "sqlite3_db_mutex"); --** CAPI3REF: Low-Level Control Of Database Files --** --** ^The [sqlite3_file_control()] interface makes a direct call to the --** xFileControl method for the [sqlite3_io_methods] object associated --** with a particular database identified by the second argument. ^The --** name of the database "main" for the main database or "temp" for the --** TEMP database, or the name that appears after the AS keyword for --** databases that are added using the [ATTACH] SQL command. --** ^A NULL pointer can be used in place of "main" to refer to the --** main database file. --** ^The third and fourth parameters to this routine --** are passed directly through to the second and third parameters of --** the xFileControl method. ^The return value of the xFileControl --** method becomes the return value of this routine. --** --** ^If the second parameter (zDbName) does not match the name of any --** open database file, then SQLITE_ERROR is returned. ^This error --** code is not remembered and will not be recalled by [sqlite3_errcode()] --** or [sqlite3_errmsg()]. The underlying xFileControl method might --** also return SQLITE_ERROR. There is no way to distinguish between --** an incorrect zDbName and an SQLITE_ERROR return from the underlying --** xFileControl method. --** --** See also: [SQLITE_FCNTL_LOCKSTATE] -- function sqlite3_file_control (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : int; arg4 : System.Address) return int; -- /usr/include/sqlite3.h:4899:16 pragma Import (C, sqlite3_file_control, "sqlite3_file_control"); --** CAPI3REF: Testing Interface --** --** ^The sqlite3_test_control() interface is used to read out internal --** state of SQLite and to inject faults into SQLite for testing --** purposes. ^The first parameter is an operation code that determines --** the number, meaning, and operation of all subsequent parameters. --** --** This interface is not for use by applications. It exists solely --** for verifying the correct operation of the SQLite library. Depending --** on how the SQLite library is compiled, this interface might not exist. --** --** The details of the operation codes, their meanings, the parameters --** they take, and what they do are all subject to change without notice. --** Unlike most of the SQLite API, this function is not guaranteed to --** operate consistently from one release to the next. -- function sqlite3_test_control (arg1 : int -- , ... ) return int; -- /usr/include/sqlite3.h:4918:16 pragma Import (C, sqlite3_test_control, "sqlite3_test_control"); --** CAPI3REF: Testing Interface Operation Codes --** --** These constants are the valid operation code parameters used --** as the first argument to [sqlite3_test_control()]. --** --** These parameters and their meanings are subject to change --** without notice. These values are for testing purposes only. --** Applications should not use any of these parameters or the --** [sqlite3_test_control()] interface. -- --** CAPI3REF: SQLite Runtime Status --** EXPERIMENTAL --** --** ^This interface is used to retrieve runtime status information --** about the preformance of SQLite, and optionally to reset various --** highwater marks. ^The first argument is an integer code for --** the specific parameter to measure. ^(Recognized integer codes --** are of the form [SQLITE_STATUS_MEMORY_USED | SQLITE_STATUS_...].)^ --** ^The current value of the parameter is returned into *pCurrent. --** ^The highest recorded value is returned in *pHighwater. ^If the --** resetFlag is true, then the highest record value is reset after --** *pHighwater is written. ^(Some parameters do not record the highest --** value. For those parameters --** nothing is written into *pHighwater and the resetFlag is ignored.)^ --** ^(Other parameters record only the highwater mark and not the current --** value. For these latter parameters nothing is written into *pCurrent.)^ --** --** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a --** non-zero [error code] on failure. --** --** This routine is threadsafe but is not atomic. This routine can be --** called while other threads are running the same or different SQLite --** interfaces. However the values returned in *pCurrent and --** *pHighwater reflect the status of SQLite at different points in time --** and it is possible that another thread might change the parameter --** in between the times when *pCurrent and *pHighwater are written. --** --** See also: [sqlite3_db_status()] -- function sqlite3_status (arg1 : int; arg2 : access int; arg3 : access int; arg4 : int) return int; -- /usr/include/sqlite3.h:4976:36 pragma Import (C, sqlite3_status, "sqlite3_status"); --** CAPI3REF: Status Parameters --** EXPERIMENTAL --** --** These integer constants designate various run-time status parameters --** that can be returned by [sqlite3_status()]. --** --** <dl> --** ^(<dt>SQLITE_STATUS_MEMORY_USED</dt> --** <dd>This parameter is the current amount of memory checked out --** using [sqlite3_malloc()], either directly or indirectly. The --** figure includes calls made to [sqlite3_malloc()] by the application --** and internal memory usage by the SQLite library. Scratch memory --** controlled by [SQLITE_CONFIG_SCRATCH] and auxiliary page-cache --** memory controlled by [SQLITE_CONFIG_PAGECACHE] is not included in --** this parameter. The amount returned is the sum of the allocation --** sizes as reported by the xSize method in [sqlite3_mem_methods].</dd>)^ --** --** ^(<dt>SQLITE_STATUS_MALLOC_SIZE</dt> --** <dd>This parameter records the largest memory allocation request --** handed to [sqlite3_malloc()] or [sqlite3_realloc()] (or their --** internal equivalents). Only the value returned in the --** *pHighwater parameter to [sqlite3_status()] is of interest. --** The value written into the *pCurrent parameter is undefined.</dd>)^ --** --** ^(<dt>SQLITE_STATUS_PAGECACHE_USED</dt> --** <dd>This parameter returns the number of pages used out of the --** [pagecache memory allocator] that was configured using --** [SQLITE_CONFIG_PAGECACHE]. The --** value returned is in pages, not in bytes.</dd>)^ --** --** ^(<dt>SQLITE_STATUS_PAGECACHE_OVERFLOW</dt> --** <dd>This parameter returns the number of bytes of page cache --** allocation which could not be statisfied by the [SQLITE_CONFIG_PAGECACHE] --** buffer and where forced to overflow to [sqlite3_malloc()]. The --** returned value includes allocations that overflowed because they --** where too large (they were larger than the "sz" parameter to --** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because --** no space was left in the page cache.</dd>)^ --** --** ^(<dt>SQLITE_STATUS_PAGECACHE_SIZE</dt> --** <dd>This parameter records the largest memory allocation request --** handed to [pagecache memory allocator]. Only the value returned in the --** *pHighwater parameter to [sqlite3_status()] is of interest. --** The value written into the *pCurrent parameter is undefined.</dd>)^ --** --** ^(<dt>SQLITE_STATUS_SCRATCH_USED</dt> --** <dd>This parameter returns the number of allocations used out of the --** [scratch memory allocator] configured using --** [SQLITE_CONFIG_SCRATCH]. The value returned is in allocations, not --** in bytes. Since a single thread may only have one scratch allocation --** outstanding at time, this parameter also reports the number of threads --** using scratch memory at the same time.</dd>)^ --** --** ^(<dt>SQLITE_STATUS_SCRATCH_OVERFLOW</dt> --** <dd>This parameter returns the number of bytes of scratch memory --** allocation which could not be statisfied by the [SQLITE_CONFIG_SCRATCH] --** buffer and where forced to overflow to [sqlite3_malloc()]. The values --** returned include overflows because the requested allocation was too --** larger (that is, because the requested allocation was larger than the --** "sz" parameter to [SQLITE_CONFIG_SCRATCH]) and because no scratch buffer --** slots were available. --** </dd>)^ --** --** ^(<dt>SQLITE_STATUS_SCRATCH_SIZE</dt> --** <dd>This parameter records the largest memory allocation request --** handed to [scratch memory allocator]. Only the value returned in the --** *pHighwater parameter to [sqlite3_status()] is of interest. --** The value written into the *pCurrent parameter is undefined.</dd>)^ --** --** ^(<dt>SQLITE_STATUS_PARSER_STACK</dt> --** <dd>This parameter records the deepest parser stack. It is only --** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].</dd>)^ --** </dl> --** --** New status parameters may be added from time to time. -- --** CAPI3REF: Database Connection Status --** EXPERIMENTAL --** --** ^This interface is used to retrieve runtime status information --** about a single [database connection]. ^The first argument is the --** database connection object to be interrogated. ^The second argument --** is the parameter to interrogate. ^Currently, the only allowed value --** for the second parameter is [SQLITE_DBSTATUS_LOOKASIDE_USED]. --** Additional options will likely appear in future releases of SQLite. --** --** ^The current value of the requested parameter is written into *pCur --** and the highest instantaneous value is written into *pHiwtr. ^If --** the resetFlg is true, then the highest instantaneous value is --** reset back down to the current value. --** --** See also: [sqlite3_status()] and [sqlite3_stmt_status()]. -- function sqlite3_db_status (arg1 : System.Address; arg2 : int; arg3 : access int; arg4 : access int; arg5 : int) return int; -- /usr/include/sqlite3.h:5084:36 pragma Import (C, sqlite3_db_status, "sqlite3_db_status"); --** CAPI3REF: Status Parameters for database connections --** EXPERIMENTAL --** --** These constants are the available integer "verbs" that can be passed as --** the second argument to the [sqlite3_db_status()] interface. --** --** New verbs may be added in future releases of SQLite. Existing verbs --** might be discontinued. Applications should check the return code from --** [sqlite3_db_status()] to make sure that the call worked. --** The [sqlite3_db_status()] interface will return a non-zero error code --** if a discontinued or unsupported verb is invoked. --** --** <dl> --** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_USED</dt> --** <dd>This parameter returns the number of lookaside memory slots currently --** checked out.</dd>)^ --** </dl> -- --** CAPI3REF: Prepared Statement Status --** EXPERIMENTAL --** --** ^(Each prepared statement maintains various --** [SQLITE_STMTSTATUS_SORT | counters] that measure the number --** of times it has performed specific operations.)^ These counters can --** be used to monitor the performance characteristics of the prepared --** statements. For example, if the number of table steps greatly exceeds --** the number of table searches or result rows, that would tend to indicate --** that the prepared statement is using a full table scan rather than --** an index. --** --** ^(This interface is used to retrieve and reset counter values from --** a [prepared statement]. The first argument is the prepared statement --** object to be interrogated. The second argument --** is an integer code for a specific [SQLITE_STMTSTATUS_SORT | counter] --** to be interrogated.)^ --** ^The current value of the requested counter is returned. --** ^If the resetFlg is true, then the counter is reset to zero after this --** interface call returns. --** --** See also: [sqlite3_status()] and [sqlite3_db_status()]. -- function sqlite3_stmt_status (arg1 : System.Address; arg2 : int; arg3 : int) return int; -- /usr/include/sqlite3.h:5132:36 pragma Import (C, sqlite3_stmt_status, "sqlite3_stmt_status"); --** CAPI3REF: Status Parameters for prepared statements --** EXPERIMENTAL --** --** These preprocessor macros define integer codes that name counter --** values associated with the [sqlite3_stmt_status()] interface. --** The meanings of the various counters are as follows: --** --** <dl> --** <dt>SQLITE_STMTSTATUS_FULLSCAN_STEP</dt> --** <dd>^This is the number of times that SQLite has stepped forward in --** a table as part of a full table scan. Large numbers for this counter --** may indicate opportunities for performance improvement through --** careful use of indices.</dd> --** --** <dt>SQLITE_STMTSTATUS_SORT</dt> --** <dd>^This is the number of sort operations that have occurred. --** A non-zero value in this counter may indicate an opportunity to --** improvement performance through careful use of indices.</dd> --** --** </dl> -- --** CAPI3REF: Custom Page Cache Object --** EXPERIMENTAL --** --** The sqlite3_pcache type is opaque. It is implemented by --** the pluggable module. The SQLite core has no knowledge of --** its size or internal structure and never deals with the --** sqlite3_pcache object except by holding and passing pointers --** to the object. --** --** See [sqlite3_pcache_methods] for additional information. -- -- skipped empty struct sqlite3_pcache --** CAPI3REF: Application Defined Page Cache. --** KEYWORDS: {page cache} --** EXPERIMENTAL --** --** ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE], ...) interface can --** register an alternative page cache implementation by passing in an --** instance of the sqlite3_pcache_methods structure.)^ The majority of the --** heap memory used by SQLite is used by the page cache to cache data read --** from, or ready to be written to, the database file. By implementing a --** custom page cache using this API, an application can control more --** precisely the amount of memory consumed by SQLite, the way in which --** that memory is allocated and released, and the policies used to --** determine exactly which parts of a database file are cached and for --** how long. --** --** ^(The contents of the sqlite3_pcache_methods structure are copied to an --** internal buffer by SQLite within the call to [sqlite3_config]. Hence --** the application may discard the parameter after the call to --** [sqlite3_config()] returns.)^ --** --** ^The xInit() method is called once for each call to [sqlite3_initialize()] --** (usually only once during the lifetime of the process). ^(The xInit() --** method is passed a copy of the sqlite3_pcache_methods.pArg value.)^ --** ^The xInit() method can set up up global structures and/or any mutexes --** required by the custom page cache implementation. --** --** ^The xShutdown() method is called from within [sqlite3_shutdown()], --** if the application invokes this API. It can be used to clean up --** any outstanding resources before process shutdown, if required. --** --** ^SQLite holds a [SQLITE_MUTEX_RECURSIVE] mutex when it invokes --** the xInit method, so the xInit method need not be threadsafe. ^The --** xShutdown method is only called from [sqlite3_shutdown()] so it does --** not need to be threadsafe either. All other methods must be threadsafe --** in multithreaded applications. --** --** ^SQLite will never invoke xInit() more than once without an intervening --** call to xShutdown(). --** --** ^The xCreate() method is used to construct a new cache instance. SQLite --** will typically create one cache instance for each open database file, --** though this is not guaranteed. ^The --** first parameter, szPage, is the size in bytes of the pages that must --** be allocated by the cache. ^szPage will not be a power of two. ^szPage --** will the page size of the database file that is to be cached plus an --** increment (here called "R") of about 100 or 200. ^SQLite will use the --** extra R bytes on each page to store metadata about the underlying --** database page on disk. The value of R depends --** on the SQLite version, the target platform, and how SQLite was compiled. --** ^R is constant for a particular build of SQLite. ^The second argument to --** xCreate(), bPurgeable, is true if the cache being created will --** be used to cache database pages of a file stored on disk, or --** false if it is used for an in-memory database. ^The cache implementation --** does not have to do anything special based with the value of bPurgeable; --** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will --** never invoke xUnpin() except to deliberately delete a page. --** ^In other words, a cache created with bPurgeable set to false will --** never contain any unpinned pages. --** --** ^(The xCachesize() method may be called at any time by SQLite to set the --** suggested maximum cache-size (number of pages stored by) the cache --** instance passed as the first argument. This is the value configured using --** the SQLite "[PRAGMA cache_size]" command.)^ ^As with the bPurgeable --** parameter, the implementation is not required to do anything with this --** value; it is advisory only. --** --** ^The xPagecount() method should return the number of pages currently --** stored in the cache. --** --** ^The xFetch() method is used to fetch a page and return a pointer to it. --** ^A 'page', in this context, is a buffer of szPage bytes aligned at an --** 8-byte boundary. ^The page to be fetched is determined by the key. ^The --** mimimum key value is 1. After it has been retrieved using xFetch, the page --** is considered to be "pinned". --** --** ^If the requested page is already in the page cache, then the page cache --** implementation must return a pointer to the page buffer with its content --** intact. ^(If the requested page is not already in the cache, then the --** behavior of the cache implementation is determined by the value of the --** createFlag parameter passed to xFetch, according to the following table: --** --** <table border=1 width=85% align=center> --** <tr><th> createFlag <th> Behaviour when page is not already in cache --** <tr><td> 0 <td> Do not allocate a new page. Return NULL. --** <tr><td> 1 <td> Allocate a new page if it easy and convenient to do so. --** Otherwise return NULL. --** <tr><td> 2 <td> Make every effort to allocate a new page. Only return --** NULL if allocating a new page is effectively impossible. --** </table>)^ --** --** SQLite will normally invoke xFetch() with a createFlag of 0 or 1. If --** a call to xFetch() with createFlag==1 returns NULL, then SQLite will --** attempt to unpin one or more cache pages by spilling the content of --** pinned pages to disk and synching the operating system disk cache. After --** attempting to unpin pages, the xFetch() method will be invoked again with --** a createFlag of 2. --** --** ^xUnpin() is called by SQLite with a pointer to a currently pinned page --** as its second argument. ^(If the third parameter, discard, is non-zero, --** then the page should be evicted from the cache. In this case SQLite --** assumes that the next time the page is retrieved from the cache using --** the xFetch() method, it will be zeroed.)^ ^If the discard parameter is --** zero, then the page is considered to be unpinned. ^The cache implementation --** may choose to evict unpinned pages at any time. --** --** ^(The cache is not required to perform any reference counting. A single --** call to xUnpin() unpins the page regardless of the number of prior calls --** to xFetch().)^ --** --** ^The xRekey() method is used to change the key value associated with the --** page passed as the second argument from oldKey to newKey. ^If the cache --** previously contains an entry associated with newKey, it should be --** discarded. ^Any prior cache entry associated with newKey is guaranteed not --** to be pinned. --** --** ^When SQLite calls the xTruncate() method, the cache must discard all --** existing cache entries with page numbers (keys) greater than or equal --** to the value of the iLimit parameter passed to xTruncate(). ^If any --** of these pages are pinned, they are implicitly unpinned, meaning that --** they can be safely discarded. --** --** ^The xDestroy() method is used to delete a cache allocated by xCreate(). --** All resources associated with the specified cache should be freed. ^After --** calling the xDestroy() method, SQLite considers the [sqlite3_pcache*] --** handle invalid, and will not use it with any other sqlite3_pcache_methods --** functions. -- type sqlite3_pcache_methods is record pArg : System.Address; -- /usr/include/sqlite3.h:5303:9 xInit : access function (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:5304:9 xShutdown : access procedure (arg1 : System.Address); -- /usr/include/sqlite3.h:5305:10 xCreate : access function (arg1 : int; arg2 : int) return System.Address; -- /usr/include/sqlite3.h:5306:21 xCachesize : access procedure (arg1 : System.Address; arg2 : int); -- /usr/include/sqlite3.h:5307:10 xPagecount : access function (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:5308:9 xFetch : access function (arg1 : System.Address; arg2 : unsigned; arg3 : int) return System.Address; -- /usr/include/sqlite3.h:5309:11 xUnpin : access procedure (arg1 : System.Address; arg2 : System.Address; arg3 : int); -- /usr/include/sqlite3.h:5310:10 xRekey : access procedure (arg1 : System.Address; arg2 : System.Address; arg3 : unsigned; arg4 : unsigned); -- /usr/include/sqlite3.h:5311:10 xTruncate : access procedure (arg1 : System.Address; arg2 : unsigned); -- /usr/include/sqlite3.h:5312:10 xDestroy : access procedure (arg1 : System.Address); -- /usr/include/sqlite3.h:5313:10 end record; pragma Convention (C, sqlite3_pcache_methods); -- /usr/include/sqlite3.h:5301:16 --** CAPI3REF: Online Backup Object --** EXPERIMENTAL --** --** The sqlite3_backup object records state information about an ongoing --** online backup operation. ^The sqlite3_backup object is created by --** a call to [sqlite3_backup_init()] and is destroyed by a call to --** [sqlite3_backup_finish()]. --** --** See Also: [Using the SQLite Online Backup API] -- -- skipped empty struct sqlite3_backup --** CAPI3REF: Online Backup API. --** EXPERIMENTAL --** --** The backup API copies the content of one database into another. --** It is useful either for creating backups of databases or --** for copying in-memory databases to or from persistent files. --** --** See Also: [Using the SQLite Online Backup API] --** --** ^Exclusive access is required to the destination database for the --** duration of the operation. ^However the source database is only --** read-locked while it is actually being read; it is not locked --** continuously for the entire backup operation. ^Thus, the backup may be --** performed on a live source database without preventing other users from --** reading or writing to the source database while the backup is underway. --** --** ^(To perform a backup operation: --** <ol> --** <li><b>sqlite3_backup_init()</b> is called once to initialize the --** backup, --** <li><b>sqlite3_backup_step()</b> is called one or more times to transfer --** the data between the two databases, and finally --** <li><b>sqlite3_backup_finish()</b> is called to release all resources --** associated with the backup operation. --** </ol>)^ --** There should be exactly one call to sqlite3_backup_finish() for each --** successful call to sqlite3_backup_init(). --** --** <b>sqlite3_backup_init()</b> --** --** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the --** [database connection] associated with the destination database --** and the database name, respectively. --** ^The database name is "main" for the main database, "temp" for the --** temporary database, or the name specified after the AS keyword in --** an [ATTACH] statement for an attached database. --** ^The S and M arguments passed to --** sqlite3_backup_init(D,N,S,M) identify the [database connection] --** and database name of the source database, respectively. --** ^The source and destination [database connections] (parameters S and D) --** must be different or else sqlite3_backup_init(D,N,S,M) will file with --** an error. --** --** ^If an error occurs within sqlite3_backup_init(D,N,S,M), then NULL is --** returned and an error code and error message are store3d in the --** destination [database connection] D. --** ^The error code and message for the failed call to sqlite3_backup_init() --** can be retrieved using the [sqlite3_errcode()], [sqlite3_errmsg()], and/or --** [sqlite3_errmsg16()] functions. --** ^A successful call to sqlite3_backup_init() returns a pointer to an --** [sqlite3_backup] object. --** ^The [sqlite3_backup] object may be used with the sqlite3_backup_step() and --** sqlite3_backup_finish() functions to perform the specified backup --** operation. --** --** <b>sqlite3_backup_step()</b> --** --** ^Function sqlite3_backup_step(B,N) will copy up to N pages between --** the source and destination databases specified by [sqlite3_backup] object B. --** ^If N is negative, all remaining source pages are copied. --** ^If sqlite3_backup_step(B,N) successfully copies N pages and there --** are still more pages to be copied, then the function resturns [SQLITE_OK]. --** ^If sqlite3_backup_step(B,N) successfully finishes copying all pages --** from source to destination, then it returns [SQLITE_DONE]. --** ^If an error occurs while running sqlite3_backup_step(B,N), --** then an [error code] is returned. ^As well as [SQLITE_OK] and --** [SQLITE_DONE], a call to sqlite3_backup_step() may return [SQLITE_READONLY], --** [SQLITE_NOMEM], [SQLITE_BUSY], [SQLITE_LOCKED], or an --** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] extended error code. --** --** ^The sqlite3_backup_step() might return [SQLITE_READONLY] if the destination --** database was opened read-only or if --** the destination is an in-memory database with a different page size --** from the source database. --** --** ^If sqlite3_backup_step() cannot obtain a required file-system lock, then --** the [sqlite3_busy_handler | busy-handler function] --** is invoked (if one is specified). ^If the --** busy-handler returns non-zero before the lock is available, then --** [SQLITE_BUSY] is returned to the caller. ^In this case the call to --** sqlite3_backup_step() can be retried later. ^If the source --** [database connection] --** is being used to write to the source database when sqlite3_backup_step() --** is called, then [SQLITE_LOCKED] is returned immediately. ^Again, in this --** case the call to sqlite3_backup_step() can be retried later on. ^(If --** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or --** [SQLITE_READONLY] is returned, then --** there is no point in retrying the call to sqlite3_backup_step(). These --** errors are considered fatal.)^ The application must accept --** that the backup operation has failed and pass the backup operation handle --** to the sqlite3_backup_finish() to release associated resources. --** --** ^The first call to sqlite3_backup_step() obtains an exclusive lock --** on the destination file. ^The exclusive lock is not released until either --** sqlite3_backup_finish() is called or the backup operation is complete --** and sqlite3_backup_step() returns [SQLITE_DONE]. ^Every call to --** sqlite3_backup_step() obtains a [shared lock] on the source database that --** lasts for the duration of the sqlite3_backup_step() call. --** ^Because the source database is not locked between calls to --** sqlite3_backup_step(), the source database may be modified mid-way --** through the backup process. ^If the source database is modified by an --** external process or via a database connection other than the one being --** used by the backup operation, then the backup will be automatically --** restarted by the next call to sqlite3_backup_step(). ^If the source --** database is modified by the using the same database connection as is used --** by the backup operation, then the backup database is automatically --** updated at the same time. --** --** <b>sqlite3_backup_finish()</b> --** --** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the --** application wishes to abandon the backup operation, the application --** should destroy the [sqlite3_backup] by passing it to sqlite3_backup_finish(). --** ^The sqlite3_backup_finish() interfaces releases all --** resources associated with the [sqlite3_backup] object. --** ^If sqlite3_backup_step() has not yet returned [SQLITE_DONE], then any --** active write-transaction on the destination database is rolled back. --** The [sqlite3_backup] object is invalid --** and may not be used following a call to sqlite3_backup_finish(). --** --** ^The value returned by sqlite3_backup_finish is [SQLITE_OK] if no --** sqlite3_backup_step() errors occurred, regardless or whether or not --** sqlite3_backup_step() completed. --** ^If an out-of-memory condition or IO error occurred during any prior --** sqlite3_backup_step() call on the same [sqlite3_backup] object, then --** sqlite3_backup_finish() returns the corresponding [error code]. --** --** ^A return of [SQLITE_BUSY] or [SQLITE_LOCKED] from sqlite3_backup_step() --** is not a permanent error and does not affect the return value of --** sqlite3_backup_finish(). --** --** <b>sqlite3_backup_remaining(), sqlite3_backup_pagecount()</b> --** --** ^Each call to sqlite3_backup_step() sets two values inside --** the [sqlite3_backup] object: the number of pages still to be backed --** up and the total number of pages in the source databae file. --** The sqlite3_backup_remaining() and sqlite3_backup_pagecount() interfaces --** retrieve these two values, respectively. --** --** ^The values returned by these functions are only updated by --** sqlite3_backup_step(). ^If the source database is modified during a backup --** operation, then the values are not updated to account for any extra --** pages that need to be updated or the size of the source database file --** changing. --** --** <b>Concurrent Usage of Database Handles</b> --** --** ^The source [database connection] may be used by the application for other --** purposes while a backup operation is underway or being initialized. --** ^If SQLite is compiled and configured to support threadsafe database --** connections, then the source database connection may be used concurrently --** from within other threads. --** --** However, the application must guarantee that the destination --** [database connection] is not passed to any other API (by any thread) after --** sqlite3_backup_init() is called and before the corresponding call to --** sqlite3_backup_finish(). SQLite does not currently check to see --** if the application incorrectly accesses the destination [database connection] --** and so no error code is reported, but the operations may malfunction --** nevertheless. Use of the destination database connection while a --** backup is in progress might also also cause a mutex deadlock. --** --** If running in [shared cache mode], the application must --** guarantee that the shared cache used by the destination database --** is not accessed while the backup is running. In practice this means --** that the application must guarantee that the disk file being --** backed up to is not accessed by any connection within the process, --** not just the specific connection that was passed to sqlite3_backup_init(). --** --** The [sqlite3_backup] object itself is partially threadsafe. Multiple --** threads may safely make multiple concurrent calls to sqlite3_backup_step(). --** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() --** APIs are not strictly speaking threadsafe. If they are invoked at the --** same time as another thread is invoking sqlite3_backup_step() it is --** possible that they return invalid values. -- function sqlite3_backup_init (arg1 : System.Address; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : System.Address; arg4 : Interfaces.C.Strings.chars_ptr) return System.Address; -- /usr/include/sqlite3.h:5506:28 pragma Import (C, sqlite3_backup_init, "sqlite3_backup_init"); -- Destination database handle -- Destination database name -- Source database handle -- Source database name function sqlite3_backup_step (arg1 : System.Address; arg2 : int) return int; -- /usr/include/sqlite3.h:5512:16 pragma Import (C, sqlite3_backup_step, "sqlite3_backup_step"); function sqlite3_backup_finish (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:5513:16 pragma Import (C, sqlite3_backup_finish, "sqlite3_backup_finish"); function sqlite3_backup_remaining (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:5514:16 pragma Import (C, sqlite3_backup_remaining, "sqlite3_backup_remaining"); function sqlite3_backup_pagecount (arg1 : System.Address) return int; -- /usr/include/sqlite3.h:5515:16 pragma Import (C, sqlite3_backup_pagecount, "sqlite3_backup_pagecount"); --** CAPI3REF: Unlock Notification --** EXPERIMENTAL --** --** ^When running in shared-cache mode, a database operation may fail with --** an [SQLITE_LOCKED] error if the required locks on the shared-cache or --** individual tables within the shared-cache cannot be obtained. See --** [SQLite Shared-Cache Mode] for a description of shared-cache locking. --** ^This API may be used to register a callback that SQLite will invoke --** when the connection currently holding the required lock relinquishes it. --** ^This API is only available if the library was compiled with the --** [SQLITE_ENABLE_UNLOCK_NOTIFY] C-preprocessor symbol defined. --** --** See Also: [Using the SQLite Unlock Notification Feature]. --** --** ^Shared-cache locks are released when a database connection concludes --** its current transaction, either by committing it or rolling it back. --** --** ^When a connection (known as the blocked connection) fails to obtain a --** shared-cache lock and SQLITE_LOCKED is returned to the caller, the --** identity of the database connection (the blocking connection) that --** has locked the required resource is stored internally. ^After an --** application receives an SQLITE_LOCKED error, it may call the --** sqlite3_unlock_notify() method with the blocked connection handle as --** the first argument to register for a callback that will be invoked --** when the blocking connections current transaction is concluded. ^The --** callback is invoked from within the [sqlite3_step] or [sqlite3_close] --** call that concludes the blocking connections transaction. --** --** ^(If sqlite3_unlock_notify() is called in a multi-threaded application, --** there is a chance that the blocking connection will have already --** concluded its transaction by the time sqlite3_unlock_notify() is invoked. --** If this happens, then the specified callback is invoked immediately, --** from within the call to sqlite3_unlock_notify().)^ --** --** ^If the blocked connection is attempting to obtain a write-lock on a --** shared-cache table, and more than one other connection currently holds --** a read-lock on the same table, then SQLite arbitrarily selects one of --** the other connections to use as the blocking connection. --** --** ^(There may be at most one unlock-notify callback registered by a --** blocked connection. If sqlite3_unlock_notify() is called when the --** blocked connection already has a registered unlock-notify callback, --** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is --** called with a NULL pointer as its second argument, then any existing --** unlock-notify callback is cancelled. ^The blocked connections --** unlock-notify callback may also be canceled by closing the blocked --** connection using [sqlite3_close()]. --** --** The unlock-notify callback is not reentrant. If an application invokes --** any sqlite3_xxx API functions from within an unlock-notify callback, a --** crash or deadlock may be the result. --** --** ^Unless deadlock is detected (see below), sqlite3_unlock_notify() always --** returns SQLITE_OK. --** --** <b>Callback Invocation Details</b> --** --** When an unlock-notify callback is registered, the application provides a --** single void* pointer that is passed to the callback when it is invoked. --** However, the signature of the callback function allows SQLite to pass --** it an array of void* context pointers. The first argument passed to --** an unlock-notify callback is a pointer to an array of void* pointers, --** and the second is the number of entries in the array. --** --** When a blocking connections transaction is concluded, there may be --** more than one blocked connection that has registered for an unlock-notify --** callback. ^If two or more such blocked connections have specified the --** same callback function, then instead of invoking the callback function --** multiple times, it is invoked once with the set of void* context pointers --** specified by the blocked connections bundled together into an array. --** This gives the application an opportunity to prioritize any actions --** related to the set of unblocked database connections. --** --** <b>Deadlock Detection</b> --** --** Assuming that after registering for an unlock-notify callback a --** database waits for the callback to be issued before taking any further --** action (a reasonable assumption), then using this API may cause the --** application to deadlock. For example, if connection X is waiting for --** connection Y's transaction to be concluded, and similarly connection --** Y is waiting on connection X's transaction, then neither connection --** will proceed and the system may remain deadlocked indefinitely. --** --** To avoid this scenario, the sqlite3_unlock_notify() performs deadlock --** detection. ^If a given call to sqlite3_unlock_notify() would put the --** system in a deadlocked state, then SQLITE_LOCKED is returned and no --** unlock-notify callback is registered. The system is said to be in --** a deadlocked state if connection A has registered for an unlock-notify --** callback on the conclusion of connection B's transaction, and connection --** B has itself registered for an unlock-notify callback when connection --** A's transaction is concluded. ^Indirect deadlock is also detected, so --** the system is also considered to be deadlocked if connection B has --** registered for an unlock-notify callback on the conclusion of connection --** C's transaction, where connection C is waiting on connection A. ^Any --** number of levels of indirection are allowed. --** --** <b>The "DROP TABLE" Exception</b> --** --** When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost --** always appropriate to call sqlite3_unlock_notify(). There is however, --** one exception. When executing a "DROP TABLE" or "DROP INDEX" statement, --** SQLite checks if there are any currently executing SELECT statements --** that belong to the same connection. If there are, SQLITE_LOCKED is --** returned. In this case there is no "blocking connection", so invoking --** sqlite3_unlock_notify() results in the unlock-notify callback being --** invoked immediately. If the application then re-attempts the "DROP TABLE" --** or "DROP INDEX" query, an infinite loop might be the result. --** --** One way around this problem is to check the extended error code returned --** by an sqlite3_step() call. ^(If there is a blocking connection, then the --** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in --** the special "DROP TABLE/INDEX" case, the extended error code is just --** SQLITE_LOCKED.)^ -- function sqlite3_unlock_notify (arg1 : System.Address; arg2 : access procedure (arg1 : System.Address; arg2 : int); arg3 : System.Address) return int; -- /usr/include/sqlite3.h:5632:16 pragma Import (C, sqlite3_unlock_notify, "sqlite3_unlock_notify"); -- Waiting connection -- Callback function to invoke -- Argument to pass to xNotify --** CAPI3REF: String Comparison --** EXPERIMENTAL --** --** ^The [sqlite3_strnicmp()] API allows applications and extensions to --** compare the contents of two buffers containing UTF-8 strings in a --** case-indendent fashion, using the same definition of case independence --** that SQLite uses internally when comparing identifiers. -- function sqlite3_strnicmp (arg1 : Interfaces.C.Strings.chars_ptr; arg2 : Interfaces.C.Strings.chars_ptr; arg3 : int) return int; -- /usr/include/sqlite3.h:5648:16 pragma Import (C, sqlite3_strnicmp, "sqlite3_strnicmp"); --** Undo the hack that converts floating point types to integer for --** builds on processors without floating point support. -- -- End of the 'extern "C"' block end Sqlite3_H;
src/main/antlr4/Proto.g4
dotslash/pb2pojo
2
2003
grammar Proto; proto: (message)+ EOF; message: 'message' IDENTIFIER OPEN_BRACE (field_declaration)+ CLOSE_BRACE; field_declaration: (FIELD_RULE)? IDENTIFIER IDENTIFIER EQUALS NUMBER ';'; OPEN_BRACE : '{'; CLOSE_BRACE : '}'; EQUALS : '='; //TYPE: ('int32'| 'int64' |'double' | // 'float' |'bool' | 'bytes' | 'string'); FIELD_RULE: ('optional' | 'required' | 'repeated'); NUMBER: [0-9]+; IDENTIFIER : [a-zA-Z][a-zA-Z0-9_]+; // Skip all whitespaces. WS : [ \t\r\n]+ -> skip ;
src/spawn_manager.ads
persan/spawn-manager
1
8872
pragma Ada_2012; with GNAT.OS_Lib; use GNAT.OS_Lib; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Containers.Vectors; private with Interfaces; package Spawn_Manager is -- This package provides tasksafe variants of the GNAT.OS_Lib Spawn routines. Version : constant String := "1.2.2"; Default_Server_Name : aliased constant String := "gnat-os_lib-spawn-manager-server"; -- The default name of the spawn server. type Wait_Options is (WCONTINUED, -- The waitpid() function shall report the status of any continued -- child process specified by pid whose status has not been reported -- since it continued from a job control stop. WNOHANG, -- The waitpid() function shall not suspend execution of the calling -- thread if status is not immediately available for one of the -- child processes specified by pid. WUNTRACED -- The status of any child processes specified by pid -- that are stopped, and whose status has not yet been reported -- since they stopped, shall also be reported to the -- requesting process. ); type Status_Kind is private; function WIFEXITED (Stat_Val : Status_Kind) return Boolean; -- True value if status was returned for a -- child process that terminated normally. function WEXITSTATUS (Stat_Val : Status_Kind) return Integer; -- If the value of WIFEXITED is True, this -- evaluates to the low-order 8 bits of the status argument that -- the child process passed to _exit() or exit(), -- or the value the child process returned from main(). --# function WIFSIGNALED (Stat_Val : Status_Kind) return Boolean; -- True if status was returned for a child process -- that terminated due to the receipt of a signal that was not caught -- (see <signal.h>). --# function WTERMSIG (Stat_Val : Status_Kind) return Boolean; -- If WIFSIGNALED(stat_val) is True, this evaluates to -- the number of the signal that caused -- the termination of the child process. --# function WIFSTOPPED (Stat_Val : Status_Kind) return Boolean; -- True if status was returned for a child process that is -- currently stopped. --# function WSTOPSIG (Stat_Val : Status_Kind) return Integer; -- If the value of WIFSTOPPED(stat_val) is True, this evaluates -- to the number of the signal that caused the child process to stop. function WIFCONTINUED (Stat_Val : Status_Kind) return Boolean; -- True if status was returned for a child process that has -- continued from a job control stop. private package Unbounded_String_Vectors is new Ada.Containers.Vectors (Natural, Unbounded_String); type Request_Kind is (Terminate_Server, Spawn_1, Spawn_2, Spawn_3, Non_Blocking_Spawn_1, Non_Blocking_Spawn_2, Wait_Process, Waitpid); type Spawn_Request is record Id : Long_Integer := 0; Spawn_Type : Request_Kind := Spawn_1; Program_Name : Unbounded_String := Null_Unbounded_String; Args : Unbounded_String_Vectors.Vector := Unbounded_String_Vectors.Empty_Vector; Output_File : Unbounded_String := Null_Unbounded_String; Err_To_Out : Boolean := True; Version : Unbounded_String := To_Unbounded_String (Spawn_Manager.Version); Pid : Process_Id; Options : Wait_Options; end record; type Spawn_Response is record Success : Boolean; Return_Code : aliased Integer; Pid : Process_Id; Message : Unbounded_String := Null_Unbounded_String; end record; function Is_Exit_Message (Request : Spawn_Request) return Boolean; type Status_Kind is new Interfaces.Unsigned_32; Debug : Boolean := False; end Spawn_Manager;
libsrc/math/daimath32/c/asm/___dai32_xsin.asm
ahjelm/z88dk
640
95446
<filename>libsrc/math/daimath32/c/asm/___dai32_xsin.asm SECTION code_fp_dai32 PUBLIC ___dai32_xsin EXTERN xsin defc ___dai32_xsin = xsin
tools-src/gnu/gcc/gcc/ada/5vmastop.adb
enfoTek/tomato.linksys.e2000.nvram-mod
80
17871
<gh_stars>10-100 ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- SYSTEM.MACHINE_STATE_OPERATIONS -- -- -- -- B o d y -- -- (Version for Alpha/VMS) -- -- -- -- $Revision$ -- -- -- Copyright (C) 2001 Ada Core Technologies, 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 2, 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. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 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. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). -- -- -- ------------------------------------------------------------------------------ -- This version of System.Machine_State_Operations is for use on -- Alpha systems running VMS. with System.Memory; with System.Aux_DEC; use System.Aux_DEC; with Unchecked_Conversion; package body System.Machine_State_Operations is use System.Exceptions; subtype Cond_Value_Type is Unsigned_Longword; -- Record layouts copied from Starlet. type ICB_Fflags_Bits_Type is record Exception_Frame : Boolean; Ast_Frame : Boolean; Bottom_Of_Stack : Boolean; Base_Frame : Boolean; Filler_1 : Unsigned_20; end record; for ICB_Fflags_Bits_Type use record Exception_Frame at 0 range 0 .. 0; Ast_Frame at 0 range 1 .. 1; Bottom_Of_Stack at 0 range 2 .. 2; Base_Frame at 0 range 3 .. 3; Filler_1 at 0 range 4 .. 23; end record; for ICB_Fflags_Bits_Type'Size use 24; ICB_Fflags_Bits_Type_Init : constant ICB_Fflags_Bits_Type := (ExceptIon_Frame => False, Ast_Frame => False, Bottom_Of_STACK => False, Base_Frame => False, Filler_1 => 0); type ICB_Hdr_Quad_Type is record Context_Length : Unsigned_Longword; Fflags_Bits : ICB_Fflags_Bits_Type; Block_Version : Unsigned_Byte; end record; for ICB_Hdr_Quad_Type use record Context_Length at 0 range 0 .. 31; Fflags_Bits at 4 range 0 .. 23; Block_Version at 7 range 0 .. 7; end record; for ICB_Hdr_Quad_Type'Size use 64; ICB_Hdr_Quad_Type_Init : constant ICB_Hdr_Quad_Type := (Context_Length => 0, Fflags_Bits => ICB_Fflags_Bits_Type_Init, Block_Version => 0); type Invo_Context_Blk_Type is record -- -- The first quadword contains: -- o The length of the structure in bytes (a longword field) -- o The frame flags (a 3 byte field of bits) -- o The version number (a 1 byte field) -- Hdr_Quad : ICB_Hdr_Quad_Type; -- -- The address of the procedure descriptor for the procedure. -- Procedure_Descriptor : Unsigned_Quadword; -- -- The current PC of a given procedure invocation. -- Program_Counter : Integer_64; -- -- The current PS of a given procedure invocation. -- Processor_Status : Integer_64; -- -- The register contents areas. 31 for scalars, 31 for float. -- Ireg : Unsigned_Quadword_Array (0 .. 30); Freg : Unsigned_Quadword_Array (0 .. 30); -- -- The following is an "internal" area that's reserved for use by -- the operating system. It's size may vary over time. -- System_Defined : Unsigned_Quadword_Array (0 .. 1); ----Component(s) below are defined as comments since they ----overlap other fields ---- ----Chfctx_Addr : Unsigned_Quadword; -- -- Align to octaword. -- Filler_1 : String (1 .. 0); end record; for Invo_Context_Blk_Type use record Hdr_Quad at 0 range 0 .. 63; Procedure_Descriptor at 8 range 0 .. 63; Program_Counter at 16 range 0 .. 63; Processor_Status at 24 range 0 .. 63; Ireg at 32 range 0 .. 1983; Freg at 280 range 0 .. 1983; System_Defined at 528 range 0 .. 127; ----Component representation spec(s) below are defined as ----comments since they overlap other fields ---- ----Chfctx_Addr at 528 range 0 .. 63; Filler_1 at 544 range 0 .. -1; end record; for Invo_Context_Blk_Type'Size use 4352; Invo_Context_Blk_Type_Init : constant Invo_Context_Blk_Type := (Hdr_Quad => ICB_Hdr_Quad_Type_Init, Procedure_Descriptor => (0, 0), Program_Counter => 0, Processor_Status => 0, Ireg => (others => (0, 0)), Freg => (others => (0, 0)), System_Defined => (others => (0, 0)), Filler_1 => (others => ASCII.NUL)); subtype Invo_Handle_Type is Unsigned_Longword; type Invo_Handle_Access_Type is access all Invo_Handle_Type; function Fetch is new Fetch_From_Address (Code_Loc); function To_Invo_Handle_Access is new Unchecked_Conversion (Machine_State, Invo_Handle_Access_Type); function To_Machine_State is new Unchecked_Conversion (System.Address, Machine_State); function To_Code_Loc is new Unchecked_Conversion (Unsigned_Longword, Code_Loc); ---------------------------- -- Allocate_Machine_State -- ---------------------------- function Allocate_Machine_State return Machine_State is begin return To_Machine_State (Memory.Alloc (Invo_Handle_Type'Max_Size_In_Storage_Elements)); end Allocate_Machine_State; ------------------- -- Enter_Handler -- ------------------- procedure Enter_Handler (M : Machine_State; Handler : Handler_Loc) is procedure Get_Invo_Context ( Result : out Unsigned_Longword; -- return value Invo_Handle : in Invo_Handle_Type; Invo_Context : out Invo_Context_Blk_Type); pragma Interface (External, Get_Invo_Context); pragma Import_Valued_Procedure (Get_Invo_Context, "LIB$GET_INVO_CONTEXT", (Unsigned_Longword, Invo_Handle_Type, Invo_Context_Blk_Type), (Value, Value, Reference)); ICB : Invo_Context_Blk_Type; procedure Goto_Unwind ( Status : out Cond_Value_Type; -- return value Target_Invo : in Address := Address_Zero; Target_PC : in Address := Address_Zero; New_R0 : in Unsigned_Quadword := Unsigned_Quadword'Null_Parameter; New_R1 : in Unsigned_Quadword := Unsigned_Quadword'Null_Parameter); pragma Interface (External, Goto_Unwind); pragma Import_Valued_Procedure (Goto_Unwind, "SYS$GOTO_UNWIND", (Cond_Value_Type, Address, Address, Unsigned_Quadword, Unsigned_Quadword), (Value, Reference, Reference, Reference, Reference)); Status : Cond_Value_Type; begin Get_Invo_Context (Status, To_Invo_Handle_Access (M).all, ICB); Goto_Unwind (Status, System.Address (To_Invo_Handle_Access (M).all), Handler); end Enter_Handler; ---------------- -- Fetch_Code -- ---------------- function Fetch_Code (Loc : Code_Loc) return Code_Loc is begin -- The starting address is in the second longword pointed to by Loc. return Fetch (System.Aux_DEC."+" (Loc, 8)); end Fetch_Code; ------------------------ -- Free_Machine_State -- ------------------------ procedure Free_Machine_State (M : in out Machine_State) is procedure Gnat_Free (M : in Invo_Handle_Access_Type); pragma Import (C, Gnat_Free, "__gnat_free"); begin Gnat_Free (To_Invo_Handle_Access (M)); M := Machine_State (Null_Address); end Free_Machine_State; ------------------ -- Get_Code_Loc -- ------------------ function Get_Code_Loc (M : Machine_State) return Code_Loc is procedure Get_Invo_Context ( Result : out Unsigned_Longword; -- return value Invo_Handle : in Invo_Handle_Type; Invo_Context : out Invo_Context_Blk_Type); pragma Interface (External, Get_Invo_Context); pragma Import_Valued_Procedure (Get_Invo_Context, "LIB$GET_INVO_CONTEXT", (Unsigned_Longword, Invo_Handle_Type, Invo_Context_Blk_Type), (Value, Value, Reference)); Asm_Call_Size : constant := 4; -- Under VMS a call -- asm instruction takes 4 bytes. So we must remove this amount. ICB : Invo_Context_Blk_Type; Status : Cond_Value_Type; begin Get_Invo_Context (Status, To_Invo_Handle_Access (M).all, ICB); if (Status and 1) /= 1 then return Code_Loc (System.Null_Address); end if; return Code_Loc (ICB.Program_Counter - Asm_Call_Size); end Get_Code_Loc; -------------------------- -- Machine_State_Length -- -------------------------- function Machine_State_Length return System.Storage_Elements.Storage_Offset is use System.Storage_Elements; begin return Invo_Handle_Type'Size / 8; end Machine_State_Length; --------------- -- Pop_Frame -- --------------- procedure Pop_Frame (M : Machine_State; Info : Subprogram_Info_Type) is procedure Get_Prev_Invo_Handle ( Result : out Invo_Handle_Type; -- return value ICB : in Invo_Handle_Type); pragma Interface (External, Get_Prev_Invo_Handle); pragma Import_Valued_Procedure (Get_Prev_Invo_Handle, "LIB$GET_PREV_INVO_HANDLE", (Invo_Handle_Type, Invo_Handle_Type), (Value, Value)); Prev_Handle : aliased Invo_Handle_Type; begin Get_Prev_Invo_Handle (Prev_Handle, To_Invo_Handle_Access (M).all); To_Invo_Handle_Access (M).all := Prev_Handle; end Pop_Frame; ----------------------- -- Set_Machine_State -- ----------------------- procedure Set_Machine_State (M : Machine_State) is procedure Get_Curr_Invo_Context (Invo_Context : out Invo_Context_Blk_Type); pragma Interface (External, Get_Curr_Invo_Context); pragma Import_Valued_Procedure (Get_Curr_Invo_Context, "LIB$GET_CURR_INVO_CONTEXT", (Invo_Context_Blk_Type), (Reference)); procedure Get_Invo_Handle ( Result : out Invo_Handle_Type; -- return value Invo_Context : in Invo_Context_Blk_Type); pragma Interface (External, Get_Invo_Handle); pragma Import_Valued_Procedure (Get_Invo_Handle, "LIB$GET_INVO_HANDLE", (Invo_Handle_Type, Invo_Context_Blk_Type), (Value, Reference)); ICB : Invo_Context_Blk_Type; Invo_Handle : aliased Invo_Handle_Type; begin Get_Curr_Invo_Context (ICB); Get_Invo_Handle (Invo_Handle, ICB); To_Invo_Handle_Access (M).all := Invo_Handle; Pop_Frame (M, System.Null_Address); end Set_Machine_State; ------------------------------ -- Set_Signal_Machine_State -- ------------------------------ procedure Set_Signal_Machine_State (M : Machine_State; Context : System.Address) is begin null; end Set_Signal_Machine_State; end System.Machine_State_Operations;
user/ln.asm
DragonHole/xv6
0
171266
<filename>user/ln.asm user/_ln: 文件格式 elf64-littleriscv Disassembly of section .text: 0000000000000000 <main>: #include "kernel/stat.h" #include "user/user.h" int main(int argc, char *argv[]) { 0: 1101 addi sp,sp,-32 2: ec06 sd ra,24(sp) 4: e822 sd s0,16(sp) 6: e426 sd s1,8(sp) 8: 1000 addi s0,sp,32 if(argc != 3){ a: 478d li a5,3 c: 02f50063 beq a0,a5,2c <main+0x2c> fprintf(2, "Usage: ln old new\n"); 10: 00000597 auipc a1,0x0 14: 7e058593 addi a1,a1,2016 # 7f0 <malloc+0xec> 18: 4509 li a0,2 1a: 00000097 auipc ra,0x0 1e: 5fe080e7 jalr 1534(ra) # 618 <fprintf> exit(1); 22: 4505 li a0,1 24: 00000097 auipc ra,0x0 28: 2aa080e7 jalr 682(ra) # 2ce <exit> 2c: 84ae mv s1,a1 } if(link(argv[1], argv[2]) < 0) 2e: 698c ld a1,16(a1) 30: 6488 ld a0,8(s1) 32: 00000097 auipc ra,0x0 36: 2fc080e7 jalr 764(ra) # 32e <link> 3a: 00054763 bltz a0,48 <main+0x48> fprintf(2, "link %s %s: failed\n", argv[1], argv[2]); exit(0); 3e: 4501 li a0,0 40: 00000097 auipc ra,0x0 44: 28e080e7 jalr 654(ra) # 2ce <exit> fprintf(2, "link %s %s: failed\n", argv[1], argv[2]); 48: 6894 ld a3,16(s1) 4a: 6490 ld a2,8(s1) 4c: 00000597 auipc a1,0x0 50: 7bc58593 addi a1,a1,1980 # 808 <malloc+0x104> 54: 4509 li a0,2 56: 00000097 auipc ra,0x0 5a: 5c2080e7 jalr 1474(ra) # 618 <fprintf> 5e: b7c5 j 3e <main+0x3e> 0000000000000060 <strcpy>: #include "kernel/fcntl.h" #include "user/user.h" char* strcpy(char *s, const char *t) { 60: 1141 addi sp,sp,-16 62: e422 sd s0,8(sp) 64: 0800 addi s0,sp,16 char *os; os = s; while((*s++ = *t++) != 0) 66: 87aa mv a5,a0 68: 0585 addi a1,a1,1 6a: 0785 addi a5,a5,1 6c: fff5c703 lbu a4,-1(a1) 70: fee78fa3 sb a4,-1(a5) 74: fb75 bnez a4,68 <strcpy+0x8> ; return os; } 76: 6422 ld s0,8(sp) 78: 0141 addi sp,sp,16 7a: 8082 ret 000000000000007c <strcmp>: int strcmp(const char *p, const char *q) { 7c: 1141 addi sp,sp,-16 7e: e422 sd s0,8(sp) 80: 0800 addi s0,sp,16 while(*p && *p == *q) 82: 00054783 lbu a5,0(a0) 86: cb91 beqz a5,9a <strcmp+0x1e> 88: 0005c703 lbu a4,0(a1) 8c: 00f71763 bne a4,a5,9a <strcmp+0x1e> p++, q++; 90: 0505 addi a0,a0,1 92: 0585 addi a1,a1,1 while(*p && *p == *q) 94: 00054783 lbu a5,0(a0) 98: fbe5 bnez a5,88 <strcmp+0xc> return (uchar)*p - (uchar)*q; 9a: 0005c503 lbu a0,0(a1) } 9e: 40a7853b subw a0,a5,a0 a2: 6422 ld s0,8(sp) a4: 0141 addi sp,sp,16 a6: 8082 ret 00000000000000a8 <strlen>: uint strlen(const char *s) { a8: 1141 addi sp,sp,-16 aa: e422 sd s0,8(sp) ac: 0800 addi s0,sp,16 int n; for(n = 0; s[n]; n++) ae: 00054783 lbu a5,0(a0) b2: cf91 beqz a5,ce <strlen+0x26> b4: 0505 addi a0,a0,1 b6: 87aa mv a5,a0 b8: 4685 li a3,1 ba: 9e89 subw a3,a3,a0 bc: 00f6853b addw a0,a3,a5 c0: 0785 addi a5,a5,1 c2: fff7c703 lbu a4,-1(a5) c6: fb7d bnez a4,bc <strlen+0x14> ; return n; } c8: 6422 ld s0,8(sp) ca: 0141 addi sp,sp,16 cc: 8082 ret for(n = 0; s[n]; n++) ce: 4501 li a0,0 d0: bfe5 j c8 <strlen+0x20> 00000000000000d2 <memset>: void* memset(void *dst, int c, uint n) { d2: 1141 addi sp,sp,-16 d4: e422 sd s0,8(sp) d6: 0800 addi s0,sp,16 char *cdst = (char *) dst; int i; for(i = 0; i < n; i++){ d8: ca19 beqz a2,ee <memset+0x1c> da: 87aa mv a5,a0 dc: 1602 slli a2,a2,0x20 de: 9201 srli a2,a2,0x20 e0: 00a60733 add a4,a2,a0 cdst[i] = c; e4: 00b78023 sb a1,0(a5) for(i = 0; i < n; i++){ e8: 0785 addi a5,a5,1 ea: fee79de3 bne a5,a4,e4 <memset+0x12> } return dst; } ee: 6422 ld s0,8(sp) f0: 0141 addi sp,sp,16 f2: 8082 ret 00000000000000f4 <strchr>: char* strchr(const char *s, char c) { f4: 1141 addi sp,sp,-16 f6: e422 sd s0,8(sp) f8: 0800 addi s0,sp,16 for(; *s; s++) fa: 00054783 lbu a5,0(a0) fe: cb99 beqz a5,114 <strchr+0x20> if(*s == c) 100: 00f58763 beq a1,a5,10e <strchr+0x1a> for(; *s; s++) 104: 0505 addi a0,a0,1 106: 00054783 lbu a5,0(a0) 10a: fbfd bnez a5,100 <strchr+0xc> return (char*)s; return 0; 10c: 4501 li a0,0 } 10e: 6422 ld s0,8(sp) 110: 0141 addi sp,sp,16 112: 8082 ret return 0; 114: 4501 li a0,0 116: bfe5 j 10e <strchr+0x1a> 0000000000000118 <gets>: char* gets(char *buf, int max) { 118: 711d addi sp,sp,-96 11a: ec86 sd ra,88(sp) 11c: e8a2 sd s0,80(sp) 11e: e4a6 sd s1,72(sp) 120: e0ca sd s2,64(sp) 122: fc4e sd s3,56(sp) 124: f852 sd s4,48(sp) 126: f456 sd s5,40(sp) 128: f05a sd s6,32(sp) 12a: ec5e sd s7,24(sp) 12c: 1080 addi s0,sp,96 12e: 8baa mv s7,a0 130: 8a2e mv s4,a1 int i, cc; char c; for(i=0; i+1 < max; ){ 132: 892a mv s2,a0 134: 4481 li s1,0 cc = read(0, &c, 1); if(cc < 1) break; buf[i++] = c; if(c == '\n' || c == '\r') 136: 4aa9 li s5,10 138: 4b35 li s6,13 for(i=0; i+1 < max; ){ 13a: 89a6 mv s3,s1 13c: 2485 addiw s1,s1,1 13e: 0344d863 bge s1,s4,16e <gets+0x56> cc = read(0, &c, 1); 142: 4605 li a2,1 144: faf40593 addi a1,s0,-81 148: 4501 li a0,0 14a: 00000097 auipc ra,0x0 14e: 19c080e7 jalr 412(ra) # 2e6 <read> if(cc < 1) 152: 00a05e63 blez a0,16e <gets+0x56> buf[i++] = c; 156: faf44783 lbu a5,-81(s0) 15a: 00f90023 sb a5,0(s2) if(c == '\n' || c == '\r') 15e: 01578763 beq a5,s5,16c <gets+0x54> 162: 0905 addi s2,s2,1 164: fd679be3 bne a5,s6,13a <gets+0x22> for(i=0; i+1 < max; ){ 168: 89a6 mv s3,s1 16a: a011 j 16e <gets+0x56> 16c: 89a6 mv s3,s1 break; } buf[i] = '\0'; 16e: 99de add s3,s3,s7 170: 00098023 sb zero,0(s3) return buf; } 174: 855e mv a0,s7 176: 60e6 ld ra,88(sp) 178: 6446 ld s0,80(sp) 17a: 64a6 ld s1,72(sp) 17c: 6906 ld s2,64(sp) 17e: 79e2 ld s3,56(sp) 180: 7a42 ld s4,48(sp) 182: 7aa2 ld s5,40(sp) 184: 7b02 ld s6,32(sp) 186: 6be2 ld s7,24(sp) 188: 6125 addi sp,sp,96 18a: 8082 ret 000000000000018c <stat>: int stat(const char *n, struct stat *st) { 18c: 1101 addi sp,sp,-32 18e: ec06 sd ra,24(sp) 190: e822 sd s0,16(sp) 192: e426 sd s1,8(sp) 194: e04a sd s2,0(sp) 196: 1000 addi s0,sp,32 198: 892e mv s2,a1 int fd; int r; fd = open(n, O_RDONLY); 19a: 4581 li a1,0 19c: 00000097 auipc ra,0x0 1a0: 172080e7 jalr 370(ra) # 30e <open> if(fd < 0) 1a4: 02054563 bltz a0,1ce <stat+0x42> 1a8: 84aa mv s1,a0 return -1; r = fstat(fd, st); 1aa: 85ca mv a1,s2 1ac: 00000097 auipc ra,0x0 1b0: 17a080e7 jalr 378(ra) # 326 <fstat> 1b4: 892a mv s2,a0 close(fd); 1b6: 8526 mv a0,s1 1b8: 00000097 auipc ra,0x0 1bc: 13e080e7 jalr 318(ra) # 2f6 <close> return r; } 1c0: 854a mv a0,s2 1c2: 60e2 ld ra,24(sp) 1c4: 6442 ld s0,16(sp) 1c6: 64a2 ld s1,8(sp) 1c8: 6902 ld s2,0(sp) 1ca: 6105 addi sp,sp,32 1cc: 8082 ret return -1; 1ce: 597d li s2,-1 1d0: bfc5 j 1c0 <stat+0x34> 00000000000001d2 <atoi>: int atoi(const char *s) { 1d2: 1141 addi sp,sp,-16 1d4: e422 sd s0,8(sp) 1d6: 0800 addi s0,sp,16 int n; n = 0; while('0' <= *s && *s <= '9') 1d8: 00054603 lbu a2,0(a0) 1dc: fd06079b addiw a5,a2,-48 1e0: 0ff7f793 andi a5,a5,255 1e4: 4725 li a4,9 1e6: 02f76963 bltu a4,a5,218 <atoi+0x46> 1ea: 86aa mv a3,a0 n = 0; 1ec: 4501 li a0,0 while('0' <= *s && *s <= '9') 1ee: 45a5 li a1,9 n = n*10 + *s++ - '0'; 1f0: 0685 addi a3,a3,1 1f2: 0025179b slliw a5,a0,0x2 1f6: 9fa9 addw a5,a5,a0 1f8: 0017979b slliw a5,a5,0x1 1fc: 9fb1 addw a5,a5,a2 1fe: fd07851b addiw a0,a5,-48 while('0' <= *s && *s <= '9') 202: 0006c603 lbu a2,0(a3) 206: fd06071b addiw a4,a2,-48 20a: 0ff77713 andi a4,a4,255 20e: fee5f1e3 bgeu a1,a4,1f0 <atoi+0x1e> return n; } 212: 6422 ld s0,8(sp) 214: 0141 addi sp,sp,16 216: 8082 ret n = 0; 218: 4501 li a0,0 21a: bfe5 j 212 <atoi+0x40> 000000000000021c <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 21c: 1141 addi sp,sp,-16 21e: e422 sd s0,8(sp) 220: 0800 addi s0,sp,16 char *dst; const char *src; dst = vdst; src = vsrc; if (src > dst) { 222: 02b57463 bgeu a0,a1,24a <memmove+0x2e> while(n-- > 0) 226: 00c05f63 blez a2,244 <memmove+0x28> 22a: 1602 slli a2,a2,0x20 22c: 9201 srli a2,a2,0x20 22e: 00c507b3 add a5,a0,a2 dst = vdst; 232: 872a mv a4,a0 *dst++ = *src++; 234: 0585 addi a1,a1,1 236: 0705 addi a4,a4,1 238: fff5c683 lbu a3,-1(a1) 23c: fed70fa3 sb a3,-1(a4) while(n-- > 0) 240: fee79ae3 bne a5,a4,234 <memmove+0x18> src += n; while(n-- > 0) *--dst = *--src; } return vdst; } 244: 6422 ld s0,8(sp) 246: 0141 addi sp,sp,16 248: 8082 ret dst += n; 24a: 00c50733 add a4,a0,a2 src += n; 24e: 95b2 add a1,a1,a2 while(n-- > 0) 250: fec05ae3 blez a2,244 <memmove+0x28> 254: fff6079b addiw a5,a2,-1 258: 1782 slli a5,a5,0x20 25a: 9381 srli a5,a5,0x20 25c: fff7c793 not a5,a5 260: 97ba add a5,a5,a4 *--dst = *--src; 262: 15fd addi a1,a1,-1 264: 177d addi a4,a4,-1 266: 0005c683 lbu a3,0(a1) 26a: 00d70023 sb a3,0(a4) while(n-- > 0) 26e: fee79ae3 bne a5,a4,262 <memmove+0x46> 272: bfc9 j 244 <memmove+0x28> 0000000000000274 <memcmp>: int memcmp(const void *s1, const void *s2, uint n) { 274: 1141 addi sp,sp,-16 276: e422 sd s0,8(sp) 278: 0800 addi s0,sp,16 const char *p1 = s1, *p2 = s2; while (n-- > 0) { 27a: ca05 beqz a2,2aa <memcmp+0x36> 27c: fff6069b addiw a3,a2,-1 280: 1682 slli a3,a3,0x20 282: 9281 srli a3,a3,0x20 284: 0685 addi a3,a3,1 286: 96aa add a3,a3,a0 if (*p1 != *p2) { 288: 00054783 lbu a5,0(a0) 28c: 0005c703 lbu a4,0(a1) 290: 00e79863 bne a5,a4,2a0 <memcmp+0x2c> return *p1 - *p2; } p1++; 294: 0505 addi a0,a0,1 p2++; 296: 0585 addi a1,a1,1 while (n-- > 0) { 298: fed518e3 bne a0,a3,288 <memcmp+0x14> } return 0; 29c: 4501 li a0,0 29e: a019 j 2a4 <memcmp+0x30> return *p1 - *p2; 2a0: 40e7853b subw a0,a5,a4 } 2a4: 6422 ld s0,8(sp) 2a6: 0141 addi sp,sp,16 2a8: 8082 ret return 0; 2aa: 4501 li a0,0 2ac: bfe5 j 2a4 <memcmp+0x30> 00000000000002ae <memcpy>: void * memcpy(void *dst, const void *src, uint n) { 2ae: 1141 addi sp,sp,-16 2b0: e406 sd ra,8(sp) 2b2: e022 sd s0,0(sp) 2b4: 0800 addi s0,sp,16 return memmove(dst, src, n); 2b6: 00000097 auipc ra,0x0 2ba: f66080e7 jalr -154(ra) # 21c <memmove> } 2be: 60a2 ld ra,8(sp) 2c0: 6402 ld s0,0(sp) 2c2: 0141 addi sp,sp,16 2c4: 8082 ret 00000000000002c6 <fork>: # generated by usys.pl - do not edit #include "kernel/syscall.h" .global fork fork: li a7, SYS_fork 2c6: 4885 li a7,1 ecall 2c8: 00000073 ecall ret 2cc: 8082 ret 00000000000002ce <exit>: .global exit exit: li a7, SYS_exit 2ce: 4889 li a7,2 ecall 2d0: 00000073 ecall ret 2d4: 8082 ret 00000000000002d6 <wait>: .global wait wait: li a7, SYS_wait 2d6: 488d li a7,3 ecall 2d8: 00000073 ecall ret 2dc: 8082 ret 00000000000002de <pipe>: .global pipe pipe: li a7, SYS_pipe 2de: 4891 li a7,4 ecall 2e0: 00000073 ecall ret 2e4: 8082 ret 00000000000002e6 <read>: .global read read: li a7, SYS_read 2e6: 4895 li a7,5 ecall 2e8: 00000073 ecall ret 2ec: 8082 ret 00000000000002ee <write>: .global write write: li a7, SYS_write 2ee: 48c1 li a7,16 ecall 2f0: 00000073 ecall ret 2f4: 8082 ret 00000000000002f6 <close>: .global close close: li a7, SYS_close 2f6: 48d5 li a7,21 ecall 2f8: 00000073 ecall ret 2fc: 8082 ret 00000000000002fe <kill>: .global kill kill: li a7, SYS_kill 2fe: 4899 li a7,6 ecall 300: 00000073 ecall ret 304: 8082 ret 0000000000000306 <exec>: .global exec exec: li a7, SYS_exec 306: 489d li a7,7 ecall 308: 00000073 ecall ret 30c: 8082 ret 000000000000030e <open>: .global open open: li a7, SYS_open 30e: 48bd li a7,15 ecall 310: 00000073 ecall ret 314: 8082 ret 0000000000000316 <mknod>: .global mknod mknod: li a7, SYS_mknod 316: 48c5 li a7,17 ecall 318: 00000073 ecall ret 31c: 8082 ret 000000000000031e <unlink>: .global unlink unlink: li a7, SYS_unlink 31e: 48c9 li a7,18 ecall 320: 00000073 ecall ret 324: 8082 ret 0000000000000326 <fstat>: .global fstat fstat: li a7, SYS_fstat 326: 48a1 li a7,8 ecall 328: 00000073 ecall ret 32c: 8082 ret 000000000000032e <link>: .global link link: li a7, SYS_link 32e: 48cd li a7,19 ecall 330: 00000073 ecall ret 334: 8082 ret 0000000000000336 <mkdir>: .global mkdir mkdir: li a7, SYS_mkdir 336: 48d1 li a7,20 ecall 338: 00000073 ecall ret 33c: 8082 ret 000000000000033e <chdir>: .global chdir chdir: li a7, SYS_chdir 33e: 48a5 li a7,9 ecall 340: 00000073 ecall ret 344: 8082 ret 0000000000000346 <dup>: .global dup dup: li a7, SYS_dup 346: 48a9 li a7,10 ecall 348: 00000073 ecall ret 34c: 8082 ret 000000000000034e <getpid>: .global getpid getpid: li a7, SYS_getpid 34e: 48ad li a7,11 ecall 350: 00000073 ecall ret 354: 8082 ret 0000000000000356 <sbrk>: .global sbrk sbrk: li a7, SYS_sbrk 356: 48b1 li a7,12 ecall 358: 00000073 ecall ret 35c: 8082 ret 000000000000035e <sleep>: .global sleep sleep: li a7, SYS_sleep 35e: 48b5 li a7,13 ecall 360: 00000073 ecall ret 364: 8082 ret 0000000000000366 <uptime>: .global uptime uptime: li a7, SYS_uptime 366: 48b9 li a7,14 ecall 368: 00000073 ecall ret 36c: 8082 ret 000000000000036e <putc>: static char digits[] = "0123456789ABCDEF"; static void putc(int fd, char c) { 36e: 1101 addi sp,sp,-32 370: ec06 sd ra,24(sp) 372: e822 sd s0,16(sp) 374: 1000 addi s0,sp,32 376: feb407a3 sb a1,-17(s0) write(fd, &c, 1); 37a: 4605 li a2,1 37c: fef40593 addi a1,s0,-17 380: 00000097 auipc ra,0x0 384: f6e080e7 jalr -146(ra) # 2ee <write> } 388: 60e2 ld ra,24(sp) 38a: 6442 ld s0,16(sp) 38c: 6105 addi sp,sp,32 38e: 8082 ret 0000000000000390 <printint>: static void printint(int fd, int xx, int base, int sgn) { 390: 7139 addi sp,sp,-64 392: fc06 sd ra,56(sp) 394: f822 sd s0,48(sp) 396: f426 sd s1,40(sp) 398: f04a sd s2,32(sp) 39a: ec4e sd s3,24(sp) 39c: 0080 addi s0,sp,64 39e: 84aa mv s1,a0 char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 3a0: c299 beqz a3,3a6 <printint+0x16> 3a2: 0805c863 bltz a1,432 <printint+0xa2> neg = 1; x = -xx; } else { x = xx; 3a6: 2581 sext.w a1,a1 neg = 0; 3a8: 4881 li a7,0 3aa: fc040693 addi a3,s0,-64 } i = 0; 3ae: 4701 li a4,0 do{ buf[i++] = digits[x % base]; 3b0: 2601 sext.w a2,a2 3b2: 00000517 auipc a0,0x0 3b6: 47650513 addi a0,a0,1142 # 828 <digits> 3ba: 883a mv a6,a4 3bc: 2705 addiw a4,a4,1 3be: 02c5f7bb remuw a5,a1,a2 3c2: 1782 slli a5,a5,0x20 3c4: 9381 srli a5,a5,0x20 3c6: 97aa add a5,a5,a0 3c8: 0007c783 lbu a5,0(a5) 3cc: 00f68023 sb a5,0(a3) }while((x /= base) != 0); 3d0: 0005879b sext.w a5,a1 3d4: 02c5d5bb divuw a1,a1,a2 3d8: 0685 addi a3,a3,1 3da: fec7f0e3 bgeu a5,a2,3ba <printint+0x2a> if(neg) 3de: 00088b63 beqz a7,3f4 <printint+0x64> buf[i++] = '-'; 3e2: fd040793 addi a5,s0,-48 3e6: 973e add a4,a4,a5 3e8: 02d00793 li a5,45 3ec: fef70823 sb a5,-16(a4) 3f0: 0028071b addiw a4,a6,2 while(--i >= 0) 3f4: 02e05863 blez a4,424 <printint+0x94> 3f8: fc040793 addi a5,s0,-64 3fc: 00e78933 add s2,a5,a4 400: fff78993 addi s3,a5,-1 404: 99ba add s3,s3,a4 406: 377d addiw a4,a4,-1 408: 1702 slli a4,a4,0x20 40a: 9301 srli a4,a4,0x20 40c: 40e989b3 sub s3,s3,a4 putc(fd, buf[i]); 410: fff94583 lbu a1,-1(s2) 414: 8526 mv a0,s1 416: 00000097 auipc ra,0x0 41a: f58080e7 jalr -168(ra) # 36e <putc> while(--i >= 0) 41e: 197d addi s2,s2,-1 420: ff3918e3 bne s2,s3,410 <printint+0x80> } 424: 70e2 ld ra,56(sp) 426: 7442 ld s0,48(sp) 428: 74a2 ld s1,40(sp) 42a: 7902 ld s2,32(sp) 42c: 69e2 ld s3,24(sp) 42e: 6121 addi sp,sp,64 430: 8082 ret x = -xx; 432: 40b005bb negw a1,a1 neg = 1; 436: 4885 li a7,1 x = -xx; 438: bf8d j 3aa <printint+0x1a> 000000000000043a <vprintf>: } // Print to the given fd. Only understands %d, %x, %p, %s. void vprintf(int fd, const char *fmt, va_list ap) { 43a: 7119 addi sp,sp,-128 43c: fc86 sd ra,120(sp) 43e: f8a2 sd s0,112(sp) 440: f4a6 sd s1,104(sp) 442: f0ca sd s2,96(sp) 444: ecce sd s3,88(sp) 446: e8d2 sd s4,80(sp) 448: e4d6 sd s5,72(sp) 44a: e0da sd s6,64(sp) 44c: fc5e sd s7,56(sp) 44e: f862 sd s8,48(sp) 450: f466 sd s9,40(sp) 452: f06a sd s10,32(sp) 454: ec6e sd s11,24(sp) 456: 0100 addi s0,sp,128 char *s; int c, i, state; state = 0; for(i = 0; fmt[i]; i++){ 458: 0005c903 lbu s2,0(a1) 45c: 18090f63 beqz s2,5fa <vprintf+0x1c0> 460: 8aaa mv s5,a0 462: 8b32 mv s6,a2 464: 00158493 addi s1,a1,1 state = 0; 468: 4981 li s3,0 if(c == '%'){ state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 46a: 02500a13 li s4,37 if(c == 'd'){ 46e: 06400c13 li s8,100 printint(fd, va_arg(ap, int), 10, 1); } else if(c == 'l') { 472: 06c00c93 li s9,108 printint(fd, va_arg(ap, uint64), 10, 0); } else if(c == 'x') { 476: 07800d13 li s10,120 printint(fd, va_arg(ap, int), 16, 0); } else if(c == 'p') { 47a: 07000d93 li s11,112 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 47e: 00000b97 auipc s7,0x0 482: 3aab8b93 addi s7,s7,938 # 828 <digits> 486: a839 j 4a4 <vprintf+0x6a> putc(fd, c); 488: 85ca mv a1,s2 48a: 8556 mv a0,s5 48c: 00000097 auipc ra,0x0 490: ee2080e7 jalr -286(ra) # 36e <putc> 494: a019 j 49a <vprintf+0x60> } else if(state == '%'){ 496: 01498f63 beq s3,s4,4b4 <vprintf+0x7a> for(i = 0; fmt[i]; i++){ 49a: 0485 addi s1,s1,1 49c: fff4c903 lbu s2,-1(s1) 4a0: 14090d63 beqz s2,5fa <vprintf+0x1c0> c = fmt[i] & 0xff; 4a4: 0009079b sext.w a5,s2 if(state == 0){ 4a8: fe0997e3 bnez s3,496 <vprintf+0x5c> if(c == '%'){ 4ac: fd479ee3 bne a5,s4,488 <vprintf+0x4e> state = '%'; 4b0: 89be mv s3,a5 4b2: b7e5 j 49a <vprintf+0x60> if(c == 'd'){ 4b4: 05878063 beq a5,s8,4f4 <vprintf+0xba> } else if(c == 'l') { 4b8: 05978c63 beq a5,s9,510 <vprintf+0xd6> } else if(c == 'x') { 4bc: 07a78863 beq a5,s10,52c <vprintf+0xf2> } else if(c == 'p') { 4c0: 09b78463 beq a5,s11,548 <vprintf+0x10e> printptr(fd, va_arg(ap, uint64)); } else if(c == 's'){ 4c4: 07300713 li a4,115 4c8: 0ce78663 beq a5,a4,594 <vprintf+0x15a> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 4cc: 06300713 li a4,99 4d0: 0ee78e63 beq a5,a4,5cc <vprintf+0x192> putc(fd, va_arg(ap, uint)); } else if(c == '%'){ 4d4: 11478863 beq a5,s4,5e4 <vprintf+0x1aa> putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 4d8: 85d2 mv a1,s4 4da: 8556 mv a0,s5 4dc: 00000097 auipc ra,0x0 4e0: e92080e7 jalr -366(ra) # 36e <putc> putc(fd, c); 4e4: 85ca mv a1,s2 4e6: 8556 mv a0,s5 4e8: 00000097 auipc ra,0x0 4ec: e86080e7 jalr -378(ra) # 36e <putc> } state = 0; 4f0: 4981 li s3,0 4f2: b765 j 49a <vprintf+0x60> printint(fd, va_arg(ap, int), 10, 1); 4f4: 008b0913 addi s2,s6,8 4f8: 4685 li a3,1 4fa: 4629 li a2,10 4fc: 000b2583 lw a1,0(s6) 500: 8556 mv a0,s5 502: 00000097 auipc ra,0x0 506: e8e080e7 jalr -370(ra) # 390 <printint> 50a: 8b4a mv s6,s2 state = 0; 50c: 4981 li s3,0 50e: b771 j 49a <vprintf+0x60> printint(fd, va_arg(ap, uint64), 10, 0); 510: 008b0913 addi s2,s6,8 514: 4681 li a3,0 516: 4629 li a2,10 518: 000b2583 lw a1,0(s6) 51c: 8556 mv a0,s5 51e: 00000097 auipc ra,0x0 522: e72080e7 jalr -398(ra) # 390 <printint> 526: 8b4a mv s6,s2 state = 0; 528: 4981 li s3,0 52a: bf85 j 49a <vprintf+0x60> printint(fd, va_arg(ap, int), 16, 0); 52c: 008b0913 addi s2,s6,8 530: 4681 li a3,0 532: 4641 li a2,16 534: 000b2583 lw a1,0(s6) 538: 8556 mv a0,s5 53a: 00000097 auipc ra,0x0 53e: e56080e7 jalr -426(ra) # 390 <printint> 542: 8b4a mv s6,s2 state = 0; 544: 4981 li s3,0 546: bf91 j 49a <vprintf+0x60> printptr(fd, va_arg(ap, uint64)); 548: 008b0793 addi a5,s6,8 54c: f8f43423 sd a5,-120(s0) 550: 000b3983 ld s3,0(s6) putc(fd, '0'); 554: 03000593 li a1,48 558: 8556 mv a0,s5 55a: 00000097 auipc ra,0x0 55e: e14080e7 jalr -492(ra) # 36e <putc> putc(fd, 'x'); 562: 85ea mv a1,s10 564: 8556 mv a0,s5 566: 00000097 auipc ra,0x0 56a: e08080e7 jalr -504(ra) # 36e <putc> 56e: 4941 li s2,16 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 570: 03c9d793 srli a5,s3,0x3c 574: 97de add a5,a5,s7 576: 0007c583 lbu a1,0(a5) 57a: 8556 mv a0,s5 57c: 00000097 auipc ra,0x0 580: df2080e7 jalr -526(ra) # 36e <putc> for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) 584: 0992 slli s3,s3,0x4 586: 397d addiw s2,s2,-1 588: fe0914e3 bnez s2,570 <vprintf+0x136> printptr(fd, va_arg(ap, uint64)); 58c: f8843b03 ld s6,-120(s0) state = 0; 590: 4981 li s3,0 592: b721 j 49a <vprintf+0x60> s = va_arg(ap, char*); 594: 008b0993 addi s3,s6,8 598: 000b3903 ld s2,0(s6) if(s == 0) 59c: 02090163 beqz s2,5be <vprintf+0x184> while(*s != 0){ 5a0: 00094583 lbu a1,0(s2) 5a4: c9a1 beqz a1,5f4 <vprintf+0x1ba> putc(fd, *s); 5a6: 8556 mv a0,s5 5a8: 00000097 auipc ra,0x0 5ac: dc6080e7 jalr -570(ra) # 36e <putc> s++; 5b0: 0905 addi s2,s2,1 while(*s != 0){ 5b2: 00094583 lbu a1,0(s2) 5b6: f9e5 bnez a1,5a6 <vprintf+0x16c> s = va_arg(ap, char*); 5b8: 8b4e mv s6,s3 state = 0; 5ba: 4981 li s3,0 5bc: bdf9 j 49a <vprintf+0x60> s = "(null)"; 5be: 00000917 auipc s2,0x0 5c2: 26290913 addi s2,s2,610 # 820 <malloc+0x11c> while(*s != 0){ 5c6: 02800593 li a1,40 5ca: bff1 j 5a6 <vprintf+0x16c> putc(fd, va_arg(ap, uint)); 5cc: 008b0913 addi s2,s6,8 5d0: 000b4583 lbu a1,0(s6) 5d4: 8556 mv a0,s5 5d6: 00000097 auipc ra,0x0 5da: d98080e7 jalr -616(ra) # 36e <putc> 5de: 8b4a mv s6,s2 state = 0; 5e0: 4981 li s3,0 5e2: bd65 j 49a <vprintf+0x60> putc(fd, c); 5e4: 85d2 mv a1,s4 5e6: 8556 mv a0,s5 5e8: 00000097 auipc ra,0x0 5ec: d86080e7 jalr -634(ra) # 36e <putc> state = 0; 5f0: 4981 li s3,0 5f2: b565 j 49a <vprintf+0x60> s = va_arg(ap, char*); 5f4: 8b4e mv s6,s3 state = 0; 5f6: 4981 li s3,0 5f8: b54d j 49a <vprintf+0x60> } } } 5fa: 70e6 ld ra,120(sp) 5fc: 7446 ld s0,112(sp) 5fe: 74a6 ld s1,104(sp) 600: 7906 ld s2,96(sp) 602: 69e6 ld s3,88(sp) 604: 6a46 ld s4,80(sp) 606: 6aa6 ld s5,72(sp) 608: 6b06 ld s6,64(sp) 60a: 7be2 ld s7,56(sp) 60c: 7c42 ld s8,48(sp) 60e: 7ca2 ld s9,40(sp) 610: 7d02 ld s10,32(sp) 612: 6de2 ld s11,24(sp) 614: 6109 addi sp,sp,128 616: 8082 ret 0000000000000618 <fprintf>: void fprintf(int fd, const char *fmt, ...) { 618: 715d addi sp,sp,-80 61a: ec06 sd ra,24(sp) 61c: e822 sd s0,16(sp) 61e: 1000 addi s0,sp,32 620: e010 sd a2,0(s0) 622: e414 sd a3,8(s0) 624: e818 sd a4,16(s0) 626: ec1c sd a5,24(s0) 628: 03043023 sd a6,32(s0) 62c: 03143423 sd a7,40(s0) va_list ap; va_start(ap, fmt); 630: fe843423 sd s0,-24(s0) vprintf(fd, fmt, ap); 634: 8622 mv a2,s0 636: 00000097 auipc ra,0x0 63a: e04080e7 jalr -508(ra) # 43a <vprintf> } 63e: 60e2 ld ra,24(sp) 640: 6442 ld s0,16(sp) 642: 6161 addi sp,sp,80 644: 8082 ret 0000000000000646 <printf>: void printf(const char *fmt, ...) { 646: 711d addi sp,sp,-96 648: ec06 sd ra,24(sp) 64a: e822 sd s0,16(sp) 64c: 1000 addi s0,sp,32 64e: e40c sd a1,8(s0) 650: e810 sd a2,16(s0) 652: ec14 sd a3,24(s0) 654: f018 sd a4,32(s0) 656: f41c sd a5,40(s0) 658: 03043823 sd a6,48(s0) 65c: 03143c23 sd a7,56(s0) va_list ap; va_start(ap, fmt); 660: 00840613 addi a2,s0,8 664: fec43423 sd a2,-24(s0) vprintf(1, fmt, ap); 668: 85aa mv a1,a0 66a: 4505 li a0,1 66c: 00000097 auipc ra,0x0 670: dce080e7 jalr -562(ra) # 43a <vprintf> } 674: 60e2 ld ra,24(sp) 676: 6442 ld s0,16(sp) 678: 6125 addi sp,sp,96 67a: 8082 ret 000000000000067c <free>: static Header base; static Header *freep; void free(void *ap) { 67c: 1141 addi sp,sp,-16 67e: e422 sd s0,8(sp) 680: 0800 addi s0,sp,16 Header *bp, *p; bp = (Header*)ap - 1; 682: ff050693 addi a3,a0,-16 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 686: 00000797 auipc a5,0x0 68a: 1ba7b783 ld a5,442(a5) # 840 <freep> 68e: a805 j 6be <free+0x42> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ bp->s.size += p->s.ptr->s.size; 690: 4618 lw a4,8(a2) 692: 9db9 addw a1,a1,a4 694: feb52c23 sw a1,-8(a0) bp->s.ptr = p->s.ptr->s.ptr; 698: 6398 ld a4,0(a5) 69a: 6318 ld a4,0(a4) 69c: fee53823 sd a4,-16(a0) 6a0: a091 j 6e4 <free+0x68> } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ p->s.size += bp->s.size; 6a2: ff852703 lw a4,-8(a0) 6a6: 9e39 addw a2,a2,a4 6a8: c790 sw a2,8(a5) p->s.ptr = bp->s.ptr; 6aa: ff053703 ld a4,-16(a0) 6ae: e398 sd a4,0(a5) 6b0: a099 j 6f6 <free+0x7a> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6b2: 6398 ld a4,0(a5) 6b4: 00e7e463 bltu a5,a4,6bc <free+0x40> 6b8: 00e6ea63 bltu a3,a4,6cc <free+0x50> { 6bc: 87ba mv a5,a4 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 6be: fed7fae3 bgeu a5,a3,6b2 <free+0x36> 6c2: 6398 ld a4,0(a5) 6c4: 00e6e463 bltu a3,a4,6cc <free+0x50> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 6c8: fee7eae3 bltu a5,a4,6bc <free+0x40> if(bp + bp->s.size == p->s.ptr){ 6cc: ff852583 lw a1,-8(a0) 6d0: 6390 ld a2,0(a5) 6d2: 02059813 slli a6,a1,0x20 6d6: 01c85713 srli a4,a6,0x1c 6da: 9736 add a4,a4,a3 6dc: fae60ae3 beq a2,a4,690 <free+0x14> bp->s.ptr = p->s.ptr; 6e0: fec53823 sd a2,-16(a0) if(p + p->s.size == bp){ 6e4: 4790 lw a2,8(a5) 6e6: 02061593 slli a1,a2,0x20 6ea: 01c5d713 srli a4,a1,0x1c 6ee: 973e add a4,a4,a5 6f0: fae689e3 beq a3,a4,6a2 <free+0x26> } else p->s.ptr = bp; 6f4: e394 sd a3,0(a5) freep = p; 6f6: 00000717 auipc a4,0x0 6fa: 14f73523 sd a5,330(a4) # 840 <freep> } 6fe: 6422 ld s0,8(sp) 700: 0141 addi sp,sp,16 702: 8082 ret 0000000000000704 <malloc>: return freep; } void* malloc(uint nbytes) { 704: 7139 addi sp,sp,-64 706: fc06 sd ra,56(sp) 708: f822 sd s0,48(sp) 70a: f426 sd s1,40(sp) 70c: f04a sd s2,32(sp) 70e: ec4e sd s3,24(sp) 710: e852 sd s4,16(sp) 712: e456 sd s5,8(sp) 714: e05a sd s6,0(sp) 716: 0080 addi s0,sp,64 Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 718: 02051493 slli s1,a0,0x20 71c: 9081 srli s1,s1,0x20 71e: 04bd addi s1,s1,15 720: 8091 srli s1,s1,0x4 722: 0014899b addiw s3,s1,1 726: 0485 addi s1,s1,1 if((prevp = freep) == 0){ 728: 00000517 auipc a0,0x0 72c: 11853503 ld a0,280(a0) # 840 <freep> 730: c515 beqz a0,75c <malloc+0x58> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 732: 611c ld a5,0(a0) if(p->s.size >= nunits){ 734: 4798 lw a4,8(a5) 736: 02977f63 bgeu a4,s1,774 <malloc+0x70> 73a: 8a4e mv s4,s3 73c: 0009871b sext.w a4,s3 740: 6685 lui a3,0x1 742: 00d77363 bgeu a4,a3,748 <malloc+0x44> 746: 6a05 lui s4,0x1 748: 000a0b1b sext.w s6,s4 p = sbrk(nu * sizeof(Header)); 74c: 004a1a1b slliw s4,s4,0x4 p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 750: 00000917 auipc s2,0x0 754: 0f090913 addi s2,s2,240 # 840 <freep> if(p == (char*)-1) 758: 5afd li s5,-1 75a: a895 j 7ce <malloc+0xca> base.s.ptr = freep = prevp = &base; 75c: 00000797 auipc a5,0x0 760: 0ec78793 addi a5,a5,236 # 848 <base> 764: 00000717 auipc a4,0x0 768: 0cf73e23 sd a5,220(a4) # 840 <freep> 76c: e39c sd a5,0(a5) base.s.size = 0; 76e: 0007a423 sw zero,8(a5) if(p->s.size >= nunits){ 772: b7e1 j 73a <malloc+0x36> if(p->s.size == nunits) 774: 02e48c63 beq s1,a4,7ac <malloc+0xa8> p->s.size -= nunits; 778: 4137073b subw a4,a4,s3 77c: c798 sw a4,8(a5) p += p->s.size; 77e: 02071693 slli a3,a4,0x20 782: 01c6d713 srli a4,a3,0x1c 786: 97ba add a5,a5,a4 p->s.size = nunits; 788: 0137a423 sw s3,8(a5) freep = prevp; 78c: 00000717 auipc a4,0x0 790: 0aa73a23 sd a0,180(a4) # 840 <freep> return (void*)(p + 1); 794: 01078513 addi a0,a5,16 if((p = morecore(nunits)) == 0) return 0; } } 798: 70e2 ld ra,56(sp) 79a: 7442 ld s0,48(sp) 79c: 74a2 ld s1,40(sp) 79e: 7902 ld s2,32(sp) 7a0: 69e2 ld s3,24(sp) 7a2: 6a42 ld s4,16(sp) 7a4: 6aa2 ld s5,8(sp) 7a6: 6b02 ld s6,0(sp) 7a8: 6121 addi sp,sp,64 7aa: 8082 ret prevp->s.ptr = p->s.ptr; 7ac: 6398 ld a4,0(a5) 7ae: e118 sd a4,0(a0) 7b0: bff1 j 78c <malloc+0x88> hp->s.size = nu; 7b2: 01652423 sw s6,8(a0) free((void*)(hp + 1)); 7b6: 0541 addi a0,a0,16 7b8: 00000097 auipc ra,0x0 7bc: ec4080e7 jalr -316(ra) # 67c <free> return freep; 7c0: 00093503 ld a0,0(s2) if((p = morecore(nunits)) == 0) 7c4: d971 beqz a0,798 <malloc+0x94> for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7c6: 611c ld a5,0(a0) if(p->s.size >= nunits){ 7c8: 4798 lw a4,8(a5) 7ca: fa9775e3 bgeu a4,s1,774 <malloc+0x70> if(p == freep) 7ce: 00093703 ld a4,0(s2) 7d2: 853e mv a0,a5 7d4: fef719e3 bne a4,a5,7c6 <malloc+0xc2> p = sbrk(nu * sizeof(Header)); 7d8: 8552 mv a0,s4 7da: 00000097 auipc ra,0x0 7de: b7c080e7 jalr -1156(ra) # 356 <sbrk> if(p == (char*)-1) 7e2: fd5518e3 bne a0,s5,7b2 <malloc+0xae> return 0; 7e6: 4501 li a0,0 7e8: bf45 j 798 <malloc+0x94>
programs/oeis/193/A193656.asm
karttu/loda
0
24569
; A193656: Q-residue of the triangle p(n,k)=(2^(n - k))*5^k, 0<=k<=n, where Q is the triangular array (t(i,j)) given by t(i,j)=1. (See Comments.) ; 1,7,43,247,1363,7327,38683,201607,1040803,5335087,27199723,138095767,698867443,3527891647,17773675963,89405250727,449173737283,2254458621007,11306652843403,56670703170487,283903271666323 mul $0,2 mov $1,1 mov $2,1 lpb $0,1 sub $0,2 add $1,$2 mul $1,5 mul $2,4 lpe add $1,$2 div $1,12 mul $1,6 add $1,1
source/s-forflo.adb
ytomino/drake
33
1296
with System.Long_Long_Float_Types; package body System.Formatting.Float is pragma Suppress (All_Checks); use type Long_Long_Integer_Types.Word_Unsigned; subtype Word_Unsigned is Long_Long_Integer_Types.Word_Unsigned; function modfl (value : Long_Long_Float; iptr : access Long_Long_Float) return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_modfl"; function roundl (X : Long_Long_Float) return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_roundl"; function truncl (X : Long_Long_Float) return Long_Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_truncl"; function isnanl (X : Long_Long_Float) return Integer with Import, Convention => Intrinsic, External_Name => "__builtin_isnanl"; function isinfl (X : Long_Long_Float) return Integer with Import, Convention => Intrinsic, External_Name => "__builtin_isinfl"; function signbitl (X : Long_Long_Float) return Integer with Import, Convention => Intrinsic, External_Name => "__builtin_signbitl"; procedure Split ( X : Long_Long_Unsigned_Float; Fore : out Digit; -- Fore < Base Aft : out Long_Long_Unsigned_Float; Exponent : out Integer; Base : Number_Base := 10); procedure Split ( X : Long_Long_Unsigned_Float; Fore : out Digit; Aft : out Long_Long_Unsigned_Float; Exponent : out Integer; Base : Number_Base := 10) is begin if X > 0.0 then if X >= Long_Long_Unsigned_Float (Base) then declare B : Long_Long_Unsigned_Float := Long_Long_Unsigned_Float (Base); begin Exponent := 1; loop declare Next_B : constant Long_Long_Unsigned_Float := B * Long_Long_Unsigned_Float (Base); begin exit when Next_B > X; B := Next_B; end; Exponent := Exponent + 1; end loop; declare Scaled : constant Long_Long_Unsigned_Float := X / B; Fore_Float : constant Long_Long_Unsigned_Float := truncl (Scaled); begin Fore := Digit (Fore_Float); Aft := X - Fore_Float * B; end; end; else declare Scaled : Long_Long_Unsigned_Float := X; B : Long_Long_Unsigned_Float := 1.0; begin Exponent := 0; while Scaled < 1.0 loop Scaled := Scaled * Long_Long_Unsigned_Float (Base); B := B * Long_Long_Unsigned_Float (Base); Exponent := Exponent - 1; end loop; declare Fore_Float : constant Long_Long_Unsigned_Float := truncl (Scaled); begin Fore := Digit (Fore_Float); Aft := X - Fore_Float / B; end; end; end if; else Fore := 0; Aft := 0.0; Exponent := 0; end if; end Split; -- decimal part for floating-point format = Aft / Base ** Exponent procedure Aft_Scale ( Aft : Long_Long_Unsigned_Float; Scaled_Aft : out Long_Long_Unsigned_Float; Exponent : Integer; Round_Up : out Boolean; Base : Number_Base := 10; Aft_Width : Positive := Standard.Float'Digits - 1); procedure Aft_Scale ( Aft : Long_Long_Unsigned_Float; Scaled_Aft : out Long_Long_Unsigned_Float; Exponent : Integer; Round_Up : out Boolean; Base : Number_Base := 10; Aft_Width : Positive := Standard.Float'Digits - 1) is L : constant Long_Long_Unsigned_Float := Long_Long_Unsigned_Float (Base) ** Aft_Width; begin Scaled_Aft := roundl ( Aft * Long_Long_Unsigned_Float (Base) ** (Aft_Width - Exponent)); Round_Up := Scaled_Aft >= L; -- ".99"99.. would be rounded up to 1".00" end Aft_Scale; procedure Aft_Image ( Value : Long_Long_Unsigned_Float; -- scaled Aft Item : out String; -- Item'Length >= Width + 1 for '.' Last : out Natural; Base : Number_Base := 10; Set : Type_Set := Upper_Case; Aft_Width : Positive := Standard.Float'Digits - 1); procedure Aft_Image ( Value : Long_Long_Unsigned_Float; Item : out String; Last : out Natural; Base : Number_Base := 10; Set : Type_Set := Upper_Case; Aft_Width : Positive := Standard.Float'Digits - 1) is X : Long_Long_Unsigned_Float := Value; begin Last := Item'First + Aft_Width; Item (Item'First) := '.'; for I in reverse Item'First + 1 .. Last loop declare Q : Long_Long_Float; R : Long_Long_Float; begin Long_Long_Float_Types.Divide (X, Long_Long_Float (Base), Q, R); Image (Digit (R), Item (I), Set => Set); X := Q; end; end loop; pragma Assert (X = 0.0); end Aft_Image; -- implementation function Sign_Mark (Value : Long_Long_Float; Signs : Sign_Marks) return Character is begin if signbitl (Value) /= 0 then return Signs.Minus; elsif Value > 0.0 then return Signs.Plus; else return Signs.Zero; end if; end Sign_Mark; function Fore_Digits_Width ( Value : Long_Long_Unsigned_Float; Base : Number_Base := 10) return Positive is P : Long_Long_Float := Long_Long_Float (Base); Result : Positive := 1; begin while P <= Value loop -- Value is finite, so exit when isinfl (P) Result := Result + 1; P := P * Long_Long_Float (Base); end loop; return Result; end Fore_Digits_Width; function Fore_Digits_Width ( First, Last : Long_Long_Float; Base : Number_Base := 10) return Positive is Actual_First : Long_Long_Float := First; Actual_Last : Long_Long_Float := Last; Max_Abs : Long_Long_Float; begin if First > Last then Actual_First := Last; Actual_Last := First; end if; if Actual_Last <= 0.0 then Max_Abs := -Actual_First; elsif Actual_First >= 0.0 then Max_Abs := Actual_Last; else -- Actual_First < 0 and then Actual_Last > 0 Max_Abs := Long_Long_Float'Max (-Actual_First, Actual_Last); end if; return Fore_Digits_Width (Max_Abs, Base => Base); end Fore_Digits_Width; procedure Image_No_Sign_Nor_Exponent ( Value : Long_Long_Float; Item : out String; Fore_Last, Last : out Natural; Base : Number_Base := 10; Base_Form : Boolean := False; Set : Type_Set := Upper_Case; Fore_Digits_Width : Positive := 1; Fore_Digits_Fill : Character := '0'; Aft_Width : Positive) is Item_Fore : aliased Long_Long_Float; Aft : Long_Long_Float; Scaled_Aft : Long_Long_Float; Round_Up : Boolean; Required_Fore_Width : Positive; Error : Boolean; begin Last := Item'First - 1; -- opening '#' if Base_Form then Image ( Word_Unsigned (Base), Item (Last + 1 .. Item'Last), Last, Error => Error); pragma Assert (not Error); Last := Last + 1; pragma Assert (Last <= Item'Last); Item (Last) := '#'; end if; -- split Aft := modfl (abs Value, Item_Fore'Access); Float.Aft_Scale ( Aft, Scaled_Aft, 0, Round_Up, Base => Base, Aft_Width => Aft_Width); if Round_Up then Item_Fore := Item_Fore + 1.0; Scaled_Aft := 0.0; end if; -- integer part Required_Fore_Width := Float.Fore_Digits_Width (Item_Fore, Base => Base); if Fore_Digits_Width > Required_Fore_Width then pragma Assert ( Last + Fore_Digits_Width - Required_Fore_Width <= Item'Last); Fill_Padding ( Item (Last + 1 .. Last + Fore_Digits_Width - Required_Fore_Width), Fore_Digits_Fill); Last := Last + Fore_Digits_Width - Required_Fore_Width; end if; pragma Assert (Last + Required_Fore_Width <= Item'Last); for I in reverse Last + 1 .. Last + Required_Fore_Width loop declare Q : Long_Long_Float; R : Long_Long_Float; begin Long_Long_Float_Types.Divide ( Item_Fore, Long_Long_Float (Base), Q, R); Image (Digit (R), Item (I), Set => Set); Item_Fore := Q; end; end loop; Last := Last + Required_Fore_Width; Fore_Last := Last; -- '.' and decimal part pragma Assert (Last + Aft_Width <= Item'Last); Float.Aft_Image ( Scaled_Aft, Item (Last + 1 .. Item'Last), Last, Base => Base, Set => Set, Aft_Width => Aft_Width); -- closing '#' if Base_Form then Last := Last + 1; pragma Assert (Last <= Item'Last); Item (Last) := '#'; end if; end Image_No_Sign_Nor_Exponent; procedure Image_No_Exponent ( Value : Long_Long_Float; Item : out String; -- same as above except unnecessary width for exponent Fore_Last, Last : out Natural; Signs : Sign_Marks := ('-', ' ', ' '); Base : Number_Base := 10; Base_Form : Boolean := False; Set : Type_Set := Upper_Case; Fore_Digits_Width : Positive := 1; Fore_Digits_Fill : Character := '0'; Aft_Width : Positive; NaN : String := "NAN"; Infinity : String := "INF") is begin Last := Item'First - 1; declare Sign : constant Character := Sign_Mark (Value, Signs); begin if Sign /= No_Sign then Last := Last + 1; pragma Assert (Last <= Item'Last); Item (Last) := Sign; end if; end; if isnanl (Value) /= 0 then declare First : constant Positive := Last + 1; begin Last := Last + NaN'Length; pragma Assert (Last <= Item'Last); Item (First .. Last) := NaN; Fore_Last := Last; end; elsif isinfl (Value) /= 0 then declare First : constant Positive := Last + 1; begin Last := Last + Infinity'Length; pragma Assert (Last <= Item'Last); Item (First .. Last) := Infinity; Fore_Last := Last; end; else Image_No_Sign_Nor_Exponent ( Value, Item (Last + 1 .. Item'Last), Fore_Last, Last, Base => Base, Base_Form => Base_Form, Set => Set, Fore_Digits_Width => Fore_Digits_Width, Fore_Digits_Fill => Fore_Digits_Fill, Aft_Width => Aft_Width); end if; end Image_No_Exponent; procedure Image ( Value : Long_Long_Float; Item : out String; Fore_Last, Last : out Natural; Signs : Sign_Marks := ('-', ' ', ' '); Base : Number_Base := 10; Base_Form : Boolean := False; Set : Type_Set := Upper_Case; Fore_Digits_Width : Positive := 1; Fore_Digits_Fill : Character := '0'; Aft_Width : Positive; Exponent_Mark : Character := 'E'; Exponent_Signs : Sign_Marks := ('-', '+', '+'); Exponent_Digits_Width : Positive := 2; Exponent_Digits_Fill : Character := '0'; NaN : String := "NAN"; Infinity : String := "INF") is begin Last := Item'First - 1; declare Sign : constant Character := Sign_Mark (Value, Signs); begin if Sign /= No_Sign then Last := Last + 1; pragma Assert (Last <= Item'Last); Item (Last) := Sign; end if; end; if isnanl (Value) /= 0 then declare First : constant Positive := Last + 1; begin Last := Last + NaN'Length; pragma Assert (Last <= Item'Last); Item (First .. Last) := NaN; Fore_Last := Last; end; elsif isinfl (Value) /= 0 then declare First : constant Positive := Last + 1; begin Last := Last + Infinity'Length; pragma Assert (Last <= Item'Last); Item (First .. Last) := Infinity; Fore_Last := Last; end; else declare Fore : Digit; Aft : Long_Long_Float; Exponent : Integer; Abs_Exponent : Word_Unsigned; Scaled_Aft : Long_Long_Float; Rouned_Up : Boolean; Error : Boolean; begin Split ( abs Value, Fore, Aft, Exponent, Base => Base); Aft_Scale ( Aft, Scaled_Aft, Exponent, Rouned_Up, Base => Base, Aft_Width => Aft_Width); if Rouned_Up then Fore := Fore + 1; Scaled_Aft := 0.0; if Fore >= Base then Fore := 1; Exponent := Exponent + 1; end if; end if; -- opening '#' if Base_Form then Image ( Word_Unsigned (Base), Item (Last + 1 .. Item'Last), Last, Error => Error); pragma Assert (not Error); Last := Last + 1; pragma Assert (Last <= Item'Last); Item (Last) := '#'; end if; -- integer part pragma Assert (Last + Fore_Digits_Width <= Item'Last); Fill_Padding ( Item (Last + 1 .. Last + Fore_Digits_Width - 1), Fore_Digits_Fill); Last := Last + Fore_Digits_Width; -- including one digit Image (Fore, Item (Last), Set => Set); Fore_Last := Last; -- '.' and decimal part pragma Assert (Last + 1 + Aft_Width <= Item'Last); Aft_Image ( Scaled_Aft, Item (Last + 1 .. Item'Last), Last, Base => Base, Aft_Width => Aft_Width); -- closing # if Base_Form then Last := Last + 1; pragma Assert (Last <= Item'Last); Item (Last) := '#'; end if; -- exponent Last := Last + 1; pragma Assert (Last <= Item'Last); Item (Last) := Exponent_Mark; declare Exponent_Sign : Character; begin if Exponent < 0 then Abs_Exponent := -Word_Unsigned'Mod (Exponent); Exponent_Sign := Exponent_Signs.Minus; else Abs_Exponent := Word_Unsigned (Exponent); if Exponent > 0 then Exponent_Sign := Exponent_Signs.Plus; else Exponent_Sign := Exponent_Signs.Zero; end if; end if; if Exponent_Sign /= No_Sign then Last := Last + 1; pragma Assert (Last <= Item'Last); Item (Last) := Exponent_Sign; end if; end; Image ( Abs_Exponent, Item (Last + 1 .. Item'Last), Last, Width => Exponent_Digits_Width, Fill => Exponent_Digits_Fill, Error => Error); pragma Assert (not Error); end; end if; end Image; end System.Formatting.Float;
Cubical/Data/Empty/Base.agda
dan-iel-lee/cubical
0
15531
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Data.Empty.Base where open import Cubical.Core.Everything open import Cubical.Foundations.Prelude private variable ℓ : Level data ⊥ : Type₀ where ⊥* : Type ℓ ⊥* = Lift ⊥ rec : {A : Type ℓ} → ⊥ → A rec () elim : {A : ⊥ → Type ℓ} → (x : ⊥) → A x elim ()
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1064.asm
ljhsiun2/medusa
9
164385
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x2291, %rsi lea addresses_normal_ht+0xbf55, %rdi nop nop nop nop sub %rbp, %rbp mov $51, %rcx rep movsb nop inc %rcx lea addresses_UC_ht+0xea91, %rdx nop nop nop nop nop sub $21616, %rbx mov $0x6162636465666768, %r14 movq %r14, (%rdx) nop nop nop nop sub $7777, %rbx lea addresses_WT_ht+0x15a91, %rsi lea addresses_normal_ht+0xb1f7, %rdi nop nop inc %r10 mov $6, %rcx rep movsw nop nop nop nop xor $2672, %rsi lea addresses_WC_ht+0x1d67, %rdx nop nop nop nop nop and $5141, %r10 movl $0x61626364, (%rdx) nop nop nop nop nop xor $62067, %rdi lea addresses_normal_ht+0x12291, %rbp dec %rcx mov (%rbp), %rbx cmp %rcx, %rcx lea addresses_D_ht+0xe209, %rcx clflush (%rcx) and %r14, %r14 mov $0x6162636465666768, %rdi movq %rdi, %xmm0 movups %xmm0, (%rcx) sub $30243, %rsi lea addresses_UC_ht+0xa051, %r14 nop nop cmp %rdx, %rdx movups (%r14), %xmm3 vpextrq $1, %xmm3, %rsi nop nop nop sub $18210, %rsi lea addresses_WT_ht+0x230b, %r14 cmp %rsi, %rsi mov $0x6162636465666768, %r10 movq %r10, (%r14) nop nop nop sub %rsi, %rsi lea addresses_UC_ht+0xa831, %rsi clflush (%rsi) nop nop nop nop xor %rcx, %rcx movb (%rsi), %r10b nop nop nop nop nop xor $36835, %rbx lea addresses_WC_ht+0x1317d, %rbp nop nop and $11762, %rdi mov $0x6162636465666768, %rbx movq %rbx, (%rbp) nop nop nop nop nop dec %r10 lea addresses_UC_ht+0x1b291, %rbp cmp %rdx, %rdx mov (%rbp), %edi sub %rsi, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %r8 push %r9 push %rax push %rcx push %rsi // Store mov $0x5c1, %r9 nop nop nop nop nop dec %r10 movl $0x51525354, (%r9) nop nop nop xor $57856, %r13 // Store lea addresses_A+0x1f3b9, %rsi nop dec %r8 movl $0x51525354, (%rsi) nop nop nop add $18615, %rax // Load mov $0x3dad260000000f1d, %r10 nop nop nop nop xor %rcx, %rcx mov (%r10), %rsi nop sub $38490, %rsi // Store lea addresses_US+0xe0b1, %rsi nop and $12026, %rax movw $0x5152, (%rsi) nop nop dec %r9 // Store mov $0x4df1970000000f51, %r13 nop nop nop inc %rsi movw $0x5152, (%r13) // Exception!!! nop nop mov (0), %r9 nop nop nop nop cmp $52151, %rax // Store lea addresses_A+0x19fd1, %rsi nop nop cmp $4852, %r8 mov $0x5152535455565758, %rax movq %rax, %xmm3 movups %xmm3, (%rsi) nop nop add $64868, %r9 // Faulty Load lea addresses_RW+0x15a91, %rax nop nop nop nop sub %r8, %r8 movups (%rax), %xmm7 vpextrq $0, %xmm7, %r9 lea oracles, %r8 and $0xff, %r9 shlq $12, %r9 mov (%r8,%r9,1), %r9 pop %rsi pop %rcx pop %rax pop %r9 pop %r8 pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 3}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 4, 'NT': True, 'same': False, 'congruent': 3}} {'src': {'type': 'addresses_NC', 'AVXalign': True, 'size': 8, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 4}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 4}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 6}} [Faulty Load] {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 7}} {'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}} {'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 11}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 2}} {'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 1}} {'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8, 'NT': True, 'same': False, 'congruent': 0}} {'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 10}, 'OP': 'LOAD'} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
src/base/log/util-log-loggers.ads
RREE/ada-util
60
12960
<reponame>RREE/ada-util<gh_stars>10-100 ----------------------------------------------------------------------- -- util-log-loggers -- Utility Log Package -- Copyright (C) 2006, 2008, 2009, 2011, 2018, 2019, 2021 Free Software Foundation, Inc. -- Written by <NAME> (<EMAIL>) -- -- 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.Exceptions; with Ada.Strings.Unbounded; with Util.Properties; private with Ada.Finalization; private with Util.Log.Appenders; package Util.Log.Loggers is use Ada.Exceptions; use Ada.Strings.Unbounded; -- The logger identifies and configures the log produced -- by a component that uses it. The logger has a name -- which can be printed in the log outputs. The logger instance -- contains a log level which can be used to control the level of -- logs. type Logger is tagged limited private; type Logger_Access is access constant Logger; -- Create a logger with the given name. function Create (Name : in String) return Logger; -- Create a logger with the given name and use the specified level. function Create (Name : in String; Level : in Level_Type) return Logger; -- Change the log level procedure Set_Level (Log : in out Logger; Level : in Level_Type); -- Get the log level. function Get_Level (Log : in Logger) return Level_Type; -- Get the log level name. function Get_Level_Name (Log : in Logger) return String; procedure Print (Log : in Logger; Level : in Level_Type; Message : in String; Arg1 : in String := ""; Arg2 : in String := ""; Arg3 : in String := ""; Arg4 : in String := ""); procedure Debug (Log : in Logger'Class; Message : in String; Arg1 : in String := ""; Arg2 : in String := ""; Arg3 : in String := ""); procedure Debug (Log : in Logger'Class; Message : in String; Arg1 : in String; Arg2 : in String; Arg3 : in String; Arg4 : in String); procedure Debug (Log : in Logger'Class; Message : in String; Arg1 : in Unbounded_String; Arg2 : in String := ""; Arg3 : in String := ""); procedure Debug (Log : in Logger'Class; Message : in String; Arg1 : in Unbounded_String; Arg2 : in Unbounded_String; Arg3 : in String := ""); procedure Info (Log : in Logger'Class; Message : in String; Arg1 : in String := ""; Arg2 : in String := ""; Arg3 : in String := ""); procedure Info (Log : in Logger'Class; Message : in String; Arg1 : in String; Arg2 : in String; Arg3 : in String; Arg4 : in String); procedure Info (Log : in Logger'Class; Message : in String; Arg1 : in Unbounded_String; Arg2 : in String := ""; Arg3 : in String := ""); procedure Warn (Log : in Logger'Class; Message : in String; Arg1 : in String := ""; Arg2 : in String := ""; Arg3 : in String := ""); procedure Error (Log : in Logger'Class; Message : in String; Arg1 : in String := ""; Arg2 : in String := ""; Arg3 : in String := ""); procedure Error (Log : in Logger'Class; Message : in String; E : in Exception_Occurrence; Trace : in Boolean := False); -- Initialize the log environment with the property file. procedure Initialize (Name : in String); -- Initialize the log environment with the properties. procedure Initialize (Properties : in Util.Properties.Manager); -- Return a printable traceback that correspond to the exception. function Traceback (E : in Exception_Occurrence) return String; private type Logger_Info; type Logger_Info_Access is access all Logger_Info; type Logger_Info (Len : Positive) is limited record Next_Logger : Logger_Info_Access; Prev_Logger : Logger_Info_Access; Level : Level_Type := INFO_LEVEL; Appender : Appenders.Appender_Access; Name : String (1 .. Len); end record; type Logger is new Ada.Finalization.Limited_Controlled with record Instance : Logger_Info_Access; end record; -- Finalize the logger and flush the associated appender overriding procedure Finalize (Log : in out Logger); end Util.Log.Loggers;
src/ada/src/afrl-cmasi-lmcptask-spark_boundary.ads
pat-rogers/OpenUxAS
0
29053
with afrl.impact.AngledAreaSearchTask; with afrl.impact.ImpactLineSearchTask; with afrl.impact.ImpactPointSearchTask; package afrl.cmasi.lmcpTask.SPARK_Boundary with SPARK_Mode is pragma Annotate (GNATprove, Terminating, SPARK_Boundary); -- This package introduces a private type hiding an access to a -- LmcpTask. type Task_Kind is (AngledAreaSearchTask, ImpactLineSearchTask, ImpactPointSearchTask, Other_Task); type Task_Kind_And_Id (Kind : Task_Kind := Other_Task) is record case Kind is when AngledAreaSearchTask => SearchAreaID : Int64; when ImpactLineSearchTask => LineID : Int64; when ImpactPointSearchTask => SearchLocationID : Int64; when Other_Task => null; end case; end record; function Get_Kind_And_Id (X : LmcpTask_Any) return Task_Kind_And_Id with Global => null, SPARK_Mode => Off; private pragma SPARK_Mode (Off); function Get_Kind_And_Id (X : LmcpTask_Any) return Task_Kind_And_Id is (if X.getLmcpTypeName = afrl.impact.AngledAreaSearchTask.Subscription then (Kind => AngledAreaSearchTask, SearchAreaID => afrl.impact.AngledAreaSearchTask.AngledAreaSearchTask (X.all).GetSearchAreaID) elsif X.getLmcpTypeName = afrl.impact.ImpactLineSearchTask.Subscription then (Kind => ImpactLineSearchTask, LineID => afrl.impact.ImpactLineSearchTask.ImpactLineSearchTask (X.all).getLineID) elsif X.getLmcpTypeName = afrl.impact.ImpactPointSearchTask.Subscription then (Kind => ImpactPointSearchTask, SearchLocationId => afrl.impact.ImpactPointSearchTask.ImpactPointSearchTask (X.all).getSearchLocationID) else (Kind => Other_task)); end afrl.cmasi.lmcpTask.SPARK_Boundary;
test/succeed/IrrelevantLambdasDoNotNeedDotsAlways.agda
asr/agda-kanso
1
8170
<filename>test/succeed/IrrelevantLambdasDoNotNeedDotsAlways.agda -- Andreas, 2011-10-02 module IrrelevantLambdasDoNotNeedDotsAlways where bla : ((.Set → Set1) → Set1) -> Set1 bla f = f (λ x → Set) -- here, the lambda does not need a dot, like in (λ .x → Set) -- because the dot from the function space can be taken over
libsrc/_DEVELOPMENT/l/sccz80/9-common/l_gintsp.asm
ahjelm/z88dk
640
25457
<reponame>ahjelm/z88dk ; Z88 Small C+ Run time Library ; l_gint variant to be used sometimes by the peephole optimizer ; SECTION code_clib SECTION code_l_sccz80 PUBLIC l_gintsp, l_gintsp_gint l_gintsp: add hl,sp inc hl inc hl l_gintsp_gint: ld a,(hl+) ld h,(hl) ld l,a ret
src/main/antlr/symtab/simple/Simple.g4
hengxin/tpdsl
0
7828
<reponame>hengxin/tpdsl grammar Simple; @header { package symtab.simple; } file : (func|var)* EOF ; func : 'def' name=ID '(' arg (',' arg)* ')' ':' block ; arg : ID ; body : (var|stat)* ; block : '[' body ']' ; var : 'var' ID ; stat : 'print' ID | block ; DEF : 'def' ; LPAREN : '(' ; COMMA : ',' ; RPAREN : ')' ; COLON : ':' ; LBRACK : '[' ; RBRACK : ']' ; VAR : 'var' ; PRINT : 'print' ; ID : [a-z]+ ; WS : [ \r\t\n] -> skip ;
Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0x84_notsx.log_21829_1956.asm
ljhsiun2/medusa
9
82467
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r14 push %r8 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0x9a4e, %rsi lea addresses_D_ht+0x19270, %rdi nop nop nop and $57142, %r9 mov $89, %rcx rep movsw nop nop nop nop add $57712, %r13 lea addresses_D_ht+0x103c6, %rsi lea addresses_D_ht+0x17470, %rdi clflush (%rsi) nop nop nop nop sub %r9, %r9 mov $102, %rcx rep movsq nop cmp %r9, %r9 lea addresses_UC_ht+0xc6f0, %rsi lea addresses_normal_ht+0x149f0, %rdi clflush (%rsi) nop nop xor %r14, %r14 mov $34, %rcx rep movsl nop nop xor %r13, %r13 lea addresses_normal_ht+0xbcf0, %rsi nop add %rbx, %rbx and $0xffffffffffffffc0, %rsi vmovaps (%rsi), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $1, %xmm2, %rcx nop nop nop nop sub $47084, %r9 lea addresses_D_ht+0x114f0, %r13 nop nop nop nop nop cmp %rcx, %rcx vmovups (%r13), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $0, %xmm6, %r9 nop nop dec %r14 lea addresses_normal_ht+0x52f0, %r14 clflush (%r14) inc %rbx movups (%r14), %xmm4 vpextrq $0, %xmm4, %rcx nop dec %r14 lea addresses_UC_ht+0x11ef0, %rsi lea addresses_UC_ht+0xd670, %rdi clflush (%rdi) inc %r8 mov $9, %rcx rep movsw cmp $34061, %r8 lea addresses_WT_ht+0xcd4, %rdi nop cmp $32790, %rsi movb $0x61, (%rdi) nop and %rsi, %rsi lea addresses_D_ht+0xc70, %rsi lea addresses_A_ht+0x1d0f0, %rdi and %r13, %r13 mov $24, %rcx rep movsl nop nop dec %r9 lea addresses_A_ht+0xd0a6, %r14 sub %rbx, %rbx vmovups (%r14), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $1, %xmm1, %r9 cmp %rdi, %rdi lea addresses_UC_ht+0x92fc, %r9 clflush (%r9) inc %r14 mov (%r9), %r13 nop dec %rdi lea addresses_UC_ht+0x2b7c, %r14 clflush (%r14) nop nop inc %r8 movups (%r14), %xmm1 vpextrq $0, %xmm1, %r13 nop sub %rbx, %rbx lea addresses_normal_ht+0x11370, %rbx nop nop nop nop nop xor $3749, %r9 and $0xffffffffffffffc0, %rbx vmovaps (%rbx), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %r13 nop nop xor %r13, %r13 lea addresses_WC_ht+0x73b4, %rsi lea addresses_WC_ht+0x18ab0, %rdi nop nop nop nop xor $13596, %r9 mov $109, %rcx rep movsl nop nop nop nop add %r9, %r9 lea addresses_D_ht+0x18cf0, %rsi lea addresses_WC_ht+0xe0f0, %rdi nop nop nop add %r13, %r13 mov $27, %rcx rep movsl nop nop nop nop add $55066, %r9 pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r8 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %r15 push %rbp push %rbx push %rcx push %rsi // Load lea addresses_PSE+0x1acf0, %rsi nop add $45534, %r10 movups (%rsi), %xmm2 vpextrq $1, %xmm2, %rcx nop nop nop nop nop xor %rbp, %rbp // Store mov $0x722, %rsi nop nop nop nop and %rbx, %rbx mov $0x5152535455565758, %rbp movq %rbp, %xmm1 movups %xmm1, (%rsi) nop nop nop sub $42771, %rbp // Store lea addresses_A+0x9730, %rbp nop nop xor %r15, %r15 mov $0x5152535455565758, %rcx movq %rcx, (%rbp) cmp %r15, %r15 // Store lea addresses_normal+0xd0f0, %r13 add $17287, %r10 movl $0x51525354, (%r13) nop nop sub $16436, %rbx // Store lea addresses_normal+0x4cf0, %rcx sub $45949, %r15 mov $0x5152535455565758, %rbp movq %rbp, %xmm2 movups %xmm2, (%rcx) nop and $10154, %r10 // Store lea addresses_A+0x1c8f0, %r10 nop nop nop nop cmp $18200, %rsi movw $0x5152, (%r10) nop nop xor %r10, %r10 // Store mov $0x3f0, %rbx nop nop nop nop and %rbp, %rbp movb $0x51, (%rbx) nop nop nop nop nop xor $29178, %rcx // Store lea addresses_PSE+0x62e0, %rsi nop nop nop nop and %rbx, %rbx mov $0x5152535455565758, %r15 movq %r15, %xmm2 vmovaps %ymm2, (%rsi) nop nop nop nop nop and $45039, %rbp // Store mov $0x4f0, %rsi nop nop dec %rcx mov $0x5152535455565758, %r15 movq %r15, %xmm4 movups %xmm4, (%rsi) cmp $58080, %rsi // Store lea addresses_US+0x13a30, %r13 nop and %r10, %r10 movw $0x5152, (%r13) nop nop nop nop nop cmp %r15, %r15 // Faulty Load mov $0x4594a800000004f0, %r13 nop nop nop nop sub %rcx, %rcx movntdqa (%r13), %xmm1 vpextrq $1, %xmm1, %rbx lea oracles, %r13 and $0xff, %rbx shlq $12, %rbx mov (%r13,%rbx,1), %rbx pop %rsi pop %rcx pop %rbx pop %rbp pop %r15 pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_NC', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_PSE', 'same': False, 'size': 16, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_P', 'same': False, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A', 'same': False, 'size': 8, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 16, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A', 'same': False, 'size': 2, 'congruent': 10, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'dst': {'type': 'addresses_P', 'same': False, 'size': 1, 'congruent': 3, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_PSE', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'dst': {'type': 'addresses_P', 'same': False, 'size': 16, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_US', 'same': False, 'size': 2, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_NC', 'same': True, 'size': 16, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 10, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'same': True, 'size': 16, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 8, 'congruent': 1, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
Create public gist from clipboard.applescript
lukaspustina/applescripts
0
1015
<filename>Create public gist from clipboard.applescript set gistFilename to the text returned of (display dialog "Gist filename?" default answer "clipboard.txt" with title "Sending clipboard to gist") set gistURL to (do shell script "pbpaste | /usr/local/bin/gist -f " & gistFilename) set the clipboard to gistURL as text display dialog gistURL buttons {"OK", "Open"} default button 1 with title "Created gist" if the button returned of the result is "Open" then open location gistURL as URL end if
programs/oeis/078/A078767.asm
karttu/loda
1
166306
<gh_stars>1-10 ; A078767: Let f(n) = A003434(n) be the number of iterations of phi needed to reach 1. Then a(n) = max(f(1), f(2), ..., f(n)). ; 0,1,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 cal $0,297251 ; Numbers whose base-3 digits have greater up-variation than down-variation; see Comments. mov $2,11700 sub $2,$0 mul $2,$0 log $2,2 sub $2,1 add $1,$2 sub $1,14
registrar-registration.ads
annexi-strayline/AURA
13
5548
<reponame>annexi-strayline/AURA<filename>registrar-registration.ads<gh_stars>10-100 ------------------------------------------------------------------------------ -- -- -- Ada User Repository Annex (AURA) -- -- ANNEXI-STRAYLINE Reference Implementation -- -- -- -- Core -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2019-2020, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * <NAME> (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. -- -- -- ------------------------------------------------------------------------------ -- The Registration package provides the interfaces for the submission of -- requests that modify or add to the Registry (All_Subsystems or -- All_Library_Units) with Ada.Directories; with Progress; with Unit_Names; with Registrar.Subsystems; with Registrar.Library_Units; package Registrar.Registration is ---------------- -- Unit Entry -- ---------------- -- Unit entry takes the Directory_Entry of a source file (library unit), -- or and takes the one of following actions: -- -- A. If the unit's file name ends in .ads or .adb, it is processed as -- follows: -- 1. All "with" statments are analyzed and the relevent units are -- requested (including subsystems) -- 2. All "pragma External_With" statements are analyzed, and the -- relevant non-ada source file is requested -- 3. The unit's unit name and subsystem is extracted and registered -- -- B. If the unit's file name has any other extention, it is registered as -- a non-ada unit, to be potentially included by an External_With pragma -- Unit entries are processed asynchronously by the Worker tasks. procedure Enter_Unit (File: in Ada.Directories.Directory_Entry_Type); -- Enter a project (non-AURA) source file. procedure Enter_Unit (File : in Ada.Directories.Directory_Entry_Type; AURA_Subsystem: in Subsystems.Subsystem); -- Enters an unit that is expected to be part of an AURA subsystem, -- typically through aquisition. -- -- The AURA Subsystem must be first registered with Enter_AURA_Subsystem -- below, and the unit must then be a member of that Subsystem. -- -- For External_With pragmas, the withed external unit is taken to be -- part of AURA_Subsystem, and thus is requested as Subsystem.Name%file.ext -- -- All non-ada units are registered as part of AURA_Subsystem, and thus -- are registered as Subsystem.Name%file.ext procedure Enter_Root; -- Iterates through the root (current) directory, and dispatches to -- Enter_Unit for each recognized source file type use type Ada.Directories.File_Kind; procedure Enter_Directory (Directory : in Ada.Directories.Directory_Entry_Type; AURA_Subsystem: in Subsystems.Subsystem) with Pre => Ada.Directories.Kind (Directory) = Ada.Directories.Directory; -- Iterates through a directory (not including subdirectories), and invokes -- Enter_Unit on each recognized source file type -- Progress Trackers -- ----------------------- Entry_Progress: aliased Progress.Progress_Tracker; -- Tracks the total amount of work orders handled by the entire entry -- process. This tracker is not reset by the registrar. Waiting on -- completion of this tracker after making an entry submission indicates -- that the work associated with that entry is complete ------------------------ -- Non-entry Services -- ------------------------ procedure Request_AURA_Subsystem (Name: in Unit_Names.Unit_Name; OK : out Boolean); -- Specifically requests a particular AURA subsystem (derrived from the -- subsystem name of Name) -- -- If that subsystem is already registered a check is made that the existing -- subsystem is also an AURA subsystem. If that check fails, OK is set to -- False. -- -- If the subsystem is succuessfully requested, or it is already entered and -- also an AURA subsystem, then OK is True -- -- This subprogram is primarily used by the CLI driver to allow the user to -- explicitly checkout subsystems procedure Update_Subsystem (Update: in Subsystems.Subsystem); -- Updates (replaces) an existing Subsystem in the Registry procedure Update_Library_Unit (Update: in Library_Units.Library_Unit); -- Updates (replaces) an existing Library_Unit in the Registry procedure Update_Library_Unit_Subset (Update: in Library_Units.Library_Unit_Sets.Set); -- Updates (replaces) all existing Library_Units in the Registry that -- are also in the Update set. If any units in the Subset are not also in -- the Registry, Constraint_Error is raised procedure Exclude_Manifests; -- Removes all Configuration Manifest units from all Subsystems. -- This should be invoked after checkout, and before compilation end Registrar.Registration;
alloy4fun_models/trashltl/models/1/tFbTfjDTdZzxE2njy.als
Kaixi26/org.alloytools.alloy
0
1723
<filename>alloy4fun_models/trashltl/models/1/tFbTfjDTdZzxE2njy.als<gh_stars>0 open main pred idtFbTfjDTdZzxE2njy_prop2 { historically ((no File) until (some File)) } pred __repair { idtFbTfjDTdZzxE2njy_prop2 } check __repair { idtFbTfjDTdZzxE2njy_prop2 <=> prop2o }
test/Succeed/Issue4048.agda
cruhland/agda
1,989
586
<gh_stars>1000+ {-# OPTIONS --rewriting #-} module Issue4048 where data _==_ {i} {A : Set i} : (x y : A) → Set i where refl : {a : A} → a == a {-# BUILTIN REWRITE _==_ #-} postulate Π : (A : Set) (B : A → Set) → Set lam : {A : Set} {B : A → Set} (b : (a : A) → B a) → Π A B app : {A : Set} {B : A → Set} (f : Π A B) (a : A) → B a Π-β : {A : Set} {B : A → Set} (b : (a : A) → B a) (a : A) → app (lam b) a == b a {-# REWRITE Π-β #-} postulate ⊤ : Set tt : ⊤ ⊤-elim : ∀ {i} (A : ⊤ → Set i) (d : A tt) (x : ⊤) → A x ⊤-β : ∀ {i} (A : ⊤ → Set i) (d : A tt) → ⊤-elim A d tt == d {-# REWRITE ⊤-β #-} tt' : ⊤ tt' = tt module _ (C : (p : ⊤) → Set) (z : C tt) where F : (n p x : ⊤) → C p F n p = app (⊤-elim (λ n → (p : ⊤) → Π ⊤ (λ _ → C p)) (⊤-elim _ (lam (⊤-elim _ z))) n p) F-red : F tt tt tt == z F-red = refl -- Bug? F-red' : F tt tt' tt == z F-red' = refl -- Not accepted, even though tt' is tt by definition.
include/bits_struct_mutex_h.ads
docandrew/troodon
5
19065
<filename>include/bits_struct_mutex_h.ads pragma Ada_2012; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with bits_thread_shared_types_h; package bits_struct_mutex_h is -- x86 internal mutex struct definitions. -- Copyright (C) 2019-2021 Free Software Foundation, Inc. -- This file is part of the GNU C Library. -- The GNU C Library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License as published by the Free Software Foundation; either -- version 2.1 of the License, or (at your option) any later version. -- The GNU C 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 -- Lesser General Public License for more details. -- You should have received a copy of the GNU Lesser General Public -- License along with the GNU C Library; if not, see -- <http://www.gnu.org/licenses/>. type uu_pthread_mutex_s is record uu_lock : aliased int; -- /usr/include/bits/struct_mutex.h:24 uu_count : aliased unsigned; -- /usr/include/bits/struct_mutex.h:25 uu_owner : aliased int; -- /usr/include/bits/struct_mutex.h:26 uu_nusers : aliased unsigned; -- /usr/include/bits/struct_mutex.h:28 uu_kind : aliased int; -- /usr/include/bits/struct_mutex.h:32 uu_spins : aliased short; -- /usr/include/bits/struct_mutex.h:34 uu_elision : aliased short; -- /usr/include/bits/struct_mutex.h:35 uu_list : aliased bits_thread_shared_types_h.uu_pthread_list_t; -- /usr/include/bits/struct_mutex.h:36 end record with Convention => C_Pass_By_Copy; -- /usr/include/bits/struct_mutex.h:22 -- KIND must stay at this position in the structure to maintain -- binary compatibility with static initializers. end bits_struct_mutex_h;
Others/bitmapTest.asm
LeonardoSanBenitez/Assembly-exercises
0
164263
<filename>Others/bitmapTest.asm # --------------------------------------- # # Libraries # --------------------------------------- # .text 0x00500000 .include "../libraries/bitmap.asm" .include "../libraries/SyscallsFunctions.asm" .include "../libraries/macros.asm" .include "../libraries/init.asm" # begin in 0x0040. Requires "macros.asm" .text 0x00410000 #------------------------------- # ra 20(sp) # s1 16(sp) # s0 12(sp) # a2 8(sp) # a1 4(sp) # a0 0(sp) #------------------------------- main: addi $sp, $sp, -24 sw $s0, 12($sp) sw $s1, 16($sp) sw $ra, 20($sp) print_str("Hello Bitmap!\n") add $s0, $zero, $zero main_L0:bge $s0, 64, main_L0_exit add $s1, $zero, $zero main_L1:bge $s1, FB_LINES, main_L1_exit move $a0, $s0 move $a1, $s1 add $a2, $s1, $zero sll $a2, $a2, 8 add $a2, $s1, $a2 sll $a2, $a2, 8 add $a2, $s1, $a2 jal setPixel addi $s1, $s1, 1 j main_L1 main_L1_exit: addi $s0, $s0, 1 j main_L0 main_L0_exit: li $s0, 64 main_L2:bge $s0, 128, main_L2_exit add $s1, $zero, $zero main_L3:bge $s1, FB_LINES, main_L3_exit move $a0, $s0 move $a1, $s1 add $a2, $s1, $zero sll $a2, $a2, 16 jal setPixel addi $s1, $s1, 1 j main_L3 main_L3_exit: addi $s0, $s0, 1 j main_L2 main_L2_exit: li $s0, 128 main_L4:bge $s0, 192, main_L4_exit add $s1, $zero, $zero main_L5:bge $s1, FB_LINES, main_L5_exit move $a0, $s0 move $a1, $s1 add $a2, $s1, $zero sll $a2, $a2, 8 jal setPixel addi $s1, $s1, 1 j main_L5 main_L5_exit: addi $s0, $s0, 1 j main_L4 main_L4_exit: li $s0, 192 main_L6:bge $s0, 256, main_L6_exit add $s1, $zero, $zero main_L7:bge $s1, FB_LINES, main_L7_exit move $a0, $s0 move $a1, $s1 add $a2, $s1, $zero jal setPixel addi $s1, $s1, 1 j main_L7 main_L7_exit: addi $s0, $s0, 1 j main_L6 main_L6_exit: lw $ra, 20($sp) lw $s1, 16($sp) lw $s0, 12($sp) addi $sp, $sp, 24 jr $ra #---------------------------------------
Src/bdf_font.adb
SMerrony/dashera
23
12414
-- Copyright ©2021,2022 <NAME> -- 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. with Ada.Text_IO; use Ada.Text_IO; with Interfaces; use Interfaces; with Logging; use Logging; package body BDF_Font is procedure Parse_BBX (Font_Line : in String; Font_Line_Length : in Positive; Pix_Width, Pix_Height : out Integer; X_Offset, Y_Offset : out Integer) is Start_Pos, End_Pos : Positive; begin Start_Pos := 5; -- "BBX n..." End_Pos := Start_Pos; while Font_Line (End_Pos) /= ' ' loop End_Pos := End_Pos + 1; end loop; Pix_Width := Integer'Value (Font_Line (Start_Pos .. End_Pos - 1)); Start_Pos := End_Pos + 1; End_Pos := Start_Pos; while Font_Line (End_Pos) /= ' ' loop End_Pos := End_Pos + 1; end loop; Pix_Height := Integer'Value (Font_Line (Start_Pos .. End_Pos - 1)); Start_Pos := End_Pos + 1; End_Pos := Start_Pos; while Font_Line (End_Pos) /= ' ' loop End_Pos := End_Pos + 1; end loop; X_Offset := Integer'Value (Font_Line (Start_Pos .. End_Pos - 1)); Start_Pos := End_Pos + 1; End_Pos := Font_Line_Length; Y_Offset := Integer'Value (Font_Line (Start_Pos .. End_Pos)); end Parse_BBX; protected body Font is procedure Load_Font (File_Name : String; Zoom : Zoom_T) is -- Font : aliased Decoded_Acc_T := new Decoded_T; Char_Count : Positive; Font_File : File_Type; Font_Line : String (1 .. 80); Font_Line_Length : Natural; Tmp_Pix_Buf, Tmp_Dim_Pix_Buf, Tmp_Reverse_Pix_Buf, Green_Pix_Buf, Dim_Pix_Buf, Black_Pix_Buf : Gdk_Pixbuf; ASCII_Code : Natural; Pix_Width, Pix_Height : Integer; X_Offset, Y_Offset : Integer; X, Y : Gint; Line_Byte : Unsigned_8; begin case Zoom is when Large => Decoded.Char_Width := 10; Decoded.Char_Height := 24; when Normal => Decoded.Char_Width := 10; Decoded.Char_Height := 18; when Smaller => Decoded.Char_Width := 8; Decoded.Char_Height := 12; when Tiny => Decoded.Char_Width := 7; Decoded.Char_Height := 10; end case; begin Open (File => Font_File, Mode => In_File, Name => File_Name); exception when others => raise OPEN_FAILURE with "ERROR: Cannot open the file '" & File_Name & "'. Does it exist?"; end; for C of Decoded.Font loop C.Loaded := False; end loop; loop Get_Line (Font_File, Font_Line, Font_Line_Length); -- Log (DEBUG, "" & Font_Line (1 .. Font_Line_Length)); exit when Font_Line (1 .. Font_Line_Length) = "ENDPROPERTIES"; end loop; Get_Line (Font_File, Font_Line, Font_Line_Length); if Font_Line (1 .. 5) /= "CHARS" then raise BDF_DECODE with "ERROR: BDF_Font - CHARS line not found"; end if; Log (INFO, "BDF Font " & Font_Line (1 .. Font_Line_Length)); Char_Count := Positive'Value (Font_Line (7 .. Font_Line_Length)); Tmp_Pix_Buf := Gdk_New (Has_Alpha => False, Width => Font_Width, Height => Font_Height); Tmp_Dim_Pix_Buf := Gdk_New (Width => Font_Width, Height => Font_Height); Tmp_Reverse_Pix_Buf := Gdk_New (Width => Font_Width, Height => Font_Height); Green_Pix_Buf := Gdk_New (Width => 1, Height => 1); Fill (Green_Pix_Buf, 16#00ff00ff#); Dim_Pix_Buf := Gdk_New (Width => 1, Height => 1); Fill (Dim_Pix_Buf, 16#008800ff#); Black_Pix_Buf := Gdk_New (Width => 1, Height => 1); Fill (Black_Pix_Buf, 16#000000ff#); for CC in 0 .. Char_Count - 1 loop Log (DEBUG, "Loading char No. " & Integer'Image(CC)); loop Get_Line (Font_File, Font_Line, Font_Line_Length); exit when Font_Line (1 .. 9) = "STARTCHAR"; end loop; Get_Line (Font_File, Font_Line, Font_Line_Length); if Font_Line (1 .. 8) /= "ENCODING" then raise BDF_DECODE with "ERROR: BDF_Font - ENCODING line not found"; end if; ASCII_Code := Natural'Value (Font_Line (10 .. Font_Line_Length)); Log (DEBUG, "... ASCII Code: " & ASCII_Code'Image); -- skip 2 lines Get_Line (Font_File, Font_Line, Font_Line_Length); Get_Line (Font_File, Font_Line, Font_Line_Length); Get_Line (Font_File, Font_Line, Font_Line_Length); Parse_BBX (Font_Line, Font_Line_Length, Pix_Width, Pix_Height, X_Offset, Y_Offset); -- skip the BITMAP line Get_Line (Font_File, Font_Line, Font_Line_Length); -- load the actual bitmap for this char a row at a time from the top down Fill (Tmp_Pix_Buf, 0); Fill (Tmp_Dim_Pix_Buf, 0); Fill (Tmp_Reverse_Pix_Buf, 16#00FF_0000#); for Bitmap_Line in 0 .. Pix_Height - 1 loop Get_Line (Font_File, Font_Line, Font_Line_Length); Line_Byte := Unsigned_8'Value ("16#" & Font_Line (1 .. 2) & "#"); for I in 0 .. Pix_Width - 1 loop if (Line_Byte and 16#80#) /= 0 then X := Gint(X_Offset + I); Y := Gint(Bitmap_Line + 12 - Pix_Height - Y_Offset); Gdk.Pixbuf.Copy_Area (Src_Pixbuf => Green_Pix_Buf, Src_X => 0, Src_Y => 0, Width => 1, Height => 1, Dest_Pixbuf => Tmp_Pix_Buf, Dest_X => X, Dest_Y => Y); Gdk.Pixbuf.Copy_Area (Src_Pixbuf => Dim_Pix_Buf, Src_X => 0, Src_Y => 0, Width => 1, Height => 1, Dest_Pixbuf => Tmp_Dim_Pix_Buf, Dest_X => X, Dest_Y => Y); Gdk.Pixbuf.Copy_Area (Src_Pixbuf => Black_Pix_Buf, Src_X => 0, Src_Y => 0, Width => 1, Height => 1, Dest_Pixbuf => Tmp_Reverse_Pix_Buf, Dest_X => X, Dest_Y => Y); -- Decoded.Font(ASCII_Code).Pixels (X_Offset + I, Y_Offset + Bitmap_Line) := True; end if; Line_Byte := Shift_Left (Line_Byte, 1); end loop; end loop; Decoded.Font(ASCII_Code).Pix_Buf := Gdk.Pixbuf.Scale_Simple (Src => Tmp_Pix_Buf, Dest_Width => Decoded.Char_Width, Dest_Height => Decoded.Char_Height, Inter_Type => Interp_Bilinear); Decoded.Font(ASCII_Code).Dim_Pix_Buf := Gdk.Pixbuf.Scale_Simple (Src => Tmp_Dim_Pix_Buf, Dest_Width => Decoded.Char_Width, Dest_Height => Decoded.Char_Height, Inter_Type => Interp_Bilinear); Decoded.Font(ASCII_Code).Reverse_Pix_Buf := Gdk.Pixbuf.Scale_Simple (Src => Tmp_Reverse_Pix_Buf, Dest_Width => Decoded.Char_Width, Dest_Height => Decoded.Char_Height, Inter_Type => Interp_Bilinear); Decoded.Font(ASCII_Code).Loaded := true; end loop; Close (File => Font_File); end Load_Font; function Get_Char_Width return Gint is (Decoded.Char_Width); function Get_Char_Height return Gint is (Decoded.Char_Height); function Is_Loaded (Ix : in Natural) return Boolean is (Decoded.Font(Ix).Loaded); function Get_Dim_Pixbuf (Ix : in Natural) return Gdk_Pixbuf is (Decoded.Font(Ix).Dim_Pix_Buf); function Get_Rev_Pixbuf (Ix : in Natural) return Gdk_Pixbuf is (Decoded.Font(Ix).Reverse_Pix_Buf); function Get_Pixbuf (Ix : in Natural) return Gdk_Pixbuf is (Decoded.Font(Ix).Pix_Buf); end Font; end BDF_Font;
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/exp2_fastcall.asm
meesokim/z88dk
0
93178
SECTION code_fp_math48 PUBLIC _exp2_fastcall EXTERN cm48_sdcciy_exp2_fastcall defc _exp2_fastcall = cm48_sdcciy_exp2_fastcall
oeis/153/A153051.asm
neoneye/loda-programs
11
240282
<filename>oeis/153/A153051.asm ; A153051: Numbers n>=9 such that 2*n-17 is not a prime. ; Submitted by <NAME>(s2) ; 9,13,16,19,21,22,25,26,28,31,33,34,36,37,40,41,43,46,47,49,51,52,54,55,56,58,61,64,66,67,68,69,70,71,73,75,76,79,80,81,82,85,86,88,89,91,93,94,96,97,100,101,102,103,106,109,110,111,112,113,115,116,117,118,119,121,124,126,127,130,131,132,133,135,136,138,139,141,142,145,146,148,151,152,153,154,156,157,158,159,160,161,163,166,168,169,170,171,172,173 lpb $0 trn $0,1 seq $0,309355 ; Even numbers k such that k! is divisible by k*(k+1)/2. mov $2,$0 mov $0,$1 lpe mov $0,$2 div $0,2 add $0,9
Ada/src/Problem_31.adb
Tim-Tom/project-euler
0
20006
with Ada.Text_IO; with Ada.Integer_Text_IO; package body Problem_31 is package IO renames Ada.Text_IO; package I_IO renames Ada.Integer_Text_IO; Type Two_Pounds is new Integer range 0 .. 200; type Coin is new Integer range 1 .. 7; denominations : constant Array(Coin) of Two_Pounds := (200, 100, 50, 20, 10, 5, 2); procedure Solve is function Count_From(amount : Two_Pounds; index : coin) return Integer is sum : Integer := 0; begin if amount = 0 then return 1; end if; declare max_usage : constant Two_Pounds := amount / denominations(index); begin for used in 0 .. max_usage loop if index = Coin'Last then -- remainder is all ones sum := sum + 1; else sum := sum + Count_From(amount - used*denominations(index), index + 1); end if; end loop; end; return sum; end Count_From; begin I_IO.Put(Count_From(Two_Pounds'Last, 1)); IO.New_Line; end Solve; end Problem_31;
slides/Slides.agda
larrytheliquid/generic-elim
11
9914
<gh_stars>10-100 module Slides where import Background import OpenTheory import OpenTheory2 import ClosedTheory import ClosedTheory2 import ClosedTheory3 import ClosedTheory4
asm/ledblink.asm
desaster/verilog-6502-ledblink
5
81202
<gh_stars>1-10 ; Copyright (c) 2018 <NAME>, All rights reserved. ; See the LICENSE file for more information *=$fc00 ; rom is at top of memory fc00-ffff num1 = $0200 ; counter, intended to be attached to leds scountl = $0201 ; sleep counter low byte scounth = $0202 ; sleep counter low byte ldx #$ff ; setup stack txs lda #$00 ; start value sta num1 ; store it to memory loop: lda num1 ; start by reading our value from memory sta $0400 ; write value to gpio - if target board doesn't have ; enough leds, just make sure at least the lowest bit ; is assigned to led inc num1 ; increment value in memory for the next iteration !if SIM = 0 { jsr sleep ; sleep } jmp loop ; software sleep, this of course depends on clock speed sleep: lda #00 ; reset counters sta scountl sta scounth sleep_loop: inc scountl ; increase lower byte of the counter bne sleep_loop ; if low byte didn't loop over, keep looping inc scounth ; low byte looped over, increase high byte bne sleep_loop ; if high byte didn't loop over, keep looping rts ; high byte looped over, we're done ; vim: set ft=acme sw=8 sts=8 noet:
parser-dialect/parser-mysql/src/main/antlr4/imports/mysql/RLStatement.g4
zhaox1n/parser-engine
0
6039
<gh_stars>0 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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. */ grammar RLStatement; import Symbol, Keyword, MySQLKeyword, Literals, BaseRule; rlStatement : (changeMasterTo | startSlave stopSlave) ; changeMasterTo : CHANGE MASTER TO (identifier EQ_ (identifier | ignoredIdentifiers_))+ (FOR CHANNEL identifier)? ; startSlave : START SLAVE threadTypes_ utilOption_* connectionOptions_* channelOption_* ; stopSlave : STOP SLAVE threadTypes_ channelOption_* ; threadTypes_ : threadType_* ; threadType_ : (IO_THREAD | SQL_THREAD) ; utilOption_ : UNTIL ((SQL_BEFORE_GTIDS | SQL_AFTER_GTIDS) EQ_ identifier | MASTER_LOG_FILE EQ_ identifier COMMA_ MASTER_LOG_POS EQ_ identifier | RELAY_LOG_FILE EQ_ identifier COMMA_ RELAY_LOG_POS EQ_ identifier | SQL_AFTER_MTS_GAPS) ; connectionOptions_ : USER EQ_ identifier | PASSWORD EQ_ identifier | DEFAULT_AUTH EQ_ identifier | PLUGIN_DIR EQ_ identifier ; channelOption_ : FOR CHANNEL identifier ;
scripts/decrypt-password-confirmation.applescript
521dimensions/ansible-vault-automator
22
4058
<gh_stars>10-100 on run {input, parameters} set password to the text returned of (display dialog "Enter password to decrypt file(s):" default answer "" buttons {"OK"} default button 1) return password end run
oeis/000/A000425.asm
neoneye/loda-programs
11
167267
<filename>oeis/000/A000425.asm ; A000425: Coefficients of ménage hit polynomials. ; Submitted by <NAME> ; 2,0,0,8,30,192,1344,10800,97434,976000,10749024,129103992,1679495350,23525384064,353028802560,5650370001120,96082828074162,1729886440780800,32874134679574208,657589108734075240,13811277748363437006,303884178002526338624 mov $3,1 add $3,$0 lpb $0 mul $2,$0 sub $0,1 sub $2,$1 add $3,$2 mov $1,$3 add $4,$3 mov $3,$2 mov $2,$4 lpe mov $0,$3 mul $0,2
programs/oeis/017/A017282.asm
karttu/loda
1
7108
; A017282: a(n) = (10*n + 1)^2. ; 1,121,441,961,1681,2601,3721,5041,6561,8281,10201,12321,14641,17161,19881,22801,25921,29241,32761,36481,40401,44521,48841,53361,58081,63001,68121,73441,78961,84681,90601,96721,103041,109561,116281,123201,130321,137641,145161,152881,160801,168921,177241,185761,194481,203401,212521,221841,231361,241081,251001,261121,271441,281961,292681,303601,314721,326041,337561,349281,361201,373321,385641,398161,410881,423801,436921,450241,463761,477481,491401,505521,519841,534361,549081,564001,579121,594441,609961,625681,641601,657721,674041,690561,707281,724201,741321,758641,776161,793881,811801,829921,848241,866761,885481,904401,923521,942841,962361,982081,1002001,1022121,1042441,1062961,1083681,1104601,1125721,1147041,1168561,1190281,1212201,1234321,1256641,1279161,1301881,1324801,1347921,1371241,1394761,1418481,1442401,1466521,1490841,1515361,1540081,1565001,1590121,1615441,1640961,1666681,1692601,1718721,1745041,1771561,1798281,1825201,1852321,1879641,1907161,1934881,1962801,1990921,2019241,2047761,2076481,2105401,2134521,2163841,2193361,2223081,2253001,2283121,2313441,2343961,2374681,2405601,2436721,2468041,2499561,2531281,2563201,2595321,2627641,2660161,2692881,2725801,2758921,2792241,2825761,2859481,2893401,2927521,2961841,2996361,3031081,3066001,3101121,3136441,3171961,3207681,3243601,3279721,3316041,3352561,3389281,3426201,3463321,3500641,3538161,3575881,3613801,3651921,3690241,3728761,3767481,3806401,3845521,3884841,3924361,3964081,4004001,4044121,4084441,4124961,4165681,4206601,4247721,4289041,4330561,4372281,4414201,4456321,4498641,4541161,4583881,4626801,4669921,4713241,4756761,4800481,4844401,4888521,4932841,4977361,5022081,5067001,5112121,5157441,5202961,5248681,5294601,5340721,5387041,5433561,5480281,5527201,5574321,5621641,5669161,5716881,5764801,5812921,5861241,5909761,5958481,6007401,6056521,6105841,6155361,6205081 mov $1,$0 mul $1,10 add $1,1 pow $1,2
graphwalker-dsl/src/main/antlr4/org/graphwalker/dsl/yed/YEdLabelLexer.g4
avito-tech/graphwalker-project
3
3964
<gh_stars>1-10 lexer grammar YEdLabelLexer; DOT : '.'; SLASH : '/'; COLON : ':'; SEMICOLON : ';'; COMMA : ','; ASSIGN : '='; BLOCKED : 'BLOCKED'; SHARED : 'SHARED'; OUTDEGREE : 'OUTDEGREE'; INDEGREE : 'INDEGREE'; INIT : 'INIT'; SET : 'SET' | 'Set' | 'set'; START : [Ss][Tt][Aa][Rr][Tt]; REQTAG : 'REQTAG'; WEIGHT : [Ww][Ee][Ii][Gg][Hh][Tt]; DEPENDENCY : [Dd][Ee][Pp][Ee][Nn][Dd][Ee][Nn][Cc][Yy]; JS_PLUS : '+'; JS_MINUS : '-'; JS_MUL : '*'; JS_MOD : '%'; JS_INC : '++'; JS_DEC : '--'; JS_NOT : '!'; JS_OR : '||'; JS_PLUS_ASSIGN : JS_PLUS ASSIGN; JS_MINUS_ASSIGN : JS_MINUS ASSIGN; JS_MUL_ASSIGN : JS_MUL ASSIGN; JS_DIV_ASSIGN : SLASH ASSIGN; JS_MOD_ASSIGN : JS_MOD ASSIGN; JS_LITERAL : '"' (~["\r\n])* '"'; JS_FUNCTION : 'function(' (Identifier (COMMA Identifier)*)? '){' (JS_FOR|(~[}\r\n]))* '}'; JS_FOR : 'for(' (~[;\r\n])* ';' (~[;\r\n])* ';' (~[;\r\n])* '){' (~[}\r\n])* '}'; JS_BRACES : '{}' | '{' Identifier COLON WHITESPACE* (JS_LITERAL|Value|Identifier|JS_BRACES) '}' | '{' Identifier COLON WHITESPACE* (JS_LITERAL|Value|Identifier|JS_BRACES) (COMMA WHITESPACE* Identifier COLON WHITESPACE* (JS_LITERAL|Value|Identifier|JS_BRACES))+'}'; JS_METHOD_CALL : Identifier '(' (~[)\r\n])* ')'; JS_ARRAY : '[]' | '[' (Identifier|(JS_MINUS? Value)|JS_BRACES) ']' | '[' (Identifier|(JS_MINUS? Value)|JS_BRACES) (COMMA WHITESPACE* (Identifier|(JS_MINUS? Value)|JS_BRACES))+']'; JS_ARRAY_START : '['; JS_ARRAY_END : ']'; HTML_TAG_START : '<html>'; HTML_TAG_END : '</html>'; HTML_TABLE_START: '<table' (WHITESPACE+ Letter+ ASSIGN JS_LITERAL)* '>'; HTML_TABLE_END : '</table>'; HTML_TR_START : '<tr' (WHITESPACE+ Letter+ ASSIGN JS_LITERAL)* '>'; HTML_TR_END : '</tr>'; HTML_TH_START : '<th' (WHITESPACE+ Letter+ ASSIGN JS_LITERAL)* '>'; HTML_TH_END : '</th>'; HTML_TD_START : '<td' (WHITESPACE+ Letter+ ASSIGN JS_LITERAL)* '>'; HTML_TD_END : '</td>'; HTML_BR : '<br/>' -> skip; NestedBrackets : '[' ( ~('[' | ']') | NestedBrackets )* ']' ; BOOLEAN : 'true' | 'false' ; Identifier : Letter LetterOrDigit* ; IDENTIFIER_ARG : ('v_'|'e_') LetterOrDigit+ WHITESPACE* '{' -> pushMode(IN_DESCRIPTION) ; Value : Integer | Integer? ('.' Digit+) ; fragment Integer : '0' | NonZeroDigit Digit* ; fragment Digit : '0' | NonZeroDigit ; fragment NonZeroDigit : [1-9] ; fragment Letter : [a-zA-Z$_] | ~[\u0000-\u00FF\uD800-\uDBFF] {Character.isJavaIdentifierStart(_input.LA(-1))}? | [\uD800-\uDBFF] [\uDC00-\uDFFF] {Character.isJavaIdentifierStart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}? ; fragment LetterOrDigit : [a-zA-Z0-9$_] | ~[\u0000-\u00FF\uD800-\uDBFF] {Character.isJavaIdentifierPart(_input.LA(-1))}? | [\uD800-\uDBFF] [\uDC00-\uDFFF] {Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}? ; LINE_COMMENT : WHITESPACE '//' ~[\r\n]* -> skip ; WHITESPACE : [ \t\r\n\u000C]+ ; JAVADOC_START : '/*' STAR* -> pushMode(IN_DESCRIPTION) ; COMMENT : '/*' ( ~[@*] | ('*' ~'/') )* '*/' ; mode IN_DESCRIPTION; MINUS : '-'; PLUS : '+'; ARG_SPLITTER : ','; CODE_TAG : '@code' DOCSPACE+; BOOLEAN_VALUE : 'true'|'false'; STRING_CAST : '(String)'|'(string)'; NUMBER_CAST : '(Number)'|'(number)'; BOOLEAN_CAST : '(Boolean)'|'(boolean)'; IDENTIFIER_NAME : Letter LetterOrDigit*; ARGS_START : '('; ARGS_END : ')'; JAVADOC_END : WHITESPACE? STAR* '*/' -> popMode; LABEL_ARGS_END : '}' -> popMode; DESCRIPTION_COLON: ':'; DESCRIPTION_COMMENT : (';' | '\r' '\n' | '\n' | '\r') (~'*' | '*' ~'/')* ; STAR : '*' ; DOCSPACE : [ \t\r\n]+ ; STRING_LITERAL : '"' (~[$] | ([$] ~[{])) StringCharacters? '"' ; DATASET_STRING_PARAMETER : '"${' IDENTIFIER_NAME '}"' ; DATASET_PARAMETER : '${' IDENTIFIER_NAME '}' ; fragment LowerCaseLetter : [a-z] ; fragment MethodLetter : [a-zA-Z0-9] ; fragment StringCharacters : StringCharacter+ ; fragment StringCharacter : ~["\\] | EscapeSequence ; fragment EscapeSequence : '\\' [btnfr"'\\] | OctalEscape ; fragment OctalEscape : '\\' OctalDigit | '\\' OctalDigit OctalDigit | '\\' ZeroToThree OctalDigit OctalDigit ; fragment ZeroToThree : [0-3] ; fragment OctalDigit : [0-7] ; REAL_VALUE : Decimal ('.' DecimalDigit+)? ; fragment Decimal : '0' | '1'..'9' DecimalDigit* ; fragment DecimalDigit : '0'..'9' ;
tools/intl_none.adb
thierr26/ada-keystore
25
21893
<reponame>thierr26/ada-keystore<gh_stars>10-100 ----------------------------------------------------------------------- -- intl -- Small libintl binding -- Copyright (C) 2019 <NAME> -- Written by <NAME> (<EMAIL>) -- -- 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 Intl is function Gettext (Message : in String) return String is begin return Message; end Gettext; procedure Initialize (Domain : in String; Dirname : in String) is begin null; end Initialize; function Current_Locale return String is begin return "en"; end Current_Locale; end Intl;
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/a/a55b13a.ada
best08618/asylo
7
14297
<reponame>best08618/asylo -- A55B13A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- USING A CASE_STATEMENT , CHECK THAT IF L , R ARE LITERALS -- OF TYPE T (INTEGER, BOOLEAN, CHARACTER, USER-DEFINED -- ENUMERATION TYPE) THE SUBTYPE BOUNDS ASSOCIATED WITH A -- LOOP OF THE FORM -- FOR I IN L..R LOOP -- ARE THE SAME AS THOSE FOR THE CORRESPONDING LOOP OF THE FORM -- FOR I IN T RANGE L..R LOOP . -- RM 04/07/81 -- SPS 3/2/83 -- JBG 8/21/83 -- PWN 11/30/94 SUBTYPE QUALIFIED LITERALS FOR ADA 9X. WITH REPORT ; PROCEDURE A55B13A IS USE REPORT ; BEGIN TEST("A55B13A" , "CHECK THAT THE SUBTYPE OF A LOOP PARAMETER" & " IN A LOOP OF THE FORM 'FOR I IN " & " LITERAL_L .. LITERAL_R LOOP' IS CORRECTLY" & " DETERMINED" ); DECLARE TYPE ENUMERATION IS ( A,B,C,D,MIDPOINT,E,F,G,H ); ONE : CONSTANT := 1 ; FIVE : CONSTANT := 5 ; BEGIN FOR I IN 1..5 LOOP CASE I IS WHEN 1 | 3 | 5 => NULL ; WHEN 2 | 4 => NULL ; END CASE; END LOOP; FOR I IN REVERSE ONE .. FIVE LOOP CASE I IS WHEN 1 | 3 | 5 => NULL ; WHEN 2 | 4 => NULL ; END CASE; END LOOP; FOR I IN REVERSE FALSE..TRUE LOOP CASE I IS WHEN FALSE => NULL ; WHEN TRUE => NULL ; END CASE; END LOOP; FOR I IN CHARACTER'('A') .. ASCII.DEL LOOP CASE I IS WHEN CHARACTER'('A')..CHARACTER'('U') => NULL ; WHEN CHARACTER'('V')..ASCII.DEL => NULL ; END CASE; END LOOP; FOR I IN CHARACTER'('A')..CHARACTER'('H') LOOP CASE I IS WHEN CHARACTER'('A')..CHARACTER'('D') => NULL ; WHEN CHARACTER'('E')..CHARACTER'('H') => NULL ; END CASE; END LOOP; FOR I IN REVERSE B..H LOOP CASE I IS WHEN B..D => NULL ; WHEN E..H => NULL ; WHEN MIDPOINT => NULL ; END CASE; END LOOP; END ; RESULT ; END A55B13A ;
libsrc/_DEVELOPMENT/adt/w_array/c/sccz80/w_array_resize_callee.asm
teknoplop/z88dk
8
93024
<reponame>teknoplop/z88dk<filename>libsrc/_DEVELOPMENT/adt/w_array/c/sccz80/w_array_resize_callee.asm ; int w_array_resize(w_array_t *a, size_t n) SECTION code_clib SECTION code_adt_w_array PUBLIC w_array_resize_callee EXTERN asm_w_array_resize w_array_resize_callee: pop hl pop de ex (sp),hl jp asm_w_array_resize
oeis/186/A186038.asm
neoneye/loda-programs
11
83305
<gh_stars>10-100 ; A186038: a(n) = log_3(A002426(n)/numerator(A002426(n)/3^n)). ; Submitted by <NAME> ; 0,0,1,0,0,1,1,1,3,0,0,1,0,0,1,2,2,4,1,1,2,1,1,2,2,2,5,0,0,1,0,0,1,1,1,3,0,0,1,0,0,1,5,3,4,2,2,3,2,2,3,3,3,6,1,1,2,1,1,2,2,2,4,1,1,2,1,1,2,3,3,6,2,2,3,2,2,3,3,3,7,0,0,1,0,0,1,1,1,3,0,0,1,0,0,1,2,2,4,1 seq $0,98453 ; Expansion of 1/sqrt(1 - 4*x - 12*x^2). lpb $0 dif $0,3 add $1,1 lpe mov $0,$1
Task/Function-prototype/Ada/function-prototype-4.ada
LaudateCorpus1/RosettaCodeData
1
16930
<filename>Task/Function-prototype/Ada/function-prototype-4.ada package body Stack is procedure Push(Object:Integer) is begin -- implementation goes here end; function Pull return Integer; begin -- implementation goes here end; end Stack;
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnarl/s-tpopsp__vxworks-tls.adb
djamal2727/Main-Bearing-Analytical-Model
0
5136
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- SYSTEM.TASK_PRIMITIVES.OPERATIONS.SPECIFIC -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2020, 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/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This is a VxWorks version of this package using Thread_Local_Storage -- support (VxWorks 6.6 and higher). The implementation is based on __threads -- support. separate (System.Task_Primitives.Operations) package body Specific is ATCB : aliased Task_Id := null; -- Ada Task_Id associated with a thread pragma Thread_Local_Storage (ATCB); ---------------- -- Initialize -- ---------------- procedure Initialize is begin null; end Initialize; ------------------- -- Is_Valid_Task -- ------------------- function Is_Valid_Task return Boolean is begin return ATCB /= Null_Task; end Is_Valid_Task; --------- -- Set -- --------- procedure Set (Self_Id : Task_Id) is begin ATCB := Self_Id; end Set; ---------- -- Self -- ---------- -- To make Ada tasks and C threads interoperate better, we have added some -- functionality to Self. Suppose a C main program (with threads) calls an -- Ada procedure and the Ada procedure calls the tasking runtime system. -- Eventually, a call will be made to self. Since the call is not coming -- from an Ada task, there will be no corresponding ATCB. -- What we do in Self is to catch references that do not come from -- recognized Ada tasks, and create an ATCB for the calling thread. -- The new ATCB will be "detached" from the normal Ada task master -- hierarchy, much like the existing implicitly created signal-server -- tasks. function Self return Task_Id is Result : constant Task_Id := ATCB; begin if Result /= null then return Result; else -- If the value is Null then it is a non-Ada task return Register_Foreign_Thread; end if; end Self; end Specific;