<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xavi/slcl/main.c, branch thumbnail</title>
<subtitle>Small and lightweight cloud storage written in C99 and POSIX.1-2008.
</subtitle>
<id>https://gitea.privatedns.org/xavi/slcl/atom?h=thumbnail</id>
<link rel='self' href='https://gitea.privatedns.org/xavi/slcl/atom?h=thumbnail'/>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/'/>
<updated>2023-07-11T11:30:17+00:00</updated>
<entry>
<title>WIP thumbnail code</title>
<updated>2023-07-11T11:30:17+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-08T01:24:32+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=aae26c510dd8a1228848d75c33a07eb992f8dd2a'/>
<id>urn:sha1:aae26c510dd8a1228848d75c33a07eb992f8dd2a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Limit amount of search results</title>
<updated>2023-07-11T11:27:49+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-11T11:11:50+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=38f3f82a77ed4782a9c4e1b4e5a6d9d4c71390a2'/>
<id>urn:sha1:38f3f82a77ed4782a9c4e1b4e5a6d9d4c71390a2</id>
<content type='text'>
When a user enters a search term that is too generic, slcl would
generate a long list of search results, where this generation could have
a big impact on the server performance and its available resources.

Therefore, it is reasonable to limit the number of search results to an
arbitrary limit, so that users are forced to enter a more specific
search term in order to achieve more relevant results.
</content>
</entry>
<entry>
<title>cftw: Allow user callback to stop recursive search</title>
<updated>2023-07-11T11:27:49+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-11T11:08:06+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=59e17afe291f9df52d2334b92e88a889c2fe8f6a'/>
<id>urn:sha1:59e17afe291f9df52d2334b92e88a889c2fe8f6a</id>
<content type='text'>
So far, cftw would search through all directories and files recursively,
until all objects are processed. However, it is interesting for the user
callback to be able to stop this process under specific circumstances.

Now, cftw will pass a pointer to a bool, initialised to false by
default, that can be optionally assigned to true by the user
callback.

Future commits will make use of this feature. For example, this will be
used to limit the number of search results when a user enters a search
term that is too generic and would otherwise generate a large amount of
search results.
</content>
</entry>
<entry>
<title>main.c: Use path_isrel for search terms</title>
<updated>2023-07-11T11:27:49+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-11T11:26:06+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=48b171335c213091cdf682c98ad784dc5c8456da'/>
<id>urn:sha1:48b171335c213091cdf682c98ad784dc5c8456da</id>
<content type='text'>
Search terms cannot use the same strict rules used for filenames or
directory names, as otherwise examples such as "*folder*/*IMG*" would
not work.
</content>
</entry>
<entry>
<title>Allow admins to define their own stylesheet</title>
<updated>2023-07-10T23:49:12+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-10T23:20:39+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=e79e955d93e24a192c9bf94181294d0797e9fded'/>
<id>urn:sha1:e79e955d93e24a192c9bf94181294d0797e9fded</id>
<content type='text'>
slcl used to provide a hardcoded stylesheet. However, it would be
desirable for some admins to provide a custom stylesheet without having
to rebuild the application.

Now, slcl creates a default stylesheet, namely style.css, into the
target directory, that can be later modified by admins.

While this might contradict the suckless philosophy a bit, hopefully
some admins might find this new feature useful.
</content>
</entry>
<entry>
<title>main.c: Disallow invalid filenames or directory names</title>
<updated>2023-07-09T03:54:53+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-09T02:41:55+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=b5282b23653b3a46ab6ae2d84049abadcc8a8a1d'/>
<id>urn:sha1:b5282b23653b3a46ab6ae2d84049abadcc8a8a1d</id>
<content type='text'>
- Relative paths must not be used for filenames or directory names,
such as "..", "." or "dir/..".
- Paths with asterisks ('*') must not be allowed, to avoid confusion
with wildcard expressions.
</content>
</entry>
<entry>
<title>Implement file/directory removal</title>
<updated>2023-07-08T01:08:07+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-07T22:54:59+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=0822a982ef3b085dc109ec373ff537974503eb04'/>
<id>urn:sha1:0822a982ef3b085dc109ec373ff537974503eb04</id>
<content type='text'>
The following workflow has been implemented:

- A new checkbox for each object inside a directory is shown.
- When one or more objects are selected, the user submits a request
through a HTML5 form.
- Then, slcl will ask the user for confirmation, listing the selected
objects, while reminding the user about the effects.
- The user confirms the selection.
- slcl removes the selected objects. All objects from non-empty
directories are removed, too.
- Finally, slcl redirects the user to the directory the request was
made from.
</content>
</entry>
<entry>
<title>cftw: Allow directories to call the user callback</title>
<updated>2023-07-08T00:30:31+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-08T00:30:31+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=74ca76a58fca114140d0d0cc13a1216d6dffbee0'/>
<id>urn:sha1:74ca76a58fca114140d0d0cc13a1216d6dffbee0</id>
<content type='text'>
This provides a few benefits:

- This will allow searching for directories by name.
- Future commits will allow to remove files and directories, so this
  change was also required for cftw.
</content>
</entry>
<entry>
<title>main.c: Fix use-after-free on failed search_fn</title>
<updated>2023-07-07T20:04:01+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-07T20:01:13+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=960a35a02fa8c98036e73be8fee9ea3f1c0888e9'/>
<id>urn:sha1:960a35a02fa8c98036e73be8fee9ea3f1c0888e9</id>
<content type='text'>
When search_fn fails, it must free `r` before `results`, as the former
is assigned based on the latter - otherwise, it would lead to undefined
behaviour.

So far, only memory allocation errors would make search_fn to fail.
</content>
</entry>
<entry>
<title>main.c: Use ISO C99-compatible declaration for main</title>
<updated>2023-07-05T22:56:27+00:00</updated>
<author>
<name>Xavier Del Campo Romero</name>
<email>xavi.dcr@tutanota.com</email>
</author>
<published>2023-07-05T22:56:19+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/slcl/commit/?id=36ff7d81432308ba430414180c0ab7a41af228ba'/>
<id>urn:sha1:36ff7d81432308ba430414180c0ab7a41af228ba</id>
<content type='text'>
C99 §5.1.2.2.1 only defines the following declarations for main:

- int main(void)
- int main(int argc, char *argv[])

While the use of equivalent types (e.g.: char **argv) is allowed, const
char ** would not be considered equivalent, and thus an invalid
declaration depending on the implementation.
</content>
</entry>
</feed>
