tUpdate API so that conf/in accepts flags for the conference type. - ratox - FIFO based tox client
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit ed084d2111166998cd9b9ef7d64c4f62ceb5549c
 (DIR) parent 96ac996477712ca79adb31e715328c9b3e727ca6
 (HTM) Author: pranomostro <pranomostro@posteo.net>
       Date:   Mon, 15 May 2017 11:43:21 +0200
       
       Update API so that conf/in accepts flags for the conference type.
       
       Diffstat:
         M README                              |       2 +-
         M ratox.1                             |      11 +++++++----
         M ratox.c                             |      18 ++++++++++++++----
       
       3 files changed, 22 insertions(+), 9 deletions(-)
       ---
 (DIR) diff --git a/README b/README
       t@@ -66,7 +66,7 @@ to help explain the semantics of the individual files.
        |
        |-- conf                        # managing conferences
        |   |-- err                        # conference related errors
       -|   |-- in                        # 'echo "group title" >in' for creating a new group
       +|   |-- in                        # 'echo 't group title' >in' for creating a new text group
        |   |-- out                        # 'echo 1 >out/ID_COOKIE' for joining a conference
        |
        |-- name                        # changing your nick
 (DIR) diff --git a/ratox.1 b/ratox.1
       t@@ -62,9 +62,12 @@ Request slot.  Send a friend request by piping the Tox ID to \fBin\fR.  Incoming
        requests are listed as FIFOs in \fBout/\fR.  Echo \fB1\fR | \fB0\fR to
        accept | reject them.
        .It Ar conf/
       -Conference management slot.  A conference is created by writing its title to \fBin\fR.  Invites
       -to conferences are FIFOs in \fBout/\fR.  Their name is id_cookie (the cookie is random data).
       -They behave like request FIFOs.
       +Conference management slot.  A conference is created by writing and flag
       +and its title to \fBin\fR. The flag is \fBt\fR | \fBa\fR | \fBv\fR for an
       +text, audio  and video conference, followed by a space character. Only
       +text conferences work at the moment. Invites to conferences are FIFOs
       +in \fBout/\fR. Their name is id_cookie (the cookie is random data). They
       +behave like request FIFOs.
        .El
        .Ss Friend slots
        Each friend is represented with a directory in the base-directory named after
       t@@ -126,7 +129,7 @@ Write here to change the title of the conference.
        .It Ar title_out
        Contains the title of the conference.
        .It Ar text_in
       -Echo \fBmessage\fR to send a text message to the conference.
       +Echo message to send a text message to the conference.
        .It Ar text_out
        Contains the messages send in the conference so far.
        .El
 (DIR) diff --git a/ratox.c b/ratox.c
       t@@ -1884,15 +1884,25 @@ newconf(void *data)
        {
                uint32_t cnum;
                size_t n;
       -        char title[TOX_MAX_NAME_LENGTH + 1];
       +        char *title, input[TOX_MAX_NAME_LENGTH + 2 + 1];
        
                n = fiforead(gslots[CONF].dirfd, &gslots[CONF].fd[IN], gfiles[IN],
       -                     title, sizeof(title) - 1);
       +                     input, sizeof(input) - 1);
                if (n <= 0)
                        return;
       -        if (title[n - 1] == '\n')
       +        if (input[n - 1] == '\n')
                        n--;
       -        title[n] = '\0';
       +        input[n] = '\0';
       +        if(!((input[0] == 't' || input[0] == 'a' || input[0] == 'v') && input[1] == ' ')) {
       +                weprintf("No flag found in input\n");
       +                return;
       +        }
       +        if(input[0] == 'a' || input[0] == 'v') {
       +                weprintf("Conferences other than text not supported yet\n");
       +                return;
       +        }
       +        title = input + 2;
       +        n -= 2;
                cnum = tox_conference_new(tox, NULL);
                if (cnum == UINT32_MAX) {
                        weprintf("Failed to create new conference\n");