Interpreted in a certain way what you are asking is standard. A category $C$ is a collection $C_1$ together with two maps $s,t:C_1\to C_1$ and a map $m$ from $C_1\times_{\langle s,t\rangle} C_1 =\\{(f,g)\,|\,s(f)=t(g)\\}$ to $C_1$ satisfying: $st=t$, $ts=s$, $m(m(f,g),h))=m(f,m(g,h))$ and $m(f,s(f))=f=m(t(f),f)$. Note that normally we write $m(f,g)=f\circ g$.
To obtain the usual description of category set $C_0=\\{f\in C_1\,|\,s(f)=f\\}$, keep the same composition, and let the domain and codomain maps $c,d :C_1\to C_0$ be defined by $c(f)=t(f)$ and $d(f)=s(f)$ respectively.
Conversely given a category $C$ forget the set $C_0$, keep the same composition, and let $s$ and $t$ be the maps defined by $t(f) = 1_{c(f)}$ and $s(f)=1_{d(f)}$.