Lines Matching refs:shellCB
52 static void ShellDeinit(ShellCB *shellCB)
54 (void)pthread_mutex_destroy(&shellCB->historyMutex);
55 (void)pthread_mutex_destroy(&shellCB->keyMutex);
56 OsShellKeyDeInit((CmdKeyLink *)shellCB->cmdKeyLink);
57 OsShellKeyDeInit((CmdKeyLink *)shellCB->cmdHistoryKeyLink);
58 (void)free(shellCB);
61 static int OsShellCreateTask(ShellCB *shellCB)
78 ret = ShellTaskInit(shellCB);
83 shellCB->shellEntryHandle = pthread_self();
134 ShellCB *shellCB = NULL;
145 shellCB = (ShellCB *)malloc(sizeof(ShellCB));
146 if (shellCB == NULL) {
149 ret = memset_s(shellCB, sizeof(ShellCB), 0, sizeof(ShellCB));
154 ret = pthread_mutex_init(&shellCB->keyMutex, NULL);
159 ret = pthread_mutex_init(&shellCB->historyMutex, NULL);
164 ret = (int)OsShellKeyInit(shellCB);
168 (void)strncpy_s(shellCB->shellWorkingDirectory, PATH_MAX, "/", 2); /* 2:space for "/" */
170 sem_init(&shellCB->shellSem, 0, 0);
172 g_shellCB = shellCB;
173 ret = OsShellCreateTask(shellCB);
175 ShellDeinit(shellCB);
180 ShellEntry(shellCB);
183 (void)pthread_mutex_destroy(&shellCB->historyMutex);
185 (void)pthread_mutex_destroy(&shellCB->keyMutex);
187 (void)free(shellCB);