<commit_before>/* Short comm. */
#define NUL		0x00
#define ENQ		0x05
#define ACK		0x06
#define DC1		0x11
#define NAK		0x15
#define TRM		0xff

/* Packet types */
#define TYPE_COMMAND	0x1b
#define TYPE_DATA	0x02
#define TYPE_DATA_END	0x03

/* Sub-types */
#define SUBTYPE_COMMAND_FIRST	0x53
#define SUBTYPE_COMMAND		0x43

#define	RETRIES			10

/* Packet functions */
int sierra_valid_packet (Camera *camera, char *packet);
int sierra_write_packet (Camera *camera, char *packet);
int sierra_read_packet  (Camera *camera, char *packet);
int sierra_build_packet (Camera *camera, char type, char subtype, int data_length, char *packet);

/* Communications functions */
int sierra_set_speed		(Camera *camera, int speed);
int sierra_end_session		(Camera *camera);
int sierra_write_ack		(Camera *camera);
int sierra_write_nak		(Camera *camera);
int sierra_ping			(Camera *camera);
int sierra_set_int_register 	(Camera *camera, int reg, int value);
int sierra_get_int_register 	(Camera *camera, int reg, int *value);
int sierra_set_string_register	(Camera *camera, int reg, char *s, int length);
int sierra_get_string_register	(Camera *camera, int reg, int file_number,
				 CameraFile *file, char *s, int *length);
int sierra_folder_set		(Camera *camera, const char *folder);
int sierra_delete		(Camera *camera, int picture_number);
int sierra_delete_all           (Camera *camera);
int sierra_capture		(Camera *camera, int capture_type, 
				 CameraFilePath *filepath);
int sierra_capture_preview 	(Camera *camera, CameraFile *file);
<commit_msg> * Move update_fs_for_folder and sierra_change_folder from sierra.c    to the library package. Add routines in the header file.<commit_after>/* Short comm. */
#define NUL		0x00
#define ENQ		0x05
#define ACK		0x06
#define DC1		0x11
#define NAK		0x15
#define TRM		0xff

/* Packet types */
#define TYPE_COMMAND	0x1b
#define TYPE_DATA	0x02
#define TYPE_DATA_END	0x03

/* Sub-types */
#define SUBTYPE_COMMAND_FIRST	0x53
#define SUBTYPE_COMMAND		0x43

#define	RETRIES			10

/* Camera specific error identifiers.
   The corresponding error descriptions are in sierra.c */
#define GP_ERROR_BAD_CONDITION  -1000 /* Bad condition for executing commands */

/* Packet functions */
int sierra_valid_packet (Camera *camera, char *packet);
int sierra_write_packet (Camera *camera, char *packet);
int sierra_read_packet  (Camera *camera, char *packet);
int sierra_build_packet (Camera *camera, char type, char subtype, int data_length, char *packet);

/* Communications functions */
int sierra_set_speed		(Camera *camera, int speed);
int sierra_end_session		(Camera *camera);
int sierra_write_ack		(Camera *camera);
int sierra_write_nak		(Camera *camera);
int sierra_ping			(Camera *camera);
int sierra_set_int_register 	(Camera *camera, int reg, int value);
int sierra_get_int_register 	(Camera *camera, int reg, int *value);
int sierra_set_string_register	(Camera *camera, int reg, char *s, int length);
int sierra_get_string_register	(Camera *camera, int reg, int file_number,
				 CameraFile *file, char *s, int *length);
int sierra_delete		(Camera *camera, int picture_number);
int sierra_delete_all           (Camera *camera);
int sierra_capture		(Camera *camera, int capture_type, 
				 CameraFilePath *filepath);
int sierra_capture_preview 	(Camera *camera, CameraFile *file);
int sierra_change_folder (Camera *camera, const char *folder);

/* Filesystem functions */
int sierra_update_fs_for_folder (Camera *camera, const char *folder);

{'fraction_non_alphanumeric': 0.09166906889593543, 'fraction_numerical': 0.02017872585759585, 'mean_word_length': 5.3321167883211675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3915280', 'n_tokens_mistral': 1220, 'n_tokens_neox': 1171, 'n_words': 382}