* trouble using glob and wordexp
@ 2013-06-10 15:59 ballsystemlord
2013-06-10 16:13 ` Jonathan Wakely
0 siblings, 1 reply; 6+ messages in thread
From: ballsystemlord @ 2013-06-10 15:59 UTC (permalink / raw)
To: gcc-help
I'm getting an error at compile time.
All the variables are declared and my glob sruct is declared like this:
struct glob_t globualation
I though I might use wordexp instead since it would be more suited to what
I'm doing but that fails with the same error exept it's wordexp's structure
that is the problem.
I also tried this to no avail.
Gcc complains that the struct size is unknown.
--
View this message in context: http://gcc.1065356.n5.nabble.com/trouble-using-glob-and-wordexp-tp945091.html
Sent from the gcc - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: trouble using glob and wordexp
2013-06-10 15:59 trouble using glob and wordexp ballsystemlord
@ 2013-06-10 16:13 ` Jonathan Wakely
2013-06-10 17:47 ` ballsystemlord
0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Wakely @ 2013-06-10 16:13 UTC (permalink / raw)
To: ballsystemlord; +Cc: gcc-help
On 10 June 2013 16:59, ballsystemlord wrote:
> I'm getting an error at compile time.
> All the variables are declared and my glob sruct is declared like this:
>
> struct glob_t globualation
>
> I though I might use wordexp instead since it would be more suited to what
> I'm doing but that fails with the same error exept it's wordexp's structure
> that is the problem.
>
> I also tried this to no avail.
>
> Gcc complains that the struct size is unknown.
Sounds like you didn't include glob.h but this isn't a GCC problem,
it's just code that doesn't work.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: trouble using glob and wordexp
2013-06-10 16:13 ` Jonathan Wakely
@ 2013-06-10 17:47 ` ballsystemlord
2013-06-10 18:02 ` ballsystemlord
0 siblings, 1 reply; 6+ messages in thread
From: ballsystemlord @ 2013-06-10 17:47 UTC (permalink / raw)
To: gcc-help
I checked that three times before posting. The code is:
#include<glob.h>
To check this using the computer (as apposed to risking human error,) I got
rid of the code:
struct glob_t globulation
leaving behind the call to glob:
glob(args, no glob_t passed)
and got the response that I needed to pass glob a struct glob_t.
--
View this message in context: http://gcc.1065356.n5.nabble.com/trouble-using-glob-and-wordexp-tp945091p945114.html
Sent from the gcc - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: trouble using glob and wordexp
2013-06-10 17:47 ` ballsystemlord
@ 2013-06-10 18:02 ` ballsystemlord
2013-06-10 22:09 ` Ian Lance Taylor
0 siblings, 1 reply; 6+ messages in thread
From: ballsystemlord @ 2013-06-10 18:02 UTC (permalink / raw)
To: gcc-help
Here's the code
#include <glob.h>
#include <wordexp.h>
#include "my-header.h"
//my-header.h brings in just a few headers like stdio.h and defines some
strucs I will be using.
/*This should eventually be called
sruct metadata filefinder(struct swches s, unsigned short int fileno, stop)
GLOB_NOMAGIC | GLOB_NOSORT | GLOB_NOESCAPE*/
struct metadata
{
unsigned short int stop;
unsigned char *file;
unsigned short int size;
unsigned char *name;
unsigned char *permissions;
//Format mmddyyyy
unsigned short int date;
//If applicable
unsigned char *directory;
unsigned short int itemsindir;
};
int main(void)
{
char a[6] = "hello";
char *char1 = a;
struct glob_t globulation;
//struct wordexp_t wordomatic;
/*int errfunc(const char *filename, int errorcode)
{
return('\0');
}
int check = glob(char1, GLOB_NOMAGIC | GLOB_NOSORT | GLOB_NOESCAPE,\
&errfunc, globulation);*/
//int check = wordexp(char1, wordomatic, WRDE_UNDEF);
if (check != 0)
{
return(1);
}
return(0);
}
--
View this message in context: http://gcc.1065356.n5.nabble.com/trouble-using-glob-and-wordexp-tp945091p945122.html
Sent from the gcc - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: trouble using glob and wordexp
2013-06-10 18:02 ` ballsystemlord
@ 2013-06-10 22:09 ` Ian Lance Taylor
2013-06-18 16:47 ` ballsystemlord
0 siblings, 1 reply; 6+ messages in thread
From: Ian Lance Taylor @ 2013-06-10 22:09 UTC (permalink / raw)
To: ballsystemlord; +Cc: gcc-help
On Mon, Jun 10, 2013 at 11:02 AM, ballsystemlord <doark@mail.com> wrote:
> Here's the code
Thanks for providing the actual case.
> struct glob_t globulation;
glob_t is not a struct. Remove the "struct" keyword.
Ian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: trouble using glob and wordexp
2013-06-10 22:09 ` Ian Lance Taylor
@ 2013-06-18 16:47 ` ballsystemlord
0 siblings, 0 replies; 6+ messages in thread
From: ballsystemlord @ 2013-06-18 16:47 UTC (permalink / raw)
To: gcc-help
Thanks!
--
View this message in context: http://gcc.1065356.n5.nabble.com/trouble-using-glob-and-wordexp-tp945091p947173.html
Sent from the gcc - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-06-18 16:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-10 15:59 trouble using glob and wordexp ballsystemlord
2013-06-10 16:13 ` Jonathan Wakely
2013-06-10 17:47 ` ballsystemlord
2013-06-10 18:02 ` ballsystemlord
2013-06-10 22:09 ` Ian Lance Taylor
2013-06-18 16:47 ` ballsystemlord
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).