MCPcopy Create free account
hub / github.com/acl-dev/acl / master_creator

Function master_creator

app/wizard/master_creator.cpp:143–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143void master_creator(const char* name, const char* type)
144{
145 file_tmpl tmpl;
146 bool loop;
147
148 if (name && *name && type && *type) {
149 loop = true;
150 } else {
151 loop = false;
152 }
153
154 // ����Դ��������Ŀ¼
155 tmpl.set_path_from("tmpl/master");
156
157 while (true) {
158 char buf[256];
159 int n;
160
161 if (name == NULL || *name == 0) {
162 printf("please input your program name: ");
163 fflush(stdout);
164
165 n = acl_vstream_gets_nonl(ACL_VSTREAM_IN, buf, sizeof(buf));
166 if (n == ACL_VSTREAM_EOF) {
167 break;
168 }
169
170 if (n == 0) {
171 acl::safe_snprintf(buf, sizeof(buf), "master_service");
172 }
173 name = buf;
174 }
175
176 // ������Ŀ����, һ��������������ͬ
177 tmpl.set_project_name(name);
178
179 // ����Ŀ¼
180 tmpl.create_dirs();
181
182 if (type == NULL || *type == 0) {
183 printf("choose master_service type:\r\n");
184 printf(" t: for master_threads\r\n"
185 " p: for master_proc\r\n"
186 " a: for master_aio\t\n"
187 " g: for master_trigger\r\n"
188 " r: for master_rpc\r\n"
189 " u: for master_udp\r\n"
190 " f: for master_fiber\r\n"
191 " o: for other service\r\n"
192 " s: skip choose, try again\r\n");
193 printf(">");
194 fflush(stdout);
195
196 n = acl_vstream_gets_nonl(ACL_VSTREAM_IN, buf, sizeof(buf));
197 if (n == ACL_VSTREAM_EOF) {
198 break;
199 }
200

Callers 2

create_master_serviceFunction · 0.85
mainFunction · 0.85

Calls 12

acl_vstream_gets_nonlFunction · 0.85
safe_snprintfFunction · 0.85
create_master_threadsFunction · 0.85
create_master_procFunction · 0.85
create_master_aioFunction · 0.85
create_master_rpcFunction · 0.85
create_master_triggerFunction · 0.85
create_master_udpFunction · 0.85
create_master_fiberFunction · 0.85
create_dirsMethod · 0.80
create_commonMethod · 0.80
create_otherMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…