/[svn]/liblscp/trunk/src/device.c
ViewVC logotype

Diff of /liblscp/trunk/src/device.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1710 by capela, Thu Jan 11 12:33:05 2007 UTC revision 1711 by schoenebeck, Tue Feb 26 19:08:13 2008 UTC
# Line 2  Line 2 
2  //  //
3  /****************************************************************************  /****************************************************************************
4     liblscp - LinuxSampler Control Protocol API     liblscp - LinuxSampler Control Protocol API
5     Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2008, rncbc aka Rui Nuno Capela. All rights reserved.
6    
7     This library is free software; you can redistribute it and/or     This library is free software; you can redistribute it and/or
8     modify it under the terms of the GNU Lesser General Public     modify it under the terms of the GNU Lesser General Public
# Line 132  static lscp_device_port_info_t *_lscp_de Line 132  static lscp_device_port_info_t *_lscp_de
132          char *pszToken;          char *pszToken;
133          char *pch;          char *pch;
134          char *pszKey;          char *pszKey;
135            char *pszVal;
136    
137          // Lock this section up.          // Lock this section up.
138          lscp_mutex_lock(pClient->mutex);          lscp_mutex_lock(pClient->mutex);
# Line 141  static lscp_device_port_info_t *_lscp_de Line 142  static lscp_device_port_info_t *_lscp_de
142                  pszResult = lscp_client_get_result(pClient);                  pszResult = lscp_client_get_result(pClient);
143                  pszToken = lscp_strtok((char *) pszResult, pszSeps, &(pch));                  pszToken = lscp_strtok((char *) pszResult, pszSeps, &(pch));
144                  while (pszToken) {                  while (pszToken) {
145                          if (strcasecmp(pszToken, "NAME") == 0) {                          pszKey = pszToken;
146                                  pszToken = lscp_strtok(NULL, pszCrlf, &(pch));                          pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
147                                  if (pszToken)                          if (pszKey && pszToken) {
148                                          lscp_unquote_dup(&(pDevicePortInfo->name), &pszToken);                                  pszVal = lscp_unquote(&pszToken, 0);
149                          }                                  lscp_plist_append(&(pDevicePortInfo->params), pszKey, pszVal);
150                          else {                                  if (strcasecmp(pszKey, "NAME") == 0) {
151                                  pszKey = pszToken;                                          // Free desteny string, if already there.
152                                  pszToken = lscp_strtok(NULL, pszCrlf, &(pch));                                          if (pDevicePortInfo->name)
153                                  if (pszToken)                                                  free(pDevicePortInfo->name);
154                                          lscp_plist_append(&(pDevicePortInfo->params), pszKey, lscp_unquote(&pszToken, 0));                                          pDevicePortInfo->name = NULL;
155                                            if (pszVal)
156                                                    pDevicePortInfo->name = strdup(pszVal);
157                                    }
158                          }                          }
159                          pszToken = lscp_strtok(NULL, pszSeps, &(pch));                          pszToken = lscp_strtok(NULL, pszSeps, &(pch));
160                  }                  }

Legend:
Removed from v.1710  
changed lines
  Added in v.1711

  ViewVC Help
Powered by ViewVC