//
// File: scolsign.h
//
// Modification history:
//$ FA(17/07/2001): Promoted to C/C++ header file
//

#ifndef _SCOLSIGN_H_
#define _SCOLSIGN_H_

#include "scolPrerequisites.h"

/* structure d'un repertoire de packages */
#ifdef __cplusplus
extern "C"
{
#endif

#include <scolPackDir.h>

extern packdir Firstpack;
extern packdir Cachepack;

//$BLG - v5.2.06: Add (Declared in myloop.cpp)
//extern char cappdatapath[MAX_PATH];		// Path to Common App Data directory:  commonappdatapath/subdir
extern char lappdatapath[MAX_PATH];		// Path to Local App Data directory:		localappdatapath/subdir
extern char mydcmtspath[MAX_PATH];		// Path to My Documents directory:  		documents/user/mydocuments/subdir
extern char execpath[MAX_PATH];						// Path to scol.exe: 										path

/* desalloue les packages */
int SPdesallocpackdir();

packdir SPinitpack();

int SPisname(int c, int l);

/* trouve un package dans la liste des packdir */
int SPfindfile(packdir p,char *sign,int *size,char *path);

/* ajout d'un fichier : trouve le chemin complet a partir du nom complet et 
  de la taille */
int SPaddfile(packdir p,char *sign,int size,char *path);

/* Signature d'un fichier. version1.0 */
int SCsign(mmachine m,char *src,int n,char *name,int typesign,char *sign);

/* calcul de typsign pour un nom de fichier 
   retourne -1 si erreur */
int SPgettypsign(char *total);

/* decoupe le nom en clair d'un nom de fichier
   retourne -1 si incorrect, 0 sinon */
int SPgetname(char *total,char *name);

/* complete le chemin d'un package */
int SPrefinePack(packdir p,char *n);

/* supprime les slash */
int SPslashtoback(char *p);

/* supprime les majuscules */
int SPkillmaj(char *p);

/* Signature incrémentale . version1.0 */
int SCincSignInit();
int SCincSign(char *buf,int n,char *sign);

extern char cookies[64];

//$BLG - v5.2.06: Modif
//int SPregistPart(char *name, char *param);
int SPregistPart(char *name, char *param, int type);

int SPunRegistPart();

#ifdef __cplusplus
}
#endif

#endif // scolsign.h
