20 #include <med_config.h> 31 #include <sys/timeb.h> 34 #if TIME_WITH_SYS_TIME 35 # include <sys/time.h> 39 # include <sys/time.h> 46 #error "unistd.h required." 51 #if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID) 52 # include <sys/types.h> 68 const char *
const meshname)
78 char _lpBuffer [UNLEN+1]=
"";
79 long _nSize = UNLEN+1;
82 struct passwd* mypasswd;
106 strcat(_path,meshname);
118 if ( GetUserName(_lpBuffer,&_nSize) == 0 )
goto ERROR_;
120 strncpy(_unvname,_lpBuffer,_nSize);
121 strcat(_unvname,
" ");
123 strcat(_unvname,ctime(&_time));
125 _nSize = strlen(_unvname)-1;
126 if ( sprintf(&_unvname[_nSize],
" %hu",_tp.millitm) < 0 )
goto ERROR_;
129 #if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID) 130 mypasswd=getpwuid(geteuid());
131 if ( mypasswd == NULL ) {
132 MESSAGE(
"Impossible d'obtenir le nom de l'utilisateur effectif");
135 strcat(_unvname,mypasswd->pw_name);
136 #elif defined(HAVE_CUSERID) 137 if ( !cuserid(_unvname) ) {
142 #error "There is no ( getpwuid && geteuid) nor cuserid" 144 strcat(_unvname,
" ");
146 strcat(_unvname,ctime(&_time));
147 if ( gettimeofday(&_tp,NULL) < 0 ) {
151 if ( sprintf(&_unvname[strlen(_unvname)-1],
" %li",_tp.tv_usec) < 0 ) {
MEDC_EXPORT void _MEDmodeErreurVerrouiller(void)
#define MED_ERR_(rt, r1, r2, r3)
MEDC_EXPORT med_err _MEDdatagroupFermer(med_idt id)
#define MED_ERR_ATTRIBUTE
#define ISCRUTE_int(entier)
#define MED_MESH_GRP_SIZE
MEDC_EXPORT med_access_mode _MEDmodeAcces(med_idt oid)
MEDC_EXPORT med_err _MEDcheckVersion30(med_idt fid)
MEDC_EXPORT med_err _MEDattributeStringWr(med_idt pid, const char *const attname, const med_size attsize, const char *const val)
MEDC_EXPORT med_idt _MEDdatagroupOuvrir(med_idt pid, const char *const nom)
#define MED_ERR_DATAGROUP
#define MED_ERR_ACCESSMODE
med_err MEDmeshUniversalNameWr(const med_idt fid, const char *const meshname)
Cette routine permet l'écriture du nom universel d'un maillage.
#define MED_ERR_UNRECOGNIZED
#define ISCRUTE_id(entier)