[ meta ] [ 1990 / am / h / s / sp ] [ ukko ]

/h/ - Hobbies

Name
Email
Subject
Comment
File
:
Password (For file deletion.)

File: 1545948863165.png (21.48 KB, 1068x1112, OQi9Pcx.png)

 No.208

so my search for a slick looking dropdown application launcher that works well with I3 hasn't been particularly fruitful
its a bit of an undertaking, but i think im gonna take the time to learn the X11 library functions and make my own menu interface from scratch
this should be a journey

 No.210

on a semi-related note, here's my rough outline of some code that records all the names of files that have a specified filename. i'll clean it up and streamline it tomorrow

#include <dirent.h>

#include <stdio.h>
#include <string.h>

int func();

int main()
{
DIR *folder;
folder = opendir(".");
struct dirent *entry;
char *ARR[10];
char *FILE[10];
int LEN[10];
int i=0;
int k=0;

if (folder != NULL)
{
for (i=0; entry = readdir(folder); i++)
{
ARR[i] = entry->d_name;
LEN[i] = strlen(ARR[i]);
printf("%s\n", ARR[i]);
}

closedir(folder);

char FILETYPE[]=".c";
int FILETYPE_L = strlen(FILETYPE);

for (int j=0; j < i; j++)
{
if (LEN[j] > FILETYPE_L)
{
char HELP[FILETYPE_L];
int OFFSET = LEN[j] - FILETYPE_L;
sprintf(HELP,"%s", (ARR[j] + OFFSET));
printf("%s\t",HELP);

int CHECK=strcmp(HELP,FILETYPE);
printf("%d\n", CHECK);

if (CHECK == 0)
{
FILE[k]=ARR[j];
k++;
}

}
}

return (0);
}

printf("something is broken");
return(1);
}

 No.211

i need to come up with a naming convention because holy shit this is a mess lol.
after i debug it i'll go through and standardize all the names.
kate keeps fucking up the formatting for some reason too
this should basically be the framework of what im doing. so long as it works, my remaining time will be spent learning/bringing it up to best practice and adding error redundancy since i have almost none in there

 No.212

>the body was too long
gahhhhhhhhh fuck you fuck you fuck you

 No.213

ok cool my proof of concept works
now i just have to clean up the variable names and tie it in to the main program
that should be relatively easy tho because i made it with that in mind
had a small issue where i was overflowing the buffer on an array of pointers by assigning string literals to it, then like some of the time those would get corrupted by stuff called later
very confusing. obv. fixed it by using malloc to allocate memory



[Return][Go to top] [Catalog] [Post a Reply]
Delete Post [ ]
[ meta ] [ 1990 / am / h / s / sp ] [ ukko ]