// 
// File: baselib.h
// Base SCOL library functions
// (Includes only those function that are referenced from other modules)
// F.J. Alberti
// Created: 06/06/2001
// Last Modified: 06/06/2001
//
// Modification history:
//$ FA(19/07/2001): Word and line processing function declarations. MAXCOM
//                  is also #defined here
//
// $LB (07/06/2004) :
// add strcpy function : fun [S    I      I]      S
//                            src  first  size    dst

#ifndef _BASELIB_H_
#define _BASELIB_H_

#include "scolPrerequisites.h"

#ifdef __cplusplus
extern "C" {
#endif

#include "scolMMemory.h"

//$BLG - v5.22: Modif
//Documentation says that messages sent through a defcom should have 
//a maximum size of around 8KB. In baselib.cpp/MBcom(), the message
//is processed and special characters get protected adding '\' when
//necessary.
//This may increase the size of the initial message awfully ... and
//result in a too big message ... which is then reduced to \0\0 ...
//which is sent to client (or server) ... and is interpreted there
//as a "bad sized message" ... and induce channel to be broken ...
//So ...
//We increase the limit ... but do not change the advice that can be 
//found in the documentation ... because, telling people that they
//can send 16KB messages with a 32KB limit is the same than sending
//8KB messages with a 16KB limit...
//#define MAXCOM        16384
#define MAXCOM        32768


int SCOLloadBase(mmachine m);
int myhtoi(char* s);
int MBsubstr(mmachine m);
int MBstrdup(mmachine m);
int MBstrcat(mmachine m);
int MBstrcatn(mmachine m);
int MBcom(mmachine m);
int MBcomv(mmachine m);
int MBtl(mmachine m);
int MBwebtostr(mmachine m);
int MBstrtoweb(mmachine m);
char *MBcopyword(char* cr, int* deb);
int MBdeftab(mmachine m);
char *stdGetLine(char *src,char *buf,int n);
int Mcutting(char* comm, char** argv);
int strCutting(char *comm, char **argv);


//$LB (07/06/2004)
int MBstrcpy (mmachine m);

#ifdef __cplusplus
}
#endif


#endif // baselib.h