#ifndef GIMMELIB_FUNCTIONS_H
#define GIMMELIB_FUNCTIONS_H

#include <exec/types.h>
#include <intuition/intuition.h>
#include <exec/memory.h>
#ifdef AZTEC_C
#include <functions.h>
#endif AZTEC_C

/* short defines for system structs used below */
#include "gimmelib/gimshortdefs.h"

/* these ones have custom structs */
#include "gimmelib/sound.h"
#include "gimmelib/picture.h"
#include "gimmelib/graph.h"
#include "gimmelib/communic.h"


/* bitmap.c */
BITMAP *    gimmeBitMap(/*  SHORT depth, SHORT width, SHORT height  */);
short	    getRidOfBitMap(/*  BITMAP*  */);

/* bitplane.c (bitplane.h) */
ULONG	    gimmeBitPlanes(/*  BITMAP*, ULONG myflags  */);
short	    getRidOfBitPlanes(/*  BITMAP*, ULONG myflags  */);

/* color.c (color.h) */
USHORT *    getDefaultColors();
short	    setColors(/*  SCREEN*, USHORT* ctable, SHORT colors  */);
short	    checkColors(/*  SCREEN*, SHORT colors */);

/* communic.c (communic.h) */
short	    c_init();
short	    c_done();
short	    c_open(/*  SERPARMS*  */);
short	    c_setup(/*  SERPARMS*  */);
short	    c_close();
short	    c_emptyc();
short	    c_getc(/*  char*  */);
short	    c_gets(/*  char*, SHORT num  */);
short	    c_getline(/*  char*, SHORT num  */);
short	    c_setEOL(/*  char  */);
short	    c_putc(/*  char  */);
short	    c_puts(/*  char*, SHORT num  */);

/* copystuff.c (copystuff.h) */
BORDER *    copyBorder(/*  void** memheadptr, BORDER*, SHORT numbord,
				ULONG myflags  */);
IMAGE *     copyImage(/*  void** memheadptr, IMAGE*, SHORT numimage,
				ULONG myflags  */);
short	    copyDataImage(/*  USHORT* srcdata, IMAGE*  */);
short	    copyImageData(/*  IMAGE*, USHORT* destdata  */);
ITEXT *     copyIntuiText(/*  void** memheadptr, ITEXT*, SHORT numitext,
				ULONG myflags  */);
MENU *	    copyMenu(/*  void** memheadptr, MENU*, SHORT nummenu, SHORT numitem,
				SHORT numsub, ULONG myflags  */);
MENUITEM *  copyMenuItem(/*  void** memheadptr, MENU*, SHORT numitem,
				SHORT numsub, ULONG myflags  */);

/* dbuf.c (minterm.h) */
short	    makeDBuf(/*  SCREEN*, BITMAP** bmptr  */);
short	    unmakeDBuf(/*  SCREEN*, BITMAP** bmptr, BITMAP*  */);
short	    swapDBuf(/*  SCREEN*, SHORT minterm  */);

/* dbufquick.c (minterm.h) */
short	    makeDBufQuick(/*  SCREEN*, BITMAP** bmptr, CPRLIST** lcpr,
				CPRLIST** scpr	*/);
short	    unmakeDBufQuick(/*  SCREEN*, BITMAP** bmptr, BITMAP*,
				CPRLIST** lcpr, CPRLIST** scpr	*/);
short	    swapDBufQuick(/*  SCREEN*, SHORT minterm, CPRLIST** lcpr,
				CPRLIST** scpr	*/);

/* dbufvquick.c (minterm.h) */
short	    makeDBufVQuick(/*  SCREEN*, BITMAP** bmptr  */);
short	    unmakeDBufVQuick(/*  SCREEN*, BITMAP** bmptr, BITMAP*  */);
short	    swapDBufVQuick(/*  SCREEN*, SHORT minterm  */);

/* dualpf.c */
short	    makeDualPlayfield(/*  SCREEN*, RASINFO*, SHORT depth  */);
short	    unmakeDualPlayfield(/*  SCREEN*  */);

/* font.c */
TEXTFONT *  gimmeFont(/*  TEXTATTR*  */);
TEXTFONT *  gimmeFontLazy(/*  UBYTE *name, UWORD size  */);
short	    getRidOfFont(/*  TEXTFONT*  */);

/* gadget.c (gadget.h) */
GADGET *    gimmeBoolGadget(/*  WINDOW*, USHORT id, SHORT left, SHORT top,
				SHORT xsize, SHORT ysize, UBYTE* s, UBYTE* s2,
				TEXTATTR*, ULONG myflags  */);
GADGET *    gimmeBoolImageGadget(/*  WINDOW*, USHORT id, SHORT left, SHORT top,
				SHORT depth, SHORT width, SHORT height,
				ULONG myflags, SHORT dep2, SHORT wid2,
				SHORT ht2  */);
GADGET *    gimmePropGadget(/*  WINDOW*, USHORT id, SHORT left, SHORT top,
				SHORT xsize, SHORT ysize, UBYTE* label,
			       TEXTATTR*, ULONG activflags, ULONG propflags  */);
PROPINFO *  gimmePropInfo(/*  void** memheadptr, ULONG flags  */);
GADGET *    gimmeStringGadget(/*  WINDOW*, USHORT id, SHORT left, SHORT top,
				SHORT width, SHORT maxbuf, UBYTE* initstr,
				UBYTE* label, TEXTATTR*, ULONG activflags  */);
STRINGINFO *gimmeStringInfo(/*  void** memheadptr, SHORT bufsize, UBYTE *s,
				ULONG flags  */);
short	    getRidOfGadgets(/*  GADGET* firstgadget  */);

/* gadgstuff.c */
short	    clearGadgets(/*  GADGET* firstgadget, WINDOW*, REQUESTER*,
				SHORT numgad  */);
short	    toggleBoolGadget(/*  WINDOW*, GADGET*, REQUESTER*  */);
GADGET *    findGadget(/*  GADGET*, USHORT id  */);
GADGET *    findMyFirstGadget(/*  WINDOW*, USHORT id  */);

/* graph.c (graph.h) */
GRAPH *     gimmeGraph(/*  NEWGRAPH*, BITMAP*, AREAINFO*, TMPRAS*  */);
short	    getRidOfGraph(/*  GRAPH*  */);
VOID	    clearGraph(/*  GRAPH*  */);
VOID	    resetGraph(/*  GRAPH*  */);
VOID	    drawGraphAxesOnly(/*  GRAPH*  */);
SHORT	    drawGraphAxes(/*  GRAPH*  */);
VOID	    drawGraphTitle(/*  GRAPH*, SHORT xoff, SHORT yoff,
				ULONG myflags  */);
VOID	    drawGraphXtitle(/*  GRAPH*, SHORT xoff, SHORT yoff,
				ULONG myflags  */);
VOID	    drawGraphYtitle(/*  GRAPH*, SHORT xoff, SHORT yoff,
				ULONG myflags  */);
SHORT	    graphWriteLabel(/*  GRAPH*, ULONG myflags, SHORT first, SHORT last,
				SHORT step  */);
VOID	    addToGraph(/*  GRAPH*, x, y  */);

/* inputhand.c */
IOSTDREQ *  addInputHandler(/*  void (*handler)(), APTR data, BYTE pri,
				UBYTE* name  */);
short	    removeInputHandler(/*  IOSTDREQ*  */);

/* intuistuff.c */
BORDER *    gimmeBorder(/*  void** memheadptr, SHORT xsize, SHORT ysize  */);
IMAGE *     gimmeImage(/*  void** memheadptr, SHORT depth, SHORT width,
				SHORT height  */);
ITEXT *     gimmeIntuiText(/*  void** memheadptr, UBYTE *s, TEXTATTR*,
				SHORT optwidth	*/);

/* keyboard.c */
SHORT	    deadKeyConvert(/*  IMSG, UBYTE* buf, USHORT size, KEYMAP*  */);

/* menu.c */
MENU *	    gimmeMenu(/*  void** memheadptr, SHORT left, SHORT width,
				UBYTE* name, ULONG flags  */);
MENUITEM *  gimmeMenuItem(/*  void** memheadptr, SHORT left, SHORT width,
				SHORT height, BYTE command, UBYTE* name,
				TEXTATTR* textattr, ULONG flags  */);

/* menustuff.c (menustuff.h) */
ULONG	    addMenuItem(/*  MENU*, MENUITEM*, SHORT positem, SHORT possub,
				SHORT numitem, ULONG myflags  */);
MENUITEM *  removeMenuItem(/*  MENU *, MENUITEM*, SHORT positem, SHORT possub,
				SHORT numitem, ULONG myflags  */);
ULONG	    addMenu(/*  MENU** menuptr, MENU*, SHORT posmenu,
				SHORT nummenu, ULONG myflags  */);
MENU *	    removeMenu(/*  MENU** menuptr, MENU*, SHORT posmenu,
				SHORT nummenu, ULONG myflags  */);
short	    adjustMenuLefts(/*  MENU* menu, MENU* stop, SHORT leftedge,
				ULONG myflags  */);
short	    adjustMenuItems(/*  ITEM* item, ITEM* stop, SHORT topedge,
				SHORT meposition, ULONG myflags  */);

/* memchain.c */
void *	    chainAllocMem(/*  void** memheadptr, ULONG size, ULONG flags  */);
VOID	    chainFreeMem(/*  void* memhead  */);
short	    linkChainMem(/*  void** memheadptr, void* memhead  */);
short	    pluckChainMem(/*  void** memheadptr, void* memory  */);

/* message.c */
MESSAGE *   gimmeMessage(/*  ULONG size, MSGPORT*  */);
short	    getRidOfMessage(/*  MESSAGE*  */);

/* picture.c (picture.h) */
PICTURE *   gimmePicture(/*  UBYTE* filename, ULONG myflags  */);
short	    getRidOfPicture(/*  PICTURE*  */);
short	    positionPicture(/*  RASTPORT*, ULONG myflags, PICTURE*,
				SHORT minterm, SHORT x, SHORT y  */);
short	    usePictureColors(/*  PICTURE*, SCREEN*  */);

/* postext.c (postext.h) */
SHORT	    positionText(/*  RASTPORT*, ULONG myflags, UBYTE* s, LONG num,
				SHORT x, SHORT y  */);

/* requester.c (requester.h) */
SHORT	    gimmeAutoRequest(/*  WINDOW*, UBYTE* string, TEXTATTR*  */);
REQUESTER * gimmeRequester(/*  void** memheadptr, SHORT left, SHORT top,
			SHORT width, SHORT height, UBYTE backfill,
			GADGET* gplist, UBYTE *s, TEXTATTR*, ULONG flags  */);

/* screen.c */
NEWSCREEN * gimmeNewScreen(/*  ULONG modes, ULONG type, SHORT depth,
				UBYTE* title, TEXTATTR*  */);
short	    getRidOfNewScreen(/*  NEWSCREEN*  */);
SCREEN *    gimmeScreen(/*  NEWWINDOW*, WINDOW** winptr, SHORT depth,
				ULONG IDCMPflags, ULONG winflags  */);
SCREEN *    gimmeScreenLazy(/*  NEWWINDOW*, WINDOW** winptr, SHORT depth  */);
short	    getRidOfScreen(/*  SCREEN*, WINDOW*  */);
short	    lowerScreen(/*  SCREEN*, SHORT toheight  */);
short	    raiseScreen(/*  SCREEN*, SHORT toheight  */);

/* scrollbar.c (scrollbar.h) */
GADGET *    gimmeFullScrollBar(/*  WINDOW*, USHORT id, ULONG propflags,
				ULONG myflags, USHORT id1, USHORT id2  */);
GADGET *    gimmeScrollBar(/*  WINDOW*, USHORT id, ULONG propflags,
				ULONG myflags  */);
GADGET *    gimmeOneScroll(/*  WINDOW*, USHORT id, ULONG dirflags,
				ULONG myflags  */);

/* sound.c (sound.h) */
SOUND *     gimmeSound(/*  UBYTE* filename  */);
short	    getRidOfSound(/*  SOUND*  */);

/* stdstuff.c (stdstuff.h) */
ULONG	    gimmeStdStuff(/*  ULONG myflags, SHORT rev  */);
ULONG	    getRidOfStdStuff(/*  ULONG myflags  */);

/* subtinit.c */
short	    initSubTasker(/*  SHORT*, MSGPORT**  */);
short	    doneSubTasker(/*  SHORT*, MSGPORT**  */);
SHORT	    handleSpecialSubTaskMsg(/*  SHORT*, MSGPORT**  */);
short	    doPrintf(/*  MSGPORT* dosport, MSGPORT* replyport, UBYTE* s,
				LONG p1, LONG p2, double p3, double p4	*/);

/* subtask.c */
TASK *	    gimmeSubTask(/*  SHORT*, MSGPORT**, LONG stacksize, LONG datasize,
				MSGPORT** myportptr  */);
VOID	    undoGimmeSubTask(/*  TASK*  */);
short	    startSubTask(/*  TASK*, char* name, BYTE pri,
				void (*initialpc)(), void (*finalpc)()  */);
VOID	    killSubTask(/*  SHORT*, MSGPORT**, TASK*  */);

/* timer.c */
TIMEREQ *   accessTimer(/*  ULONG unit, MSGPORT** msgportptr  */);
LONG	    releaseTimer(/*  TIMEREQ* master, MSGPORT* saveport  */);
TIMEREQ *   gimmeTimeRequest(/*  TIMEREQ* master  */);
LONG	    getRidOfTimeRequest(/*  TIMEREQ* slave  */);

/* timerstuff.c */
LONG	    timeDelay(/*  ULONG secs, ULONG micros, ULONG unit, TIMEREQ*  */);
TIMEREQ *   timeDelayAsync(/*  ULONG secs, ULONG micros, ULONG unit,
				TIMEREQ*  */);
LONG	    waitTimer(/*  TIMEREQ*  */);
LONG	    killTimeDelay(/*  TIMEREQ*  */);
short	    getSysTime(/*  ULONG* secsptr, ULONG* microsptr, TIMEREQ*  */);
short	    setSysTime(/*  ULONG secs, ULONG micros, TIMEREQ*  */);

/* window.c (window.h) */
NEWWINDOW * gimmeNewWindow(/*  UBYTE* title, SCREEN*, SHORT left, SHORT top,
			    ULONG IDCMPflags, ULONG flags  */);
short	    getRidOfNewWindow(/*  NEWWINDOW*  */);
WINDOW *    gimmeWindow(/*  NEWWINDOW*, SHORT depth, SHORT width,
			    SHORT height  */);
short	    getRidOfWindow(/*  WINDOW*  */);

/* undefine the gimshortdefs.h defines to avoid possible redefined symbols */
#include "gimmelib/gimNOshortdefs.h"

#endif !GIMMELIB_FUNCTIONS_H
