libnjb: /usr/obj/ports/libnjb-2.2.7/libnjb-2.2.7/src/procedure.c File Reference

libnjb 2.2.7

- Main Page
- Modules
- Data Structures
- Files
- Examples

- File List
- Globals

Functions | Variables
procedure.c File Reference
`#include "config.h"`
`#include <sys/stat.h>`
`#include <ctype.h>`
`#include <fcntl.h>`
`#include <string.h>`
`#include "libnjb.h"`
`#include "procedure.h"`
`#include "protocol.h"`
`#include "protocol3.h"`
`#include "base.h"`
`#include "njb_error.h"`
`#include "defs.h"`
`#include "ioutil.h"`
`#include "unicode.h"`
`#include "byteorder.h"`
`#include "eax.h"`
`#include "songid.h"`
`#include "datafile.h"`
`#include "njbtime.h"`

## Functions
int | _file_size (njb_t *njb, const char *path, u_int64_t *size)
int | _file_time (njb_t *njb, const char *path, time_t *ts)
int | NJB_Handshake (njb_t *njb)
int | NJB_Discover (njb_t *njbs, int limit, int *n)
int | NJB_Open (njb_t *njb)
void | NJB_Close (njb_t *njb)
int | NJB_Capture (njb_t *njb)
int | NJB_Release (njb_t *njb)
void | NJB_Get_Extended_Tags (njb_t *njb, int extended)
void | NJB_Reset_Get_Track_Tag (njb_t *njb)
njb_songid_t * | NJB_Get_Track_Tag (njb_t *njb)
void | NJB_Reset_Get_Playlist (njb_t *njb)
njb_playlist_t * | NJB_Get_Playlist (njb_t *njb)
int | NJB_Get_Disk_Usage (njb_t *njb, u_int64_t *btotal, u_int64_t *bfree)
char * | NJB_Get_Owner_String (njb_t *njb)
int | NJB_Set_Owner_String (njb_t *njb, const char *name)
void | NJB_Reset_Get_Datafile_Tag (njb_t *njb)
njb_datafile_t * | NJB_Get_Datafile_Tag (njb_t *njb)
int | NJB_Get_Track (njb_t *njb, u_int32_t fileid, u_int32_t size, const char *path, NJB_Xfer_Callback *callback, void *data)
int | NJB_Get_Track_fd (njb_t *njb, u_int32_t fileid, u_int32_t size, int fd, NJB_Xfer_Callback *callback, void *data)
int | NJB_Send_Track (njb_t *njb, const char *path, njb_songid_t *songid, NJB_Xfer_Callback *callback, void *data, u_int32_t *trackid)
int | NJB_Send_File (njb_t *njb, const char *path, const char *name, const char *folder, NJB_Xfer_Callback *callback, void *data, u_int32_t *fileid)
int | NJB_Create_Folder (njb_t *njb, const char *name, u_int32_t *folderid)
void | NJB_Reset_Get_EAX_Type (njb_t *njb)
njb_eax_t * | NJB_Get_EAX_Type (njb_t *njb)
void | NJB_Destroy_EAX_Type (njb_eax_t *eax)
void | NJB_Adjust_EAX (njb_t *njb, u_int16_t eaxid, u_int16_t patchindex, int16_t scalevalue)
njb_time_t * | NJB_Get_Time (njb_t *njb)
int | NJB_Set_Time (njb_t *njb, njb_time_t *time)
void | NJB_Destroy_Time (njb_time_t *time)
int | NJB_Delete_Playlist (njb_t *njb, u_int32_t plid)
int | NJB_Update_Playlist (njb_t *njb, njb_playlist_t *pl)
int | NJB_Delete_Track (njb_t *njb, u_int32_t trackid)
int | NJB_Delete_Datafile (njb_t *njb, u_int32_t fileid)
int | NJB_Play_Track (njb_t *njb, u_int32_t trackid)
int | NJB_Queue_Track (njb_t *njb, u_int32_t trackid)
int | NJB_Pause_Play (njb_t *njb)
int | NJB_Resume_Play (njb_t *njb)
int | NJB_Stop_Play (njb_t *njb)
int | NJB_Seek_Track (njb_t *njb, u_int32_t position)
int | NJB_Elapsed_Time (njb_t *njb, u_int16_t *elapsed, int *change)
void | NJB_Set_Debug (int debug_flags)
void | NJB_Set_Unicode (int unicode_flag)
int | NJB_Replace_Track_Tag (njb_t *njb, u_int32_t trackid, njb_songid_t *songid)
int | NJB_Get_Bitmap_Dimensions (njb_t *njb, int *x, int *y, int *bytes)
int | NJB_Set_Bitmap (njb_t *njb, const unsigned char *bitmap)
void | NJB_Ping (njb_t *njb)
njb_keyval_t * | NJB_Get_Keys (njb_t *njb)
u_int64_t | NJB_Get_NJB1_Libcounter (njb_t *njb)
int | NJB_Send_Firmware (njb_t *njb, const char *path, NJB_Xfer_Callback *callback, void *data)
int | NJB_Get_Battery_Level (njb_t *njb)
int | NJB_Get_Battery_Charging (njb_t *njb)
int | NJB_Get_Auxpower (njb_t *njb)
int | NJB_Get_SDMI_ID (njb_t *njb, u_int8_t *sdmiid)
const char * | NJB_Get_Device_Name (njb_t *njb, int type)
int | NJB_Get_Firmware_Revision (njb_t *njb, u_int8_t *major, u_int8_t *minor, u_int8_t *release)
int | NJB_Get_Hardware_Revision (njb_t *njb, u_int8_t *major, u_int8_t *minor, u_int8_t *release)
int | NJB_Set_Turbo_Mode (njb_t *njb, u_int8_t mode)

## Variables
int | njb_unicode_flag
int | __sub_depth

## Detailed Description

This file contains most generic functions and switches between different protocols depending on the device type that has been connected.

## Function Documentation

int _file_size | ( | njb_t * | njb,
|  | const char * | path,
|  | u_int64_t * | size
| ) |  |

This is a helper function for retrieveing the file size for a file on the host system.

Referenced by NJB_Send_File(), NJB_Send_Firmware(), and NJB_Send_Track().

int _file_time | ( | njb_t * | njb,
|  | const char * | path,
|  | time_t * | ts
| ) |  |

This is a helper function to retrieve the time stamp for a file on the host system.

Referenced by NJB_Send_File().

int NJB_Handshake | ( | njb_t * | njb | ) |

This function "handshakes" a previously opened and captured device represented by a `njb_t` object. This basically means some basic "how do you do" calls are made, and the `njb_id_t` property of the `njb_t` object gets filled in properly.

Parameters

  njb | a pointer to the `njb_t` object to perform the handshake on

Returns
  0 on success, -1 on failure

References njb_struct::device_type, EO_BADCOUNT, EO_BADNJBID, njb3_get_codecs(), NJB_DEVICE_NJB1, njb_get_library_counter(), njb_ping(), njb_set_library_counter(), njb_verify_last_command(), njb_struct::protocol_state, and njb_state_t::sdmiid.

Referenced by NJB_Open().

## Variable Documentation

int __sub_depth

The current subroutine depth for all of libnjb (global)