1 /**************************************************************
2 **** Utility.h: Prototypes of nice and helpful functions ****
3 **** Free software under GNU license, written in 9/6/2000 ****
4 **************************************************************/
9 #ifndef INTUITION_INTUITION_H
13 /** Very simple SPrintf-like function **/
14 STRPTR
my_SPrintf(STRPTR fmt
, APTR data
);
18 ULONG sa_NbArgs
; /* Nb. of WBArg */
19 APTR sa_ArgLst
; /* WBArg * */
20 UBYTE sa_Free
; /* Must FreeVec()'ed sa_ArgLst */
23 /** Converts command line arguments into WBArg **/
24 void ParseArgs(StartUpArgs
*, int nb
, char **);
27 /** List manipulation **/
28 void InsertAfter( void *It
,void *Src
);
30 void Destroy( void *First
, void *p
);
33 /** Get include file name **/
34 STRPTR
GetIncludeFile( Project
, LINE
* );
36 /** Like CopyMem but copy buf from end instead of beg. **/
37 void MemMove(UBYTE
*Src
, UWORD Offset
, LONG sz
);
40 /** Pre-computes the 256 first tabstop **/
41 void init_tabstop(UBYTE ts
);
44 /** Returns increment to next tabstop **/
47 /** Shutdown events coming to the window and change pointer **/
48 void BusyWindow(struct Window
*);
50 /** Enable receiving events and reset pointer **/
51 void WakeUp(struct Window
*);
53 /** Simple strings manipulation **/
54 STRPTR
CatPath ( STRPTR dir
, STRPTR file
);
56 /** Display an error in title bar & start a countdown **/
57 void ThrowError (struct Window
*, STRPTR
);
58 void ThrowDOSError (struct Window
*, STRPTR
);
60 /** Update window title **/
61 void UpdateTitle(struct Window
*, Project
);
63 /** Stop countdown msg. and restore original title */
64 void StopError(struct Window
*);
66 /** Check if path already exists **/
67 char warn_overwrite( STRPTR path
);
69 /** Write column/line in top of window **/
70 void draw_info(Project p
);
72 /** Avert user that its file has been modified **/
73 char warn_modif(Project p
);
75 void show_info(Project p
);
77 /** Simple requester to ask user for a number **/
78 int get_number( Project p
, CONST_STRPTR title
, LONG
* result
);
80 /** About requester messages **/
81 extern STRPTR JanoMessages
[];
82 #define MsgAbout (JanoMessages + (MSG_ABOUT - ERR_BADOS))