:: Re: [DNG] Debugging netman auto-con…
Startseite
Nachricht löschen
Nachricht beantworten
Autor: Edward Bartolo
Datum:  
To: Rainer Weikusat
CC: dng
Betreff: Re: [DNG] Debugging netman auto-connect.
As suggested by tilt, I switched to use GSList but I need to use it
for two distinct cases:
a) to manage a list of strings
b) to manage a list of structures of this construct:

typedef struct {
    double quality;
    char name[MAX_ESSID_LENGTH];
} wifi_quality;


I expect this to be possible as lists may not always be lists of strings.

In the case it is possible to use GSList to manage lists of custom
structures like the above, which function the type of strdup is used
to allocate memory and prepare a structure so that it would be added
to the list?

I also need to swap two items in the list in a sorting function.

Edward

On 11/09/2015, Rainer Weikusat <rainerweikusat@???> wrote:
> "tilt!" <tilt@???> writes:
>> On 09/11/2015 10:35 AM, Edward Bartolo wrote:
>>> Hi all,
>>>
>>> Since yesterday I have been trying to understand why "char**
>>> essid_list" is working inside getInstalledEssidList(&count,
>>> essid_list) but failing as soon as I try to access essid_list[0]
>>> outside the function.
>>>
>>> Both the source and the gdb text output are attached.
>>>
>>> Any helpful pointers are appreciated.
>>
>> Having dynamically growing (and shrinking) lists in C is
>> always a problem. That's why the problem has been solved
>> many times. :-)
>>
>> For example, the singly-linked list, GSList, from the GLIB
>> library is pretty popular and could save you some time.
>
> JFTR: That part of the code is works.
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
>