Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who's Online
19 user(s) are online (15 user(s) are browsing Forum)

Members: 0
Guests: 19

more...

Browsing this Thread:   1 Anonymous Users



« 1 (2)


Re: Dynamic Lists, Hooks, Zune and Mr. X random's leisure gang

Joined:
2009/5/15 13:18
From Naples, Italy
Group:
Member
Posts: 415
Offline
thk you! i downloaded those from the main page (files) :)
Now when i run my app from shell it crashes. Do you know if there's any difference when you run an executable from the shell or from wanderer? (like in morphos with -nostlib? or -noixemul?)

Posted on: 2012/12/30 1:44
_________________
Somethin'nothin'o'u have: a working MPS1550 (Commodore Dot Matrix Color Printer) :p:p:p &
1 "amiga computer of the year 1986" sticker with an original 1987 coffee stain upon it!!!
Transfer the post to other applications Transfer


Re: Dynamic Lists, Hooks, Zune and Mr. X random's leisure gang

Joined:
2009/10/28 4:25
From Finland
Group:
Member
Posts: 181
Offline
@lellonapoli

If you are using the standard startup code (no -nostdlib or -nostartfiles) then the only difference is the argc and argv values passed to your main function:
Quote:

int main (int argc, char **argv);


If your program is started from WB/Wanderer argc is 0 and argv is a pointer to struct WBStartup as defined in "workbench/startup.h".

If your program is started from Shell argc and argv are set as usual with argc as the number of commandline arguments and argv being a pointer to an array containing the arguments.

#include <workbench/startup.h>
#include <stdio.h>

int main (int argcchar **argv) {
    
struct WBStartup *wbsm NULL;
    
int i;
    if (
argc == 0) {
        
printf("started from WB\n");
        
wbsm = (struct WBStartup *)argv;
        for (
0wbsm->sm_NumArgsi++) {
            
printf("lock: 0x%08lx name: %s\n",
                
wbsm->sm_ArgList[i].wa_Lock,
                
wbsm->sm_ArgList[i].wa_Name);
        }
    } else {
        
printf("started from Shell\n");
        for (
0argci++) {
            
printf("arg: %s\n"argv[i]);
        }
    }
    return 
0;
}

Posted on: 2012/12/31 4:04
Transfer the post to other applications Transfer


Re: Dynamic Lists, Hooks, Zune and Mr. X random's leisure gang

Joined:
2012/1/16 5:57
Group:
Member
Posts: 260
Offline
Quote:

salass00 wrote:
If your program is started from Shell argc and argv are set as usual with argc as the number of commandline arguments and argv being a pointer to an array containing the arguments.


Thank you, useful tip!
I remember this piece of code from 68000 ASM listings

Posted on: 2013/1/1 4:50
Transfer the post to other applications Transfer


Re: Dynamic Lists, Hooks, Zune and Mr. X random's leisure gang

Joined:
2009/5/15 13:18
From Naples, Italy
Group:
Member
Posts: 415
Offline
thk you!

Posted on: 2013/1/1 10:48
_________________
Somethin'nothin'o'u have: a working MPS1550 (Commodore Dot Matrix Color Printer) :p:p:p &
1 "amiga computer of the year 1986" sticker with an original 1987 coffee stain upon it!!!
Transfer the post to other applications Transfer



« 1 (2)



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
3623
2 nikolaos
nikolaos
3451
3 phoenixkonsole
phoenixkonsole
2920
4 magorium
magorium
2780
5 deadwood
deadwood
2286
6 clusteruk
clusteruk
2052
7 ncafferkey
ncafferkey
2046
8 mazze
mazze
2033
9 damocles
damocles
1787
10 Kalamatee
Kalamatee
1700
© 2004-2013 AROS Exec