Skip to content

Commit 1bee90a

Browse files
rebranding
1 parent 6a9634f commit 1bee90a

File tree

7 files changed

+41
-39
lines changed

7 files changed

+41
-39
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
pyoverflow-cli
22
a.out
33
pyoverflow.tar.gz
4-
~
4+
~
5+
quickoverflow

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# pyoverflow-cli
1+
# QuickOverflow
22
A Command Line Tool for Unix Based Operating Systems to instantly open Stack Overflow Solution for corresponding error
33

44

headers/commands.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,26 @@
2121
/*
2222
Function Declarations for builtin shell commands:
2323
*/
24-
int pyoverflow_sofsearch(char **args); //change directory
25-
int pyoverflow_help(char **args); //help command
26-
int pyoverflow_leave(char **args); //exit command
24+
int quickoverflow_search(char **args); //change directory
25+
int quickoverflow_help(char **args); //help command
26+
int quickoverflow_leave(char **args); //exit command
2727

2828
/*
2929
List of builtin commands, followed by their corresponding functions.
3030
*/
3131
char *builtin_str[] = {
32-
"sofsearch", //change directory
32+
"search", //change directory
3333
"help", //help command
3434
"leave", //exit command
3535
};
3636

3737
int (*builtin_func[]) (char **) = {
38-
&pyoverflow_sofsearch, //change directory
39-
&pyoverflow_help, //help command
40-
&pyoverflow_leave, //exit command
38+
&quickoverflow_search, //change directory
39+
&quickoverflow_help, //help command
40+
&quickoverflow_leave, //exit command
4141
};
4242

43-
int pyoverflow_num_builtins() {
43+
int quickoverflow_num_builtins() {
4444
return sizeof(builtin_str) / sizeof(char *);
4545
}
4646

@@ -50,7 +50,7 @@ int pyoverflow_num_builtins() {
5050

5151
//***************************************sofsearch*********************************************** */
5252
//function for calling the python files for searching
53-
int pyoverflow_sofsearch(char **args)
53+
int quickoverflow_search(char **args)
5454
{
5555

5656
int argc = 0;
@@ -62,7 +62,7 @@ int pyoverflow_sofsearch(char **args)
6262
Py_Initialize();
6363
FILE *fp = fopen("search.py", "r");
6464
if (fp == NULL) {
65-
perror("PyOverFlowFileNotFoundError: Have you deleted search.py by any chance?");
65+
perror("QuickOverFlowFileNotFoundError: Have you deleted search.py by any chance?");
6666
return 1;
6767
}
6868
PyRun_SimpleFile(fp, "search.py");
@@ -78,15 +78,15 @@ int pyoverflow_sofsearch(char **args)
7878

7979

8080
//*****************************************sos*********************************************** */
81-
int pyoverflow_help(char **args)
81+
int quickoverflow_help(char **args)
8282
{
8383
int i;
84-
printf("--------------------------------PyOverflow-CLI-----------------------------\n");
84+
printf("--------------------------------QuickOverflow-----------------------------\n");
8585
printf("---------------------------------Version 1.0----------------------------\n");
8686
printf("Type program names and arguments, and hit enter.\n");
8787
printf("The following are built in:\n");
8888

89-
for (i = 0; i < pyoverflow_num_builtins(); i++) {
89+
for (i = 0; i < quickoverflow_num_builtins(); i++) {
9090
printf(" %s\n", builtin_str[i]);
9191
}
9292

@@ -95,7 +95,7 @@ int pyoverflow_help(char **args)
9595

9696

9797
//*****************************************leave*********************************************** */
98-
int pyoverflow_leave(char **args)
98+
int quickoverflow_leave(char **args)
9999
{
100100
return 0;
101101
}

headers/shellops.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@
3030
#define PYOF_TOK_BUFFERSIZE 64
3131
#define PYOF_TOK_DELIM " \t\n\r\a"
3232
// function for reading input
33-
char *pyoverflow_readLine();
34-
char **pyoverflow_splitLine();
35-
int pyoverflow_execute(char **args);
33+
char *quickoverflow_readLine();
34+
char **quickoverflow_splitLine();
35+
int quickoverflow_execute(char **args);
3636

3737
//loop for shell
38-
void pyoverflow_loop(void){
38+
void quickoverflow_loop(void){
3939
char *line;
4040
char **args;
4141
int status;
4242

4343
do{
44-
printf("PyOverflow-CLI> ");
44+
printf("QuickOverflow > ");
4545
//reading and executing input
46-
line= pyoverflow_readLine();
47-
args = pyoverflow_splitLine();
48-
status = pyoverflow_execute(args);
46+
line= quickoverflow_readLine();
47+
args = quickoverflow_splitLine();
48+
status = quickoverflow_execute(args);
4949

5050
//freeing allocated memory
5151
free(line);
@@ -55,7 +55,7 @@ void pyoverflow_loop(void){
5555

5656
// function for reading input
5757

58-
char *pyoverflow_readLine(void){
58+
char *quickoverflow_readLine(void){
5959
//setting buffer size
6060
int bufsize = PYOF_RL_BUFFERSIZE;
6161
//setting buffer position
@@ -66,7 +66,7 @@ char *pyoverflow_readLine(void){
6666

6767
//handling buffer memory allocation error
6868
if(!buffer){
69-
fprintf(stderr,"pyoverflow-cli: Buffer Allocation Failed");
69+
fprintf(stderr,"QuickOverflow: Buffer Allocation Failed");
7070
exit(EXIT_FAILURE);
7171
}
7272

@@ -89,7 +89,7 @@ char *pyoverflow_readLine(void){
8989
//realloc the buffer
9090
buffer = (char*)realloc(buffer,bufsize);
9191
if(!buffer){
92-
fprintf(stderr,"pyoverflow-cli: Buffer Allocation Error");
92+
fprintf(stderr,"QuickOverflow: Buffer Allocation Error");
9393
exit(EXIT_FAILURE);
9494
}
9595
}
@@ -100,7 +100,7 @@ char *pyoverflow_readLine(void){
100100
}
101101

102102
//split line
103-
char **pyoverflow_splitLine(){
103+
char **quickoverflow_splitLine(){
104104
//defining buffersize and position
105105
int bufsize = PYOF_TOK_BUFFERSIZE, position =0;
106106
//allocating mem for tokens
@@ -110,7 +110,7 @@ char **pyoverflow_splitLine(){
110110

111111
//handling mem allocation failure
112112
if(!tokens){
113-
fprintf(stderr,"pyoverflow-cli: Buffer Allocation Failed");
113+
fprintf(stderr,"QuickOverflow: Buffer Allocation Failed");
114114
exit(EXIT_FAILURE);
115115
}
116116
token = strtok(line,PYOF_TOK_DELIM);
@@ -124,7 +124,7 @@ char **pyoverflow_splitLine(){
124124
//realloc bufsize
125125
tokens = realloc(tokens, bufsize * sizeof(char*));
126126
if (!tokens) {
127-
fprintf(stderr, "ghz-sh: allocation error\n");
127+
fprintf(stderr, "QuickOverflow: allocation error\n");
128128
exit(EXIT_FAILURE);
129129
}
130130

@@ -136,7 +136,7 @@ char **pyoverflow_splitLine(){
136136
}
137137

138138
//launch function
139-
int pyoverflow_launch(char **args)
139+
int quickoverflow_launch(char **args)
140140
{
141141
pid_t pid, wpid;
142142
int status;
@@ -146,12 +146,12 @@ int pyoverflow_launch(char **args)
146146
if (pid == 0) {
147147
// Child process
148148
if (execvp(args[0], args) == -1) {
149-
perror("pyoverflow-cli");
149+
perror("QuickOverflow");
150150
}
151151
exit(EXIT_FAILURE);
152152
} else if (pid < 0) {
153153
// Error forking
154-
perror("pyoverflow-cli");
154+
perror("QuickOverflow");
155155
} else {
156156
// Parent process
157157
do {
@@ -162,7 +162,7 @@ int pyoverflow_launch(char **args)
162162
return 1;
163163
}
164164

165-
int pyoverflow_execute(char **args)
165+
int quickoverflow_execute(char **args)
166166
{
167167
int i;
168168

@@ -171,13 +171,13 @@ int pyoverflow_execute(char **args)
171171
return 1;
172172
}
173173

174-
for (i = 0; i < pyoverflow_num_builtins(); i++) {
174+
for (i = 0; i < quickoverflow_num_builtins(); i++) {
175175
if (strcmp(args[0], builtin_str[i]) == 0) {
176176
return (*builtin_func[i])(args);
177177
}
178178
}
179179

180-
return pyoverflow_launch(args);
180+
return quickoverflow_launch(args);
181181
}
182182

183183

main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ int main(int argc, char **argv){
2626
//area for config files
2727

2828
//call the loop
29-
pyoverflow_loop();
29+
quickoverflow_loop();
3030

3131
//space for cleanup
3232

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pyoverflow3

search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
import pyoverflow
3+
from pyoverflow3.pyoverflow3 import pyoverflow3
44

55
a = input("Enter first number")
66

@@ -13,6 +13,6 @@
1313

1414
except Exception as e:
1515
#Error message and number of solutions
16-
pyoverflow.submit_err(str(e),2)
16+
pyoverflow3.submit_error(str(e),2)
1717

1818
#Wait for the magic :)

0 commit comments

Comments
 (0)