Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with C function returning a gchar**
    primarykey
    data
    text
    <p>I have a function defined as the following (in C):</p> <pre><code>gchar **Scan_Return_File_Tag_Field_From_Mask_Code (File_Tag *FileTag, gchar code) { switch (code) { case 't': /* Title */ return &amp;FileTag-&gt;title; case 'a': /* Artist */ return &amp;FileTag-&gt;artist; case 'b': /* Album */ return &amp;FileTag-&gt;album; case 'd': /* Disc Number */ return &amp;FileTag-&gt;disc_number; case 'y': /* Year */ return &amp;FileTag-&gt;year; case 'n': /* Track */ return &amp;FileTag-&gt;track; case 'l': /* Track Total */ return &amp;FileTag-&gt;track_total; case 'g': /* Genre */ return &amp;FileTag-&gt;genre; case 'c': /* Comment */ return &amp;FileTag-&gt;comment; case 'p': /* Composer */ return &amp;FileTag-&gt;composer; case 'o': /* Orig. Artist */ return &amp;FileTag-&gt;orig_artist; case 'r': /* Copyright */ return &amp;FileTag-&gt;copyright; case 'u': /* URL */ return &amp;FileTag-&gt;url; case 'e': /* Encoded by */ return &amp;FileTag-&gt;encoded_by; case 'i': /* Ignored */ return NULL; default: Log_Print(LOG_ERROR,"Scanner: Invalid code '%%%c' found!",code); return NULL; } } </code></pre> <p>I am trying to add a new condition to the switch statement, such as</p> <pre><code>case 'f': </code></pre> <p>In which it would return the first character of &amp;FileTag->artist.</p> <p>I have scoured all of the internet looking for a solution, but have come up empty handed. Anyone have any ideas?</p> <p><strong>Update:</strong> If it helps, this function is part of the application EasyTag. From what I have seen looking through the code, this is where the new file name for easytag's file sorting feature is determined. I am trying to add a new variable to allow the application to sort music into directories like so: <code>&lt;First letter of artist name&gt;/&lt;Artist&gt;/&lt;Album&gt;/&lt;Tracks&gt;</code></p> <p>There is always the chance that I may be looking at the wrong function, but to the best of my knowledge I am.</p> <p><strong>Another Update:</strong> I got this function working as I wanted (pointers are funny little things), but it does not, as pointed out below, do what I had expected it to. Thanks for all the help and patience!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload