list.c File Reference
#include <stdlib.h>
#include "wge100_camera/list.h"
#include "wge100_camera/host_netutil.h"
Go to the source code of this file.
Function Documentation
Adds a new camera to camera list ipCamList if that serial number is not already in the list.
- Parameters:
- 
  
    |  | ipCamList | Pointer to the IpCamList head |  |  | newItem | Pointer to an IpCamList structure that describes the new camera |  
 
- Returns:
- Returns CAMLIST_ADD_OK if the camera was added to the list, or CAMLIST_ADD_DUP if it was a duplicate. 
Definition at line 65 of file list.c.
 
 
      
        
          | void wge100CamListDelAll | ( | IpCamList * | ipCamList | ) |  | 
      
 
Utility function to remove all entries from a camera list.
- Parameters:
- 
  
    |  | ipCamList | Pointer to the camera list head |  
 
- Returns:
- Returns 0 if successful. 
Definition at line 191 of file list.c.
 
 
      
        
          | int wge100CamListDelEntry | ( | IpCamList * | ipCamList, | 
        
          |  |  | int | index |  | 
        
          |  | ) |  |  |  | 
      
 
Utility function to remove a specific element number from the camera list.
- Precondition:
- index must be less than the value returned by wge100CamListNumEntries().
- Parameters:
- 
  
    |  | ipCamList | Pointer to the camera list head |  |  | index | Number of the list element to remove (0..max) |  
 
- Returns:
- Returns 0 if successful, -1 if index was invalid 
Definition at line 146 of file list.c.
 
 
      
        
          | int wge100CamListFind | ( | IpCamList * | ipCamList, | 
        
          |  |  | uint32_t | serial |  | 
        
          |  | ) |  |  |  | 
      
 
Utility function to locate a camera with a particular serial number in a list. 
- Parameters:
- 
  
    |  | ipCamList | Pointer to the list head |  |  | serial | Serial number (not including product ID) to look for |  
 
- Returns:
- Returns the index of the camera, or -1 if not found 
Definition at line 96 of file list.c.
 
 
Utility function to return a specific element number from the camera list.
- Precondition:
- index must be less than the value returned by wge100CamListNumEntries(). If it is greater, then the last element in the list will be returned.
- Parameters:
- 
  
    |  | ipCamList | Pointer to the camera list head |  |  | index | Number of the list element to returna (0..max) |  
 
- Returns:
- Returns a pointer to the requested list element 
Definition at line 123 of file list.c.
 
 
      
        
          | int wge100CamListInit | ( | IpCamList * | ipCamList | ) |  | 
      
 
Initializes a new camera list using macros from list.h
- Parameters:
- 
  
    |  | ipCamList | Pointer to an IpCamList list element |  
 
- Returns:
- Always returns zero. 
Definition at line 50 of file list.c.
 
 
      
        
          | int wge100CamListNumEntries | ( | const IpCamList * | ipCamList | ) |  | 
      
 
Utility function to determine the number of entries in an IpCamlist
- Parameters:
- 
  
    |  | ipCamList | Pointer to the list head to count. |  
 
- Returns:
- Returns the number of elements in the list 
Definition at line 171 of file list.c.