00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <stdio.h>
00042 #include <string.h>
00043 #include "mensagem.h"
00044 #include "memvirtu.h"
00045 #include "lowparam.h"
00046 #include "lowmacro.h"
00047 #include "lowsolid.h"
00048 #include "vectorop.h"
00049 #include "mancommd.h"
00050 #include "genfunc_.h"
00051 #include "hiegroup.h"
00052
00053 #ifdef __Extended_Version
00054 void MSD_execNameCreateSetGroup(void)
00055 {
00056 char gname[30], name[30];
00057
00058 while (2 != sscanf(restbuf, "%s %s", gname, name))
00059 {
00060 printf("CreateSetGroup: name set\n");
00061 if (!lineins("? "))
00062 {
00063 return;
00064 }
00065 }
00066 MSD_highNameCreateSetGroup(gname, name);
00067 }
00068
00069 #endif
00070
00071 int MSD_highNameCreateSetGroup(char *name1, char *name2)
00072 {
00073 GPTYPE gptr;
00074 int gn;
00075
00076 if (MSD_getGroupIdFromName(name1) != -1)
00077 {
00078 fprintf(stderr, MEN_GroupJaExiste, NAM_CreateGroupSetCurrent, name1);
00079 return(ERROR);
00080 }
00081 if ((gn = MSD_highCreateSetGroup(!strcmp(name2, "TRUE"))) != -1)
00082 {
00083 gptr = MSD_getGroup(gn);
00084 strcpy(GrpName(gptr), name1);
00085 return(SUCCESS);
00086 }
00087 return(ERROR);
00088 }
00089
00090 #ifdef __Extended_Version
00091 void MSD_execCreateSetGroup(void)
00092 {
00093 int flag;
00094
00095 while (1 != sscanf(restbuf, "%d", &flag))
00096 {
00097 printf("CreateSetGroup: flag\n");
00098 if (!lineins("? "))
00099 {
00100 return;
00101 }
00102 }
00103 printf("Id = %d\n", MSD_highCreateSetGroup(flag));
00104 }
00105
00106 #endif
00107
00108 int MSD_highCreateSetGroup(int flag)
00109 {
00110 Id gn;
00111
00112 gn = MSD_getMaxGroupId();
00113 if (MSD_lowCreateGroup(gn) == ERROR)
00114 {
00115 return(-1);
00116 }
00117 if (flag)
00118 {
00119 MSD_highSetGroupCurrent(gn);
00120 }
00121 return(gn);
00122 }