ref: 1a5dbff69ba31de0690069b324001605432ce5bc
parent: fe6beae477034fb2c9ffcdce1204fc844856077e
author: Ori Bernstein <[email protected]>
date: Sun Jan 26 22:13:39 EST 2020
better naming
--- a/fs.c
+++ b/fs.c
@@ -7,8 +7,6 @@
#include "git.h"
-typedef struct Ols Ols;
-
char *Eperm = "permission denied";
char *Eexist = "does not exist";
char *E2long = "path too long";
@@ -53,7 +51,7 @@
int qdir;
/* For listing object dir */
- Ols *ols;
+ Objlist *ols;
Object *olslast;
};
@@ -318,7 +316,7 @@
Object *o;
Crumb *c;
char name[64];
- Ols *ols;
+ Objlist *ols;
Hash h;
aux = p;
--- a/git.h
+++ b/git.h
@@ -13,7 +13,7 @@
typedef struct Buf Buf;
typedef struct Dirent Dirent;
typedef struct Idxent Idxent;
-typedef struct Ols Ols;
+typedef struct Objlist Objlist;
enum {
/* 5k objects should be enough */
@@ -48,7 +48,7 @@
Cparsed = 1 << 5,
};
-struct Ols {
+struct Objlist {
int idx;
int fd;
@@ -217,9 +217,9 @@
Object *osfind(Objset *, Hash);
/* object listing */
-Ols *mkols(void);
-int olsnext(Ols *, Hash *);
-void olsfree(Ols *);
+Objlist *mkols(void);
+int olsnext(Objlist *, Hash *);
+void olsfree(Objlist *);
/* util functions */
void *emalloc(ulong);
--- a/ols.c
+++ b/ols.c
@@ -41,7 +41,7 @@
}
int
-olsreadpacked(Ols *ols, Hash *h)
+olsreadpacked(Objlist *ols, Hash *h)
{
char *p;
int i, j;
@@ -79,7 +79,7 @@
int
-olsreadloose(Ols *ols, Hash *h)
+olsreadloose(Objlist *ols, Hash *h)
{
char buf[64], *p;
int i, j, n;
@@ -122,12 +122,12 @@
return -1;
}
-Ols*
+Objlist*
mkols(void)
{
- Ols *ols;
+ Objlist *ols;
- ols = emalloc(sizeof(Ols));
+ ols = emalloc(sizeof(Objlist));
if((ols->ntop = slurpdir(".git/objects", &ols->top)) == -1)
sysfatal("read top level: %r");
if((ols->npack = slurpdir(".git/objects/pack", &ols->pack)) == -1)
@@ -137,7 +137,7 @@
}
void
-olsfree(Ols *ols)
+olsfree(Objlist *ols)
{
if(ols == nil)
return;
@@ -150,7 +150,7 @@
}
int
-olsnext(Ols *ols, Hash *h)
+olsnext(Objlist *ols, Hash *h)
{
if(ols->stage == 0){
if(olsreadloose(ols, h) != -1){