Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions functionsLib/Makefile.vbcc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CC := vc +aos68k
CFLAGS :=
AR := join

OBJS := functions.o
DEPS := functions.h

all: functions.lib

%.o: %.c $(DEPS)
$(CC) $(CFLAGS) -c -o $@ $<

functions.lib: $(OBJS)
$(AR) $^ AS $@
8 changes: 4 additions & 4 deletions functionsLib/functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ BOOL fileExist(STRPTR filePath)
/*===============================
RunDAControl
===============================*/
void RunDAControl(char parameter[BUFFERSIZE])
void RunDAControl(char *parameter)
{
char dacontrolPATH[BUFFERSIZE];
strcpy(dacontrolPATH, "SYS:C/DAControl ");
strcat(dacontrolPATH, parameter);
Execute(dacontrolPATH, NULL, NULL);
Execute(dacontrolPATH, 0, 0);
}

/*===============================
Expand Down Expand Up @@ -79,7 +79,7 @@ char* fulltrim(char* str)
return str;
}

extern BOOL isContainsAdfExt(STRPTR filePath)
BOOL isContainsAdfExt(STRPTR filePath)
{
int i;
char * isPointAdfStr;
Expand All @@ -92,4 +92,4 @@ extern BOOL isContainsAdfExt(STRPTR filePath)

isPointAdfStr = strstr(fPath, padf);
if(isPointAdfStr) return 1; else return 0;
}
}
2 changes: 1 addition & 1 deletion functionsLib/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define BUFFERSIZE 0X200

extern BOOL fileExist(STRPTR filePath);
extern void RunDAControl(char parameter[BUFFERSIZE]);
extern void RunDAControl(char *parameter);
extern char* fulltrim(char* str);
extern char* substring(char*, int , int);
extern BOOL isContainsAdfExt(STRPTR filePath);
Expand Down
Binary file removed functionsLib/functions.lib
Binary file not shown.
Binary file removed functionsLib/functions.o
Binary file not shown.
14 changes: 14 additions & 0 deletions src/Makefile.vbcc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CC := vc +aos68k
CFLAGS := -c99
LIBS := -lfunctions -lamiga -lreaction

OBJS := main.o
DEPS := menu.h includes.h version.h

all: DAControlGUI

%.o: %.c $(DEPS)
$(CC) $(CFLAGS) -c -o $@ $<

DAControlGUI: $(OBJS)
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
19 changes: 19 additions & 0 deletions src/functions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef FUNCTIONS_H
#define FUNCTIONS_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <exec/types.h>
#include <proto/dos.h>

#define BUFFERSIZE 0X200

extern BOOL fileExist(STRPTR filePath);
extern void RunDAControl(char *parameter);
extern char* fulltrim(char* str);
extern char* substring(char*, int , int);
extern BOOL isContainsAdfExt(STRPTR filePath);

#endif
Binary file removed src/functions.lib
Binary file not shown.
123 changes: 66 additions & 57 deletions src/includes.h
Original file line number Diff line number Diff line change
@@ -1,57 +1,66 @@
#ifndef INCLUDES_H
#define INCLUDES_H

#define STREQUAL(s1, s2) (strcmp(s1, s2) == 0)

#include <stdlib.h>
#include <stdio.h>

#include <exec/types.h>
#include <libraries/gadtools.h>
#include <intuition/intuition.h>
#include <exec/execbase.h>

#include <classes/window.h>
#include <gadgets/layout.h>
#include <proto/layout.h>
#include <proto/window.h>

#include <gadgets/button.h>
#include <proto/listbrowser.h>
#include <gadgets/listbrowser.h>
#include <proto/integer.h>
#include <gadgets/integer.h>
#include <proto/checkbox.h>
#include <gadgets/checkbox.h>
#include <proto/label.h>
#include <images/label.h>
#include <proto/getfile.h>
#include <gadgets/getfile.h>
#include <proto/chooser.h>
#include <gadgets/chooser.h>
#include <proto/string.h>
#include <gadgets/string.h>

#include <workbench/workbench.h>
#include <proto/dos.h>

#define ALL_REACTION_MACROS
#define ALL_REACTION_CLASSES
#include <reaction/reaction.h>
#include <reaction/reaction_macros.h>

#define ASM __asm
#define REG(x) register __ ## x

#define BASEDEF(base) struct Library *base##Base = NULL
#define OPENLIB(base,name) if (!((base##Base) = OpenLibrary ((name),0))) CloseLibs()
#define CLOSELIB(base) if (base##Base) {CloseLibrary (base##Base); base##Base=NULL;}

#define NAME_MAX 0X020
#define PATH_MAX 0X100
#define MAX_LISTED_ADF 0X200
#define BUFFERSIZE 0X200

#include <string.h>

#endif
#ifndef INCLUDES_H
#define INCLUDES_H

#define STREQUAL(s1, s2) (strcmp(s1, s2) == 0)

#include <stdlib.h>
#include <stdio.h>

#include <exec/types.h>
#include <libraries/gadtools.h>
#include <intuition/intuition.h>
#include <exec/execbase.h>

#include <classes/window.h>
#include <gadgets/layout.h>
#include <proto/layout.h>
#include <proto/window.h>

#include <gadgets/button.h>
#include <proto/listbrowser.h>
#include <gadgets/listbrowser.h>
#include <proto/integer.h>
#include <gadgets/integer.h>
#include <proto/checkbox.h>
#include <gadgets/checkbox.h>
#include <proto/label.h>
#include <images/label.h>
#include <proto/getfile.h>
#include <gadgets/getfile.h>
#include <proto/chooser.h>
#include <gadgets/chooser.h>
#include <proto/string.h>
#include <gadgets/string.h>

#include <workbench/workbench.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/gadtools.h>
#include <proto/icon.h>
#include <proto/intuition.h>
#include <proto/utility.h>
#include <proto/wb.h>

#include <clib/alib_protos.h>
#include <clib/reaction_lib_protos.h>

#define ALL_REACTION_MACROS
#define ALL_REACTION_CLASSES
#include <reaction/reaction.h>
#include <reaction/reaction_macros.h>

#define ASM __asm
#define REG(x) register __ ## x

#define BASEDEF(base) struct Library *base##Base = NULL
#define OPENLIB(base,name) if (!((base##Base) = OpenLibrary ((name),0))) CloseLibs()
#define CLOSELIB(base) if (base##Base) {CloseLibrary (base##Base); base##Base=NULL;}

#define NAME_MAX 0X020
#define PATH_MAX 0X100
#define MAX_LISTED_ADF 0X200
#define BUFFERSIZE 0X200

#include <string.h>

#endif
28 changes: 19 additions & 9 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ NOSTanDardIO

#include "includes.h"
#include "menu.h"
#include "functions.h"
#include "version.h"

BASEDEF(Intuition);
BASEDEF(Utility);
BASEDEF(GadTools);
BASEDEF(Icon);
BASEDEF(Workbench);
BASEDEF(Window);
Expand Down Expand Up @@ -174,6 +178,9 @@ int main(void)
OPENLIB(Dos, "dos.library");
OPENLIB(Icon, "icon.library");
OPENLIB(Workbench, "workbench.library");
OPENLIB(GadTools, "gadtools.library");
OPENLIB(Intuition, "intuition.library");
OPENLIB(Utility, "utility.library");

ret = appMain();

Expand All @@ -194,7 +201,7 @@ int appMain()
UWORD code;

ScreenPtr = LockPubScreen(NULL);
VisualInfoPtr = GetVisualInfo(ScreenPtr, NULL);
VisualInfoPtr = GetVisualInfoA(ScreenPtr, NULL);
//InitHook(&HookStruct, HookFunc, NULL);


Expand All @@ -211,7 +218,7 @@ int appMain()
dobj=GetDiskObject(appPath);
if(dobj!=0)
{
dobj->do_Type=NULL;
dobj->do_Type=0;
}

if (!(WindowObjectPtr = NewObject
Expand Down Expand Up @@ -316,7 +323,7 @@ int appMain()
done=TRUE;
}

UnlockPubScreen(ScreenPtr);
UnlockPubScreen(NULL, ScreenPtr);
ScreenPtr = NULL;

if (!(WindowPtr = (struct Window *) DoMethod(WindowObjectPtr, WM_OPEN, NULL)))
Expand Down Expand Up @@ -413,7 +420,7 @@ int appMain()
FreeVisualInfo(VisualInfoPtr);

// delete log file
Execute("Delete RAM:dacgui.log >NIL:", NULL, NULL);
Execute("Delete RAM:dacgui.log >NIL:", 0, 0);

return 0;
}
Expand Down Expand Up @@ -467,7 +474,7 @@ void CloseLibs(void)
{
if (ScreenPtr)
{
UnlockPubScreen(NULL);
UnlockPubScreen(NULL, ScreenPtr);
ScreenPtr = NULL;
}

Expand All @@ -481,6 +488,9 @@ void CloseLibs(void)

if (AppPort) DeleteMsgPort(AppPort);

CLOSELIB(Intuition);
CLOSELIB(Utility);
CLOSELIB(GadTools);
CLOSELIB(Workbench);
CLOSELIB(Icon);
CLOSELIB(Layout);
Expand Down Expand Up @@ -553,7 +563,7 @@ void ProcessMenuIDCMPdacMenu(UWORD MenuNumber)
break;

case HelpMenuManual :
Execute(manualPath, NULL, NULL);
Execute(manualPath, 0, 0);
break;
}
break;
Expand Down Expand Up @@ -662,7 +672,7 @@ void createADFList(void)

if(fp)
{
UBYTE buffer[BUFFERSIZE];
char *buffer = AllocVec(BUFFERSIZE, MEMF_CLEAR);
while(FGets(fp, buffer, BUFFERSIZE))
{
if((count>0)&&(strlen(buffer)>0))
Expand All @@ -672,7 +682,7 @@ void createADFList(void)
col2[count-1]= fulltrim(substring(buffer, 18, 32)); // volume name
col4[count-1]= fulltrim(substring(buffer, 79, 11)); // access
col5[count-1]= fulltrim(substring(buffer, 91, strlen(buffer)-90)); // file
free(buffer);
FreeVec(buffer);
}
count++;
}
Expand Down Expand Up @@ -1270,4 +1280,4 @@ void iconify(void)
{
done = TRUE;
}
}
}
Loading