TailBite 1.0 Preview, soon in PureProject and PureArea

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Progi1984 wrote:Any news about a release with update for creating gadgets with PB ?
You can use CreateGadget from PBOSL
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post by Progi1984 »

And generate a userlib ?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

You can make a UserLib with TailBite and CreateGadget, but the CreateGadget Lib is required
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Dr. Dri
Enthusiast
Enthusiast
Posts: 243
Joined: Sat Aug 23, 2003 6:45 pm

Post by Dr. Dri »

i've found a bug in tailbite, it's makes undefined symbol and dulpicates instructions.

i wanted to make a "BigEndian" lib, and this is an example of working function which doesn't compile.

Code: Select all

ProcedureDLL.w PeekBigEndianW(*MemoryBuffer)
  !MOV   eax, dword [p.p_MemoryBuffer]
  !MOV    ax,  word [eax]
  !BSWAP eax
  !SHR   eax, 16
  ProcedureReturn
EndProcedure
if i get the "/comented" purebasic.asm it looks like this

Code: Select all

; ProcedureDLL.w PeekBigEndianW(*MemoryBuffer)
Macro MP0{
_Procedure0:
_PeekBigEndianW:
  PS0=4                                                                                                                                                                                                                                                     
; !MOV   eax, dword [p.p_MemoryBuffer]
p.p_MemoryBuffer equ esp+PS0+0
MOV   eax, dword [p.p_MemoryBuffer]
; !MOV    ax,  word [eax]
MOV    ax,  word [eax]
; !BSWAP eax
BSWAP eax
; !SHR   eax, 16
SHR   eax, 16
; ProcedureReturn
  JMP   _EndProcedure1
; EndProcedure
  XOr    eax,eax
_EndProcedure1:
  RET    4
}
But tailbite output isn't the same, one line is missing and instead i got the following line (which makes the following line twice)

Code: Select all

format MS COFF

Public PB_PeekBigEndianW




section '.text' code readable executable

PB_PeekBigEndianW:
_PeekBigEndianW:
PS0=4
; !MOV   eax, dword [p.p_MemoryBuffer]
MOV   eax, dword [p.p_MemoryBuffer]
MOV   eax, dword [p.p_MemoryBuffer]
; !MOV    ax,  word [eax]
MOV    ax,  word [eax]
; !BSWAP eax
BSWAP eax
; !SHR   eax, 16
SHR   eax, 16
; ProcedureReturn
JMP   _EndProcedure1
; EndProcedure
XOR    eax,eax
_EndProcedure1:
RET    4
fortunately i can fix this manually :)

Dri
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

Ok, on the list ;)
El_Choni
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Post by Droopy »

Any news :cry: ?
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

El_Choni's HP is down and everyone is wondering why... . Can you tell us something?
bye,
Daniel
User avatar
Falko
Enthusiast
Enthusiast
Posts: 271
Joined: Sat Oct 04, 2003 12:57 pm
Location: Germany
Contact:

Post by Falko »

Where are you, EL-Choni? PB4.01 is good but TailBit chrashed :roll:
Regards Falko from germany
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

EL .. I can give you a permanent home on Liquidbuzz .. you can use
it for betas and full releases. Let me know.

- np
User avatar
Falko
Enthusiast
Enthusiast
Posts: 271
Joined: Sat Oct 04, 2003 12:57 pm
Location: Germany
Contact:

Post by Falko »

EL_Chonis HP ist online, but the TailBite-Version ist v1.3 PR 1.8 do have problems.
Following error has shown with tailibite on PB4.01.
---------------------------
PureBasic - Error
---------------------------
Error: The following PureLibrary is missing: :System
---------------------------
OK
---------------------------
Regards Falko
User avatar
Droopy
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Sep 16, 2004 9:50 pm
Location: France
Contact:

Post by Droopy »

I have the same problem as Falko :(

Use this code to convert PB4 Optionnal parameters to Tailbite optional parameter format :

Code: Select all

;/ PureBasic 4.0 / Droopy 06/11/06

;{/ Enumerations

Enumeration ;/ Zone Fichier
  #Read
  #Write
  #DebutZone
  #DansZone
  #FinZone
  #HorsZone
EndEnumeration

Enumeration ;/ Zone de Procédure
  #Inconnu
  #Variable
  #Valeur
  #Commentaires
EndEnumeration

;}

Structure DetailProcedure
  Optionnel.l
  NomVariable.s
  Valeur.s
EndStructure

Global NewList Proc.DetailProcedure(), ContenuProcedure.s

Procedure InsertionTBProcedure(Ligne.s)
  
  ClearList(Proc())
  
  ;/ Mise en forme de la ligne
  Ligne=LTrim(RTrim(Ligne))
  
  ;/ Extraction du Nom de la procedure
  NomProcedure.s=StringField(Ligne,2," ")
  NomProcedure=LTrim(RTrim(StringField(NomProcedure,1,"(")))
  
  ;/ Garde juste les paramètres
  Ligne.s=LTrim(RTrim(Right(Ligne,Len(Ligne)-14-Len(NomProcedure))))
  
  Zone=#Inconnu
  For n=1 To Len(Ligne)
    
    c.s=Mid(Ligne,n,1)
    a=Asc(c)
    
    Select Zone
      
      Case #Inconnu
        If (a>64 And a<91) Or (a>96 And a<123) ;/ C'est un nom de variable
          AddElement(Proc())
          Proc()\NomVariable+c
          Zone=#Variable
        ElseIf c=")"
          Zone=#Commentaires
        EndIf
        
      Case #Variable
        Select c
          Case ")"
            Zone=#Commentaires
          Case ","
            Zone=#Inconnu
          Case " "
            
          Case "="
            NbParaOptionnels+1
            Proc()\Optionnel=1
            Zone=#Valeur
            
          Default
            Proc()\NomVariable+c
        EndSelect
        
        
      Case #Valeur
        
        If a=34 ;/ Détermine si je rentre ou sort d'une zone de guillemet
          If ZoneGuillemet=1
            ZoneGuillemet=0
          Else
            ZoneGuillemet=1
          EndIf
        EndIf
        
        If ZoneGuillemet=1
          Proc()\Valeur+c 
        Else
          Select c  
            Case ","
              Zone=#Inconnu
              
            Case ")"
              Zone=#Commentaires
              
            Default
              Proc()\Valeur+c
              
          EndSelect
        EndIf
        
      Case #Commentaires
        Commentaires.s+c
        
    EndSelect
  Next
  
  Commentaires=LTrim(RTrim(Commentaires))
  Commentaires=LTrim(Right(Commentaires,Len(Commentaires)-1))
  
  If NbParaOptionnels 
    ;- Il y a des paramètres optionnels
    
    ; Ecriture de la déclaration
    Temp.s="Declare "+NomProcedure+Str(NbParaOptionnels+1)+"("
    ForEach Proc()
      Temp+Proc()\NomVariable
      
      If ListIndex(Proc())<CountList(Proc())-1
        Temp+"," ; Ajoute une virgule uniquement si necessaire entre chaque variable
      EndIf
    Next
    Temp+")"
    WriteStringN(#Write,Temp)
    
    For n= 0 To NbParaOptionnels
      
      ; Ecrit le nom de la procédure
      Temp.s=#crlf$+"ProcedureDLL "+NomProcedure
      
      ; Ecriture du N° de la procédure
      If n
        Temp+Str(n+1)
      EndIf
      Temp+ "("
      
      ; Ecrit juste les paramètres necessaires
      ForEach Proc()
        
        If ListIndex(Proc())=n
          Break ; Quitte si on atteind le paramètre max requis
        EndIf
        
        Temp+Proc()\NomVariable
        
        If ListIndex(Proc())<n-1 
          Temp+"," ; Ajoute une virgule uniquement si necessaire entre chaque variable
        EndIf
        
      Next
      
      ; Finalise la ligne de ProcedureDLL en y ajoutant les commentaires
      Temp+")"
      If Commentaires<>""
        Temp+" ; "+Commentaires
      EndIf
      
      WriteStringN(#Write,Temp)
      If n=NbParaOptionnels
        ; Ecriture du contenu de la procédure
        WriteStringN(#Write,ContenuProcedure)
      Else
        ; Ecriture de l'appel à la procédure principale
        Temp2.s="  "+NomProcedure+Str(NbParaOptionnels+1)+"("
        ForEach Proc()
          If ListIndex(Proc())>n-1
            Temp2+Proc()\Valeur
          Else
            Temp2+Proc()\NomVariable
          EndIf
          
          If ListIndex(Proc())<CountList(Proc())-1 
            Temp2+"," ; Ajoute une virgule uniquement si necessaire entre chaque variable
          EndIf
        Next
        Temp2+")"
        
        WriteStringN(#Write,Temp2)
        WriteStringN(#Write,"EndProcedure")
      EndIf
      
    Next
    
    
  Else 
    ;- Aucun paramètre optionnels
    Temp.s="ProcedureDLL "+NomProcedure+"("
    ForEach Proc()
      Temp+Proc()\NomVariable
      If ListIndex(Proc())<CountList(Proc())-1
        Temp+"," ; Ajoute une virgule uniquement si necessaire entre chaque variable
      EndIf
    Next
    Temp+")"
    If Commentaires<>""
      Temp+" ; "+Commentaires
    EndIf
    
    WriteStringN(#Write,Temp)
    WriteStringN(#Write,ContenuProcedure)
    
  EndIf
  
EndProcedure

Procedure TBOP(FileIn.s,FileOut.s,TailbitePath.s,Compile)
  
  ;{/ Boucle de lecture du fichier en entrée / Génération du fichier de sortie
  
  CreateFile(#Write,FileOut)
  If ReadFile(#Read,FileIn)=0 
    End 
  EndIf
  
  ZoneFichier=#HorsZone
  
  While Eof(#Read)=0
    
    Ligne.s=ReadString(#Read)
    Temp.s=UCase(LTrim(Ligne))
    
    If Left(Temp,12)="PROCEDUREDLL"
      ZoneFichier=#DebutZone
      LigneProcedure.s=Ligne
    ElseIf Left(Temp,12)="ENDPROCEDURE" And (ZoneFichier=#DebutZone Or ZoneFichier=#DansZone)
      ZoneFichier=#FinZone
    EndIf
    
    Select ZoneFichier
      Case #HorsZone
        WriteStringN(#Write,Ligne)
        
      Case #DebutZone
        ZoneFichier=#DansZone
        ContenuProcedure.s=""
        
      Case #DansZone
        If ContenuProcedure=""
          ContenuProcedure.s+Ligne
        Else
          ContenuProcedure.s+#crlf$+ Ligne
        EndIf
        
      Case #FinZone
        ZoneFichier=#HorsZone
        ContenuProcedure+#crlf$+Ligne
        InsertionTBProcedure(LigneProcedure)
         
    EndSelect
    
  Wend
  ;}
  
  CloseFile(#Read)
  CloseFile(#Write)
  
  If Compile
    RunProgram("TailBite.exe",FileOut,TailbitePath)
  EndIf
  
EndProcedure

; TBOP("d:\affiche.pb","d:\Out.txt","c:\Program Files\PureBasic4\TailBite",#True)
User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post by Progi1984 »

I think that Tailbite must find a new maintainer !
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

@Droopy
Use this code to convert PB4 Optionnal parameters to Tailbite optional parameter format :
don´t work for me :

Tailbite says : Error: Line 233 - Syntax error!

Line 233 :
ProcedureDLL Print_SetUnits(s(Unit.l)

Code: Select all

TBOP("C:\Programme\PureBasic400\Examples\Printer_Lib\Source\Printer_Lib.pb","C:\Programme\PureBasic400\Examples\Printer_Lib\Source\Out.txt","c:\Programme\PureBasic400\TailBite",#True) 
Source code is my PrinterLib

Regards Klaus
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

can this solve the problem with tailbite :?:
feedback please :twisted:

Code: Select all

Procedure SplitFunctions(FileStart, FileEnd, DestFolder$, FinalDestFolder$, mID)
  FileSeeker = FileStart
  AsmHeader$ = "The header must remain intact for Re-Assembly"+WNL$+"; "+WNL$
  FileSeeker = FindNextString(AsmHeader$, FileSeeker, FileEnd)+Len(AsmHeader$)
  HeaderEnd$ = "; "+WNL$+"format MS COFF"
  While PeekS(FileSeeker, Len(HeaderEnd$))<>HeaderEnd$ And FileSeeker<FileEnd
    PBLibName$ = RemoveString(GetNextString(FileSeeker, WNL$), "; ")
    If PBLibName$="ImagePlugin" And IPluginAdded=0
      AddElement(PBLib())
      PBLib() = "ImagePlugin"
      IPluginAdded=1
    ElseIf PBLibName$="Gadget" And GadgetAdded=0
      AddElement(PBLib())
      PBLib() = "Gadget"
      GadgetAdded=1
    Else
      If Left(PBLibName$, Len("TB_Include"))="TB_Include"
        Included$ = Right(PBLibName$, Len(PBLibName$)-Len("TB_Include"))
        AlreadyThere = 0
        ForEach PBLib()
          If PBLib()=Included$
            AlreadyThere = 1
            Break
          EndIf
        Next
        If AlreadyThere=0
          AddElement(PBLib())
          PBLib() = Included$
        EndIf
      Else
        Select PBLibName$
          Case "TB_GadgetExtension"
            AddTB_GadgetExtension = 1
              AddElement(PBLib())
              PBLib() = "Gadget"
              GadgetAdded = 1
          Case "TB_Debugger"
            AddTB_Debugger = 1
          Case "TB_ImagePlugin"
            If IPluginAdded=0
              AddElement(PBLib())
              PBLib() = "ImagePlugin"
              IPluginAdded = 1
            EndIf
            AddTB_ImagePlugin = 1
          Default
            If PBLibName$=":System" ; here we can end the search for PBLibs (ABBKlaus 11.11.2006 00:33)
              Break
            EndIf
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

ABBKlaus wrote:can this solve the problem with tailbite :?:
feedback please :twisted:
What problem please ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply